I would like to display the total number of links available in a Related Categories. I'm using Links 2, templates and the Alternate Category mod.
I added ($numlinks) to nph-build.cgi like this - but it displays 0 (zero) links for some of the related categories. The numbers it shows are also not quite accurate if a site was included in an alternate category.
@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> ($numlinks)</li>";
}
Is it possible to count the total number of links in a category and all its subcategories? Even if the link is included in that category using the Alternate Category field?
Also, I'm using multiple templates - different ones for each category and have figured out it displays a number when I used the category.html, but a 0 for the others I have created ... even though they all are using the same code at this point.
Ideally I would like to modify the templates to include the code for the number of links for related categories, and not use nph-build.cgi. Then I could show the number for just some related categories and not others.
Confused? I am
Anyone have any thoughts on this?
[This message has been edited by lunaria (edited March 04, 1999).]
I added ($numlinks) to nph-build.cgi like this - but it displays 0 (zero) links for some of the related categories. The numbers it shows are also not quite accurate if a site was included in an alternate category.
Quote:
# 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> ($numlinks)</li>";
}
Is it possible to count the total number of links in a category and all its subcategories? Even if the link is included in that category using the Alternate Category field?
Also, I'm using multiple templates - different ones for each category and have figured out it displays a number when I used the category.html, but a 0 for the others I have created ... even though they all are using the same code at this point.
Ideally I would like to modify the templates to include the code for the number of links for related categories, and not use nph-build.cgi. Then I could show the number for just some related categories and not others.
Confused? I am
[This message has been edited by lunaria (edited March 04, 1999).]

