Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 7 of 7

Thread: Gallery Issue

  1. #1
    Join Date
    Jun 2007
    Location
    England
    Posts
    495
    Tokens
    0

    Default Gallery Issue

    Hey,

    I am making a script for photographers, and I am abit stuck with the images bit, I want to lay the thumbnail images out in a table 4 images wide by howeva many long/down...

    But im stuck because when the user makes the gallery they specify a folder that the images are in names thumb_imagename.jpg and imagename.jpg but I dont know how to take the script get the images called thumb_imagename.jpg...

    Any ideas
    Dan


  2. #2
    Join Date
    Feb 2007
    Location
    Essex, England
    Posts
    1,392
    Tokens
    0

    Latest Awards:

    Default

    Get them to enter the name of the normal photograph, and then assuming you're using PHP, do this for the thumb:

    PHP Code:
    <?php

    $photo 
    "imagename.jpg";
    $thumb "thumb_" $photo;

    ?>
    not sure if that helps, but I couldn't tell exactly what you meant.


  3. #3
    DarrenToogood Guest

    Default

    Have you got any more information on this system?

  4. #4
    Join Date
    Jun 2007
    Location
    England
    Posts
    495
    Tokens
    0

    Default

    Quote Originally Posted by L?KE View Post
    Get them to enter the name of the normal photograph, and then assuming you're using PHP, do this for the thumb:

    PHP Code:
    <?php

    $photo 
    "imagename.jpg";
    $thumb "thumb_" $photo;

    ?>
    not sure if that helps, but I couldn't tell exactly what you meant.
    Thats not that I ment, I mean say I have 15 image files in a folder and I wanted them in a list and the folder the files where in was called "studio" and thats in the database, the script finds out that the folder where the images are is in the folder "studio" then echos all the images in a 4x* table,
    Do you understand me better...


    Quote Originally Posted by DarrenToogood View Post
    Have you got any more information on this system?
    Please PM me and I will let you know!

    Dan


  5. #5
    Join Date
    Jun 2007
    Location
    England
    Posts
    495
    Tokens
    0

    Default

    I have come up with this...

    PHP Code:
    $result mysql_query("EDITED!!!");

    echo 
    "<p><table border=0 cellspacing=0 cellpadding=2 bordercolor=#eeeeee  class='table' width=100%>";
    echo 
    "<tr align=top class='tdtop'>
      <td colspan='4' class='tdtop'><b>View Gallery</b></td>
      </tr>"
    ;

    while (
    $row mysql_fetch_array($result))
    {
        
    $id $row["id"];
        
    $images $row["images"];


    $handle opendir('../images/photos/test/thumb');
    while (
    false !== ($file readdir($handle))){
    echo 
    "  <tr>
      <td width='25%' align='center'><img src='../images/photos/test/thumb/
    $file' width='100' height='100'></td>
      <td width='25%' align='center'><img src='../images/photos/test/thumb/
    $file' width='100' height='100'></td>
      <td width='25%' align='center'><img src='../images/photos/test/thumb/
    $file' width='100' height='100'></td>
      <td width='25%' align='center'><img src='../images/photos/test/thumb/
    $file' width='100' height='100'></td>
    </tr>"
    ;
    }


    }
    closedir($handle);
    echo 
    "</table>";
    ?> 
    A screenshot of what it produces...


    As you can see it echos the same image 4 times and echos 2 blanks for ./ and ../ can someone fix it for me?

    Dan

    PS top of the script has been edited for secruty


  6. #6
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default

    You've reminded me of a gallery script I was producing, I remember that I used a database to get the locations of the images, none of this opendir stuff. I'll upload mine when I get on the pc. I'm not too sure on how the dir stuff works, but i would assume that you need to get an array of all the files.
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


  7. #7
    Join Date
    Jun 2007
    Location
    England
    Posts
    495
    Tokens
    0

    Default

    Thanks mate


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •