Gossamer Forum
Skip to Content


Home : Plugins Support - FREE : Duplicate_Check :

allow certain duplicate URLs

Quote Reply
allow certain duplicate URLs
Can the plugin be modified to allow through URLs that are simply http:// as in the GLinks default where no web address is inserted?
Quote Reply
Re: [scottish] allow certain duplicate URLs In reply to
Hi,

I don't see why not :)

Try opening up /admin/Plugins/Dumplicate_Check.pm, and just after;


Code
    my ($error_show, $chk_dup, $db_con);


..add;


Code
    if (!$IN->param('URL') || $IN->param('URL') eq "http://") { return @args; }


Also, an optional update;

Change:


Code
 	$chk_dup = $db_con->count ( { URL => $IN->param('URL') } );


..to;


Code
        my $cond = new GT::SQL::Condition; 
$cond->add('URL','=',$IN->param('URL'));
$cond->add('URL','=',$IN->param('URL')."%"); # matches anything extra after it - optional, but a recommended add in :)
$cond->bool('OR');
$chk_dup = $db_con->count ( $cond );


Untested, but should work fine :)

Cheers
Andy
Programmer/Designer/LinksSQL Freak Cool

http://www.ultranerds.com
http://www.imagesql.com