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?
Jul 24, 2000, 4:09 PM
Veteran / Moderator (3111 posts)
Jul 24, 2000, 4:09 PM
Post #6 of 8
Views: 2314
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/
- Bobsie
bobsie@orphanage.com
http://goodstuff.orphanage.com/
Jul 24, 2000, 4:43 PM
Veteran / Moderator (3111 posts)
Jul 24, 2000, 4:43 PM
Post #8 of 8
Views: 2269
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:
It should appear in 3 places:
First occurance:
# 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:
$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:
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/
Code:
$numlinks = ($#{$links{$cat}} + 1) / ($#db_cols + 1);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);
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);
}
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);
- Bobsie
bobsie@orphanage.com
http://goodstuff.orphanage.com/