Gossamer Forum
Home : Products : Links 2.0 : Customization :

Editor's Pick Strangeness

Quote Reply
Editor's Pick Strangeness
I just added the Editor's Pick mod, which I'd done once before a long time ago and don't remember having trouble with. I've checked and rechecked everything--paths in links.cfg; defined fields in links.def; changes in site_html_templates.html and nph_build.cgi; no problems with the database; and pick.html is okay. When I go into Admin, I can even modify a record and choose pick--that field shows up as "Yes" in links.db. But when I go to build pages, the field gets changed back to "No." Pages are built okay, but there are no picks because links.db is being changed. This must be something I've done wrong in nphbuild.cgi, right? I mean, Links can't just change my database... Can it?

Sorry. I've been staring at this screen too long. Smile

Kathy
Quote Reply
Re: [KM] Editor's Pick Strangeness In reply to
The most likely-sounding culprit is links.db. Did you add a new field to all the existing entries, with either a Yes or No?

|Yes

|No

Did you add the isPick field as the last one, or are there others after it (in links.def)?


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Editor's Pick Strangeness In reply to
Yes, I added a new field to the records in links.db. I didn't make it the last field, though. Made it second to last. But I edited links.def to reflect that. Do you think that could be causing a problem?

I think you're right that the problem is in links.db. My database is pretty large so it'd be easy for a mistake to hide in there. I've read the multiple warnings in here about fooling around with your database manually, but you know how it is--you think you'll be careful and it could never happen to you. I'll search links.db again and see if I can locate the culprit.

Thanks again. Your help is greatly, extremely, muchly appreciated.

Kathy
Quote Reply
Re: [KM] Editor's Pick Strangeness In reply to
Okay. I've checked links.db, and I don't think there's a problem there. Could it be something else? I'm having a very bad week with Links.

Kathy Frown
Quote Reply
Re: [KM] Editor's Pick Strangeness In reply to
Weakest Link? Pirate

You can upload/attach your links.def and nph-build.cgi to this thread, and also paste in a few lines from your links.db. I'll look it over, and see if I spot anything...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Editor's Pick Strangeness In reply to
Thanks. This is awfully nice of you. I really appreciate it.

Here are a few records from my database:

2|Synagogues.com|http://www.synagogues.com/|22-Oct-2004|Judaism/Synagogues_and_Congregations||a database of synagogues worldwide with contact information for each.||||Kathy Marks|webmaster@evjcc.org|No|No|No
3|Jewish Communities of the World|http://www.haruth.com/JewsoftheWorld.html|22-Oct-2004|Society_and_People/Jewish_Communities||links to Harry Leichter's Jewish communities of the world.||||Kathy Marks|webmaster@evjcc.org|No|No|No
4|Orleans Jewish Community Center|http://www.nojcc.com/|22-Oct-2004|Society_and_People/Jewish_Organizations/Jewish_Community_Centers||enriches Jewish life through recreational, social, cultural and informal educational activities for kids, teens, adults and seniors.||||Kathy Marks|webmaster@evjcc.org|No|No|No

I'll also attach my nphbuild and links.def.

Thanks very much, again.

Kathy
Quote Reply
Re: [KM] Editor's Pick Strangeness In reply to
Aha!

I'm pretty sure you cannot just comment out those lines in links.def. If you don't want them, remove them and renumber accordingly. Here is what's happening:

Code:

ID => [0, -- 2
Title => [1, -- Synagogues.com
URL => [2, -- http://www.synagogues.com
Date => [3, -- 22-Oct-2004
Category => [4, -- Judaism/Synagogues_and_Congregations
AltCategories => [5, --
Description => [6, -- a database of synagogues...
Keywords => [7,
State => [8,
Country => [9,
'Contact Name' => [10, -- Kathy
'Contact Email' => [11, -- webmaster@
#Hits => [12, -- No
isNew => [13, -- No
#isPopular => [14, -- No
#Rating => [15,
# Votes => [16,
ReceiveMail => [17,
isPick => [18,


Renumber like so:

Code:

ID => [0, -- 2
Title => [1, -- Synagogues.com
URL => [2, -- http://www.synagogues.com
Date => [3, -- 22-Oct-2004
Category => [4, -- Judaism/Synagogues_and_Congregations
AltCategories => [5, --
Description => [6, -- a database of synagogues...
Keywords => [7,
State => [8,
Country => [9,
'Contact Name' => [10, -- Kathy
'Contact Email' => [11, -- webmaster@
isNew => [12, -- No
ReceiveMail => [13, -- No
isPick => [14, -- No


At least, that's my first impulse. It's easy to do, and if that doesn't fix it, let me know, I'll keep looking...
Unimpressed

Just looked at your 'Add' page, and saw your little note about using http://
Just like you put your name and email in the links.def, you can put that in there, too:

URL => [2, 'alpha', 40, 100, 1, 'http://', '^http|news|mailto|ftp'],


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Nov 16, 2004, 10:32 PM
Quote Reply
Re: [PerlFlunkie] Editor's Pick Strangeness In reply to
Excellent. Awesome. That was it! I commented them out, but left them in as important fields. Duh. Picks are coming up just great now. I am one happy camper. A very grateful one, too. Thanks so much. Now if I can just stop myself from messing with my database...

Yes, the http:// is a bother, but I'm using the Bookmarklet to build the directory and having the http:// screws it up. Maybe when I've done seeding the site. I read in a thread here somewhere that Links could only handle about 5000 records, but I'm over that now and it's still working great. Fast, too. Well, except when I screw something up.

BTW, I noticed that the post here for building an Editor's Pick is missing a few steps. Should I post them? I feel like I should give something back, as I've gotten such terrific help.

Thank you again. You're a lifesaver...my computer will actually survive to see another day. Smile

Kathy
Quote Reply
Re: [KM] Editor's Pick Strangeness In reply to
Great! Wink

Did you see this Editor's Pick thread?

http://www.gossamer-threads.com/...i?post=140567#140567

What was left out? If you used the original mod code, it is a bit confusing, but this one is pretty clear.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Editor's Pick Strangeness In reply to
I hadn't seen that thread. You're right. It's much clearer. About deleting those lines in links.def-- Isn't commenting them out the same as deleting them? Anyway, I tried deleting them, as well as (big mistake) deleting them from important fields. Ouch. Links went bonkers. It changed all 5000 of my IDs to "No." It marked every record as New. This is, clearly, not the solution. So I tried keeping them in in both places, commenting them out only in %db_def, but reordering them. What I have now is:

ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 75, 125, 1, '', ''],
URL => [2, 'alpha', 100, 300, 1, '', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 500, 1, '', ''],
AltCategories => [5, 'alpha', '75x15', 1000, 0, '', ''],
Description => [6, 'alpha', '70x3', 500, 0, '', ''],
Keywords => [7, 'alpha', '70x3', 500, 0, '', ''],
State => [8, 'alpha', '50', 75, 0, '', ''],
Country => [9, 'alpha', '50', 75, 0, '', ''],
'Contact Name' => [10, 'alpha', 40, 75, 1, 'Kathy', ''],
'Contact Email' => [11, 'alpha', 40, 75, 1, 'webmaster@, '.+@.+\..+'],
ReceiveMail => [12, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
isPick => [13, 'alpha', 0, 5, 0, 'No', ''],
isNew => [14, 'alpha', 0, 5, 0, 'No', ''],
# Hits => [15, 'numer', 10, 10, 1, '0', '\d+'],
# isPopular => [16, 'alpha', 0, 5, 0, 'No', ''],
# Rating => [17, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
# Votes => [18, 'numer', 10, 10, 1, 0, '^\d+$']
);

So all the unused fields are together at the end, and important fields are still defined. I've only built pages once with it this way, but it worked. Picks, too. I'll see if it's still working in the morning. Too beat to work on it anymore tonight.

I swear, when I get this all straightened out I'll never, ever, ever add another mod.

Yeah. Right.

Kathy
Quote Reply
Re: [KM] Editor's Pick Strangeness In reply to
I know what you mean!

Code:

Isn't commenting them out the same as deleting them?

I suppose so, except that you didn't renumber them, and I'm not sure if that matters... I am pretty fair at coaxing perl to do what I want, but I certainly do not know it "real good". Mainly I'm familiar with the Links code, so I'm used to what bits do what.

Hope it keeps on workin'! Angelic


Leonard
aka PerlFlunkie