MyBB Community Forums

Full Version: Avatar on ShowTeam page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Just a simple tutorial.

Edit showteam.php and find

$query = $db->simple_select("users", "uid, username, displaygroup, usergroup, ignorelist, hideemail, receivepms, lastactive, lastvisit, invisible, away", "displaygroup IN ($groups_in) OR (displaygroup='0' AND usergroup IN ($groups_in)) OR uid IN ($users_in)", array('order_by' => 'username'));

Change that line to:



$query = $db->simple_select("users", "uid, username, displaygroup, avatar, usergroup, ignorelist, hideemail, receivepms, lastactive, lastvisit, invisible, away", "displaygroup IN ($groups_in) OR (displaygroup='0' AND usergroup IN ($groups_in)) OR uid IN ($users_in)", array('order_by' => 'username'));


Now save it, and just go to "Show Forum Team Templates"


and change the template "showteam_usergroup_user"

insert

<img src="{$user['avatar']}">

Wherever you want it to be.


Preview: (http://yourmotherisyoursister.com/lWAuj)

[Image: lWAuj.png]
What will happen if the user has no avatar?
(2015-06-14, 10:18 PM)Omar G. Wrote: [ -> ]What will happen if the user has no avatar?

A square will appear. Toungue
(2015-06-14, 10:19 PM)Akay Wrote: [ -> ]
(2015-06-14, 10:18 PM)Omar G. Wrote: [ -> ]What will happen if the user has no avatar?

A square will appear. Toungue

You can try:
$query = $db->simple_select("users", "uid, username, displaygroup, if(avatar='', './images/default_avatar.png',avatar) as avatar, usergroup, ignorelist, hideemail, receivepms, lastactive, lastvisit, invisible, away", "displaygroup IN ($groups_in) OR (displaygroup='0' AND usergroup IN ($groups_in)) OR uid IN ($users_in)", array('order_by' => 'username'));

It will display the forum default avatar if no avatar is setted
It's funny because the top person in that pic stole my old avatar on Leakforums ;_;
(2016-03-17, 07:57 PM)FoxKF Wrote: [ -> ]It's funny because the top person in that pic stole my old avatar on Leakforums ;_;

Who cares? :^)
this is how mine turned out https://gyazo.com/ac7932a6c9edea272a55a181dceb4469

As you can see it looks pretty terrible compared to you. Was wondering how you can make it look a lot more professional like yours.
(2016-03-29, 02:23 AM)Michaud© Wrote: [ -> ]this is how mine turned out https://gyazo.com/ac7932a6c9edea272a55a181dceb4469

As you can see it looks pretty terrible compared to you. Was wondering how you can make it look a lot more professional like yours.

Set a custom width & height to the avatar. ( <img src="{$user['avatar']}" width="40" height="40"> ) for example.
Thanks already looks so much better <3
(2016-03-29, 11:36 AM)Sazze Wrote: [ -> ]
(2016-03-29, 02:23 AM)Michaud© Wrote: [ -> ]this is how mine turned out https://gyazo.com/ac7932a6c9edea272a55a181dceb4469

As you can see it looks pretty terrible compared to you. Was wondering how you can make it look a lot more professional like yours.

Set a custom width & height to the avatar. ( <img src="{$user['avatar']}" width="40" height="40"> ) for example.

Where do you put this? What template?
Pages: 1 2