Random Kylie My Own Images!
|
|
|
|
|
|
|
|
|
|
What?!?!? You don't want to see images of Kylie? What is wrong with
you?!?!!
Ok, so I originally made this module as a joke, so the code is rather simple,
and does not have any Admin features to change the images, etc... Many people
have asked me if they could use the code to display their own images. Well, you
can! The code is very easy to modify, and I will lay it all out here with
comments on what you would need to change.
modules/mod_kylie.php
$total = "20";
//change this to the total number of thumbnail images in your folder
$file_type = ".jpg";
//if you used gifs of pngs, you would change this
$image_folder = "http://www.stupidscifi.com/kylie";
//the path to your thumbnail folder
$start = "1";
$random = mt_rand($start, $total);
$image_name = $random . $file_type;
//leave these 3 lines alone
//the next line I will break into pieces to show you what is what
echo "<center>
<a href=\"http://www.yoursite.com/big/$image_name\" target=\"_blank\">
//this sets the link, if you want the thumbnail clickable...
//you could make it a popup or whatever.
<img src=\"$image_folder/$image_name\" border='0'
width=\"100\" height=\"120\"
//you should change the width and height to match
your thumbnail size if it is different
alt=\"$image_name\" /></a></center>";
Enjoy! |