Tips for my script.

Discussion in 'Beyond the Basics' started by Artemis, Aug 6, 2004.

  1. Artemis

    Artemis Just Punked Himself

    Joined:
    May 16, 2004
    Messages:
    5,313
    Likes Received:
    43
    Location:
    England! w000t!
    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
     
  2. Artemis

    Artemis Just Punked Himself

    Joined:
    May 16, 2004
    Messages:
    5,313
    Likes Received:
    43
    Location:
    England! w000t!
    Can others edit my Photos:
    Photos NOT OK to edit
    Just to add I am also making a Random image script..pm me if you want it :)
     
  3. Artemis

    Artemis Just Punked Himself

    Joined:
    May 16, 2004
    Messages:
    5,313
    Likes Received:
    43
    Location:
    England! w000t!
    Can others edit my Photos:
    Photos NOT OK to edit
  4. StvShoop

    StvShoop TPF Noob!

    Joined:
    Jun 9, 2004
    Messages:
    449
    Likes Received:
    0
    Location:
    Troy, NY
    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.
     
  5. oriecat

    oriecat work in progress

    Joined:
    Jul 7, 2003
    Messages:
    3,118
    Likes Received:
    19
    Location:
    Portland OR USA
    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...
     
  6. Artemis

    Artemis Just Punked Himself

    Joined:
    May 16, 2004
    Messages:
    5,313
    Likes Received:
    43
    Location:
    England! w000t!
    Can others edit my Photos:
    Photos NOT OK to edit
    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.
     
  7. Karalee

    Karalee hOtLiPs!

    Joined:
    Feb 22, 2004
    Messages:
    3,849
    Likes Received:
    46
    Location:
    Here....there....everywhere
    Can others edit my Photos:
    Photos NOT OK to edit
    Didnt work the first time cos theres a comma on the end of the site url.
     
  8. Artemis

    Artemis Just Punked Himself

    Joined:
    May 16, 2004
    Messages:
    5,313
    Likes Received:
    43
    Location:
    England! w000t!
    Can others edit my Photos:
    Photos NOT OK to edit
    You like the site? the proggy is on the right bar thing :)
     
  9. StvShoop

    StvShoop TPF Noob!

    Joined:
    Jun 9, 2004
    Messages:
    449
    Likes Received:
    0
    Location:
    Troy, NY
    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!
     
  10. Artemis

    Artemis Just Punked Himself

    Joined:
    May 16, 2004
    Messages:
    5,313
    Likes Received:
    43
    Location:
    England! w000t!
    Can others edit my Photos:
    Photos NOT OK to edit
    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 :)
     
  11. oriecat

    oriecat work in progress

    Joined:
    Jul 7, 2003
    Messages:
    3,118
    Likes Received:
    19
    Location:
    Portland OR USA
    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.
     
  12. Artemis

    Artemis Just Punked Himself

    Joined:
    May 16, 2004
    Messages:
    5,313
    Likes Received:
    43
    Location:
    England! w000t!
    Can others edit my Photos:
    Photos NOT OK to edit
    I could do with some to...btw does anyone want the the zip file of my random pick mod?
     

Share This Page