How to make Email optional for guests posting new topics?

Started by itomic, November 08, 2004, 01:43:07 AM

Previous topic - Next topic

itomic

Hi,

I want to make it *real* easy for guests to post to a forum I'm setting up. Right now it seems that they have to enter a name and an email address in order to post. Is it possible to make the email address optional?

Thanks!

Oldiesmann

Yeah, it's possible, but I don't see why it has to be. They can enter any email address they want (such as [email protected]). It's not really used for anything.
Michael Eshom
Christian Metal Fans

itomic

Quote from: Oldiesmann on November 08, 2004, 09:29:46 AM
Yeah, it's possible, but I don't see why it has to be. They can enter any email address they want (such as [email protected]). It's not really used for anything.

I presume that you mean that it's possible at a coding level as opposed to an admin function?

The reason I'm asking for this feature is because I'm replacing an old crappy forum board on a website with smf which is about a zillion times better *but* there was a raw simplicity with the old board which we wanted to preserve: a guest only had to enter a subject and a message to make a post, i.e. absolute minimum barriers to making a post. You and I know that the user can enter any old email address, but by requiring an email address you are asking for the user to either
a) 'lie' by giving a false one, or
b) provide their actual email address when in fact they'd rather not give it out (fear of spam, etc.).

So it would be fabulous if name and email address were optional (i.e. through the admin controls we had the option to make them optional). Better still, don't ask for the email address at all when guests are posting.

Thanks for listening.

P.S. http://www.davemanncollective.com/ - click 'message board'. Dave Mann is a local West Australian musician who's going to be huge! :-) Thanks smf!

Grudge

In Post.template.php find what is similar to:
<input type="text" name="email" ... />

and replace it with:
<input type="hidden" name="email" value="[email protected]" />

I'd imagine that would work (i.e hide the field and give it a dummy value). It will mess up spam protection though... but not a problem unless you have many guests posting at once.
I'm only a half geek really...

itomic

Quote from: Grudge on November 09, 2004, 04:54:55 AM
In Post.template.php find what is similar to:
<input type="text" name="email" ... />

and replace it with:
<input type="hidden" name="email" value="[email protected]" />

I'd imagine that would work (i.e hide the field and give it a dummy value). It will mess up spam protection though... but not a problem unless you have many guests posting at once.

Thanks for that Grudge - will implement that today. I assume this change won't affect things for registered users making posts, i.e. their registered email addresses won't be somehow overridden?

p.s. Have you seen the movie "The Grudge"? :-)


Grudge

The change should be fine. All it is basically doing is filling out the "email" field for the guest. You could do the same with the username field in post.template.php too if you wish.

I haven't seen "The Grudge", but I'm annoyed at it for stealing my name :P
I'm only a half geek really...

itomic

Quote from: Grudge on November 09, 2004, 06:43:30 PM
I haven't seen "The Grudge", but I'm annoyed at it for stealing my name :P

LOL :-)

Made the code changes. It looks like this now (made email disappear from the form, shows name as 'guest' by default unless the user changes it).


// Guests have to put in their name and email...
if (isset($context['name']) && isset($context['email']))
echo '
<tr>
<td align="right">
<b', isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? ' style="color: #FF0000;"' : '', '>', $txt[68], ':</b>
</td>
<td>
<input type="text" name="guestname" size="25" value="guest" />
</td>
</tr>
<tr>
<td align="right">
<!--
<b', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' style="color: #FF0000;"' : '', '>', $txt[69], ':</b>
-->
</td>
<td>
<input type="hidden" name="email" size="25" value="[email protected]" />
</td>
</tr>';

Advertisement: