WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

Feature Suggestion: eMail check
and search/edit

Version:
printPrint


Feature Suggestion: eMail check
Jenny
Forum Regular
Avatar

Usergroup: Customer
Joined: May 11, 2003
Total Topics: 40
Total Posts: 119
Posted 01/30/05 - 09:13 AM:
quote post
#1
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
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 02/01/05 - 09:46 PM:
quote post
#2
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.

Edited by Paul on 02/01/05 - 09:48 PM

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 02/02/05 - 10:40 AM:
quote post
#3
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.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Synozeer
Forum Regular

Usergroup: Customer
Joined: Jun 02, 2004
Total Topics: 32
Total Posts: 142
Posted 02/04/05 - 11:23 AM:
quote post
#4
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

GameLinks.com
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 02/04/05 - 03:46 PM:
quote post
#5
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();

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Synozeer
Forum Regular

Usergroup: Customer
Joined: Jun 02, 2004
Total Topics: 32
Total Posts: 142
Posted 02/11/05 - 01:10 PM:
quote post
#6
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

GameLinks.com
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 02/11/05 - 03:37 PM:
quote post
#7
Change
if ($_POST['email'] != '' && !strstr($email, '@'))

to
if ($_POST['email'] != '' && (!strstr($email, '@') || !strstr($email, '.')))

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.