All pugdog did for me was rem out the following lines of code in the sub build_category_pages routine:
###while (1) {
$categories_r = $CATDB->query ( { ID => '*', mh => $limit, $offset+1, sb => 'Name', so => 'ASC', tb => 0 });
###last unless ($categories_r and @{$categories_r} > 0);
Note: The bolded lines are what you need to rem out with the # sign.
I also changed $limit = 100; to the following:
$limit = &Links::DB_Utils::get_totalcats;
This is referencing a sub that I added in the DB_Utils.pl that counts the total number of categories in the Category table.
The sub you need to add in the DB_Utils.pl file is as follows:
sub get_totalcats {
#-----------------------------------------------------
my ($CATDB, $GRAND_TOTAL);
$GRAND_TOTAL = 0;
$CATDB = new Links::DBSQL "$LINKS{admin_root_path}/defs/Category.def";
$GRAND_TOTAL = $CATDB->total();
return $GRAND_TOTAL;
}
BTW: You can create a global variable in your HTML_Templates.pm like the following:
totalcats => &Links::DB_Utils::get_totalcats;
Then you can use <%totalcats%> in all your template files.
Yes...the same thing can be done with links...rename the above sub, rename the .def file and global variables in that sub, then rename the global variable in the HTML_Templates.pm.
Hope this helps.
Regards,
Eliot Lee
Code:
###while (1) {
$categories_r = $CATDB->query ( { ID => '*', mh => $limit, $offset+1, sb => 'Name', so => 'ASC', tb => 0 });
###last unless ($categories_r and @{$categories_r} > 0);
Note: The bolded lines are what you need to rem out with the # sign.
I also changed $limit = 100; to the following:
Code:
$limit = &Links::DB_Utils::get_totalcats;
This is referencing a sub that I added in the DB_Utils.pl that counts the total number of categories in the Category table.
The sub you need to add in the DB_Utils.pl file is as follows:
Code:
sub get_totalcats {
#-----------------------------------------------------
my ($CATDB, $GRAND_TOTAL);
$GRAND_TOTAL = 0;
$CATDB = new Links::DBSQL "$LINKS{admin_root_path}/defs/Category.def";
$GRAND_TOTAL = $CATDB->total();
return $GRAND_TOTAL;
}
BTW: You can create a global variable in your HTML_Templates.pm like the following:
Code:
totalcats => &Links::DB_Utils::get_totalcats;
Then you can use <%totalcats%> in all your template files.
Yes...the same thing can be done with links...rename the above sub, rename the .def file and global variables in that sub, then rename the global variable in the HTML_Templates.pm.
Hope this helps.
Regards,
Eliot Lee