Try changing the rountine
sub check in admin/Plugins/Duplicate_Check.pm, with the following;
Code:
sub check {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'add_link'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#
my (@args) = @_;
my $args = shift;
my ($error_show, $chk_dup, $db_con,$chk_dup2,$mod_url);
# fix so we can get the www in front of a URL to check too. If someone submits something
# like http://www.google.com, it then gets the www. taken out of it, so we end up with http://google.com
# Also should work in reverse...so if they enter http://google.com, it will look for http://www.google.com
if ($IN->param('URL') =~ /www\./) { $mod_url = $IN->param('URL'); $mod_url =~ s/www\./i; }
else { $mod_url = $IN->param('URL'); $mod_url =~ s#http://#http://www\.#i; }
# Check that the URL isn't already in the Links database
$db_con = $DB->table("Links");
$chk_dup = $db_con->count ( { URL => $IN->param('URL') } );
$chk_dup2 = $db_con->count ( { URL => $mod_url } );
if ($chk_dup || $chk_dup2) {
$error_show = "The URL you entered already seems to be in our database, either live, or awaiting validation!";
print Links::SiteHTML::display('error', { error => $error_show });
exit;
}
}
That should do it...but its not tested, so there may be typos etc in it.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my
Amazon Wish List GLinks ULTRA Package | GLinks ULTRA Package PRO Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin |
Pre-Made Template Sets |
FREE GLinks Plugins!