Gossamer Forum
Home : Products : Links 2.0 : Customization :

Need help with AltCategories mod

Quote Reply
Need help with AltCategories mod
Hiya! I recently added the AltCategories mod to my Links 2.0 setup -- this is the only mod I've added so far (and I haven't added any of the stuff like adding the AltCategories field to confirmation emails, or changing add.cgi to allow the users to specify alternates yet, either).

Adding links with the additional categories is fine, and I modified the links.db file for all the old links, and everything looks good except for two things.
Less important: For some categories (which only contain subcategories), it lists 0 links, even when the subcategories do contain links. I'm not sure if that's the expected behavior or not, but I would like it to show the number of the links under all the subcategories.
More important: The links which have alternate categories defined only show up in their primary category, not at all in their alternate categories.

I tried searching the forum for other posts about this but I couldn't find anything helpful. I double-checked the mod site at http://www.online-sweepstakes.com/links-mods/ to make sure I'd integrated all of the code that it specifies, and I have -- actually, I did find one thing that I'd missed (removing one line in nph-build.cgi), which once done fixed a problem where it was doubling the link count for certain categories, but it didn't fix anything else.

Any help would be appreciated. The site is at http://www.ziggurat.org/soap/links/ if anyone would like to see. One example of a link which is affected by the alt-category not listing problem is listed thus in my links.db (newlines added to prevent this post from being very wide):

129|Suds and Scents Natural Soapmaking Supplies|
http://www.sudsandscents.com/|8-Mar-2003|
Suppliers/Canada/Essential_Oils|
Suppliers/Canada/Bases~~Suppliers/Canada/Colorants~~Suppliers/Canada/Flavoring~~
Suppliers/Canada/Fragrance_Oils~~Suppliers/Canada/Packaging|
High quality soap making supplies and ingredients for natural and safe, handmade soap making, bath and body care crafts at reasonable prices. - Located in North Vancouver, BC|
sabrina|viv@ziggurat.org|0|Yes|No|0|0|Yes

thanks very much in advance,
--sabrina Smile
viv@ziggurat.org

Last edited by:

tabbygirl42: Mar 13, 2003, 5:40 PM
Quote Reply
Re: [tabbygirl42] Need help with AltCategories mod In reply to
Hey, your site's lookin' good! When you did the mod, did you paste the code parts from the blue boxes (from the mod page) over the original code on your server? If so, then it should work OK, has for me on a couple of installs...

You could attach the modded files to a post, where we can look 'em over, other than that, I don't know what to say?


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Need help with AltCategories mod In reply to
Well, originally I just copied and pasted the red-text parts, but just now I copied over my modified versions of the files (nph_build.cgi, links.def, and db_utils.pl) with fresh untouched copies and re-applied all the changes by copy and paste as you suggested, and still no luck. Unsure

I dunno. Maybe it's something with my perl (v5.8.0), or something else entirely different. Nothing appears in my errorlog when I build the site, so I'm just drawing a blank as to where to even start looking. The field separator within the AltCategories column is supposed to be ~~, right?

Rather than posting the scripts here, since they're so long, I put them up on the site so that you can read them. http://www.ziggurat.org/gosshelp/ Let me know if I missed any.

thanks so much for helping me out. Smile
--sabrina
Quote Reply
Re: [tabbygirl42] Need help with AltCategories mod In reply to
No, the seperator is not ~~, but a 'pipe' like this |. After adding the mod, there should be a second list of your categories labeled 'Alt Cat' under the main, original listing (in the admin.cgi). So when adding, select the cat for the link in the main list, and the same link can be placed under ONE other category using the second list.

So you link.db should be like

59|Name of Link|http:etc|date|category|altcat|description|etc, etc...

If you don't use an altcat for a link, then the space should be blank in the db:

59|Name of Link|http:etc|date|category||description|etc, etc...

Try that, see if it works fer ya.


Leonard
aka PerlFlunkie
Quote Reply
Re: [tabbygirl42] Need help with AltCategories mod In reply to
actually, you can select more than one alt category by holding down the control key and clicking the alt cat.

the separator between these multiple categories will be the ~~ as you showed in your earlier post.

In looking quickly over the code in your files, it looks correct.

The links.db shows in part

|8-Mar-2003|Mailing_Lists/General|0|

The 0 is the alt cat field, correct? Should that be blank or contain the alt cat?

I wasn't sure what the original problem was...not enough time to read thru it carefully. maybe on monday...


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Need help with AltCategories mod In reply to
While you can of course select more than one altcat (using ctrl), I wasn't aware that the mod would recognize that action, as in keeping the correct count, etc.

Has this been discussed elsewhere? I don't recall reading about this, I thought a person would have to add multiple altcat fields to have more than the one...?

+++++++++++++++++++

OK, a quick search answers my question! The main thread on this mod is here, and there are many links off of it. Read and experiment, I guess...


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Mar 15, 2003, 1:35 PM