creepydrawings Posted March 3, 2009 Share Posted March 3, 2009 Okay I will try my best to explain what I want to do... Lets say I have a series of web galleries or albums or whatever you want to call them. For each one lets say for example there are 15 thumbnailed photos per gallery. Each thumbnail file is named in succession 01.jpg, 02.jpg, 03.jpg... all the way up to 15.jpg Now one option would be to manually link each thumbnail to its destination so that when you click lets say 01.jpg it takes you to http://www.someaddress.com/whatever and then clicking 02.jpg would take you to http://www.12345.com/abc etc... this could take a long time if i have hundreds of gallery pages or more and trying to update them would be even more annoying as i would have to scan through all the code and individually replace the links... SO... would it be possible, using php to have each thumbnail obtain its link from an external textfile so that the text file could contain a simple list of links and the gallery thumbnails would obtain the link information from that text file? for example: clicking the linked thumbnail titled 01.jpg would > check external txt file in same directory > obtain link titled 01: http://www.something.com/other which would be on the first line of the text file. clicking 02.jpg would link me to 02: http://www.anotherone.com/123 and so forth... The idea being, whenever i want to update links i can just change the text files easily without having to mess with the original page's code. I am familiar with some php functions such as include and require but i am a novice and it's kind of tricky to learn with no prior programing knowledge and knowing only basic html so be patient with me please Also, if there is a way for me to do something similar with image comments and the page's title too that would be helpful... of course if you have a better suggestion on how to manage my links and picture information please feel free to share it. Thank you very much. Quote Link to comment https://forums.phpfreaks.com/topic/147792-tricky-question-about-gallery-linking/ Share on other sites More sharing options...
ober Posted March 3, 2009 Share Posted March 3, 2009 You can certainly do that... but I'd recommend using a database instead of text files. Each thumbnail would then have a value in a record in the database that would contain the link to the full image/gallery or whatever and you build the links dynamically. Titles and comments and whatnot would just be additional fields or tables in the database. Now... asking us for a code example of all of that would be a bit much, but if you need something specific, ask away. Quote Link to comment https://forums.phpfreaks.com/topic/147792-tricky-question-about-gallery-linking/#findComment-775803 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.