Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [hannahmackenzie] limit number of links added per user

Quote Reply
Re: [hannahmackenzie] limit number of links added per user In reply to
You would need to write a plugin, or at least a global function, but the plugin has the advantages outlined below.

Ok, I'm assuming your users log in -- if they don't, the exercise is pointless from the start :)

The simplest idea would be to have the add.cgi run a plugin pre-hook to see what the date of the last successful submission was.

The add.cgi script would update this field upon successful exiting ie: post-hook.

If the date was within the past 24 hours, reject the submission.

I'd use 24 hours, rather than calendar days, for a number of logical, logistical and other reasons.

To use a global, you'd need to have the global check the date of last submission on the add.html form, and update this column on the add_success.html form. It's more tricky, and probably asking more of the template parser/globals than you would want -- or should want -- to make them do, but it could probably be done. add.html uses a global that checks the Users.last_sub field, and add_success.html has a global that sets the Users.last_sub field. I'm not sure how/when globals are processed, but it should be possible to make sure the update global only runs on the add_success.html form. Whether the other globals run all the time is trivial ... you can then show the user the date of their last submission :)


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Subject Author Views Date
Thread limit number of links added per user hannahmackenzie 2717 Jan 21, 2002, 2:35 AM
Thread Re: [hannahmackenzie] limit number of links added per user
pugdog 2658 Jan 21, 2002, 9:07 AM
Thread Re: [pugdog] limit number of links added per user
Paul 2694 Jan 21, 2002, 9:10 AM
Thread Re: [RedRum] limit number of links added per user
pugdog 2647 Jan 21, 2002, 10:08 AM
Thread Re: [pugdog] limit number of links added per user
Paul 2657 Jan 21, 2002, 10:10 AM
Thread Re: [RedRum] limit number of links added per user
pugdog 2661 Jan 21, 2002, 10:38 AM
Thread Post deleted by RedRum
Paul 2660 Jan 21, 2002, 10:48 AM
Post Re: [RedRum] limit number of links added per user
pugdog 2643 Jan 21, 2002, 10:55 AM
Thread Re: [pugdog] limit number of links added per user
hannahmackenzie 2630 Jan 21, 2002, 10:56 AM
Post Re: [hannahmackenzie] limit number of links added per user
pugdog 2629 Jan 21, 2002, 11:50 AM