RANDOM IMAGE SCRIPT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    RANDOM IMAGE SCRIPT

    Some posted this here i got a copy and just gona post it again

    Create a folder for ur images, upload ur images to it. Create a file called "rotate.php" copy and paste this code 2 it and there u go! Simply link 2 http:// YourSite/images/rotate.php


    Code:
    <?php
    
    $folder = &#39;.&#39;;
    
    $extList = array();
    $extList[&#39;gif&#39;] = &#39;image/gif&#39;;
    $extList[&#39;jpg&#39;] = &#39;image/jpeg&#39;;
    $extList[&#39;jpeg&#39;] = &#39;image/jpeg&#39;;
    $extList[&#39;png&#39;] = &#39;image/png&#39;;
    
    $img = null;
    
    if (substr($folder,-1) != &#39;/&#39;) {
        $folder = $folder.&#39;/&#39;;
    }
    
    if (isset($_GET[&#39;img&#39;])) {
        $imageInfo = pathinfo($_GET[&#39;img&#39;]);
        if (
            isset( $extList[ strtolower( $imageInfo[&#39;extension&#39;] ) ] ) &&
            file_exists( $folder.$imageInfo[&#39;basename&#39;] )
        ) {
            $img = $folder.$imageInfo[&#39;basename&#39;];
        }
    } else {
        $fileList = array();
        $handle = opendir($folder);
        while ( false !== ( $file = readdir($handle) ) ) {
            $file_info = pathinfo($file);
            if (
                isset( $extList[ strtolower( $file_info[&#39;extension&#39;] ) ] )
            ) {
                $fileList[] = $file;
            }
        }
        closedir($handle);
    
        if (count($fileList) > 0) {
            $imageNumber = time() % count($fileList);
            $img = $folder.$fileList[$imageNumber];
        }
    }
    
    if ($img!=null) {
        $imageInfo = pathinfo($img);
        $contentType = &#39;Content-type: &#39;.$extList[ $imageInfo[&#39;extension&#39;] ];
        header ($contentType);
        readfile($img);
    } else {
        if ( function_exists(&#39;imagecreate&#39;) ) {
            header ("Content-type: image/png");
            $im = @imagecreate (100, 100)
                or die ("Cannot initialize new GD image stream");
            $background_color = imagecolorallocate ($im, 255, 255, 255);
            $text_color = imagecolorallocate ($im, 0,0,0);
            imagestring ($im, 2, 5, 5,  "IMAGE ERROR", $text_color);
            imagepng ($im);
            imagedestroy($im);
        }
    }
    
    ?>
    Here is a tip for you, if you upload these files to a folder called image.gif and rename rotate.php to index.php you will be able to use it on forums by using the url www.yoursite.com/image.gif and it will run the index.php[/b]
    previous post by GumSlone
    Here is an example, eg your text file contains different text lines each is starting with ::

    ::Hello
    ::HI
    ::How are you
    ::Whazzup



    Code:
    $xfile = @file("text.txt");
    $random_num = rand (0,count($xfile)-1);
    $udata = explode("::",$xfile[$random_num]);
    
    echo $udata[1]; //a random text line from the text file will be displayed
    [/b]
    = = = = =
    The more you laugh...the longer you live.
    Read more jokes at
    http://fun-files.co.cc

    #2
    rambom link same way you posted
    Code:
    ::[url="http://topsite.6te.net/top"]top-site-top[/url]
    ::[url="http://topsite.6te.net/downloads.php"]top-site-downloads[/url]
    ::[url="http://topsite.6te.net/sms.php"]top-site-free-sms[/url]
    ::[url="http://topsite.6te.net/upload.php"]top-site-uploads[/url]

    Code:
    $xfile = @file("text.txt");
    $random_num = rand (0,count($xfile)-1);
    $udata = explode("::",$xfile[$random_num]);
    
    echo $udata[1]; //a random text line from the text file will be displayed
    if having problems you can try this

    make ram.php file put this in it ---

    Code:
    <?php
    
    $xfile = @file("text.txt");
    $random_num = rand (0,count($xfile)-1);
    $udata = explode("::",$xfile[$random_num]);
    
    echo $udata[1]; //a random text line from the text file will be displayed
    
    ?>
    then add this to place you what it to show
    Code:
    <?
    include(&#39;ram.php&#39;);
    ?>
    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment


      #3
      i have different random image script an it is much faster and easier

      Comment


        #4
        i have different random image script an it is much faster and easier[/b]
        why just post about it? why dont you upload it?
        = = = = =
        The more you laugh...the longer you live.
        Read more jokes at
        http://fun-files.co.cc

        Comment


          #5
          you mean the one that clint posted

          Comment


            #6
            you mean the one that clint posted [/b]
            no i got a different one i will upload it but my scripts or jumbled on my pc i will sort it out later.......

            Comment


              #7
              lamar why you always say something wrong with your pc when sum1 ask u to upload script ?

              i think you talk bollox
              8th wonder of the world

              Comment


                #8
                I didin&#39;t noticed that and he could until now upload it,you got right strange

                Comment


                  #9
                  lamar why you always say something wrong with your pc when sum1 ask u to upload script ?

                  i think you talk bollox[/b]
                  lol, uv got a good way with words and from the way u talk I think ur avatar is a real picture of u! hehe.

                  Comment


                    #10
                    lol clint, but i speak truth.. he ALWAYS she pc is broken or something to do with his pc.
                    8th wonder of the world

                    Comment


                      #11
                      maybe it is coinsidance

                      Comment


                        #12
                        i will be posting mine later ok guys...

                        Comment


                          #13
                          I have one and it works fine.

                          Comment


                            #14
                            i will be posting mine later ok guys...[/b]
                            hmmm, we&#39;ll see!

                            Comment


                              #15
                              POST IT LAMAR POST IT, I can&#39;t wait so it!!

                              Comment

                              Working...
                              X