Joo!BB - Making Community
Joo!BB - Joomla! Bulletin Board
Welcome, Guest

6 Replies

by ~cXc~ on 02/02/2010 15:27
Post Display users avatar

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~ | Joined Board: 01/30/2010 15:30 | Last Visit: 12/03/2010 05:51
Joo!BB - Newie
Registered
Posts: 10
Offline Member is Offline
View all users posts


by Robbie on 02/02/2010 20:37
Post Re: Display users avatar

~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


Robbie | Joined Board: 12/14/2007 10:38 | Last Visit: 11/20/2011 10:49
Joo!BB - Master
Administrator
Posts: 775
Offline Member is Offline
View all users posts


by ~cXc~ on 02/02/2010 21:46
Post Re: Display users avatar

Inside Joo!BB ...


~cXc~ | Joined Board: 01/30/2010 15:30 | Last Visit: 12/03/2010 05:51
Joo!BB - Newie
Registered
Posts: 10
Offline Member is Offline
View all users posts


by Robbie on 02/03/2010 07:05
Post Re: Display users avatar

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; ?>" />


Robbie | Joined Board: 12/14/2007 10:38 | Last Visit: 11/20/2011 10:49
Joo!BB - Master
Administrator
Posts: 775
Offline Member is Offline
View all users posts

Last Edit on 02/03/2010 07:09


by ~cXc~ on 02/03/2010 11:35
Post Re: Display users avatar

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 Wink


~cXc~ | Joined Board: 01/30/2010 15:30 | Last Visit: 12/03/2010 05:51
Joo!BB - Newie
Registered
Posts: 10
Offline Member is Offline
View all users posts


by ~cXc~ on 02/03/2010 11:42
Post Re: Display users avatar

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();

$avatarFile = $joocmAvatar->getAvatarFile($this->joobbUser->get('id'));
the single quotes on either side of id where the cause this time Wink

I'll release my template after I take my daughter to school Big Smile [/edit]


~cXc~ | Joined Board: 01/30/2010 15:30 | Last Visit: 12/03/2010 05:51
Joo!BB - Newie
Registered
Posts: 10
Offline Member is Offline
View all users posts

Last Edit on 02/03/2010 11:58


by Robbie on 02/03/2010 13:49
Post Re: Display users avatar

oh... sorry for the syntax errors... I made it "on the fly". Blush

Yes, you can use K2 avatars. The code is the same. All you need to change is the Avatar Source in Joo!CM configuration. Wink

[EDIT]
Please be in mind K2 is installed. Wink


Robbie | Joined Board: 12/14/2007 10:38 | Last Visit: 11/20/2011 10:49
Joo!BB - Master
Administrator
Posts: 775
Offline Member is Offline
View all users posts

Last Edit on 02/03/2010 13:51


6 Replies

Joo!BB - Joomla! Bulletin Board

Copyright © 2007 - 2012 Joo!BB Project - All rights reserved.