This is turning out to be a very significant find. There have been a number of discussions about how to work with sites with a large number of categories. The two lines of code here in the categories.tmpl file along with some conditional code to determine whether the lines should be active or not, could alleviate a lot of problems for these sites.
Coupled this with a user selectable option located conveniently on the index.php or showcat.php page(s) would make this a very powerful enhancement.
Note the difference in the results of these two links:
http://www.timesharegateway.com/auct...ex.php/cat/128
and
http://www.timesharegateway.com/auct...ns.php/cat/128
Althought the script name is different, they are exact copies of each other, but call a different template (for now).
The difference in the two templates are simply
Quote:
if ( $cats['numproducts'][$x] < 1 )
continue;
|
just below
Quote:
|
for ( $x=0; $x < $cats['catcount']; $x++ ) {
|
as the categories.tmpl file begins its run to display the categories. The display as you will see is significantly different between the two.
With a user selectable flag (checkbox and suitable text e.g. "Show all Categories") on the template itself, and perhaps a javascript URL that activates when a change occurs in the checkbox, a user could easily acitivate the view to show all categories or only categories with ads with a single click.
Add a variable to the language file for the text of the checkbox and you have a universal solution for sites with large numbers of categories.