March 15, 201214 yr Hey, I'm new, been designing and building for about 12 years on and off and thought it would be nice to talk to some of you I run a photography business. We show the client their images through the web. I have editors that I send raw images to and they transform them and when ready they upload them. To make it easy for the (non web design) editors to upload the images I give them a HTML doc with relative URL's which link to their 'images' file in the same directory as the HTML doc. All images for each client are named 'T1', 'T2' etc. This means no 'insert image' or any fiddling. They copy and paste the HTML doc beside the images folder and the images are found and used. My problem is that each client has a different amount of images and they have to open the HTML doc in Dreamweaver and delete any unused DIV's manually, we have roughly 60 clients a week so this is a massive pain. BASICALLY - If, image 'T1' not found, hide DIV 'T1' Any help is appreciated, Google returns nothing!
March 15, 201214 yr Author Ok, after searching for ages and resulting to making a thread about it, I found the answer 5 minutes later. The answer is php... <?php $filename = 'images/t1.jpg'; if (file_exists($filename)) { echo "<div id="T1" class="T1"> <img src="images/t1.jpg" alt="Photograph T1" /> </div>"; } else { echo ""; } ?>
March 15, 201214 yr If they want to show all images in the folder then why not just read the folder contents and display what it finds? Then they don't need to edit a document.
March 15, 201214 yr Ok, after searching for ages and resulting to making a thread about it, I found the answer 5 minutes later. The answer is php... <?php $filename = 'images/t1.jpg'; if (file_exists($filename)) { echo "<div id="T1" class="T1"> <img src="images/t1.jpg" alt="Photograph T1" /> </div>"; } else { echo ""; } ?> No need for the else statement. Can leave it with just the if.
March 15, 201214 yr Author If they want to show all images in the folder then why not just read the folder contents and display what it finds? Then they don't need to edit a document. It has formatting like putting image titles saying T1 and some info under each picture, so it couldn't just display everything surely? No need for the else statement. Can leave it with just the if. Yeh spotted that when I was adapting it Thanks anyway guys, I have a billion other things I'm trying to solve too but I'll search around first
March 15, 201214 yr It has formatting like putting image titles saying T1 and some info under each picture, so it couldn't just display everything surely? You can pull meta data from the images, I don't know how plausible that approach would be for you as someone (probably the editors) would have to add the meta data into the image. Meta data can hold alot of useful information, Including things like descriptions, url's, copyrights, authors and so on. And that data will be available wherever the image is transferred (i.e clients computer) and for whoever's using it (search engines, third parties etc.) Just some food for thought. Edited March 15, 201214 yr by bocaj
Create an account or sign in to comment