Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Pre Mod: AlphaBar [Complete List]

Quote Reply
Pre Mod: AlphaBar [Complete List]
Hi,

I recently made a mod to put selected categories in an 'Alpha' bar across the top of the category page, but I'd like to enhance it by including ALL the links from these 'alpha' type categories into a 'Complete List' category as well.

Instead of making it a complicated manual process I'd like nph-build.cgi to check for a category named 'Complete List' and where it finds one, get ALL of the links from the 'Alphabar' sub-cats of the same parent.

As a visual example:

[ A | D | T ]

Complete List (xxx)

... if A has 10 links, D - 30, and T - 12, the Complete List category should have all of those totalling 52.

Any idea's on how I could go about this and what logic I could use such as WHERE statements, checking loops, etc. would be much appreciated Smile?


All the best
Shaun

Quote Reply
Re: Pre Mod: AlphaBar [Complete List] In reply to
I believe you would use get_record command with the $LINKDB object that would get all links with the CATEGORYID...Basically, you would have to do the following:

1) Get an alphabetical list of all categories (similar to what you already have).
2) Rather than using the HIERARCHY table to display the alphabetical list of subcats, you would use the LINKS table to get a listing of links based on the CATEGORYID column between the CATEOGORY and LINKS tables.

Regards,

Eliot Lee
Quote Reply
Re: Pre Mod: AlphaBar [Complete List] In reply to
Hi Eliot,

That's interesting, I didn't think about it that way. What you're saying is that I would get the list of 'Alphabar' category ID's based on the path of the 'Complete List' cat and then query the LINKS table with those ID's to get the "complete list" of matching links? (similar idea to the 'search this category' mod!)

I think that could work quite well ... what's that saying about "Two heads are better than one!" Smile

Thanks Eliot

All the best
Shaun