<!--I post again, as the original message seems to not display.-->
Hi. I am working on a theme which displays always the same layout: an image, plus a menu of albums linked to their latest image. My index.php changes context and includes image.php:
`
set_context(ZP_GALLERY);
$_zp_current_album = $_zp_gallery->getAlbum(0);
add_context(ZP_ALBUM);
$_zp_current_image = $_zp_current_album->getImage(0);
add_context(ZP_IMAGE);
include ('image.php');
`
The whole thing holds together, and comments are displayed properly for the current image, whether the user is on index.php or image.php (after any click).
[b]The problem[/b]
When under an image.php URL, comments for current image are viewed and posted correctly.
When in index.php, comments for current image are viewed correctly, but none posted and no error message is echoed.
[b]Tests[/b]
[list]
[*]
Problem does not seem to be $_zp_current_context. I get a puzzling 6 (ZP_GALLERY + ZP_ALBUM) in index.php after image.php is included (how can that be after I force the context change?), but even if I force it to 7 in image.php for debugging, checking before and after printCommentForm that the value remains, comments are not sent from index.php.
[*]
Comments just vanish, as they don't appear either in admin panel (thinking they might be getting attached to albums instead of images).
[*]I've checked all global variables I could find in comment_form.php, out of desperation and lack of knowledge, and they output the same value in index.php and in image.php.
[*]
I've tried both checked and unchecked "allow comments in albums". No difference.
[*]
Adding
`
header('Location: ' . FULLWEBPATH . '/' . getURL($_zp_current_image));
`
to index.php solves the problem, but having the user reach a subpage on arrival to the site is unacceptable.
[/list]
My assumption is that "pushbutton" uses the url to link the comments to the proper object, and zenPhoto discards them as Gallery is not a valid comment-containing-object. However all of this, tests and assumption, has been playing above my current knowledge, and I'm stuck not knowing what to try next or how to get more info. I would try to get in the middle of the form's "#" action if I did know or could find what it means, but I don't and I couldn't.
Anyone can give me a clue?