Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Duplicate Submission Check (Basic Check)

Quote Reply
Duplicate Submission Check (Basic Check)
Hi,

I'm not sure if anyone has provided a solution for duplicate submission checking, but I've put together this basic one if its of any use.

It checks the URL from the add form, but only for an exact match. This means that if a user puts something on the end of the original URL, such as "index.html" this check won't catch it.

Anyway here goes:

Firstly, create an error message in 'Build > User Language > Add' called ADD_DUP. The message will need to be generic since duplicates caught can be both validated or unvalidated. Maybe something like "'%s' has already been suggested to us, thank you".

Then, add the following to Add.pm above # Add the record.:

Code:
# Check that the URL isn't already in the Links database
my $chk_dup = $db->count ( { URL => $IN->param('URL') } );
if ($chk_dup) {
print Links::SiteHTML::display('error', { error => Links::language('ADD_DUP', $IN->param('URL')) });
return;
}


That's it.

As I've said, its only basic - maybe someone could enhance it by adding an 'IsValidated' check to give a more specific error report.

Note: It also uses the general 'error.html' template, as opposed to continually displaying the error in the 'Add' form.

Hope it helps.

All the best
Shaun
Subject Author Views Date
Thread Duplicate Submission Check (Basic Check) qango 3496 Aug 12, 2002, 8:20 AM
Thread Re: [qango] Duplicate Submission Check (Basic Check)
Andy 3352 Aug 12, 2002, 9:57 AM
Thread Re: [Andy] Duplicate Submission Check (Basic Check)
Paul 3349 Aug 12, 2002, 10:48 AM
Post Re: [Paul] Duplicate Submission Check (Basic Check)
Andy 3336 Aug 12, 2002, 10:54 AM
Thread Re: [qango] Duplicate Submission Check (Basic Check)
katabd 3327 Aug 12, 2002, 11:13 AM
Thread Re: [katabd] Duplicate Submission Check (Basic Check)
Andy 3419 Aug 12, 2002, 1:28 PM
Thread Re: [Andy] Duplicate Submission Check (Basic Check)
katabd 3328 Aug 12, 2002, 2:09 PM
Thread Re: [katabd] Duplicate Submission Check (Basic Check)
Stealth 3335 Aug 12, 2002, 2:13 PM
Post Re: [Stealth] Duplicate Submission Check (Basic Check)
Paul 3354 Aug 12, 2002, 3:36 PM
Thread Re: [katabd] Duplicate Submission Check (Basic Check)
Andy 3299 Aug 15, 2002, 11:53 AM
Post Re: [Andy] Duplicate Submission Check (Basic Check)
katabd 3281 Aug 15, 2002, 3:22 PM