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