Gossamer Forum
Home : Products : Links 2.0 : Customization :

Yahoo like categories

Quote Reply
Yahoo like categories
Hi,

I'm not sure if this has been asked before.

Is it at all possible with the current method Links builds subcategories to achieve the same thing major directories have now.

Which is: If you are in /Internet/World_Wide_Web/ in yahoo
One of the subcategories there is Software@. Porbably everyone knows that @ just shows that Software is located under Computers_and_Internet/Software.

Would it be possible to achieve anything like this?

thanks


------------------
Greg L
gregl@email.com
www.GLdev.com


Quote Reply
Re: Yahoo like categories In reply to
Thats what related categories is.

------------------
Quote Reply
Re: Yahoo like categories In reply to
I know what realted categories are.

But I was talking about incorporating them in subcategories and adding at least a description to them or even a counter so the only thing that would make them different from subcategories would be a "@" at the end.

------------------
Greg L
gregl@email.com
www.GLdev.com


Quote Reply
Re: Yahoo like categories In reply to
Well, I worked on it a little and got it to work myself.

Here's an example. http:// First come real subcategories, then subcategories with a "@" meaning that they're somewhere else in the directory.

1. backup your nph-build.cgi
2. in nph-build.cgi replace
Code:
# Calculate the related entries and put in a <LI> list.
@related = split(/\Q$db_delim\E/, $related); $related = "";
foreach $relation (@related) {
$related .= qq|<li><a href="$build_root_url/|;
$related .= &urlencode($relation);
$related .= qq|/$build_index">|;
$related .= &build_clean($relation);
$related .= "</a></li>";
}
with
Code:
# Calculate the related entries and put in a <LI> list.

@related = split(/\Q$db_delim\E/, $related);
$half = int (($#related) / 2);

$related = "<CENTER><TABLE BORDER=0 WIDTH=\"100%\"><TR><TD VALIGN=TOP WIDTH=\"50%\">";
foreach $relation (@related) {
$related .= qq|<DL><DT><FONT face=\"arial, helvetica\" size=2 color=\"#000000\"><STRONG><a href="$build_root_url/|;
$related .= &urlencode($relation);
$related .= qq|/$build_index">|;
@onerelated = split(/\//, $relation);
$related .= &build_clean($onerelated[$#onerelated]) . "\@\n";
$related .= "</a></STRONG> <FONT color=\"#222222\"> ($stats{$relation}[0])";
$related .= "</FONT> </FONT></DT><DD><FONT face=\"arial, helvetica\" size=2 color=\"#000000\">@{$category{$relation}}[2]</FONT></DD></DL>";

if ($i == $half) {
$related .= "</UL></TD><TD VALIGN=TOP WIDTH=\"50%\">\n";
}
$i++;

}
$related .= "</TD></TR></TABLE></CENTER>";

3. in site_html.pl
4. in "sub site_html_category" move the $related somwhere below the $category.

I'm sorry that if my explanations are not precise enough, but I am working with HIGHLY modified site_html.pl and it hard to say what was there before and what was added by me Smile

------------------
Greg L
gregl@email.com
www.GLdev.com