mY.sweeT.shadoW Posted June 13, 2009 Share Posted June 13, 2009 Hey Guys, Blog functionality is fairly simple. Here's where I am having a problem though. I built the blog originally with 50 pictures and picture blurbs, just recently I was asked to change this number to 100, so I did on the "blog add" page, but the edit section is a monster. I have a page called edit-picture4.php for the form, then edit-picture4-handler.php to handle the mysql and php. and I have basically these two pages for each entry, (50 of them >.>) is there an easier way to do this? Any direction would be much apreciated. Thanks all! -T Quote Link to comment https://forums.phpfreaks.com/topic/162049-solved-hey-question-about-design-of-specific-part-of-blog/ Share on other sites More sharing options...
Grayda Posted June 15, 2009 Share Posted June 15, 2009 What are these files actually used for? Are they for a gallery? Are they a part of the layout? Are they images in the blog post? In either way, you could probably store all of these files in the one file and systematically get them. For example (and this is based off the assumption that these 50 files are for a gallery): <?php $file[0]["src"] = "File1.jpg"; $file[0]["blurb"] = "Description for File one"; $file[1]["src"] = "File2.jpg"; $file[1]["blurb"] = "Description for File two"; // .... $file[49]["src"] = "File50.jpg"; $file[49]["blurb"] = "Description for File fifty"; for($i = 0; $i <= $numOfFiles; $i++) { echo "<img src='" . $file[$i]["src"] . "'>" . $file[$i]["blurb"] . "<br />"; } ?> But that's a horrible way of doing it. My suggestion would be create a table on your database called 'tblGallery' or something, store the image locations in there then use a simple PHP function to get the src and blurb. That way, you can programatically maintain the list meaning you can have fifty, one hundred or even a million image locations in your database But until you can tell us more about your application, this is the best I can offer Quote Link to comment https://forums.phpfreaks.com/topic/162049-solved-hey-question-about-design-of-specific-part-of-blog/#findComment-856022 Share on other sites More sharing options...
mY.sweeT.shadoW Posted June 15, 2009 Author Share Posted June 15, 2009 Hey, I fixed the problem I was having. Thanks for the help though, really appreciate your post :] Best, -T Quote Link to comment https://forums.phpfreaks.com/topic/162049-solved-hey-question-about-design-of-specific-part-of-blog/#findComment-856502 Share on other sites More sharing options...
Maq Posted June 15, 2009 Share Posted June 15, 2009 Hey, I fixed the problem I was having. Thanks for the help though, really appreciate your post :] Best, -T Would you mind sharing for future references? Also, please mark as solved, bottom left right above "quick reply". Quote Link to comment https://forums.phpfreaks.com/topic/162049-solved-hey-question-about-design-of-specific-part-of-blog/#findComment-856528 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.