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.
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.