how difficult would this script be in php to write?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • d-null
    . . .
    • Apr 2007
    • 13724

    #1

    how difficult would this script be in php to write?

    I am thinking of a standalone php script that would put up a neat column and row page of images that don't change, out of a folder of images that could be added too.... for example, if there are 9 images in the folder, it will display three rows of three columns, but if I later add more images to the folder, it will automatically display more rows so that all the pictures are displayed on the single page....

    the script would have nothing to do with the adding of pictures, it would only need to look in that folder and work with what it finds there

    how long would it take an average php programmer to script something like that?

    __________________

    Looking for a custom TUBE SCRIPT that supports massive traffic, load balancing, billing support, and h264 encoding? Hit up Konrad!
    Looking for designs for your websites or custom tubesite design? Hit up Zuzana Designs
    Check out the #1 WordPress SEO Plugin: CyberSEO Suite
  • jimbona
    Confirmed User
    • Jan 2007
    • 190

    #2
    Heres a simple way to do it

    PHP Code:
    <?php
    $i=1;
    $mid=3;
    foreach (glob("{*.jpg,*.JPG,*.gif,*.GIF}",GLOB_BRACE) as $file) 
    {
       echo '<a href="./'.$file.'"><img src="./thumbs/'.$file.'" border="0" width="100" hspace="5" vspace="5"></a>';
       if($i == $mid)
       {
            echo "<br />";
           $i=0;
       }
       $i++;
    }
    ?>
    Drop the file into the same dir as you images in the structure of

    /index.php
    /thumbs/

    for example.

    All your images and thumbs need to have the same name.
    Change $mid to the number of images you want per row.
    Thanks
    Paul
    Thunder-Ball.net - Member

    Comment

    • Libertine
      sex dwarf
      • May 2002
      • 17860

      #3
      An hour. That includes turning on the computer, getting coffee, getting distracted by a porn flick, and having two cigarette breaks.

      I suppose it could be done in 5 minutes, but then the programmer would miss out on a cup of coffee, two cigarettes and a decent porn scene.
      /(bb|[^b]{2})/

      Comment

      • d-null
        . . .
        • Apr 2007
        • 13724

        #4
        thanks jimbona, I'll give that a try and let you know how I make out

        __________________

        Looking for a custom TUBE SCRIPT that supports massive traffic, load balancing, billing support, and h264 encoding? Hit up Konrad!
        Looking for designs for your websites or custom tubesite design? Hit up Zuzana Designs
        Check out the #1 WordPress SEO Plugin: CyberSEO Suite

        Comment

        Working...