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~
~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
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’);
<img src="<?php echo $avatarFile; ?>" />
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’));
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'));
[/edit]
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.