PDA

View Full Version : Rotate Avatars Hack


nulltone
01-20-2003, 05:33 PM
I have searched on this forum multiple times for some type of modification which will enable me to use multiple avatars.
I am the admin of my forum. I don't really care if other people have this feature, infact, it would be best if they do not. I have about 30 avatars which I really like, all somewhat similar. Is there any way for me to place these all in a folder on my server, and have vBulletin randomize upon loading the page?
If that can't happen, the next best thing would be to have vBulletin change the avatar (in a sequence, from 1.jpg, 2.jpg...30.jpg) on my account every few minutes?
If there is already a mod like this, please point me in the right direction. I have spent at least an hour searching here, the vbulletin.com, and google.

Neo
01-20-2003, 06:00 PM
In admin/functions.php find


if ($post[avatarid]!=0) {
$avatarurl=$post[avatarpath];
} else {
if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
} else {
$avatarurl="";
}
}


and place this under it


if ($bbuserinfo[userid]==1) {
srand(time());
$rand = rand(1,30);
$avatarurl="http://www.yourdomain.com/forum/images/avatars/ava[$rand].gif"; // edit this to your own settings
}


as you can see this is manually done but its fast and it should work.

nulltone
01-20-2003, 06:04 PM
I LOVE You.
Seriously, you are great. Thank you so much.
If you ever need anything, just let me know via email or PM.

nulltone
01-20-2003, 06:20 PM
Ok, it isn't really working.
The problem somehow lies in

if ($bbuserinfo[userid]="1") {

For some reason it isn't being limited to just user # 1
all users have my avatars now

Neo
01-20-2003, 08:54 PM
Just responded to your PM.

Neo
01-20-2003, 08:55 PM
and make sure thay when you have your images.. have the files names like

ava[1].gif
ava[2].gif