Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-08-29 02:48:38

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

Make texpattern self aware when I am commenting on my own blog?

How do I make textpattern self aware when I am commenting on my own blog so I don’t have to enter in my name and email?

Wordpress does this and I’m sure there has to be a plugin for txp.


Art Rogue – Fine Art Photography

Offline

#2 2008-08-29 03:10:49

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Make texpattern self aware when I am commenting on my own blog?

You can use rvm_privileged, a plugin which has a set of if/else conditionals. Then, you can do:

<txp:rvm_if_privileged name="mattmikulla">
...some input type="hidden" prefilled with your name and email...
<txp:else />
... the txp tags (name and email) for comments, which will output the input fields for your visitors
</txp:rvm_if_privileged>
... the rest of the comment form code... the textarea, the preview/submit buttons...

La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2008-08-29 03:36:53

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: Make texpattern self aware when I am commenting on my own blog?

maniqui provided a great example, but I just wanted to expand on it for others who may have multiple authors or users:

<txp:rvm_if_privileged>
 <input type="hidden" name="name" id="name" value="<txp:rvm_privileged_user />" />
 <input type="hidden" name="email" id="email" value="<txp:rvm_privileged_user type="email" />" />
<txp:else />
 <input type="text" name="name" id="name" />
 <input type="text" name="email" id="email"  />
</txp:rvm_if_privileged>

... the rest of the comment form code... the textarea, the preview/submit buttons...

Offline

#4 2008-08-29 05:14:06

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Make texpattern self aware when I am commenting on my own blog?

Amit

Shouldn’t these…

 <input type="hidden" name="name" id="name" value="<txp:rvm_privileged_user />" />
 <input type="hidden" name="email" id="email" value="<txp:rvm_privileged_user type="email" />" />

…be single quoted for the new tag parser to do its thing; like this…

 <input type="hidden" name="name" id="name" value='<txp:rvm_privileged_user />' />
 <input type="hidden" name="email" id="email" value='<txp:rvm_privileged_user type="email" />' />

…??


Steve

Offline

#5 2008-08-29 05:19:41

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Make texpattern self aware when I am commenting on my own blog?

net-carver wrote:

…be single quoted for the new tag parser to do its thing; like this…

Are you still sleeping net-carver? :P Wake up, wake up and put on some makeup. Yeah, I’m sleepyhead too :D

Back from offtopic, to the great answer: No, it is only XHTML, not Textpattern tag. <input.* /> != <txp:.*/>.

Offline

#6 2008-08-29 05:21:52

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Make texpattern self aware when I am commenting on my own blog?

Doh!


Steve

Offline

Board footer

Powered by FluxBB