Back to vBulletin 3.0 Add-Ons

Show Avatar Anywhere
Mod Version: 1.00, by dsboyce8624

This modification is in the archives.
vB Version: 3.0.7 Rating: (0 vote - 0 average) Installs: 9
Released: 16 Jun 2005 Last Update: Never Downloads: 0
Not Supported Template Edits  

Okay, I searched all over for this and finally found something that works for 3.0.7 in a post, to help those who don't look outside the Mod Forums for answers I am going to post it here.

I did not code it or figure it out, all credit goes to Gellpak in this post

Spoiler (click to open)


Got it. Here's the code. Place this in phpinclude_start

Code:
require_once('./includes/init.php');
require_once('./includes/functions_user.php');
$bbuserinfo['user_avatar']=fetch_avatar_url($bbuserinfo['userid']);
$bbuserinfo['user_avatar']="<img src='$vboptions[bburl]/{$bbuserinfo['user_avatar']}' border='0'>";
$bbuserinfo['user_avatar']="<a href='$vboptions[bburl]/profile.php?{$session['sessionurl']}&do=editavatar'>{$bbuserinfo['user_avatar']}</a>";
$welcome_avatar=$bbuserinfo['user_avatar'];
and then place $welcome_avatar where you want it to output the avatar.

Close
. Gellpak, if you want to post this as your hack, PM me and I'll pull it.

Place this at the end of phpinclude_start:

Code:
require_once('./includes/init.php');
require_once('./includes/functions_user.php');
$bbuserinfo['user_avatar']=fetch_avatar_url($bbuserinfo['userid']);
if ($bbuserinfo['user_avatar']=='') ($bbuserinfo['user_avatar']='images/misc/noavatar.gif'); 
$bbuserinfo['user_avatar']="<img src='$vboptions[bburl]/{$bbuserinfo['user_avatar']}' border='0'>";
$bbuserinfo['user_avatar']="<a href='$vboptions[bburl]/profile.php?{$session['sessionurl']}&do=editavatar'>{$bbuserinfo['user_avatar']}</a>";
$welcome_avatar=$bbuserinfo['user_avatar'];
Then place the $welcome_avatar variable anywhere you want the avatar to show up.

I corrected his code a bit for people who do not have avatars.

Check the URL and file name for whatever image you use for those without an avatar.

Also, if you use vBadvanced and want this on the main page somewhere add welcome_avatar to the variable list in vBa CMPS Default Settings in the AdminCP.

Download

No files for download.

Supporters / CoAuthors

  • Gellpak

Similar Mods

Show "No Avatar" Image If No Avatar is Selected vBulletin 2.x Full Releases

vblts.ru supports vBulletin®, 2022-2024