I want to show the users avatar in the welcome area of the template I am making, how can I do it?
I've been looking into avatar display in Joo!CM but I'm not getting anywhere. I've probably looked over the proper code a dozen times I'm just missing it o.O
~cXc~
Joined Board
01/30/2010 15:30
Last Visit
03/07/2010 10:36
User is OfflineView all users posts
~cXc~,
where do you want to add the avatar exactly? In other component? Or do you creating an own template for the Joo!CM view?
Robbie
Joined Board
12/14/2007 10:38
Last Visit
07/27/2010 13:03
User is OfflineView all users posts
Joined Board
01/30/2010 15:30
Last Visit
03/07/2010 10:36
User is OfflineView all users posts
You can implement the folowing code into
JOOMLA_ROOT/components/com_joobb/designs/templates/joobb/joobb_header.php
php
Code
$joocmAvatar =& JoocmAvatar::getInstance();
$avatarFile = $joocmAvatar->getAvatarFile($this->joobbUser->get(‘id’);
html
Code
<img src="<?php echo $avatarFile; ?>" />
Joined Board
12/14/2007 10:38
Last Visit
07/27/2010 13:03
User is OfflineView all users posts
Thank you very much, there is an error in the syntax though ...
Quote by Robbie:Code$joocmAvatar =& JoocmAvatar::getInstance();
$avatarFile = $joocmAvatar->getAvatarFile($this->joobbUser->get(‘id’);
... should be ...
Code
$joocmAvatar =& JoocmAvatar::getInstance();
$avatarFile = $joocmAvatar->getAvatarFile($this->joobbUser->get(‘id’));
... you just left the ) off the end of the second variable
Joined Board
01/30/2010 15:30
Last Visit
03/07/2010 10:36
User is OfflineView all users posts
One final question and I can publish my template, this works fine for Joo!CM Avatars but I'm using K2 Avatars how can I make it work for those too?
Or, I guess the better question is can I?
[edit] Nevermind there was another syntax error, the correct code is Code
$joocmAvatar =& JoocmAvatar::getInstance();the single quotes on either side of id where the cause this time
$avatarFile = $joocmAvatar->getAvatarFile($this->joobbUser->get('id'));
I'll release my template after I take my daughter to school
[/edit] Joined Board
01/30/2010 15:30
Last Visit
03/07/2010 10:36
User is OfflineView all users posts
oh... sorry for the syntax errors... I made it "on the fly".
Yes, you can use K2 avatars. The code is the same. All you need to change is the Avatar Source in Joo!CM configuration.
[EDIT]
Please be in mind K2 is installed.
Joined Board
12/14/2007 10:38
Last Visit
07/27/2010 13:03
User is OfflineView all users posts


