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
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 :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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