Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  
    Hello,

    I have a new installation of Plogger that I am running within an IFrame of my clients site. I'm using the default theme, and everything works correctly, except when you input the information to submit a comment. Once you add your info and hit submit it goes to a page cannot be displayed. but if you go hit the back button (or if you revisit the image, the comment has successfully been placed. The issue can be recreated here. http://www.jennymeigsphotography.com/gallery/index.php?level=album&id=3

    It appears that the comment are redirecting to a page, here http://www.jennymeigsphotography.com/gallery/?level=picture&id=0#comment-post
    Of course the URL shows that it's not going to the correct page (the index.php), no is it pulling the picture ID when it redirects.

    Any idea's?
    •  
      CommentAuthorsidtheduck
    • CommentTimeNov 19th 2009
     
    Hi marrellsanders,

    Can you open the 'comments.php' file from the theme directory you are using and verify you have some code similar to this?:
    <input type="hidden" name="redirect" value="<?php echo str_replace('&', '&amp;', $_SERVER['REQUEST_URI']); ?>#comment-post" />
  2.  


    <p>
    <input type="text" name="author" id="author" <?php if (plogger_is_form_error('author')) { echo 'class="field-error" '; } ?>value="<?php echo plogger_get_form_author(); ?>" size="28" tabindex="1" />
    <label for="author"><?php echo plog_tr('Name'); ?></label> (<?php echo plog_tr('required'); ?>)
    <input type="hidden" name="parent" value="<?php echo plogger_get_picture_id(); ?>" />
    <input type="hidden" name="redirect" value="<?php echo str_replace('&', '&amp;', $_SERVER['REQUEST_URI']); ?>#comment-post" />
    <?php echo plogger_get_form_token(); ?>
    </p>
  3.  
    Sorry I accidently removed my comments.
    Yes I do have the code you posted. I posted the few lines above and below it. In my comment above.
  4.  
    Any other thoughts?

    THanks
    •  
      CommentAuthorsidtheduck
    • CommentTimeNov 20th 2009
     
    Yes, although I'm still testing some possibilities. It's odd that your server has a blank $_SERVER['REQUEST_URI'] variable. Are you possibly on a Windows server? That's the only explanation that I can think of for having that variable not set (some IIS servers do not set this for some reason).

    One thing that could get you up and running is to REMOVE the line of code that I mentioned in my post above. Then, open plog-comment.php and find this code:
    // Check for a redirect, referrer, or default back to the generic Plogger URL
    if (isset($_POST['redirect'])) {
    $redirect = $_POST['redirect'];
    } else if (isset($_SERVER['HTTP_REFERRER']) && !empty($_SERVER['HTTP_REFERRER'])) {
    $redirect = $_SERVER['HTTP_REFERRER'];
    } else {
    $redirect = generate_url('picture', $parent_id);
    }

    and change the second-to-last line of code from this:
    $redirect = generate_url('picture', $parent_id);
    to this:
    $redirect = generate_url('picture', $parent_id, null, true);
  5.  
    Yes sir, it is a windows server. Should I still attempt the code change since it is a Windows Server?
  6.  
    I made the code change, and tried to submit a comment. This time it didn't redirect to the "page cannot be found", but it did post this error message below.
    I am NOT using captcha btw.

    "Comment did not post due to the following errors:
    ? Spam token missing or does not match!"
    •  
      CommentAuthorsidtheduck
    • CommentTimeNov 20th 2009 edited
     
    Seems to be working fine for me now. You can delete the comments I made using the name "test" and the email "test@test.com". It may be that you were accessing the file without the leading 'www' or something.

    p.s. The spam token is new to stop spammers from sending emails from their own forms to your server. it is supposed to create a unique id for the session on your server to make sure that the comment is being submitted by the form on your server.
  7.  
    Most excellent! Looks to be working great now!
    Thank you again!