Recent Topics

checking the "remember me" box as default

Started by on Mar 16, 2008 – Contents updated: Mar 16, 2008

Mar 16, 2008 05:30    

My b2evolution Version: Not Entered

Something seems funny to me here. The "Remember me" box is unchecked by default so I figured I'd go in and hack it to be checked. No biggie, except the code there seems a bit ... funny. Perhaps someone smart can explain?

In skins/_item_comment_form.inc.php it says

		$comment_options[] = '<label><input type="checkbox" class="checkbox" name="comment_cookies" tabindex="7"'
													.( $comment_cookies ? ' checked="checked"' : '' ).' value="1" /> '.T_('Remember me').'</label>'
													.' <span class="note">('.T_('Name, email &amp; website').')</span>';


The odd thing there is

$comment_cookies ? ' checked="checked"' : ''

I can't for the life of me see any way where $comment_cookies can be 'true' for a first-time visitor. I suppose I should hack it back and leave a comment as a random visitor to see if it reads my cookie, but what I want is to have it checked for any visitor's first comment and let them opt out of the cookies - rather than expecting them to opt in.

Mar 16, 2008 06:18

EdB wrote:

The odd thing there is

$comment_cookies ? ' checked="checked"' : ''

I can't for the life of me see any way where $comment_cookies can be 'true' for a first-time visitor.

It can't and that's the whole point of it. The cookie can is created on the moment you click "remember me". It's only supposed to 'remember' a previous setting.

For this fact you simply cannot 'opt-out' for new visitors. And logged in members get their 'preferred name' by default. So you're only bothered with not logged in members. Eat them. Or copy the code for creating the 'remember me' cookie and paste that right after their registration.

Good luck

Mar 16, 2008 07:06

Yeah I guess that's what I sort of figured out. Bummer, because I'm not hip to it being that way. I like that "allow message form" defaults to unchecked, but to my way of thinking dropping the cookie should be assumed. Oh well eh? I changed mine to have ( true) in that spot so forever-more the box will show up as checked. I think if someone unchecks it then they won't get the cookie, but if they come back they will have the box checked again.

Have a friend who seemingly can't comment anymore. She never checked the box - always typed stuff in. And recently couldn't remember the answer to my turing test (which admittedly was somewhat geeky), so she called me to say "I can't leave comments on your stupid blog because I don't know your stupid answer". But turing test gives the answer to those who eat the cookie and therefore I want the cookie-maker checked by default.

Non-web-hip people yah?

Anyway thanks for clarifying. I was almost on board with accepting that there is something in the back office I couldn't for the life of me find ;)


Form is loading...

Secure CMS – This forum is powered by b2evolution CMS, a complete engine for your website.