Jump to content

Turning User Profiles Addon into a Powerful Social System!


plethoraonline-1492071863

Recommended Posts

Hi,

From almost 15 months of struggling to find an easy registration process, but no luck.  Now we have found the solution,  without using any heavy code, No EasySocial, No Jomsocial, No Nothing... Just UserProfiles Addon. Some of you probably tried using that and left it behind (i did the same) because at the first sight it doesnt give you so much possibilities managing all your needs! 

Well, i was wrong! 

I will explain to you everything i did creating powerful profiles using only UserProfiles addon step by step, also some added code here and there to make everything easy for everyone. With these changes im having 25-35 registrations / day from 18 - 65 years old.

 

First Part

First, create your Joomla UserGroups based on the profile types u want to have in your website: 

Example:  Teacher, Parent, Student, Company, Whatever...

Then go to your Jreviews, and create a Directory, Example: Users.

Create a Listing Type, User Profiles

Go to Joomla Categories and create the same structure as u have created in the joomla groups. Exactly the same names:

Parent Category => Users

Teacher, Parent, Student, Company, Whatever... all of these inside the Users Category.

Go to Jreviews categories Manager and create categories, by creating first the Users Category and do not assign listings to it.

Create Teacher Category and do the same for the rest.

Now go to the User Profiles Addon, and choose the UserProfiles Directory => Users in our example

Select all radio buttons to no, if u need something specific u can also mark Yes what u want.

Go to Profile Types in the left menu of the addon and create the profile types one by one based on the user groups u created.

Now go to create a new menu UserProfiles Add-on - Account Menus and Type of Menu SIGNUP PAGE, DONT CHOOSE A PROFILE. Save it and access it through your joomla frontend.

now u will see the registration form with a dropdown where u select the Profile Types, which in fact it assigns also the user to the specified Joomla User Group. After you register, you will be redirected to the dashboard from where u can create your public profile.

 

Here arises a problem in our case, that even if u are registered as a Teacher, you are still asked to pick a category for your public profile, which makes the users confusing by selecting and then loading a new form based on the choosen category etc etc.

 

So we create a Javascript Code which does thhis: 

It gets the registered user the group name from joomla and matches it with the same category where the user belongs in Jreviews, so this way you categorize every user automatically, in their categories and it disables the category option. Remember to change the /url/link in the code with your public profile link creation in your site otherwise no one can add listings in your site.

Add this code in the end of the create.thtml file in templates/jreviews_overrides/views/themes/your_theme/listings

 

<?php
// Get user group
$user_  = JFactory::getUser();
$db     = JFactory::getDBO();
foreach($user_->groups as $group){
    $query  = 'SELECT title FROM #__usergroups';
    $query .= ' WHERE id = ' . $group;
    $db->setQuery( $query );
  }
?>

<script>
if (window.location.pathname == '/url/link') {
var userGroupId = "<?php echo $db->loadResult(); ?>";
$( document ).ready(function() {

$(document).ajaxStop(function() {
	$("#cat_id2 option:contains(" + userGroupId +")").attr("selected", true);
	$('#cat_id2').attr('disabled', true)
});
});
};
 </script>

 

Go to Field Groups, create one group about the User Registration called :  Basic Information and add, Name, Last Name, Birthday, Birthplace whatever u want... basic information which is the same for all the users.

Then create the specific group.... Like Extra Information or whatever name. and create the fields u want but... dont forget the assing the user rights: 

For example if u create a field called Biography for the teacher then assign it to only the Teacher User Group, or Company About Us, assign it only to the company user group... do this for all the fields and profile types u have... if u have similar fields, then dont touch the user group, u dont have to repeat the fields for each profile type. 

Then assign the field Groups to the User Profiles listing type we created in the beggining.

Now try the registration and it should work like a charm, from where the user selects only in the beginning his profile and in the next page he registers the full profile, same idea as easy social or jomsocial but in the easiest way possible.

You should use UserProfiles Addon because it has no extra CSS, Javascripts, so your site will never get heavy on loading... its the best way for a Jreviews Site.

 

Second Part - Styling and Making Profiles Unique

Go to Jreviews, Theme Manager, and give the categories u created a new template suffix _teacher, _company, _student etc.

Go to templates/jreviews_overrides/views/themes/your_theme/listings and create the files

detail_header_profile_teacher.thtml
detail_profile_teacher.thtml

detail_header_profile_company.thtml
detail_profile_company.thtml

and so on for all the profiles, and use the original code from Jreviews for all the files.  We are doing this so every usergroup template can have their own template. A company should have a Company Profile, a teacher with their representing theme with a school foto etc. 

Suggestion, in the theme files i have used Bootstrap columns for easy templating... even that Alejandro its user his classes based also on bootstrap, just i wasn't familiar.

You can play and design the profile how u want it, with the Jreviews fields we have created ...

 

Thats all for now... everything is running smoothly and easy.

 

When ill implement other features in the futures ill let u know.

 

Regards 

L.

Edited by plethoraonline-1492071863
  • Like 1
  • Thanks 2
Link to comment
×
×
  • Create New...