4 Replies - 1548 Views - Last Post: 08 September 2002 - 09:13 PM Rate Topic: -----

#1 Markp  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 76
  • Joined: 18-January 02

Creating A Simple Image Gallery... Can You Help?

Post icon  Posted 05 September 2002 - 03:09 PM

Please view my current gallery: http://www.markp.com/photos

I don't want to change the design, or feel I just want to make it simpler for me to upload images.

My directory structure is: Photos/PhotoSetName/TN

Photos is the main photo directory
PhotoSetName is the different photos i.e. newcastle03sept02
TN is the thumbnails directory for the above directory

Basically I want to drop a php file in the TN directory that reads all the files in that directory. Then links to the main file in the directory above when you click on the thumbnail.

I don't know where to start. Can anyone help?

Is This A Good Question/Topic? 0
  • +

Replies To: Creating A Simple Image Gallery... Can You Help?

#2 supersloth  Icon User is online

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4503
  • View blog
  • Posts: 28,410
  • Joined: 21-March 01

Re: Creating A Simple Image Gallery... Can You Help?

Posted 05 September 2002 - 10:00 PM

i know gneato already has something very similar worked out, hopefully he'll see this in the next 24 hours, if not, i'll pm him. :)
Was This Post Helpful? 0
  • +
  • -

#3 Markp  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 76
  • Joined: 18-January 02

Re: Creating A Simple Image Gallery... Can You Help?

Posted 06 September 2002 - 09:26 AM

supersloth, on Sep 5 2002, 11:00 PM, said:

i know gneato already has something very similar worked out, hopefully he'll see this in the next 24 hours, if not, i'll pm him. :)

pm him! pm him! pm him! pm him! pm him! pm him!
pm him! pm him! pm him! pm him! pm him! pm him!
pm him! pm him! pm him! pm him! pm him! pm him!
pm him! pm him! pm him! pm him! pm him! pm him!
pm him! pm him! pm him! pm him! pm him! pm him!
pm him! pm him! pm him! pm him! pm him! pm him!
pm him! pm him! pm him! pm him! pm him! pm him!

:D :D :D
Was This Post Helpful? 0
  • +
  • -

#4 Markp  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 76
  • Joined: 18-January 02

Re: Creating A Simple Image Gallery... Can You Help?

Posted 06 September 2002 - 09:47 AM

Ok I've been given this code:

<?php
echo "testing stuff<hr>";
$dir = "/Users/nucleuz/Sites/flashkit.com/dir/tm";
$handle = opendir($dir);
echo "directory=$dir<br>"; 
while (($file = readdir($handle))) {
    if(preg_match("/\.jpg$/", $file)) {
        $link = $file;
        $file = str_replace("_tm", "", $file);
        echo "<a href=\"../" . $file . "\">" . $link . "<br>\n";
    }
} 
?>


but this has two problems, it adds images one on top of each other, which should be fixed by removing the <BR> and if I remove the string replace _tm thing that should work I think! Then all I need to do is add the frame target.

Hurray! No doubt I'll be back when I have problems! :D

M
Was This Post Helpful? 0
  • +
  • -

#5 gneato  Icon User is offline

  • <title>Untitled Document</title>

Reputation: 0
  • View blog
  • Posts: 1,311
  • Joined: 03-September 01

Re: Creating A Simple Image Gallery... Can You Help?

Posted 08 September 2002 - 09:13 PM

I have a script that creates the thumbnails on the fly. Currently designed for this directory structure...

/gallery/root/dir/
/gallery/root/dir/gallery_one/imagename.jpg
/gallery/root/dir/thumbs/THUMB_gallery_one_imagename.jpg

You call the script like this...
http://url.to.galler...ery=gallery_one

It shows a list of the images

To see a thumb, you visit
http://url.to.galler...l=imagename.jpg
If the thumbnail file doesn't exist, the script creates it... if the thumbnail image has already been created, it uses the existing one... (e.g. the thumbs are cached)

for fullsize, it's
http://url.to.galler...e=imagename.jpg

Tell me if you want the source code. Send me a pm or something. I'll have to adapt the code.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1