Webmastersite.net
Register Log In

Feature Suggestion: eMail check
and search/edit

Comments on Feature Suggestion: eMail check

Jenny
Forum Regular

Usergroup: Customer
Joined: May 11, 2003

Total Topics: 64
Total Comments: 199
Jenny
Posted Jan 30, 2005 - 11:13 AM:

1.
When registering or submitting a link the submitted email address should be checked. I have a lot of people submitting some cryptic sh* in that field. So if the script makes ure that the field at least contains a '@' it would really help. Maybe it's even possible to prevent certain domains, just like when submitting links ?!?
(BTW, is there a chance that this is not working when editing links afterwards?)


2.
On the search/edit in the drop downs containg 'is exactly, contains', etc. is it possible to add a 'does not contain' option?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 01, 2005 - 11:46 PM:

I don't believe editing is designed to exclude domains.

#1: Already done if email is a required field, to apply when it isn't: In suggest.php replace
    if ( (strstr($settings->requiredlinks, 'email')) && (!strstr($email, '@')) )
with
   if ( ($_POST['email'] != '') && (!strstr($email, '@')) )


#2 I'll have to check later.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 02, 2005 - 12:40 PM:

There are two types of searching on that page, one using edit.php and the other using search.php. For the former open /admin/adminfunctions.php and replace every instance of
if ($condition == 'like') $condition = "$field LIKE '%$fieldvalue%'";

with
if ($condition == 'like') $condition = "$field LIKE '%$fieldvalue%'";
else if ($condition == 'not like') $condition = "$field NOT LIKE '%$fieldvalue%'";


For search.php I think you need to relace
    else if ($condition == 'like')

{

$generatesearch .= "$searchfields[$count] ";

if ($condition == 'like') $generatesearch .= "LIKE '%$search%'";

else $generatesearch .= "$condition '$search'";

if ($count < ($num-1)) { if ($action == 'filter') $generatesearch .= " AND "; else $generatesearch .= " OR "; }

}


with
    else if ($condition == 'like')

{

$generatesearch .= "$searchfields[$count] ";

if ($condition == 'like') $generatesearch .= "LIKE '%$search%'";

else $generatesearch .= "$condition '$search'";

if ($count < ($num-1)) { if ($action == 'filter') $generatesearch .= " AND "; else $generatesearch .= " OR "; }

}
else if ($condition == 'not like')
{
$generatesearch .= "$searchfields[$count] ";
if ($condition == 'not like') $generatesearch .= "NOT LIKE '%$search%'";
else $generatesearch .= "$condition '$search'";
if ($count < ($num-1)) { if ($action == 'filter') $generatesearch .= " AND "; else $generatesearch .= " OR "; }
}


Then, in both cases, just place a condition option with the value "not like" in the template where you want it.
Synozeer
Forum Regular

Usergroup: Customer
Joined: Jun 02, 2004

Total Topics: 32
Total Comments: 142
Posted Feb 04, 2005 - 1:23 PM:

On a similar note, is it possible to make it so that proper email syntax is checked when a new member is signing up (not sure if this would be the same as a person submitting a link)? I get a lot of people signing up with incomplete email addresses (example: george@, x234@hotmail, davidb, etc). Also, email is already selected as a required field on the Functionality page.

Thanks,
Adam
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 04, 2005 - 5:46 PM:

Register.php
 $templatesdir = $settings->templatesdir; // correct problem of wrong template set being used 

$correctsecurityimage = securityimagevalue();

->
 if ($_POST['email'] != '' && !strstr($email, '@')) { $incomplete = true; $incompletelang = $language->suggest_invalidemail; }
$templatesdir = $settings->templatesdir; // correct problem of wrong template set being used

$correctsecurityimage = securityimagevalue();
Synozeer
Forum Regular

Usergroup: Customer
Joined: Jun 02, 2004

Total Topics: 32
Total Comments: 142
Posted Feb 11, 2005 - 3:10 PM:

I implemented this code, but had someone sign up today with an email address missing the .com (name@hotmail). Is there a way to check for at least one "." after the "@"?

Adam
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 11, 2005 - 5:37 PM:

Change
if ($_POST['email'] != '' && !strstr($email, '@'))

to
if ($_POST['email'] != '' && (!strstr($email, '@') || !strstr($email, '.')))
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.