JomSocial Avatar and a Custom JomSocial Field in article

More
14 years 11 months ago #691 by devil
Hi,

you can put the JomSocial Avatar from the author and a Custom Jomsocial Field (like "about me") under the Item.

Open:

joomlaroot/components/com_flexicontent/templates/default/item.php

and paste follow code after Line 165
Code:
<!-- BOF Author block --> <?php //get authorid $authorid = $this->item->created_by; $jspath = JPATH_BASE.DS.'components'.DS.'com_community'; include_once($jspath.DS.'libraries'.DS.'core.php'); //get cuser and some field values $user =& CFactory::getUser($authorid); $data = $user->getInfo('FIELD_ABOUTME'); //create an jomsocial custom field (textarea) and enter in the field code: FIELD_ABOUTME $avatarUrl = $user->getThumbAvatar(); echo '<div style="border:1px solid silver;">'; echo '<p><img src="'. $avatarUrl .'"/></p>'; echo '<p>'.$data.'</p>'; echo '</div>'; ?> <!-- EOF Author block -->

You can style it in anyway you want...

Joomla-Aktuell - www.joomla-aktuell.de
Attachments:

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

More
14 years 11 months ago #694 by vistamedia
Cool trick!!!
Thanks for sharing Markus ;-)

FLEXIcontent lead developer.
www.vistamedia.fr web agency and custom development.
www.joomla.fr co-administrator.
Please no PM for support request, use the forum for that!!!

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

More
14 years 6 months ago #7021 by earnware
First, thank you for this code. It worked well.

Can you possibly suggest how to make the author name and avatar link to the user's JomSocial profile?

Thank you for your time and consideration.

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

More
14 years 4 months ago #8255 by devil
Hi,

sry for the long delay...

In the next 2-3 weeks i will make a plugin and then the avatar will link to jomsocial profile.

Joomla-Aktuell - www.joomla-aktuell.de

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

More
14 years 4 months ago #8257 by iLLeT
This is from JomSocial 3rd Party Component Integration www.jomsocial.com/docs/3rd_Party ... ntegration
To Get Profile Link
Code:
$jspath = JPATH_ROOT.DS.'components'.DS.'com_community'; include_once($jspath.DS.'libraries'.DS.'core.php'); // Get CUser object $link = CRoute::_('index.php?option=com_community&view=profile&userid='.$userid); echo '[url='. $link .']View user profile[/url]';

Now the bottom has devils code, with Jomsocial link added
Code:
<!-- BOF Author block --> <?php //get authorid $authorid = $this->item->created_by; $jspath = JPATH_BASE.DS.'components'.DS.'com_community'; include_once($jspath.DS.'libraries'.DS.'core.php'); //get cuser and some field values $user =& CFactory::getUser($authorid); // Get CUser object $link = CRoute::_('index.php?option=com_community&view=profile&userid='.$user); $data = $user->getInfo('FIELD_ABOUTME'); //create an jomsocial custom field (textarea) and enter in the field code: FIELD_ABOUTME $avatarUrl = $user->getThumbAvatar(); echo '<div style="border:1px solid silver;">'; echo '<p>[url='.$link.']<img src="'. $avatarUrl .'"/>[/url]</p>'; echo '<p>'.$data.'</p>'; echo '</div>'; ?> <!-- EOF Author block -->

I made the avatar link to the jomsocial profile. You can change it to what you want, but you get the idea.

Why join the Navy? when you can be a pirate.

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

More
14 years 3 weeks ago #11332 by tembargo

In the next 2-3 weeks i will make a plugin and then the avatar will link to jomsocial profile.

Je ne le vois pas dans la page "all downloads", je me demandais donc si ce plugin avait finalement était releasé ?

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.448 seconds
Save
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