Gossamer Forum
Home : Products : Links 2.0 : Discussions :

what is the difference...

Quote Reply
what is the difference...
between this

(in links.db, at the end of any link)

com|2|No|No|||

and this:

com|0|No|No|0|0|Yes

???????????

What is the meaning of the first number??? (ergo com|2|No|No|||



thanks for some "educational info

Quote Reply
Re: [gossy] what is the difference... In reply to
hmmm....counting backwards from the original links.def file that would be the number of hits.

but it has been a long day....If I was a drinking man, I'd need a drink

but just out of curiosity, what is the com?


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] what is the difference... In reply to
but just out of curiosity, what is the com?...........................

yeah, i guess you should have gotten yourself a good beer on this question....

-it's the last portion of the links URL, i thought i leave a bit with it so it's easier to understand where it comes from (the links.db file)



So, if that first number is counting the hits a certain link receives it would mean this number may constantly change the more hits a link receives????

I stopped the counting of hits at some point and that's in this case i guess why it says from that point on "0" as the first number - but it still counts hits for those links that where listet before i stopped the counting as i noticed in the "hits" folder in data.

What would then the last Yes be? (there was no such before i stopped the counting)

|0|No|No|0|0|Yes

And eventually the purists question of the day;

Can i somehow tell Links 2 to stop printing any of this -|0|No|No|0|0|Yes-

into the links.db file??????????????/
Quote Reply
Re: [gossy] what is the difference... In reply to
OK, the com is part of the email address

the last yes is the field ReceiveMail - see the Emailing - Link Owners menu option in the Links Administrative Menu control panel.

For a complete list of the fields open the links.def file in your admin folder.

the ultimate answer is yes. it's just code and code can be changed. I have read your previous posts on hacking the Links code to stop certain pages from being built.

Practically, I think you are better just to leave them there and they take up almost no space on the server - you would need to convert to LINKS SQL if your file got large. A few weeks ago I had to change the field name for Contact Name and Contact Email to ContactName and ContactEmail. As it turned out, they are used in several times in many files. The code using these fields was extensive. I'm sure that the fields you mention are the same way. Having said that, you may find that you can just delete whole subroutines.

For example, you stopped sub build_update_newpop in nph-build.cgi from running. Just delete that section of code. Correct error messages as you go. Once you get all the code that uses those fields deleted, you can delete them from your links.def file. Then delete the appropriate section from each record in the links.db file

I sure would make back up copies of everything first. Good luck.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] what is the difference... In reply to
Thanks for that Gene.
Indeed i have actually tried that changing of the add form field names myself and ended up with the same realisation - to complicated!
Also, the stopping of all the "stuff" i don't need has apparently a downside too;
When i have to change something (modify) in a link that was listet before the stopping it is no longer possible.
It gives me a "Can't modify... because "snd mail, ..is new" or whatever is missing, so i have to simply delete the entire link and add it completely new.
So, i guess i will leave things as they are now.
My links.db file has now about 600kb's, i think i'll see how much Links2 can actually take before it becomes "overweight" and then it's definitively time for the Sql version.
Quote Reply
Re: [esm] what is the difference... In reply to
I just had a look into links.def and i assume it's this section
------------------section out of links.def------------
# System defaults. When adding new links or modifying links, these fields
# can not be overwritten by a user.
%add_system_fields = (
isNew => 'No',
isPopular => 'No',
Hits => '0',
Rating => 0,
Votes => 0,
ReceiveMail => 'Yes'
);

# Hash of column names to possible options. If you want to use a select form
# field, you can use &build_select_field in your HTML page. This routine will
# make a <SELECT> input tag using the following values:
%db_select_fields = (
isNew => 'Yes,No',
isPopular => 'Yes,No',
ReceiveMail => 'Yes,No'

);
-----------end section-------------------------------
you where talking about.
This has always confused me;

The first segment i highlighted in red:

Hits has the 0 in " " quotes, (i assume i can simply change it to "No"?)

Rating and Votes do not have any quotes around the 0, how do i change anything there???

In the second segment, those 3 fields with the "Yes,No" is that anything i could change, say to only "No"

or is that just a "if" type of event thing i do not have to mock around with???
Quote Reply
Re: [gossy] what is the difference... In reply to
No offense, but you don't seem to have a concept of databases in general or perl in particular. And with over 600k size file, I recommend that you not fool around with your database or field definitions. At least until you learn alot more.

Here is a record in links.db

Code:
10024|Free Calendar|http://www.calendars.net/|6-Nov-2000|Resources/Tools|This is a free calendar for your use. NICE...!|Calendar|support@calendars.net|29|No|No|0|0|No|USA|No||0||cal123|Other|Yes|6-Nov-2000||0|No


Note that each field is separated by a vertical bar |.

In links.db these fields are defined

Code:
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 80, 125, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '100x5', 500, 1, '', ''],
ContactName => [6, 'alpha', 40, 75, 1, '', ''],
ContactEmail => [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'],


Each field has certain attributes separated by commas. Search for "Field Definitions" to learn what each attribute is. Notice that each has an attribute of alpha or numer. This means that the field is either text or numeric - If it is numeric, you can't enter text into the field and if it is alpha, you cannot use it in arithmetic operations (but you can enter numbers).

If you want to delete the ContactEmail field you have to do lots of things.

Code:
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 80, 125, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '100x5', 500, 1, '', ''],
ContactName => [6, 'alpha', 40, 75, 1, '', ''],
ContactEmail => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
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'],



Notice field 8 has been delete.


Then you must delete that information in EVERY record.


Code:
10024|Free Calendar|http://www.calendars.net/|6-Nov-2000|Resources/Tools|This is a free calendar for your use. NICE...!|Calendar|support@calendars.net|29|No|No|0|0|No|USA|No||0||cal123|Other|Yes|6-Nov-2000||0|No

becomes

Code:
10024|Free Calendar|http://www.calendars.net/|6-Nov-2000|Resources/Tools|This is a free calendar for your use. NICE...!|Calendar|29|No|No|0|0|No|USA|No||0||cal123|Other|Yes|6-Nov-2000||0|No


Now just find all the other places where ContactEmail exist, and delete not just the variable itself but the appropriate code as well ( and determining what is appropriate code to delete requires at least some knowledge of programming and perl ).

If you forget to delete the information correctly, you will see strange results.

Check out http://home.hccnet.nl/...e/t2t/text2table.htm


Remember to back up in case you screw up!!!!!!!!!!!!!!!!!!!!!!!!!!!


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [gossy] what is the difference... In reply to
Actully, the info you describe in not the field definition but "nice to have" stuff.

Quote:


Hits has the 0 in " " quotes, (i assume i can simply change it to "No"?)


Nope, Hits is defined as numeric thus you cannot enter text like NO into it.

Notice what the header for this section says

Quote:


# System defaults. When adding new links or modifying links, these fields
# can not be overwritten by a user.


As for the next section, it allows the dropdown selection on the yes/no boxes in the Links Admin menu control panel. Nothing more.

Quote:
# Hash of column names to possible options. If you want to use a select form
# field, you can use &build_select_field in your HTML page. This routine will
# make a <SELECT> input tag using the following values:
%db_select_fields = (
isNew => 'Yes,No',
isPopular => 'Yes,No',
isMonthPopular => 'Yes,No',


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] what is the difference... In reply to
No, i am not offened by your observation as it reflects the facts.

I am no programmer., i am a designer.

So i use common sense as far as that works and a little of experience with JAVA to see my way through cgi scripts.

The difficulty is of course exactly where one block of script comands to another and another script and another script portion and so on and it's clear to me that it would be easier with an overview and understanding of all pieces of such a script and template number as Links2 has.

However, looking through your post i see i better don't mock around more as i have already (the email feature as it appears in your example with an actual email address for instance has never appeared in my links.db as i from the beginning never wanted to keep emailing "bulk" out. It sends the submission report out and that's all it has to do

What i probably should do one fine miserable rainy day is copy the

new varibles |0|No|No|0|0|Yes

and paste them over all the old |2|No|No||| ones

and that would probably let me in the future modify those links again too, isn't it????

(I have no "modify" feature online where anyone could modify a link by themselfs, they have to use a seperate form for this, independend from links2 and i have to make the changes myself).

Have you any idea how large the links.db can be before it runs into any slow down or other problems?
Quote Reply
Re: [gossy] what is the difference... In reply to
well, if you are going to change those fields, use the program I referred you to. But you won't gain much from doing that.

if you use the build all thru your browser, my understanding is that that will begin to "time out" and not complete the build. Although then maybe you can try to build staggered

I've seen here in a post a limit of 2,000 to 5,000 links and a upper size of 1mb. But someone had over 15,000. Just depends on what size each link is.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] what is the difference... In reply to
It's a sleepless night and 6500 links later but i did change them all now and i hope with this i have eventually my mission to "leanify" Links2 concluded????

Interesting, i never actually realised before you told me that Links2 counts each click - and honestly i don't go to read all the stuff in links.db, it's just to much of plain text and numbers.

Maybe some day i'll regret not having this feture anymore as it looked interesting to see what sort of links get how many visits.

Thanks for your "guidance" in this