• Is there a hack, or could someone write one, for remembering info when people comment? MT has this feature built-in and it’s very convenient to the people who comment on your blog. It’s just a checkbox that people can check so that WP would remember their info so they do not have to input it, every time they comment.
    Just curious,
    Daisyhead

Viewing 15 replies - 16 through 30 (of 31 total)
  • I’ve written the back:

    First, put the following in your comments.php, in the section where the comments form is. I put it in between the URL field and the actual comment field:

    <p>
    <input type="checkbox" name="remember" value="remember" tabindex="4" />
    <label for="remember">Remember details?</label>
    </p>

    I adjusted the tabindex for the next two fields to 5 and 6 where they had previously been 4 and 5.

    Next, in yourblog/wp-comments-post.php, you’ll find the following code:

    setcookie('comment_author_' . COOKIEHASH, stripslashes($comment_author), time() + 30000000, COOKIEPATH);
    setcookie('comment_author_email_' . COOKIEHASH, stripslashes($comment_author_email), time() + 30000000, COOKIEPATH);
    setcookie('comment_author_url_' . COOKIEHASH, stripslashes($comment_author_url), time() + 30000000, COOKIEPATH);

    You need to put “if ($remember)” around this with brackets, so it reads:

    if( $remember ) {setcookie('comment_author_' . COOKIEHASH, stripslashes($comment_author), time() + 30000000, COOKIEPATH);
    setcookie('comment_author_email_' . COOKIEHASH, stripslashes($comment_author_email), time() + 30000000, COOKIEPATH);
    setcookie('comment_author_url_' . COOKIEHASH, stripslashes($comment_author_url), time() + 30000000, COOKIEPATH);
    }

    It’s worked for me so far. Simple hack.

    The checkbox code for comments.php works ok. The resulting checkbox, however, comes out fixed in size. This puts it some distance form its label. Adding size="" above doesn’t seem to do anything. Any ideas?

    Solution found. It’s a css thing. Add class="checkbox" to the input tag and #commentform input.checkbox {width: 15px;} to style.css.

    Sorry to ressurect this again, but the same thing is happening to me. My wordpress site has never remembered mine or anyone else’s info when commeting. I’m using inline comments. I’ve tried the if remember hack, i’ve tried plugins.. nothing works. What is going on here?

    Switch temporarily to the unedited default theme ans see if the problem persists.

    Beel: Tested default, still not remembering.

    Yep, I figured it wouldn’t as I think the called function, “comments_template()” is responsible for setting the cookie. But worth a try. Now the problem is figuring out why the cookie is not being set.

    We need the help of a Cookie Monster…uh, Master… yeah that’s it, Cookie Master.

    My comments template says:
    $comment_author = isset($_COOKIE[‘comment_author_’.COOKIEHASH]) ? trim(stripslashes($_COOKIE[‘comment_author_’.COOKIEHASH])) : ”;
    $comment_author_email = isset($_COOKIE[‘comment_author_email_’.COOKIEHASH]) ? trim(stripslashes($_COOKIE[‘comment_author_email_’.COOKIEHASH])) : ”;
    $comment_author_url = isset($_COOKIE[‘comment_author_url_’.COOKIEHASH]) ? trim(stripslashes($_COOKIE[‘comment_author_url_’.COOKIEHASH])) : ”;

    Just like the ‘hack’. ::shrug::

    GOBLUE14

    (@goblue14)

    Same problem here. Anyone figure this one out yet?

    I’m on WP 2.0, have tried the hack mentioned above and got nothing. It’s a Firefox issue for me, as IE remembers my information.

    I’d love to get a solution on this one!
    I’m on WP2 and I’d like to have the options for my visitors to have their names and info saves.
    I know how irritating it is visiting others blogs when it doesn’t save my info and I have to type it every time.

    i agree with you, it is very irritating when you have to re-type your information, i hope some body have the answer!

    Still wondering if anyone has a solution to this?

    I’ve put in the hack and it’s still not remembering for me either, in IE or Firefox.

    Can anyone help?

    BTW I use inline comments

    Have read and read on this and is it possible that the problem originates with the host server?

    I can lower my security settings and it doesn’t make a difference on my site, but yet I can visit other people’s sites and their comment sections remember me.

    I have the cookies from my site sitting in my cookie “log” so I know they’re there.

    My theme designer has looked and looked and originally had my site posted to her server before I bought it and it remembered the comment info then, but not now. The only thing that has changed is the host.

    BTW.

    http://www.merettapater.com if it helps.

Viewing 15 replies - 16 through 30 (of 31 total)
  • The topic ‘Remember info option in comments’ is closed to new replies.