inherit
11234
0
Oct 24, 2012 19:48:57 GMT -8
maxxx
6,077
July 2003
nightmare
|
Post by maxxx on Aug 1, 2005 18:18:15 GMT -8
hi, i see that the avy changing code has been getting more and more popular and ive started to create a string of graphics that will all fit nicely together so i was wondering if i could get the avatar change code where you put a php/asp/perl script into a folder with images and then you put the link to it as the link to your avatar or something and it randomly switches them thanks
|
|
inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
Post by Ross on Aug 2, 2005 1:39:22 GMT -8
PM frufru, he'll be able to help you with that
|
|
squalleh
inherit
-149542
0
Dec 3, 2024 6:49:03 GMT -8
squalleh
0
January 1970
GUEST
|
Post by squalleh on Aug 2, 2005 3:38:26 GMT -8
<?php
$imgDir = 'http://yourhost.com/path/to/avatars'; // Leave off the ending slash
$imgCollection = array ( 'avatar1.jpg', 'myavatar.jpg', 'anotheravatar.gif' );
$imgRand = rand (0, count ($imgCollection) - 1); header ('location: ' . $imgDir . '/' . $imgRand);
?>
You just need to edit the first two variables. The first one '$imgDir' is the URL to where your avatars are kept. The second is an array, the names and extension for all avatars you want included in the series are kept there. You'll notice I have three in there for example so far. Continue adding them as you wish. Just remember to keep the same flow I've started, a comma after each item except for the last. So, five would look like:
$imgCollection = array ( 'avatar1.jpg', 'myavatar.jpg', 'wheee.jpg', 'goo.png', 'anotheravatar.gif' );
Finally, just save it as a PHP file, upload it, and put the location into your avatar. If that doesn't work, try renaming it so: '.php.png'. In other words, add the '.png' to the end and try again.
|
|