Source for file _categories.php
Documentation is available at _categories.php
* This is the template that displays (recursive) list of (sub)categories
* This file is not meant to be called directly.
* It is meant to be called by an include in the _main.php template.
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
* @copyright (c)2003-2005 by Francois PLANQUE - {@link http://fplanque.net/}
if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );
# You can customize the following as you wish:
if(!isset
($cat_all)) $cat_all =
/* TRANS: All categories, skin's categories list */ T_('All'); // Set to empty to hide
# global category list delimiters:
if(!isset
($cat_main_start)) $cat_main_start =
'';
if(!isset
($cat_main_end)) $cat_main_end =
'';
if(!isset
($cat_line_start)) $cat_line_start =
'<li>';
if(!isset
($cat_line_end)) $cat_line_end =
'</li>';
if(!isset
($cat_line_checkbox)) $cat_line_checkbox =
true;
# Category group delimiters:
if(!isset
($cat_group_start)) $cat_group_start =
'<ul>';
if(!isset
($cat_group_end)) $cat_group_end =
'</ul>';
# When multiple blogs are listed on same page:
if(!isset
($cat_blog_start)) $cat_blog_start =
'<h4>';
if(!isset
($cat_blog_end)) $cat_blog_end =
'</h4>';
* WARNING: the category list is displayed recursively.
* This is a little tricky. Don't modify below unless you really know what you're doing!
// ----------------- START RECURSIVE CAT LIST ----------------
cat_query(); // make sure the caches are loaded
if( ! isset
( $cat_array ) ) $cat_array =
array();
* callback to start sublist
{ // callback to start sublist
if( $level >
0 ) echo
"\n",$cat_group_start,"\n";
* callback to display sublist element
{ // callback to display sublist element
global $blogfilename, $cat_array, $cat_line_start, $cat_line_checkbox;
echo
'<label><input type="checkbox" name="catsel[]" value="'.
$cat_ID.
'"';
{ // This category is in the current selection
echo
' checked="checked"';
{ // This category is in the current selection
* callback to display sublist element
{ // callback to display sublist element
* callback to end sublist
{ // callback to end sublist
if( $level >
0 ) echo
$cat_group_end,"\n";
{ // We want to display cats for one blog
echo
"\n",$cat_group_start,"\n";
{ // We want to display a link to all cats:
echo
$cat_line_start,"\n";
echo
'<a href="',get_bloginfo('blogurl'),'">',$cat_all,'</a>';
cat_children( $cache_categories, $blog, NULL, 'cat_list_before_first', 'cat_list_before_each', 'cat_list_after_each', 'cat_list_after_last', 0 );
echo
"\n",$cat_group_end,"\n";
{ // We want to display cats for all blogs
{ # by uncommenting the following lines you can hide some blogs
// if( $curr_blog_ID == 2 ) continue; // Hide blog 2...
if( ($curr_blog_ID ==
1) &&
empty( $cat_all ) ) continue; // Hide blog 1 if requested
// run recursively through the cats
cat_children( $cache_categories, $curr_blog_ID, NULL, 'cat_list_before_first', 'cat_list_before_each', 'cat_list_after_each', 'cat_list_after_last', 1 );
// ----------------- END RECURSIVE CAT LIST ----------------