Member
Member
mauritsivs   2011-02-16, 18:23
#1

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.

Administrator
Administrator
acrylian   2011-02-16, 19:33
#2

What are you actually doing or want to do? The next_image loop sets the current image object of course for each image in that loop one after another.

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.

Member
Member
mauritsivs   2011-02-16, 21:56
#3

in the end i want to display the posted comments separate from the form itself. right now i use part of the printCommentForm() function to display the comments:

`


">


on



`

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.

Member
Member
sbillard   2011-02-16, 22:23
#4

You will have to preserve and then restore the context around the next_image() loop. It is not normal to have an "album" functionality on the image page, so to accomplish that you will have to remove the damage it has done.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.