Hi guys
I'm wondering if it would be possible to password protect a second iteration of the contact form so that only registered users could access it. If that's not possible, alternatively would it be possible to password protect the form using .htpasswd/.htaccess with mod rewrite enabled.
If neither of the above, I'm open to ideas
thanks
d_cee
Password protecting contact form
Re: Password protecting contact form
Registered as in "registered users of a s9y blog"? That's actually pretty easy:d_cee wrote:I'm wondering if it would be possible to password protect a second iteration of the contact form so that only registered users could access it.
Code: Select all
{if $is_logged_in} ... {/if}
The contact form plugin can be installed multple times, so that's not an issue. The tricky thing is to find out which contact form is the one (assuming all or most of them will use the same .tpl file). You could check that using {$plugin_contactform_name} -- of course you'll need to know the value of that variable.
Code: Select all
{if $plugin_contactform_name == 'NAME_OF_CONTACT_FORM'}
{if $is_logged_in}
YOU_FORM_CODE_HERE
{else}
<p>Nothing to see here.</p>
{/if}
{/if}
YL
Re: Password protecting contact form
Thanks YL
I'll give it a whirl tomorrow and see if I can make it work
Dave
I'll give it a whirl tomorrow and see if I can make it work
Dave
Re: Password protecting contact form
Hi YL
returned 'Contact Form' no matter which iteration of the form I was using, however I was able to use which did the trick.
thanks again
Dave
Code: Select all
$plugin_contactform_name
Code: Select all
{if $head_title == 'My other Form'}
thanks again
Dave
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Password protecting contact form
I think what YL intended was {$plugin_contactform_pagetitle}, which should be equal to "URL shorthand name".
=Don=