Question about rotating Banners on HJU

I used to have a rotating avatar on another forum, which wasn't really feasible in most forums, cause they're 141x190 and look crummy when you make any of them smaller. But anyways, what I basically did was create a file named "danger.php.gif" (danger because the avatar images are all danger sign spoofs) which most browsers are tricked into thinking is an image file initially, but which they run the code inside as normal PHP.

And inside the file was just the following code:

Code:
<?php
  $danger = rand(1, 20);
  if (($danger > 0) && ($danger < 10)) { $danger = "0" . $danger; }
  Header("Location: http://arrow.rangerwiki.com/avatars/danger/" . $danger . ".gif");
?>

It would result in throwing back a random avatar between 01.gif and 20.gif in that folder. Obviously to modify this for your own needs, you would need to change the rand call from 20 to however many images you're going to use, and then change the URL below that where the images are all stored. If you don't want to bother with a leading zero (1.gif instead of 01.gif), you'd need to completely delete that if-then statement on the second line.

EDIT: Here's the result if you're curious, though it's a modified one; I had two versions of the PHP file, with the second only using 18 of the images since 2 of them were a little overly raunchy. Anyways, refresh away.

danger2.php.gif
 
Last edited:

how to help support popgeeks, popgeeks, pop geeks

Latest News & Videos

Latest News

Back
Top