Using Profiles like social Media sites

More
13 years 4 weeks ago #32486 by igcorreia
This is something we just implemented :D workes like a charm. The idea is simple. Each user needs to have a personal page, a PROFILE PAGE.

Steps:
1 - Create and Category, Type and Template: WELCOME
2 - Link them together.(this should be a FC feature :D )
3 - Create and Category, Type and Template: PROFILE
4 - Link them together.
5 - Create an item: WELCOME using the category WELCOME.
6 - Create an menu item and link it to this item set it only for registered users.
7 - Create a login module and redirect it to this menu item after login

NOW LET GO TO THE CODE

8 - Open the item.php of the WELCOME template
9 - Add this lines:

//Get User ID
Code:
$user = JFactory::getUser();
//Define Category
Code:
$category = "1"; // This category ID for the PROFILE CATEGORY
//Define DB - Query
Code:
$db = JFactory::getDbo(); $query = $db->getQuery(true);
//Define Query
Code:
$query ->select('id') ->from('#__content') ->where('created_by="'.$user->id.'" and catid="'.$category.'" and state="1"');
//Query
Code:
$db->setQuery($query);
//Get Results
Code:
$results = $db->loadObjectList();
//Redirect the user if no profile is found
Code:
if ($results != 0 && $results != NULL && $results != "" && $results != Undefined) { //YES profile header( 'Location: /my-items-page.php' ) ; } else { //NO profile header( 'Location: /new-profile?tmpl=component' ) ; }
//Load Template
Code:
include(JPATH_SITE.DS.'components'.DS.'com_flexicontent'.DS.'tmpl_common'.DS.'item_layouts'.DS.'modular.php');

Basically what it does is, if the user does not have at least 1 item in the category profile then redirect him to the PROFILE submission page, if it already has redirect him to his profile page.

The advantages is that like this we can use FC custom fields, categories to list the users :D without the need to link anything. Like this the user is linked to a profile. Also you need to verify in the form is the current log in user already has a profile, basicly is to make sure the user does not submit 2 profiles :D

Please Log in or Create an account to join the conversation.

More
13 years 3 weeks ago #32503 by micker
great thanks for sharing !

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
13 years 3 weeks ago #32726 by igcorreia
I have update the code to work with JGroups.
Also I am leaving the print_r so we can debug it right away.
Code:
<?php //Get User ID $user = JFactory::getUser(); $userGroup = $user->groups; // echo "<pre>";print_r($userGroup);echo "</pre>"; if (count($userGroup) == 1 && $userGroup[2] == 2){ //echo "Mantém aqui"; } else { //Define Category $category = "13"; // This cateogry is profile //Define DB - Query $db = JFactory::getDbo(); $query = $db->getQuery(true); //Define Query $query ->select('id') ->from('#__content') ->where('created_by="'.$user->id.'" and catid="'.$category.'" '); //Query $db->setQuery($query); //Get Results $results = $db->loadObjectList(); // Override Author //echo "<pre>";print_r($this->item->created_by);echo "</pre>"; //$this->item->created_by = $user->id; //Teste Results //echo "<pre>";print_r($results);echo "</pre>"; //Redirect the user if no profile if ($results != 0 && $results != NULL && $results != "" && $results != Undefined) { //YES it has profile header( 'Location: /meus-projetos' ) ; } else { //NO it has profile header( 'Location: /criar-novo-perfil' ) ; } } ?>

Please Log in or Create an account to join the conversation.

More
13 years 2 weeks ago #32755 by gauthier
Very interesting,

I keep in mind to remove community builder from my system to manage myself users, lists with Flexicontent. Your idea is a good starting point. ;)

To still innovative, I think that FC should manage itself users.

Please Log in or Create an account to join the conversation.

More
13 years 2 weeks ago #32758 by igcorreia
This is working well for us :D

Put for future features we WANT user profiles :D

Please Log in or Create an account to join the conversation.

More
13 years 2 weeks ago #32759 by micker
A Flexicommunity component or addon ? ;)

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
13 years 2 weeks ago #32762 by igcorreia
We need to make sure we define the purpose. It is for maneging Profiles so I would call it. FlexiAuthors or FlexiProfiles.


@Micker the name FlexiCommunity is very powerfull are it can be use with another purpose like jomsocial if you know what I mean. For me community is like the interactions between users.

Please Log in or Create an account to join the conversation.

More
13 years 2 weeks ago #32767 by ggppdk
in General you should also update

a record in flexicontent_authors_ext to set this "profile" item as "author description item"

This now makes me think , we should change the "Author Description item" to be "User FLEXIprofile" ???


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 2 weeks ago #32770 by igcorreia
I forgot That one. Please confirm all the user fields in the database because I don't know them all.

---

Flexi profile is coll :D

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #33616 by mauriestate
Hi,

Have been searching around the forum & FAQ and this is the only closer topic I could found about our current issue.

As mention previously in some other topics, we are currently developing a classified website, meant for real estate advertising with community features using Jomsocial, in fact, we do not want to mix things, Jomsocial, as mention in this topic is more likely for user interactivity and we want to have an author page where we can show the 'author profile' including avatar (logo or image) some basic contact details and all items that such author has added to the website.

In fact, we have various categories and sub-categories like properties for sale, properties for rent etc. Each category (sub-category) has its own type and template, hence, we want to show the items and in which category such item has been added as well.

I know this can be done with new features that have been added to FC lately but I would need some help (guidelines) how we may start this kind of approach, will the solutions provided by @algardata be good for what we are trying to do? Or is there any new simpler solution to achieve this?

Note: We do not want to build a complicated author profile, just the avatar, contact details and items added by this author, such author profile needs to be as individual items within specific categories so that we can use such information as relative fields within other categories.

That is, when a user is adding for let say, a property for sale, in the category view and item view, we'll be showing the author avatar and his contact details as well in some other tab, such information will be retrieved from the author type.

Hope I was clear enough about what we want to do! If not, please let me know and I will try to provide more information.

Offering professional real estate and investment services in Mauritius. Visit us at www.sjkestate.com to also see the power of Flexicontent with Joomla to promote our services.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save