Remove Guest Email Input Box

Started by mooxigirl, July 01, 2005, 04:49:26 AM

Previous topic - Next topic

mooxigirl

I'm sorry if this is in the wrong board, please let me know if I need to delete and repost elsewhere.

I used to have the guest email input box removed on SMF 1.0.3 and now that I have upgraded to 1.1 Beta 3 public, I can't remove it without getting a parse error.  Can someone help me do this?

[Unknown]

Find, Sources/Post.php:

// Only check if they changed it!
if (!isset($row) || $row['posterEmail'] != $_POST['email'])
{
if (!allowedTo('moderate_forum') && (!isset($_POST['email']) || $_POST['email'] == ''))
$post_errors[] = 'no_email';
if (!allowedTo('moderate_forum') && preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', stripslashes($_POST['email'])) == 0)
$post_errors[] = 'bad_email';
}

// Now make sure this email address is not banned from posting.
isBannedEmail($_POST['email'], 'cannot_post', sprintf($txt['you_are_post_banned'], $txt[28]));


And remove it.  In the Post template, find and remove:

</tr>
<tr>
<td align="right" style="font-weight: bold;', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? 'color: #FF0000;' : '', '" id="caption_email">
', $txt[69], ':
</td>
<td>
<input type="text" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" />
</td>


How do I modify files?  For later releases of 1.1, you need only run this query:

INSERT INTO smf_settings
   (variable, value)
VALUES ('guest_post_no_email', '1');

What is phpMyAdmin?

Please forgive the late response.

-[Unknown]

mooxigirl

Thank you so much Unknown!

It allows guest posting without an email now, but there is one problem.  When I input a name in the name field it doesn't log it, only shows "Guest" in the post profile info. 

Any suggestions as to why this would happen?  There's no rush, I don't mind the name not showing as long as no email is required.

Thanks again :)

[Unknown]

Find, Subs-Post.php:

if (empty($posterOptions['name']) || empty($posterOptions['email']))

Replace:

if (!isset($posterOptions['name']) || $posterOptions['name'] == '' || (empty($posterOptions['email']) && !empty($posterOptions['id'])))

Sorry about that.

-[Unknown]

mooxigirl

Ah, thank you!  Works beautifully now  :D


Advertisement: