Gossamer Forum
Home : Products : Links 2.0 : Customization :

How do you add new fields??

Quote Reply
How do you add new fields??
How do you add new fields?

For example when someone adds a link they put the title of their site, it is added to the database, then in the templates you can use <%Title%> to insert the site title. Say I want to have a new property for the site Author, I want to be able to be put <%Author%> in the template. Like <%Title%> by <%Author%>. I have an idea but want to do it right, can some experienced help me out?

Thanks,
Ryan
Quote Reply
Re: How do you add new fields?? In reply to
Read the FAQ in the Resource Center. Also adding fields has been discussed MANY times in this forum and in the Discussion Forum...piece of friendly advice...SEARCH them!

Wink

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




Quote Reply
Re: How do you add new fields?? In reply to
Hi istudio!

I have a cgi file called field.cgi which will go some way to assisting you to add a field.

Forget who put it together. Send me an email if you want it.



------------------
www.nzcid.godzone.net.nz
New Zealand Christian Internet Directory




Quote Reply
Re: How do you add new fields?? In reply to
Everytime I post something here somebody is telling me I have to do this or that, I thought this thing was for help, am I wrong? I did search and did not find what I wanted, and the FAQ was more to convert an existing database, I am just starting my database. I did not find what I wanted so can someone please help me? I want to add new fields to add to the database, I add it to links.def(#14)...
# Database Definition: LINKS
# --------------------------------------------------------
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']
Author => [14, 'alpha', 40, 75, 1, '', ''],
);

what else do i have to do to use the <%author%> tag in my templates and make it add to the database? thanks
Quote Reply
Re: How do you add new fields?? In reply to
Dude, you need to relax a little. Eliot is right... someone has already gone to the trouble of putting detailed instructions together for what is undoubtedly the *first* question anybody asks when customizing links (or did you think we were all just using it straight out of the box, so to speak?). Here is that URL, which you could find in the Resource section of this very site...
http://www.gossamer-threads.com/...es/Detailed/162.html

Also, make sure that every definition line EXCEPT for the LAST FIELD has a comma after it (your example does not). I won't repeat the rest of what is in the FAQ, except to say that the <%%> tags are case sensitive, so <%author%> will not reference the field Author. BTW does HB=Huntington?

------------------
The Immuatable Order of Modding
-=-=-=-=-=-=-=-
1. Read the FAQ, 2. Search the board, 2a. Search the board again, 3. ask the question, 4. back-up, 5. experiment, 6. rephrase question (or better yet, post solution to original question)
Quote Reply
Re: How do you add new fields?? In reply to
oldmoney,

thanks, i didn't see that tutorial before.

and hb=Huntington Beach, CA

thanks again!
ryan
Quote Reply
Re: How do you add new fields?? In reply to
<wink> Curious . . . I couldn't recall having seen that page in the Resource Center either.

Submitted by Phoenix Amon.
Added: 24-Jan-2000

Seriously . . . the step-by-step procedure listed there is very well done! Thanks

------------------
~ ~ ~ ~ ~
Karen