Gossamer Forum
Home : Products : Links 2.0 : Customization :

adding new fields to the addurl form

Quote Reply
adding new fields to the addurl form
I have a question. I know there has been some discussion about recip link checking, but what I have seen is something a little different I think. Here is what I am trying to do.

I have added a new imput field on the addsite page, and I want that field to show up in my admin.cgi area as well as the email I receive when I get notification for validation. Im not sure what other files I need to modify. I added a new tag <%linkback%> to my addsite page but thats the only place that field is showing up on. I am thinking I know I have to do something to a couple of other files, but I am not sure what, and I don't want to goof anything up. SmileAny advice would be greatly appreciated.

Thanks in advance
Quote Reply
Re: adding new fields to the addurl form In reply to
What you need to do is add the "linkback" field to links.def. There are instructions on how to do this in the resource center, here http://www.gossamer-threads.com/...es/Detailed/162.html .

Then, in your templates (or site_html.pl), you can add your new field to your forms the way you would any other variable (I'm guessing you're probably adding a yes/no dropdown menu).

To include the variable in your add success page, just use <%linkback%> wherever you want to see the variable. Same with your e-mail text files.

Hope that helps!

Smile Kate



------------------
www.floor42.com
Quote Reply
Re: adding new fields to the addurl form In reply to
Thanks Kate Smile

I thought it was in the links.def but I was not sure exactly what. What I did was add the linkback input so that they could tell me the url where the linkbacks is rather than a drop down menu. That way I don't have to spend all day looking at it. I did not know that info was in the resource center, but I found a thread from about 3 months ago that talks about the same thing. So I will check it out Smile

Thanks once again
Quote Reply
Re: adding new fields to the addurl form In reply to
I dont think I did this right:/

Here is what I added. In the links.def I added
Linkback => [14, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],

Under all the others. I also included down where the important fields were, and gave it the right number. When I uploaded it, I got a fatal syntax error near line 37, which is where I added the Linkback => [14, etc etc...I did read that resource page, but I feel like I am still missing something here. Frown
Quote Reply
Re: adding new fields to the addurl form In reply to
Where you have Linkback => [14,, was it necessary to put a comma on the line before it? Did you?
Quote Reply
Re: adding new fields to the addurl form In reply to
Hi Bobsie,

I don't know if it is necessary? I did not am I supposed to? It looks like thats how the rest of them are now that you mention it.
I will try that.

Thank you Smile
Quote Reply
Re: adding new fields to the addurl form In reply to
Hey Bobsie,

I did put a comma on the line before, which was part of the problem. The new field now shows up in the admin, but it seems to have created another problem. Hopefully something simple to fix. When I go to validate, I get something like "Choose which records (6.666666)you wish to validate. What am I doing or not doing that would cause this?

Quote Reply
Re: adding new fields to the addurl form In reply to
Oh, man, I've had that problem before. It has to do with adding a field while you have records already in your validation database. I think what is going on is this:

Let's say you have two records to validate, and you add a field. The first line (ID) of record #2 will then be read as the last line (the new field) of the first record, because links.db didn't "know" to add a pipe (|) automatically to compensate for the new field.

I know that upgrade.pl (update.pl?) deals with this problem, but if it's only a couple of records, it may be less of a headache to edit links.db manually and add an extra pipe to the end of each line.

Sorry, this problem happened to me a long time ago, and I'm not 100% certain how I fixed it...

-Kate
Quote Reply
Re: adding new fields to the addurl form In reply to
Hi Kate Smile

That was the problem alright. I thought that might have something to do with it so last night I cleared all the records awaiting validation out and just edited the links.def again. All worked well.

Thanks for your help. Bobsie, you too Smile