FRIHOST • FORUMS • SEARCH • FAQ • TOS • BLOGS • COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Dynamic Signatues (please read)





polly-gone
Hey all! I have a quick question.

Have you noticed how some peoples signatures display a random picture whenever you load that page? Well, I want to know how that is done? Is it done forum side or some external script. It isn't an animated gif, I know that for sure.

Thanks ahead of time,
-Nick Smile Smile Smile
Peterssidan
If it isn't animated gif it has to be some serverside script (probably PHP).
froginabox
http://www.nickfitzgerald.com/index.php/scripts/rotate-avatar/ wrote:


Rotate Avatar

Simple script that allows you to have a rotating avatar (would work for image signatures as well) on forums. You will need access to hosting that allows PHP as well as .htaccess.

First, create a file named avatar.png with a text editor and place the following in it:

< ?php
$dh = opendir(".");

while (false !== ($file = readdir($dh)))
{
if (preg_match('/.(jpg|gif|png)$/i', $file) and $file != "avatar.png")
{
$filelist[] = $file;
}
}

srand((double)microtime()*1000000);
$picnum = rand(0, sizeof($filelist) - 1);

header("Location: " . $filelist[$picnum]);

closedir($dh);
?>

Now create another text file called .htaccess and put this in it:

< filesmatch avatar.png>
SetHandler application/x-httpd-php
< /filesmatch>

Now on your web host create a new directory where you will upload these two files as well as any images you wish to use for your avatar. Now you would simply enter the URL to the avatar.png file in your forum profile and you’re all set.


From the blog of a guy I know, this is the script he used to make his.
polly-gone
Sorry, I am not too good with PHP, so where would the image files go on this? Under filelist[] ?

Thanks,
-Nick Smile Wink Smile
froginabox
I'm not so hot either - maybe post in the coding part of the forum to see if you can get some help? It's a direct copy-paste from his blog.
mk12327
You will need to put your images in the same folder as the 2 files. You do not need to change filelist[] as its contents are generated dynamically and automatically through the code. However, one thing to note is that there should not be a whitespace for < ?php, < filesmatch and < /filesmatch. Use <?php, <filesmatch and </filesmatch instead.
rvec
-close-
this topic is really old
Related topics
please read this topic very interest
Please read this first
Please Read
Please Read *Important Notice from Me =) *
Orkut invite!! Please read!!
PHP and HTML????
network sharing
APPEAL TO ALL PLEASE READ!!
help on a drop down menu!! Please Read!!
I think I found the PhpNuke Problem! Bondings Please Read!
URGENT FORM TROUBLE!!! PLEASE READ!!!!
Need Your Input*Easy Contest*Please Read*
squirrelmail (bondings please read)
interactive sigs
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Support and Web Hosting -> Frihost Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.