jpopuk Posted March 1, 2010 Share Posted March 1, 2010 Hi, when a user submits a post (forum post) with an image attached I have it so the image URL inserts in a db table. When I link to the file on the view_topic.php page, every post loads all the images that have been submitted rather than the one the is relevant to the post it was submitted with. Here is the line of code I am using to load the image for the correct place: <?php foreach (get_images($file_name) as $image) { ?> <tr> <td valign="middle" align="center" height="140" width="120"><div id="galleryImage"><a href="/images/gallery/<?php echo $image['image_url']; ?>" target="_blank"><img src="/images/gallery/thumbnails/<?php echo $image['image_url']; ?>" border="0" alt="<?php echo $topic['subject']; ?>" title="<?php echo $topic['subject']; ?>" /></a></div></td> </tr> <?php } ?> I am not sure how to load it so the image just shows on the post it was submitted with. If anyone has any suggestion or tips that would be great. Thanks, Paul Link to comment https://forums.phpfreaks.com/topic/193730--/ Share on other sites More sharing options...
teamatomic Posted March 1, 2010 Share Posted March 1, 2010 Lets have a look at the get_images function. HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/193730--/#findComment-1019697 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.