I have a (while next_image) loop on my image.php page to display all images in the album at once.
(the page is called with getFirstImageURL() )
after the while loop is done i place a commentform on this page. But i noticed that there is something going wrong with the printCommentForm()
the commentform ofcourse only posts a comment for the first image. the posting works ok, BUT the part of the function that displays the already posted comments shows "no comments". ( the context is set to another image by the while-loop??)
how do i set the context back to the first image before printing the commentform?
i could also use $_zp_current_image->getComments() and print the whole array separately but i would prefer the standard function inside the printcommentform() function since this is already fully styled.
Comments
You can of course set the $_zp_current_image again to the object of the first image manually. See the object model tutorial.
If you want to show thumbs for navigation I suggest to use one of the plugins for this purpose: pagethumbsnav or jcarousel. That saves you all this hassle actually.
`
<?php while (next_comment())<br />
{
?>
">
<?php printCommentAuthorLink();?>
: on <?php echo getCommentDateTime(); printEditCommentLink('Edit', ', ', ''); ?><?php echo getCommentBody();?>
<?php } ?>
`
if i place printCommentForm() BEFORE the while-loop everything is ok. but due to my design it has to be placed after it...and thus the function doesnt work correctly anymore.
i dont see how to make 'while (next_comment())' ,in the code above, loop through the first image comments in the tutorial you mention.