Topic-icon reviewer picture(avatars)

Active Subscriptions:

None
13 years 2 months ago #31712 by Bettychung
Hi, I am wondering how to add the reviewer picture(avatars) beside the member's name when use JFB connect to log in.
Thanks
The topic has been locked.
Support Specialist
13 years 2 months ago #31718 by alzander
Replied by alzander on topic reviewer picture(avatars)
What are you using for reviews? Can you provide an example URL of a page where you'd like to see avatars being used?

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

None
13 years 2 months ago #31753 by Bettychung
I use Jreviews. Here is a example scifireviewed.com/movie/249-dark-skies
Can it display facebook avatars?
Thanks!
File Attachment:
The topic has been locked.
Support Specialist
13 years 2 months ago #31886 by alzander
Replied by alzander on topic reviewer picture(avatars)
Betty,
Very sorry for the delay in getting back to this. Getting the user's avatar from Facebook is actually pretty easy. Pulling that in within jReviews is a little more difficult, but shouldn't be too bad. We'll just need to research their template system a little more. Can you let me know what version of jReviews you're using? That way we know we're looking at the same version and get you the best solution.

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

None
13 years 2 months ago #32265 by mhanagan
Replied by mhanagan on topic reviewer picture(avatars)
I'd love to hear how this can be done as I'm running Jreviews as well and this would be a cool feature. I have Jreviews 2.3.2 which is current.

Thanks!

Matt
The topic has been locked.
Support Specialist
13 years 2 months ago #32277 by alzander
Replied by alzander on topic reviewer picture(avatars)
BettyChung/Matthew,
Sorry for the delay in getting this answer out. We have some code, but its for the 2.4 release of JReviews. I'm not sure how different it will be for 2.3, but hopefully this can get you started. To use the Facebook avatar, you'll want to edit the review template file that actually displays the review and add our code. These are the instructions:
* Edit the /components/com_jreviews/jreviews/views/themes/default/reviews/review_layout.thtml file
* In my file, around like 83, I have:
<div class="jrUserInfo">
		<?php echo $Community->avatar($review);?>
Update that by adding more code underneath it, like:
<div class="jrUserInfo">
		<?php echo $Community->avatar($review);?>
        <?php if (($Community->avatar($review)) == "")
        {
            $userId = $review['Review']['user_id'];
            $userMapModel = new JFBConnectModelUserMap();
            $profileLibrary = JFBConnectProfileLibrary::getInstance();
            $fbAvatarUrl = $profileLibrary->getAvatarUrl($userMapModel->getFacebookUserId($userId));
            # Show their FB avatar (if desired), or give them the option to link accounts
            if ($fbAvatarUrl)
                echo '<img src="' . $fbAvatarUrl . '" />';
        }
        ?>
With that code, the Facebook Avatar url for the user will be a fallback image instead of JomSocial or one of the other avatar configuration options you can use. If no FB avatar exists, then no avatar will be used at all.

Please test and let me know how that goes. Hopefully, v2.3 will be easily modified as well.

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

None
13 years 2 months ago #32302 by mhanagan
Replied by mhanagan on topic reviewer picture(avatars)
ah yeah I have 2.4 and that code worked perfectly. Thanks much!
The topic has been locked.
Support Specialist
13 years 2 months ago #32308 by alzander
Replied by alzander on topic reviewer picture(avatars)
Fantastic! Glad to hear that worked for you. Should you need anything else, just let us know. We're going to pass this thread along to Alejandro (at reviewforjoomla) to see if he'd be implementing it in JReviews as an option. I think others would like it as well.

Should you need anything else, just let us know.

Finally, if you haven't already, please consider leaving a rating and review for JFBConnect, or our support, on the Joomla Extension Directory. It certainly isn't required, but is very appreciated:
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks,
Alex
The topic has been locked.