Help - Search - Members - Calendar
Full Version: No name given...
Movable Type Community Forum > Additional Resources > Tips and Tricks
neave
I'd like to allow my site visitors to not enter their names into the comments form if they wish.

At the moment, I'm using this PHP script to check if the author name is given:
CODE
echo (strlen('<$MTCommentAuthor encode_php="q"$>') > 0) ? '<$MTCommentAuthorLink spam_protect="1" encode_php="q"$>' : 'somebody';

Which displays 'somebody' if they haven't entered a name, or their name if they have.

Is there a way MT can display 'somebody' by default instead of having to run this PHP for each comment? Also, the PHP doesn't work on the mt-comments.cgi preview script, because it's in CGI.)

Many thanks,
Paul.
maddy
You can do it with a plugin, as I mentioned in this thread. There is also an example in the comments on the page I linked to in my post in that thread. smile.gif
neave
Thanks maddy - works a treat! Now I'm hooked on mt-plugins.org... tongue.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.