WordPress.org

Forums

Registered Members can't comment through login (11 posts)

  1. James
    Member
    Posted 7 years ago #

    I'm having some problems with allowing comments:

    I want to allow registered members to be able to leave a comment without having to leave their name, email, website, etc. (Even as the administrator, *I* even can't leave comments without filling in the same info as regular, non-registered guests do.)

    I used to be able to do this on my previous theme, (maybe it has something to do with my new theme's code (freshblue theme)).

    I also downloaded a WP_SMF plugin, and I don't know if that affected it either.

    Thanks

  2. James
    Member
    Posted 7 years ago #

    Sorry about that double-thread post, I was having server connection slowdowns.

    (So mods may want to delete the thread duplicate)

  3. James
    Member
    Posted 7 years ago #

    No one else have this problem? I can't find its source, so I'd really appreciate any help.

    Here is my comments.php code, in case it has something to do with my theme:

    <?php // Do not delete these lines
     if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
      die ('Please do not load this page directly. Thanks!');
    
            if (!empty($post->post_password)) { // if there's a password
                if ($_COOKIE['wp-postpass_'.$cookiehash] != $post->post_password) {  // and it doesn't match the cookie
        ?>
    
        <p class="nocomments"><?php _e("This post is password protected. Enter the password to view comments."); ?><p>
    
        <?php
        return;
                }
            }
    
      /* This variable is for alternating comment background */
      $oddcomment = "graybox";
    ?>
    
    <?php if ($comments) : ?>
     <a name="comments"></a><h2><?php comments_number('No Responses','One Response','% Responses' );?></h2>
    
     <ol class="commentlist">
    
     <?php foreach ($comments as $comment) : ?>
    
      <li class="<?=$oddcomment;?>">
       <a name="comment-<?php comment_ID() ?>"></a><cite><?php comment_author_link() ?></cite> Says:<br />
       <!--<small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title="<?php comment_date('l, F jS, Y') ?> at <?php comment_time() ?>"><?php /* $entry_datetime = abs(strtotime($post->post_date)); $comment_datetime = abs(strtotime($comment->comment_date)); echo time_since($entry_datetime, $comment_datetime) */ ?></a> after publication. <?php edit_comment_link('e','',''); ?></small>-->
       <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('e','',''); ?></small>
    
       <?php comment_text() ?>
    
      </li>
    
      <?php /* Changes every other comment to a different class */
       if("graybox" == $oddcomment) {$oddcomment="";}
       else { $oddcomment="graybox"; }
      ?>
    
     <?php endforeach; /* end for each comment */ ?>
    
     </ol>
    
     <?php else : // this is displayed if there are no comments so far ?>
    
      <?php if ('open' == $post-> comment_status) : ?>
      <!-- If comments are open, but there are no comments. -->
    
      <?php else : // comments are closed ?>
      <!-- If comments are closed. -->
      <p class="nocomments">Comments are closed.</p>
    
     <?php endif; ?>
    <?php endif; ?>
    
    <?php if ('open' == $post-> comment_status) : ?>
    
    <a name="respond"></a><h2>Leave a Comment</h2>
    <form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <p><label for="author"><small>Name</small></label><input type="text" name="author" id="author" class="styled" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    <input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]); ?>" /></p>
    
    <p><label for="email"><small>Mail (will not be published)</small></label>
    <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" /></p>
    
    <p><label for="url"><small>Website</small></label><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    </p>
    
    <small>Your comment</small>
    <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
    <p><input name="submit" type="submit" class="submit1" id="submit" tabindex="5" value="Submit Comment" /></p>
    <p><small>You can use these tags: <?php echo allowed_tags(); ?></small></p>
    
    <?php if ('none' != get_settings("comment_moderation")) { ?>
     <p><small><strong>Please note:</strong> Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.</small></p>
    <?php } ?>
    
    </form>
    
    <?php // if you delete this the sky will fall on your head
    endif; ?>
  4. Do you have the Admin SSL plugin installed and running?

  5. James
    Member
    Posted 7 years ago #

    Thanks for responding,
    Don't have a plugin like that which I'm aware of :)

    (Although I do have the WP_SMF plugin installed, if that is somehow affecting my comments.)

  6. Wish I could be be helpful; I ran into that issue with Admin SSL, it turned out to be a cookie issue.

  7. James
    Member
    Posted 7 years ago #

    What was your cookie issue? Maybe mine is having a similar problem.

  8. It was convoluted: See http://haris.tv/2007/04/24/admin-ssl-new-wordpress-plugin/ comment #17.

    Logged in users where setting their cookie with SSL, after making that change wp-comments-post.php was not SSL so the logged in users could not leave a comment as it thought they were not filling out a name and e-mail address.

    The fix was a simple if (is_user_logged_in()) check so that logged in users would now submit comments using SSL.

    Dunno if it's applicable to your situation but it may be that the authenticated users are not having their cookie set correctly.

  9. James
    Member
    Posted 7 years ago #

    Looked at the code, but it didn't seem to solve my problem, tried placing that line of code in a few places but didn't seem to make a difference.

    Thanks for the suggestion, anyway, though.

  10. James
    Member
    Posted 7 years ago #

    Anyone else get any errors similar to mine?

    Does it have to do with changing something with my comments.php file I listed above?

  11. James
    Member
    Posted 7 years ago #

    I apologize if I seem like I'm getting desperate here, but I would really like to have access to my comment profile.

Topic Closed

This topic has been closed to new replies.

About this Topic