Comment form problem

I'm having a problem getting the comment form to work with the "Only members can comment" option. The comment form displays fine when logged in and immediately when I log out. However, after refreshing the page or going to another page the comment form disappears completely instead of saying "Only registered users can comment" or some such. The code around it isn't causing any problems, the printCommentForm() function simply does not print anything.

Thanks,
kagutsuchi

Comments

  • Perhaps it is something in your theme. This is working correctly for me.
  • All the theme is using to call printCommentForm() is this:

    `
    <?php if (function_exists('printCommentForm')) { ?>

    This is a test.



    <?php printCommentForm(); ?>
    <?php } ?>
    `
    The test paragraph and br work but the comment form isn't displayed at all, not even any of the comments that the comment form usually has. I've looked through my theme files and I can't seem to find anything that would be blocking the comment form from displaying. Would you have any idea of what might be causing this?
  • How about a link to the site? The printCommentForm code is pretty straight forward. It will either display the comment form or the "only rgistered users" message. There are no third options.
  • The link to the site is in my profile but I'll post it here too: http://www.archlinuxgallery.com/zenphoto/

    To see this for yourself feel free to register an account.

    And thanks for all of your help!
  • there is no `
    ` showing on your image page--therefore the printcommentform() must not have been called.
  • It's being called when logged in and immediately after log out though, and the "<p>This is a test</p>" is still output whether logged in or out. It's only after logging out and refreshing the page that it doesn't work (or if you weren't logged in in the first place). printCommentForm() should be called, and if it's not then I have no idea why it's not. :/
  • Sorery, but I visited the link you gave. On the images there thre is no div as described. That div is always output from the pringCommetForm. So I guess that there is nothing more I can do to help.
  • Out of curiosity I finally tracked down the problem (though I still don't know why it happens). For some reason, after logging out, the comment_form_* options all get set to 0, even though they are 1 when logged in. Now time to try to find where these options get changed...

    Edit: the comment_form_* options are changed because comment_form_members_only is enabled which turns them off after logout. However, it looks like switching these off will simply have the printCommentForm() function return instead of printing the comment form with comments disabled.
Sign In or Register to comment.