Welcome, Guest. Please Login or Register.
August 29, 2025, 10:31:38 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  English User Help  |  English Help  |  How can guests NOT have to enter email address? « previous next »
Pages: [1] Reply Ignore Print
Author Topic: How can guests NOT have to enter email address?  (Read 583 times)
szybszy
Noobie
*
Posts: 36


me not llama

How can guests NOT have to enter email address?
« on: April 14, 2002, 06:30:01 AM »
Reply with quote

How can guests NOT have to enter email address?

Plz help...

Thanks!!!
Logged
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:How can guests NOT have to enter email address?
« Reply #1 on: April 14, 2002, 09:54:22 AM »
Reply with quote

[Edit: i just re-read your post and realised you diddnt want to remove the thing completley]

I think you just need to not make it a required field in your mysql database.
« Last Edit: April 14, 2002, 09:56:20 AM by Tom B » Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
mediman
Support Team
YaBB God
*****
Posts: 2858


WWW
Re:How can guests NOT have to enter email address?
« Reply #2 on: April 14, 2002, 03:00:14 PM »
Reply with quote

edit your post.php this way that if guest not enter a email the email button in posts disappear!

medi

its a really usefull hack, cause most of my guests use fake email adresses!
« Last Edit: April 14, 2002, 03:01:21 PM by mediman » Logged

mainComm Dev Team
szybszy
Noobie
*
Posts: 36


me not llama

Re:How can guests NOT have to enter email address?
« Reply #3 on: April 15, 2002, 12:07:14 AM »
Reply with quote

THat's what I thought but when I tried that a couple of days I only f...ed things up. Which piece of code do I exactly have to change?

Like I said in another post I suck as a programmer but I do learn so you don't need to give the exact instruction but a hint would be appreciated...

Thanks!!!
Logged
szybszy
Noobie
*
Posts: 36


me not llama

Re:How can guests NOT have to enter email address?
« Reply #4 on: April 15, 2002, 12:27:53 AM »
Reply with quote

DONE!!!

I had to remove the line:

$email_field = $realemail == '' ? "<tr><td align=\"right\"><font size=2><b>$txt[69]:</b></font></td><td><font size=\"2\"><input type=\"text\" name=\"email\" size=\"25\"></font>" : '';

which existed in two places; and basically every other piece of code with "email" e.g. "posteremail," in "$request" line.

PERFECT!!! If I only knew how to let my guests use avatars...
Logged
mediman
Support Team
YaBB God
*****
Posts: 2858


WWW
Re:How can guests NOT have to enter email address?
« Reply #5 on: April 15, 2002, 12:32:42 AM »
Reply with quote

in Post.php change

# If poster is a Guest then evaluate the legality of name and email
   if ($username == 'Guest') {
      $name = trim($name);
      if ($name == '' || $name == '_' || $name == ' ')
         fatal_error($txt[75]);
      if (strlen($name) > 25)
         fatal_error($txt[568]);
      if ($email == '')
         fatal_error($txt[76]);
      if (!preg_match("/^[0-9A-Za-z@\._\-]+$/",$email))
         fatal_error($txt[243]);
   }

to # If poster is a Guest then evaluate the legality of name and email
   if ($username == 'Guest') {
      $name = trim($name);
      if ($name == '' || $name == '_' || $name == ' ')
         fatal_error($txt[75]);
      if (strlen($name) > 25)
         fatal_error($txt[568]);
      if ($email == ''){}
      else {
      if (!preg_match("/^[0-9A-Za-z@\._\-]+$/",$email))
         fatal_error($txt[243]);
      }
   }

and now in display.php you can use a if thingy to deactivate the button!

if($muserID == '-1') {
   print "            <BR><a href=\"mailto:$memail\">$img[email_sm]</a>\n";
}else if ($userprofile[$mname]['hideEmail'] != "1" || $settings[7] == "Administrator" || $allow_hide_email != '1') {
   print "            $profbutton".$userprofile[$mname]['websiteUrl']." <a href=\"mailto:$memail\">$img[email_sm]</a>$sendm\n";
} else {
   print"    $profbutton{$userprofile[$mname]['websiteUrl']}$sendm \n";
}
have to be changed to

if($muserID == '-1' && $memail !='') {
   print "            <BR><a href=\"mailto:$memail\">$img[email_sm]</a>\n";
}else if ($muserID == '-1' && $memail =='') {
}else if ($userprofile[$mname]['hideEmail'] != "1" || $settings[7] == "Administrator" || $allow_hide_email != '1') {
   print "            $profbutton".$userprofile[$mname]['websiteUrl']." <a href=\"mailto:$memail\">$img[email_sm]</a>$sendm\n";
} else {
   print"    $profbutton{$userprofile[$mname]['websiteUrl']}$sendm \n";
}

more is not needed, and the email (so given) will be checked!
and guest have the choice email or not!

medi
« Last Edit: April 15, 2002, 05:03:50 AM by mediman » Logged

mainComm Dev Team
szybszy
Noobie
*
Posts: 36


me not llama

Re:How can guests NOT have to enter email address?
« Reply #6 on: April 15, 2002, 01:13:21 AM »
Reply with quote

Mediman, thanks!

I've cut way too many stuff so just in case I restored post.php and removed only the lines you told me to.

However, I found that two lines just below the ones you showed have to be deleted also.

if (!preg_match("/^[0-9A-Za-z@\._\-]+$/",$email))
fatal_error($txt[243]);

Now it works just fine. Thanks!
Logged
mediman
Support Team
YaBB God
*****
Posts: 2858


WWW
Re:How can guests NOT have to enter email address?
« Reply #7 on: April 15, 2002, 05:04:36 AM »
Reply with quote

look my edited posting this is the whole hack!

thx medi
Logged

mainComm Dev Team
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  English User Help  |  English Help  |  How can guests NOT have to enter email address? « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.015 seconds with 19 queries.