Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Limit Add Link?

Quote Reply
Limit Add Link?
Hello all,

Is it possible to limit a user to add only one link base on IP address at only one category, for the information, i allowed to any user to add a link without a registration but still need a validation from Links SQL Admin.

Please help and thanks.
Quote Reply
Re: [reenee] Limit Add Link? In reply to
Hello all ?

Any idea please ?
Quote Reply
Re: [reenee] Limit Add Link? In reply to
Limiting the submission by USERID would be better since IP addresses do change for those on dialup and some DSL modems.

What you could do is the following:

1) Create a global tag that checks the USERID and CategoryID.

2) Then create a "hook" that calls the global tag within the add.cgi script. (Add conditional - if/else statements to allow the user to add or throw up an error message.)
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [reenee] Limit Add Link? In reply to
Hi,

You can't really say one IP == one user. It's possible several users use the same IP (lots of AOL users or cable modem users share the same proxy server IP). You should use registration if you want to limit links per user.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Limit Add Link? In reply to
Ok..Thanks Alex & stealth,

Let see if i limit only one submission per user registered, i try to build the members database and it only limit to one submission to each members. Is it possible ? Please help ..
Quote Reply
Re: [reenee] Limit Add Link? In reply to
I think I made a plugin for this a while ago but can't find it. You just need to hook add_user_link (I think thats the hook) then do a count on the Links table where LinkOwner = $USER->{Username} ....if it equals one then return an error.

Or you could make the LinkOwner column unique...but thats not a great solution imo.
Quote Reply
Re: [Paul] Limit Add Link? In reply to
Hi Paul, Thanks for help...

By the way, can u show the clear picture here how i can make it, for sure, my knowledge on programming are very limited, i really need this hack because my members keep submit a new submission, the only way i can do now its only manually check and delete the duplicate submission.

Please help.
Quote Reply
Re: [reenee] Limit Add Link? In reply to
I think the way he was suggesting you do it is;

Make user log in first, before they can submit a link.
Add a new field, something like isSubmitted or something (with yes/no option).
Then, when calling add.cgi, check to see if the username being submitted, and if the owner has got isSubmitted set to 'yes'. If so, don't let them submit another link.

I could be completly wrong here..but thats how I interpreted it.

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!

Last edited by:

Andy.: May 4, 2002, 9:02 AM
Quote Reply
Re: [reenee] Limit Add Link? In reply to
Hi,

Do you have user registration on or not?
Quote Reply
Re: [Paul] Limit Add Link? In reply to
Thanks Paul & Andy,

Yes Paul, i have a user registration before submit the information.

Please help ..
Quote Reply
Re: [reenee] Limit Add Link? In reply to
You'd need to add a pre hook to user_add_link....the code would be something like:

Code:
if ($DB->table('Links')->count( { LinkOwner => $USER->{Username} } ) == 1) {
GT::Plugins->action ( STOP );
return { error => 'Only one submission per user is allowed.' }
}
Quote Reply
Re: [Paul] Limit Add Link? In reply to
Thanks Paul,

But sorry, which file suppose i insert the code ?

Please help ..
Quote Reply
Re: [reenee] Limit Add Link? In reply to
You need to create a plugin using the wizard.
Quote Reply
Re: [Paul] Limit Add Link? In reply to
Surrender!

I really have no idea how to create a plug-in Blush