PHP/MySQL Image Gallery

This is a discussion on PHP/MySQL Image Gallery within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hiya, Can anyone kindly help me to get started in creating a PHP/MySQL image gallery, it doesn't have ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-18-2004
DaRemedy
 
Posts: n/a
Default PHP/MySQL Image Gallery

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


Reply With Quote
  #2 (permalink)  
Old 10-18-2004
Andrew DeFaria
 
Posts: n/a
Default Re: PHP/MySQL Image Gallery

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.
Reply With Quote
  #3 (permalink)  
Old 10-19-2004
john.postlethwait@gmail.com
 
Posts: n/a
Default Re: PHP/MySQL Image Gallery

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.

Reply With Quote
  #4 (permalink)  
Old 10-19-2004
Harrie Verveer
 
Posts: n/a
Default Re: PHP/MySQL Image Gallery

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.
>

Reply With Quote
  #5 (permalink)  
Old 10-19-2004
Steaming Balturd
 
Posts: n/a
Default Re: PHP/MySQL Image Gallery

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.
Reply With Quote
  #6 (permalink)  
Old 10-20-2004
DaRemedy
 
Posts: n/a
Default Re: PHP/MySQL Image Gallery


"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.


Reply With Quote
  #7 (permalink)  
Old 10-20-2004
Good Man
 
Posts: n/a
Default Re: PHP/MySQL Image Gallery

"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!




Reply With Quote
  #8 (permalink)  
Old 10-20-2004
John Postlethwait
 
Posts: n/a
Default Re: PHP/MySQL Image Gallery

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.

Reply With Quote
  #9 (permalink)  
Old 10-21-2004
castnblast
 
Posts: n/a
Default Re: PHP/MySQL Image Gallery


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

Reply With Quote
  #10 (permalink)  
Old 10-21-2004
castnblast
 
Posts: n/a
Default Re: PHP/MySQL Image Gallery


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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:26 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0