Helpful Information
 
 
Category: vBulletin 3.0 Beta Releases
Random avator for a specific user

I use this for changing a specific user. It goes in functions_showthread.php after line.
}
else
{
$avatarurl = '';
}

}

if ($post['userid']==##) {

header("Expires: " . gmdate("D, d M Y H:i:s",time()) . "GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s",time()) . "GMT");
if ($dir = @opendir('{full directory path}')) {
$filecount=0;
while (($file = readdir($dir)) !== false) {
if ($file != ".." && $file != ".") {
$filelist[] = $file;
$filecount++; //Keep track of the total number of files.

}
}
closedir($dir);
}
mt_srand ((double) microtime() * 1000000);

$filebreak = rand(1,$filecount);
$filecount2=0;


while (list ($key, $val) = each ($filelist)) {
$val;
$filecount2++;
if ($filebreak==$filecount2) {
$avatarurl = '{relative path}'.$val;
}
}



}


Does anybody else do something similiar or have a better way to do it?

i can't tell just yet cause i've not installed it (plus i'm tired as) but i made a random avatar for vb2..... i'd have trandscribed it to vb3 but i've been to busy to do it.

so if i can't find the time to convert it i might just use yours.....

i can't tell just yet cause i've not installed it (plus i'm tired as) but i made a random avatar for vb2..... i'd have trandscribed it to vb3 but i've been to busy to do it.

so if i can't find the time to convert it i might just use yours.....
I used to just do this with template modifications, to give people with no avatar, a random one.

I used to just do this with template modifications, to give people with no avatar, a random one.

How did you do it with pure template modification?
One of the things I like with this is it reads the file list so it you don't need to change anything to add new files and they don't need to be named anything special. It also is random per post.

To see a specific example go Here* (http://www.nothingland.com/showthread.php?t=3418) Look at the user Squirrel Nutkin.

*There is swearing in that thread.

How did you do it with pure template modification?
One of the things I like with this is it reads the file list so it you don't need to change anything to add new files and they don't need to be named anything special. It also is random per post.

To see a specific example go Here* (http://www.nothingland.com/showthread.php?t=3418) Look at the user Squirrel Nutkin.

*There is swearing in that thread.
I gotta say...it didn't seem like all that special at first, but knowing it works for a random pic for each post in the same thread...well, that is cool!

thought it would be similar to the one i did.... mine was Java script though.....

looks like i don't need to remake it then.... thanks tom.... *wishes weekend would hurry up so it can be installed.*

This would be good for a certain usergroup so I could give it to usenet posts. How can I limit it to one usergroup?

This would be good for a certain usergroup so I could give it to usenet posts. How can I limit it to one usergroup?

Change ($post['userid']==##) to ($post['displaygroupid'] = ##)

Where ## is the usergroup id that you want to target.

Hmm.I'm having a problem...in a thread it says:

Warning: Variable passed to each() is not an array or object in /home/bere/public_html/forum/includes/functions_showthread.php on line 430










privacy (GDPR)