Gossamer Forum
Home : Products : Links 2.0 : Customization :

Adding New Fields

Quote Reply
Adding New Fields
I would like to add a field to my Links 2. It would be for "State", if the state entered is correct I would like it to keep going through the standard process, but if it is wrong state entered I would like it to send the contents of badsubmission.txt to the submitter in an email.

Any help would be appriciated.

Quote Reply
Re: Adding New Fields In reply to
Uh ... define "wrong state".
You can make the field a select form field to control the input. To do so, add something like
State => 'Minnesota,Nebraska,California',
in %db_select_fields in your links.def

Then, in your add.html, see how to build the select form by looking at how Category is done.

I'm not sure I understand what you want to email, and why ...

Quote Reply
Re: Adding New Fields In reply to
Ok, this is the thing.. My site is for the State of Maine, yet I get stuff from all over the country and world. I would like to have a drop down where they can choose the "State", if the "state" = "ME - Maine" it will submit the site, but if "state" does not equal "ME - Maine" then it will send them an email (using a configurable txt file" saying something like, "This site is for Maine residents only, etc etc", I know this may not cut back on spam, but if it stops a few ignorant people from spamming me with content that does not belong on my site I will be happy.. I have a warning explaining what my site is on the "Add URL" page, but they either ignore it or just can't read! :(

Quote Reply
Re: Adding New Fields In reply to
OK, I see. You know, it might be that your site has been "caught" by some of these #&%!/¤# auto-submission engines out there ...
Are the non-relevant links usually added in one particular category, or none category at all? This is usually a sign of auto-submissions.
Since I think your mod idea is a bit complex, I suggest this simple test: Try and rename you newadd.cgi script (and change the links to it, of course). If this "suddenly" stops non-relevant submission, well, there you are ... you migt want to change the name regularly, to prevent getting in the same situation after a while ...
Now, if you want to test things further, you might want to look at this old thread: http://www.gossamer-threads.com/p/24807 ...