For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > October 2004 > PHP/MySQL Image Gallery









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PHP/MySQL Image Gallery
DaRemedy

2004-10-18, 8:55 pm

Hiya,

Can anyone kindly help me to get started in creating a PHP/MySQL image
gallery, it doesn't have to be anything fancy, just something that
automatically reads the images in the folder and displays it.

Cheers


DaRemedy


Andrew DeFaria

2004-10-18, 8:55 pm

DaRemedy wrote:

> Hiya,
>
> Can anyone kindly help me to get started in creating a PHP/MySQL image
> gallery, it doesn't have to be anything fancy, just something that
> automatically reads the images in the folder and displays it.
>
> Cheers
>
> DaRemedy


Try http://gallery.sourceforge.net/
--
The facts, although interesting, are irrelevant.
john.postlethwait@gmail.com

2004-10-19, 3:57 am

Why do you need the images in a database if you are already reading
them from a folder? It is kind of redundant... Unless I am missing
something.

Harrie Verveer

2004-10-19, 8:58 am

no not necessary, with the dir() method you can find images (and open
them/display them/delete them), but mostly I keep the filenames in a
database because I often like to have some administration with my
images; like the owner, the gallery it should be displayed in, a
discription of the image, location of the thumbnail, a one to many
relation with a users comments table. In that case it is just easier to
keep the filenames in the database. As long as you add the images when
uploaded, and unlink() them when removed from the database, there
shouldn't be any problem.

john.postlethwait@gmail.com wrote:
> Why do you need the images in a database if you are already reading
> them from a folder? It is kind of redundant... Unless I am missing
> something.
>

Steaming Balturd

2004-10-19, 3:55 pm

DaRemedy wrote:

> Hiya,
>
> Can anyone kindly help me to get started in creating a PHP/MySQL image
> gallery, it doesn't have to be anything fancy, just something that
> automatically reads the images in the folder and displays it.
>
> Cheers
>
>
> DaRemedy


Nothing to do with your request admittedly, but you should check out
http://www.flickr.com if you havent already.

It's SERIOUSLY good - and the online community aspect has to be seen to be
believed.
DaRemedy

2004-10-20, 3:56 pm


"Harrie Verveer" <newsgroup{remove-this}@harrieverveer.com> wrote in message
news:GsCdndZQI9rKbuncRVnyuA@zeelandnet.nl...
> no not necessary, with the dir() method you can find images (and open
> them/display them/delete them), but mostly I keep the filenames in a
> database because I often like to have some administration with my
> images; like the owner, the gallery it should be displayed in, a
> discription of the image, location of the thumbnail, a one to many
> relation with a users comments table. In that case it is just easier to
> keep the filenames in the database. As long as you add the images when
> uploaded, and unlink() them when removed from the database, there
> shouldn't be any problem.
>

What I originally wanted to do is to have the image path stored in a
database and the php page retrieving them. Only problem is that I have about
200 images so inputting them all into a database is going to be one long
task. How would you suggest I approach this?

Thanks.


Good Man

2004-10-20, 3:56 pm

"DaRemedy" <demonnet@btinternet.com.nospam> wrote in
news:cl658t$gpp$1@hercules.btinternet.com:

> What I originally wanted to do is to have the image path stored in a
> database and the php page retrieving them. Only problem is that I have
> about 200 images so inputting them all into a database is going to be
> one long task. How would you suggest I approach this?
>
> Thanks.



throw all the files in any directory.

write a php script that reads the names of the image files in the directory,
then appends the 'real' path to the front of them (ie: the script changes the
variable from "butter.jpg" to "http://www.yoursite.com/path/to/butter.jpg")

the same script then takes the new name and puts it where you want in your
database.... loop it 200 times (or once for each file in your directory) and
voila!

good luck!




John Postlethwait

2004-10-20, 3:56 pm

Yeah, that is what I would do, you may even want to make it modular so
you can reuse it later, for instance have it ask you what the absolute
URL to the image folder is before it appends the URL (as opposed to
hard-coding the URL)

Just use foreach() to make it loop through every file in the directory
for the number of files in the directory.

castnblast

2004-10-21, 3:55 am


DaRemedy wrote:
> Hiya,
>
> Can anyone kindly help me to get started in creating a PHP/MySQL

image
> gallery, it doesn't have to be anything fancy, just something that
> automatically reads....


do more with less, Robopages:
http://www.phpclasses.org/browse/package/743.html

castnblast

2004-10-21, 3:55 am


DaRemedy wrote:
> Hiya,
>
> Can anyone kindly help me to get started in creating a PHP/MySQL

image
> gallery, it doesn't have to be anything fancy, just something that
> automatically reads....


do more with less, Robopages:
http://www.phpclasses.org/browse/package/743.html

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com