Jump to content

Automate PHP photo gallery


JasonTTex84

Recommended Posts

I'm introducing an new photo gallery to our site, however we have many groups of images that will need to be inserted. I'm looking for a way to automate this process based on a directory lookup, as well as adding captions to images based on a .txt file.

 

Here is the code I'm using to call the image within the gallery.

 

<a href="images/ICI_TAC_web1.jpg" rel="lightbox[iCI]" title="Some Caption for Cool Pic Here"><img src="images/ICI_TAC_web1_thumb.jpg" alt></a>
<a href="images/ICI_TAC_web2.jpg" rel="lightbox[iCI]" title="Some Caption for Cool Pic Here"></a>
<a href="images/ICI_TAC_web3.jpg" rel="lightbox[iCI]" title="Some Caption for Cool Pic Here"></a>

 

So I have a few attributes that would need to be automated, file name, group name (ICI in the case above), and captions. I don't need this to produce thumbnails for the gallery as we will handle this resizing before the upload, but I will need the code to recognize the thumbnail and display it.

 

Thanks in advance for help with this. I'm not sure this is possible or not, however I appreciate the communities input.

Link to comment
https://forums.phpfreaks.com/topic/268609-automate-php-photo-gallery/
Share on other sites

Thanks for the reply. To be clear, I'm not asking someone to do this for me. I'm really looking for some input on the matter. Is this a JS project, can it be done within PHP only, is it even possible, and where should I start.

 

You can use http://php.net/manual/en/function.file-get-contents.php to get data from your .txt file :)

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.