Topic-icon Which is the best JFBC compatible extended profile component?

Active Subscriptions:

None
Grateful for your advice.

I am trying to decide on an extended user profile component to work with JFBC. It needs to be able to store a selection of facebook profile fields pulled by JFBC including the user's profile picture and friend list. But ideally it would be relatively lightweight and if it allows access to profile data with API calls so much the better. This is for a J!3.2 site.

The options seem to be:

Jomsocial - although it is big component and excessive for my current needs
Easy Profile - claims to duplicate the jomsocial API so anything that works with JS will work with it. Alex, grateful for your view on whether JFBC will out of the box.
Joomla's native extended profile plugin - with a few added fields.
Easy Social - no experience with this component.

Grateful for your views.
The topic has been locked.
Support Specialist
I've never used Easy Profile, so I can't say much about that. I honestly just heard of it the other day. I doubt we'd work with it 'out of the box' though, because even though it may allow for a similar API as JomSocial, I'm pretty confident it wouldn't work the same from the level we need.

If you want lots of features and bells and whistles, JomSocial and EasySocial are definitely the way to go. If you simply want profile data stored, the built-in Joomla profile plugin is a great first step. It's very simple and built-into Joomla itself.. no extra frills to get in the way. The biggest drawback to that plugin is that it doesn't store the user's avatar.

One other option is the CustomDB integration we have. With that, you can create a database table and store any data you want. There isn't an API to fetch the information, but since you're creating the database table, you have full control.

Unfortunately, there really isn't a one-size fits all solution, so I can't say "this is the best for all cases". Hopefully the above gives a little more information of an overview of things, but if you have any other questions, just let us know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago - 9 years 11 months ago #43584 by davlar
custom db table might be the answer. How would you go about storing the avatar in a custom db?

Will jfbc insert the joomla userid from registration by default?
Last edit: 9 years 11 months ago by davlar.
The topic has been locked.
Support Specialist
Right now, the avatar isn't saved with the Custom DB plugin. That's a feature we've been planning on adding, and could gladly help you with the few lines of code that it would take, if interested.

As for the table structure, it's meant to use a single-row per user with columns as the profile data. Something like the below would be an example:
id | user_id | first_name | last_name | city | state

The id would just be an auto-incrementing key. The user_id would be the Joomla user ID for the user. The rest of the columns would store the profile data you configure. You can create as many columns as you want for the data to store.

When configuring the Custom DB plugin, one of the options is for the User ID row so the plugin knows how to search the table for an existing user id, if it exists, or to insert a new row with the profile info. That *should* be all there is to it, and that format works with multiple other 3rd party extensions that have profile support (though not all).

I hope that helps explain, but if you have any questions, just let me know!

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
Yes - please. Very grateful for some code for storing the avatar. I think custom tables is the way we will go. Jomsocial is just too problematic for our needs.
The topic has been locked.
Support Specialist
Sorry for the delay. To store the avatar in a custom directory, edit the /plugins/socialprofiles/customdb/customdb.php file. At the very bottom, add the following functions before the last } so that the bottom of your file looks like:
protected function onLogin()
    {
        $this->settings->set('import_avatar', 1);
        parent::onLogin();
    }

    protected function onRegister()
    {
        $this->settings->set('import_avatar', 1);
        parent::onRegister();
    }

    protected function setAvatar($socialAvatar)
    {
        $dest = JPATH_SITE . '/tmp/avatar_' . $this->joomlaId . '.jpg';
        JFile::copy($this->getAvatarPath() . '/' . $socialAvatar, $dest);
    }
}
The onLogin and onRegister functions are what tell the plugin to import the avatar on registration and every login. If you only want registration, don't add the onLogin function.

Then, in the bottom, update the $dest path to whatever directory or file structure you want. Right now, it will store any user's social avatar as:
YOUR_SITE/tmp/avatar_12345.jpg
Where 12345 is the user's Id.

I hope that helps get you going, but if you have any other questions, just let me know!

Thanks,
Alex
The topic has been locked.