PDA

View Full Version : PHP/vBulletin question?? about avatars


SocomNego
02-23-2007, 09:34 PM
Ok I am trying to use this conditional to show a users avatar if they have it enabled, and if they don't then show this....basically if they have an avatar show it then if not show the default one i have made...here is my code....This code is outside of the forums on a basic PHP page....I have included the vBulletin files needed to do this, but it's not working...I might have the conditional wrong...

if($vbulletin->options['avatarenabled'] == !0 ) {
echo "<center><br><a href=\"".$forumpath."profile.php?do=editprofile\"><img src=\"$file.$type\" border=\"0\" width = \"70\" height = \"70\" align=\"center\" title=\" Member Picture\" ></a><br>";
}else {
echo "<center><br><a href=\"".$forumpath."profile.php?do=editprofile\"><img src=\"This is where Default Avatar is\" border=\"0\" width = \"70\" height = \"70\" align=\"center\" title=\" Member Picture\" ></a><br>";
}

any help would we be great...thanks in advance!!!

Kirk Y
02-23-2007, 11:51 PM
$vbulletin->options['avatarenabled'] == !0


Should be:

$vbulletin->options['avatarenabled'] != 0

SocomNego
02-24-2007, 01:53 AM
I didn't mean to put that there....however, I did do exactly what you put and I still get nothing when I login...
I also did this:

if(!$vbulletin->options['avatarenabled']) {
echo "<center><br><a href=\"".$forumpath."profile.php?do=editprofile\"><img src=\"$file.$type\" border=\"0\" width = \"70\" height = \"70\" align=\"center\" title=\" Member Picture\" ></a><br>";
}else {
echo "<center><br><a href=\"".$forumpath."profile.php?do=editprofile\"><img src=\"This is where Default Avatar is\" border=\"0\" width = \"70\" height = \"70\" align=\"center\" title=\" Member Picture\" ></a><br>";
}

Kirk Y
02-24-2007, 03:49 AM
Try: $show['avatar']