Tips for my script.

Artemis

Just Punked Himself
Joined
May 16, 2004
Messages
5,313
Reaction score
43
Location
England! w000t!
Website
www.falcon-eye.co.uk
Can others edit my Photos
Photos NOT OK to edit
Oki guys Ive just finished work on a script that I will release to you all soon.
Its a random tip script, that you will be able to put on your websites, but atm I need some short tips to put in it, any tips would be really welcome :D
 
network problem w/ that url :?

i'm interested in the random image one though :D
is it jscript? php? i've wanted to learn some of that for a while now, but never sit down and read up on em.
 
I've got a random image on my site, here's the code I used:

Code:
<?php
/*
    By Matt Mullenweg > http://photomatt.net
    Inspired by Dan Benjamin > http://hiveware.com/imagerotator.php
    Latest version always at:
    http://photomatt.net/scripts/randomimage
*/

// Make this the relative path to the images, like "../img" or "random/images/".
// If the images are in the same directory, leave it blank.
$folder = '';

// Space seperated list of extensions, you probably won't have to change this.
$exts = 'jpg jpeg png gif';

$files = array(); $i = -1; // Initialize some variables
if ('' == $folder) $folder = './';
$handle = opendir($folder);
$exts = explode(' ', $exts);
while (false !== ($file = readdir($handle))) {
    foreach($exts as $ext) { // for each extension check the extension
        if (preg_match('/\.'.$ext.'$/i', $file, $test)) { // faster than ereg, case insensitive
            $files[] = $file; // it's good
            ++$i;
            }
        }
    }
closedir($handle); // We're not using it anymore
mt_srand((double)microtime()*1000000); // seed for PHP < 4.2
$rand = mt_rand(0, $i); // $i was incremented as we went along

header('Location: '.$folder.$files[$rand]); // Voila!
?>

Put that as rotate.php in the folder where the images are stored, then call using, for example <img src="http://moltenwords.net/picto/wp-admin/thumbnails/black-white/rotate.php" alt="A Random Image" />

I probably forgot a step...
 
Mine is alot simpler...simply because Im rubbish at php.
Mine uses a text file where you place the image urls, and then the pho randomly pics a url, and then uses it to extract the image...about 5 lines of simple code.

If you want the program anyone, just message me, Im more than happy to give any of these scripts to members of thephotoforum.com.

Hmm...try www.arakiba.com again...if it still dont work msg me.
 
cool, the url works now :D *hits refresh a lot of times to see random images*

oriecat, that looks so simple :shock:
do you know any good php tutorials? like something i can download from the web? it seems like every time i ask my computer peeps about dynamic web content, they tell me to use a different app, whether it be java, jscript, php, css :? so i end up not doing anything!
 
Well mate, it really does involve the persons opinion..
but go with php, I feel its alot more practical..although flash you can make games with, and javascript.

I used www.phpfreaks.com
Great easy to use totorials :)
 
I don't really know anything about php myself, I just find stuff to use. :) I have seen some good css links tho, it's pretty easy to learn the basics of. I will see if I can find those and post them back for ya.
 
wow, thanks a lot artemis and oriecat :D
i've got some reading to do.

artemis, what kind of tips are you looking for? photography stuff?
 

Most reactions

New Topics

Back
Top