PDA

View Full Version : Adding User Avatars On Custom Modifications


Allan
17 Jan 2007, 14:03
Compatible with vBulletin 3.6.x


Upload the attached image to your misc. folder.
Import this product
<?xml version="1.0" encoding="ISO-8859-1"?>
<product productid="NoAvatar" active="1">
<title>No Avatar</title>
<description>Add avatar in your mods</description>
<url>http://www.blabla.com</url>
<version>1.0.0</version>
<plugins>
<plugin active="1">
<title>NoAvatar</title>
<hookname>forumhome_start</hookname>
<phpcode><![CDATA[if ($vbulletin->userinfo['userid']){
require_once('./includes/functions_user.php');
$noavatar = fetch_avatar_url($vbulletin->userinfo['userid']);
if (!is_array($noavatar)){
$noavatar[0] = $vbulletin->options['bburl'] . "/images/misc/no_avatar.gif";
}
}]]></phpcode>
</plugin>
</plugins>
</product>

And add this variable in your mods: $noavatar[0]

If user doesn't have a avatar, the "no_avatar.gif" image will display.
(REMINDER: Upload the no_avatar.gif to your misc. folder.)

I don't want to display the no_avatar.gif image.

Add this code in your mod:

<img src="image.php?$session[sessionurl]u=$bbuserinfo[userid]" alt="" border="0" />
If user doesn't have an avatar, the clear.gif (from your forum root) will display.

Mr_Snob
17 Jan 2007, 19:04
cool hack thank you for your usefully tutorial Allan :)

bigmonay2k
19 Jan 2007, 03:44
how do I download the product

Allan
19 Jan 2007, 08:13
how do I download the product
Product add ^^

bigmonay2k
19 Jan 2007, 15:50
^ THANKS, how does this thing work, I upload the image, I don't see anything

Terminatoronly
21 Jan 2007, 08:58
cool i like it ;)

bigmonay2k
22 Jan 2007, 01:44
cool i like it ;)

did it work for you??

Mr Pink
27 Feb 2007, 17:04
After a little (yes, a llittle big) search, I've found also this code:

<img src="image.php?u=$userid" />

Using this one, you will call the current user avatar (logged user).
Maybe it isn't the best, but it's what I was searching for (a simple code without plug-ins, file edits).
Now only what I need to do, is search a conditional for users that have not an avatar. :)

After a little (yes, a llittle big) search, I've found also this code:

<img src="image.php?u=$userid" />Using this one, you will call the current user avatar (logged user).
Maybe it isn't the best, but it's what I was searching for (a simple code without plug-ins, file edits).
Now only what I need to do, is search a conditional for users that have not an avatar. :)

Oh, great. It does't work. :rolleyes:
Zorry. :(