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

Sub Categories Like Yahoo

Quote Reply
Sub Categories Like Yahoo
Good Day,

forgive me if this topic has already been covered, but in my searching I have been unable to come across it. For Links Version 2.0, Widgetz made a modification that allowed for sub categories for Top Level categories to be displayed as links below. Is there anyway that a similar effect can be done on Links SQL?

Thanks in advance,

quixotic

Quote Reply
Re: Sub Categories Like Yahoo In reply to
Read the following Thread:

http://www.gossamer-threads.com/...=&vc=1#Post82847

There seems to be no solution at this time.

Regards,

Eliot Lee
Quote Reply
Re: Sub Categories Like Yahoo In reply to
Ah, I see.

Thank you however for your quick response. It is greatly appriciated.

Regards,

quixotic
Quote Reply
Re: Sub Categories Like Yahoo In reply to
I've made this for Links SQL..

It is in this forum somwhere I think..

Jerry Su
email@jerrysu.com
http://www.jerrysu.com/
Quote Reply
Re: Sub Categories Like Yahoo In reply to
I searched all the Links SQL forums going back a year and could not find it.

Regards,

Eliot Lee
Quote Reply
Re: Sub Categories Like Yahoo In reply to
http://www.gossamer-threads.com/...ew=&sb=&vc=1

its here, i rememebered that Janio_Br was in the conversation and searched by Username.

Quote Reply
Re: Sub Categories Like Yahoo In reply to
no.. i think he is talking about subcategories like yahoo.. not categories aliases..

that is somewhere in the forum..

Jerry Su
email@jerrysu.com
http://www.jerrysu.com/
Quote Reply
Re: Sub Categories Like Yahoo In reply to
o, ok my mistake
http://www.gossamer-threads.com/...um9/HTML/000163.html

Quote Reply
Re: Sub Categories Like Yahoo In reply to
Basically, what you need to do is add SQL queries to retrieve the appropriate subcategories. You need to place these queries into nph-build.cgi. So, suppose you want the categories listing to have access to the subcategories.. you would need to add the query:

#this gets all the subcategories containing 'Software'
my($sof, $software, $this_sof, $software_cat); #for the software category listing
Code:
$sof = $CATDB->prepare (qq!
SELECT c.*
FROM CategoryHierarchy as h, Category as c
WHERE h.Depth = 1 AND h.SubCategoryID = c.ID AND c.Name like '%Software%'
!);
$sof->execute();
if ($sof->rows) {
$tmp = $sof->fetchall_arrayref();
foreach $this_sof (@{$tmp}) { $software->{${$this_sof}[1]} = $CATDB->array_to_hash($this_sof); }
}
else { $software = undef; }
THen you just add into the %OUT hash

$software ? ($OUT{software_cat} = &site_html_print_cat ($software)) : ($OUT{software_cat} = '');

now you can use the <%software_cat%> global variable in your categories template.. the variable will contain all the subcategories in the 'Software' category. Hope that helps.