This mod is almost as simple as the other "remove album/file number" mods. We just need to add a new template variable which we use for the root category and then check for the current category in theme_display_cat_list to decide which template variable we need to use (I marked those two lines with the comment "// mod").
mndyy, copy the following code to your theme's theme.php file, right before the closing PHP tag ( ?> ):
$template_cat_list_no_cat = <<<EOT
<!-- BEGIN header -->
<tr>
<td class="tableh1" width="100%" align="left">{CATEGORY}</td>
</tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
<tr>
<td class="catrow_noalb" colspan="1"><table border="0"><tr><td align="left">{CAT_THUMB}</td><td align="left"><span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
</tr>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
<tr>
<td class="catrow" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
</tr>
<tr>
<td class="tableb tableb_alternate" colspan="1">{CAT_ALBUMS}</td>
</tr>
<!-- END catrow -->
<!-- BEGIN footer -->
<tr>
<td colspan="1" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
</tr>
<!-- END footer -->
<!-- BEGIN spacer -->
<img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->
EOT;
function theme_display_cat_list($breadcrumb, &$cat_data, $statistics)
{
global $template_cat_list, $lang_cat_list;
global $cat, $template_cat_list_no_cat; // mod
if (!$cat) $template_cat_list = $template_cat_list_no_cat; // mod
if (count($cat_data) > 0) {
starttable('100%');
$template = template_extract_block($template_cat_list, 'header');
$params = array(
'{CATEGORY}' => $lang_cat_list['category'],
'{ALBUMS}' => $lang_cat_list['albums'],
'{PICTURES}' => $lang_cat_list['pictures'],
);
echo template_eval($template, $params);
}
$template_noalb = template_extract_block($template_cat_list, 'catrow_noalb');
$template = template_extract_block($template_cat_list, 'catrow');
foreach($cat_data as $category) {
if (!isset($category['cat_thumb'])) { $category['cat_thumb'] = ''; }
if (count($category) == 3) {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
);
echo template_eval($template_noalb, $params);
} elseif (isset($category['cat_albums']) && ($category['cat_albums'] != '')) {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
'{CAT_ALBUMS}' => $category['cat_albums'],
'{ALB_COUNT}' => cpg_float2decimal($category[2]),
'{PIC_COUNT}' => cpg_float2decimal($category[3]),
);
echo template_eval($template, $params);
} else {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
'{CAT_ALBUMS}' => '',
'{ALB_COUNT}' => cpg_float2decimal($category[2]),
'{PIC_COUNT}' => cpg_float2decimal($category[3]),
);
echo template_eval($template, $params);
}
}
if ($statistics && count($cat_data) > 0) {
$template = template_extract_block($template_cat_list, 'footer');
$params = array('{STATISTICS}' => $statistics);
echo template_eval($template, $params);
}
if (count($cat_data) > 0)
endtable();
echo template_extract_block($template_cat_list, 'spacer');
}