Jump to content

Can Learning Php Help With This ?


Shade

Recommended Posts

hello,I did an image gallery for my site before, it was pure HTML and JS. But there was a big problem,every time I had to add content to the gallery, I had to do a lot of changes, upload images, edit the HTML and JS,so, I'am looking for a web language/technique which can automate this all.THIS kind of automation:1. automatically, check the image folder.(how many images are there,etc)2. get corresponding thumbnails.3. count and sort the images.4. generate a detailed XML(info about number of images, their links and thumbnail links, metadata,tags etc) which the client side script can use to show the gallery.5. generate HTML pages for the content.6. and If possible, a custom uploading/managing interface for the admin.PS : I have knowledge of HTML, CSS, Javascript (and ECMA kind of scripts).and have access to the server only via my C-Panel.

Link to comment
Share on other sites

A Server-side script can do all of the above.Lots of scripts are available in Google. Here is a link to a php script that will read a set of directories and write the code for a randomized 'Hoverbox' page of images. http://www.jlhaslip.trap17.com/samples/gal...ox_tutorial.txtAnd here is a Demo link for a Hoverbox: http://jlhaslip.trap17.com/hoverbox/Main Hoverbox script can be found here: http://sonspring.com/journal/hoverbox-ie7-fixCheck that out.

Link to comment
Share on other sites

Thank you.I'm currently having a look at the code...all I can get is that the code:1. checks dir, mid_dir and full_dir exist.2. they are readable.3. for each file the file is not .*, not ..* and is *.jpeg,4. file has corresponding thumbnail,5. add then to array, shuffle it,6. generate an HTML list of images.OK. A little help here, I assume, that hoverbox shows three states : thumbnail, mid sized on mouseover and full size on clickright ? but I'd like to use dir and full dir only.

set directory paths here.//// There are Bandwidth issues with loading the 'full-size' pictures for use as thumbs and mid-size, however, there is a time-delay issue on-click when the full-size picture must then be downloaded. Your call on which method suits you best. The Demo uses three Folders, one for each size, which is the slowest possible setting, other than using over-sized images since they take longest to download and requires more bandwidth to provide, etc, blah, blah...// To minimize the bandwidth usage, use only one directory of optimized pictures, but be sure to alter the paths accordingly.//// example://// $dir = "full_images/";		 // will cause all images to be loaded from a single folder// $mid_dir = "full_images/";	 // where the full-sized images are stored. The Hoverbox html sizes them down to suit the thumbnail size and mid-size, but must download the entire gallery of pictures before displaying the thumbs.// $full_dir = "full_images/";	////// All occurences of a picture MUST have the SAME NAME whether in one or three directories.// The filenames don't appear to be case-sensitive. ( PIC001 = pic001 = PiC001 = pIc001 )//$dir = "images/";			  // name of the folder where the Thumbnail images are stored$mid_dir = "mid_images/";	  // name of the folder where the Mid-sized images are stored.$full_dir = "full_images/";	// name of the folder where the Full-sized images are stored

Link to comment
Share on other sites

yes, you can use only two directories if you want to, or only one. Change the directory variables to suit in the last three lines of code you list.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...