Gossamer Forum
Home : Products : Links 2.0 : Customization :

Number of links in each cat is wrong

Quote Reply
Number of links in each cat is wrong
When I use this ($numlinks) in site_html_templates.pl, it shows the wrong amount of links in each category. Additionally it shows no links, if the main cat has none but the sub cats do. What gives?

Quote Reply
Re: Number of links in each cat is wrong In reply to
That fact has already been established in the forum. Bmxer, the author of the mod, will - as far as I know - check on that problem.

Quote Reply
Re: Number of links in each cat is wrong In reply to
Hmmmmm, this is not a mod perse, it is the way the links 2.0 comes packaged. I didn't know he created that ability. I will watch for further info, thanks!

Quote Reply
Re: Number of links in each cat is wrong In reply to
what are you talking about? I never maid a mod that shows the number of links in each category, that comes with Links.

Quote Reply
Re: Number of links in each cat is wrong In reply to
Silly me, thought A R referred to that num_list thing, my mistake...

Quote Reply
Re: Number of links in each cat is wrong In reply to
Have you made any modifications to nph-build.cgi, particularly, sub build_category_pages or to sub site_html_print_cat in site_html_templates.pl?

- Bobsie
bobsie@orphanage.com
http://goodstuff.orphanage.com/
Quote Reply
Re: Number of links in each cat is wrong In reply to
I've added, the mod to put a jumpto box for categories, and page numbers.. Ummmmm I think that's it..

Quote Reply
Re: Number of links in each cat is wrong In reply to
The problem may be with the page numbers, especially if that was in sub build_category_pages, nph-build.cgi. Check the routine and see that this code is there:
Code:
$numlinks = ($#{$links{$cat}} + 1) / ($#db_cols + 1);
It should appear in 3 places:

First occurance:
Code:
# If we are spanning pages, we grab the first x number of links and build
# the main index page. We set $numlinks to the remaining links, and we remove
# the links from the list.
$numlinks = ($#{$links{$cat}} + 1) / ($#db_cols + 1);
Second occurance:
Code:
if (($numlinks > $build_links_per_page) && $build_span_pages) {
$page_num = 2;
$next = $url . "more$page_num$build_extension";
for ($i = 0; $i < $build_links_per_page; $i++) {
%tmp = &array_to_hash ($i, @{$links{$cat}});
$links .= &site_html_link (%tmp);
}
@{$links{$cat}} = @{$links{$cat}}[(($#db_cols+1)*$build_links_per_page) .. $#{$links{$cat}}];
$numlinks = ($#{$links{$cat}}+1) / ($#db_cols + 1);
}
Last occurance:
Code:
open (CAT, ">$dir/more$page_num$build_extension") or &cgierr ("unable to open category page: $dir/index$page_num$build_extension. Reason: $!");
print CAT &site_html_category;
close CAT;

@{$links{$cat}} = @{$links{$cat}}[(($#db_cols+1)*$build_links_per_page) .. $#{$links{$cat}}];
$numlinks = ($#{$links{$cat}}+1) / ($#db_cols + 1);
I hope this helps.

- Bobsie
bobsie@orphanage.com
http://goodstuff.orphanage.com/