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
Quote Reply
Re: [qango] Duplicate Submission Check (Basic Check) In reply to
It may be possible to add it as a hook for add.cgi (via a pluing)...I may look into this...

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!
Quote Reply
Re: [Andy] Duplicate Submission Check (Basic Check) In reply to
I did this ages ago with a plugin...not sure where the plugin went though.....hm maybe it was a dream.
Quote Reply
Re: [Paul] Duplicate Submission Check (Basic Check) In reply to
LOL..Paul even dreams Links SQL plugins now Crazy

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!
Quote Reply
Re: [qango] Duplicate Submission Check (Basic Check) In reply to
Hi

why not change the URl field in the link table to UNIQUE ?

That should work.. I think..!!
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Duplicate Submission Check (Basic Check) In reply to
Thats a very interesting idea. That should give the desired effect Smile

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!
Quote Reply
Re: [Andy] Duplicate Submission Check (Basic Check) In reply to
Hi

That DOES work.. just tried it..

The only problem is if you have dublicate link you SHOULD CLEAN UP FIRST..!!
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Duplicate Submission Check (Basic Check) In reply to
Yea, it does work.

However, in terms of the end-user, qango has come up with a nice error processing page that will not add duplicate links. Setting constructs only on the back-end is not very friendly to the end-user (like seeing the nasty MySQL Software Error message).
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Duplicate Submission Check (Basic Check) In reply to
You don't get a nasty error page but you do get a nasty error.

Failed to execute query: 'INSERT INTO lsql_Links (Description,Title,LinkOwner,Rating,Hits,Votes,isNew,URL,Status,Contact_Name,Contact_Email,isChanged,Mod_Date,isPopular,isValidated,Add_Date,ID) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NULL)' Reason: Duplicate entry 'http://www.test.com' for key 2
Quote Reply
Re: [katabd] Duplicate Submission Check (Basic Check) In reply to
Hi...just completed a plugin that will do what you are asking. I'm gonna email it to Alex in a second, and post a release in the Development forum.

BTW: Thanks for the help there Paul...

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!
Quote Reply
Re: [Andy] Duplicate Submission Check (Basic Check) In reply to
 LOL...
That was qango that asked for it..
thanks anyways Wink
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory