Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-08-31 22:20:05

reid
Member
From: Atlanta, Ga.
Registered: 2004-04-04
Posts: 224
Website

Plugin Request: display a remembered commenter's name

I’ve seen Wordpress sites that alter the comment form for visitors who have a cookie, so that they not only don’t see the name, email, and url input boxes they’ve filled in before, they get a message “Welcome Back, [Remembered Name].”

I can make the input boxes go away using txp:if_cookie and display:none, but it would be nice to have the ability to insert their remembered name somehow.

Any takers? My thanks in advance…


TextPattern user since 04/04/04

Offline

#2 2005-09-01 03:25:22

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plugin Request: display a remembered commenter's name

Reid, I’m using <code><?php echo pcs(‘name’); ?></code> in my comment form for returning visitors to pick up their name in a welcome message. I’m also using the if_cookie plug-in. Is that what you are after?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2005-09-01 04:47:29

reid
Member
From: Atlanta, Ga.
Registered: 2004-04-04
Posts: 224
Website

Re: Plugin Request: display a remembered commenter's name

That is exactly what I was looking for (though I wrapped the function in the recommended <txp:php></txp:php> ) Thanks!!!

Last edited by reid (2005-09-01 04:47:45)


TextPattern user since 04/04/04

Offline

#4 2005-09-01 20:18:57

jonhicks
Member
From: Oxfordshire UK
Registered: 2004-03-22
Posts: 256
Website

Re: Plugin Request: display a remembered commenter's name

Reid, I’ve not come across txp:if_cookie before, could you show me your syntax? (not a come-on in case anyone was wondering)


Cheers,
Jon VC#9

Offline

#5 2005-09-01 20:34:43

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Plugin Request: display a remembered commenter's name

It’s a plugin where the author didn’t prefix his functions with his initials (which leads to confusions and might lead to name clashes down the road).

I would also like to point out, that pages that are modified depending on cookies should double check that they are also sending the correct HTTP-Headers, because otherwise you might run into trouble with Proxies…

Offline

#6 2005-09-01 21:33:59

jonhicks
Member
From: Oxfordshire UK
Registered: 2004-03-22
Posts: 256
Website

Re: Plugin Request: display a remembered commenter's name

superb – thanks Sencer


Cheers,
Jon VC#9

Offline

#7 2005-09-02 01:06:42

reid
Member
From: Atlanta, Ga.
Registered: 2004-04-04
Posts: 224
Website

Re: Plugin Request: display a remembered commenter's name

Jon, the “syntax” I’m using was lifted from the method Paul Arms details here. My whole code chunk is kinda ugly, but here’s the code for hiding the “Website” input box, and the added part with the remembered name:

<code>
<dd class=“textinput”<txp:if_cookie> style=“display: none;”</txp:if_cookie>><label><txp:text item=“Website” /> :<txp:comment_web_input /></label></dd>
<txp:if_cookie><dd id=“remembered”>Welcome back, <txp:php>echo pcs(‘name’);</txp:php>. Your info is “remembered.” Comment away!</dd></txp:if_cookie>

</code>

Sencer, I assume checking for correct HTTP headers is something that needs to be within the plugin?

Last edited by reid (2005-09-02 01:07:27)


TextPattern user since 04/04/04

Offline

Board footer

Powered by FluxBB