This is not really a bug in the technical sense of the word but I've always found strange the organisation of the cat display in the classic theme, where 2 categories of the same level appear differently if they have albums or just subcategories. Actually the problem is that the only thing that makes the difference between 2 categories is the fact that there is an album directly in it or not. In my example, there's a difference between 2.1 and 2.2 when there should rather be a difference between 2 and 2.1 (in my mind anyway).
There are some really slight modifications to make it possible:
Open /index.php
in the get_subcat_data function, find
if ($pic_count == 0 && $album_count == 0) {
$user_thumb = $ident;
$cat_data[] = array($link, $subcat['description'], 'cat_thumb' => $user_thumb);
} else {
// Check if you need to show subcat_level
if ($level == $CONFIG['subcat_level']) {
$cat_albums = list_cat_albums($subcat['cid']);
} else {
$cat_albums = '';
}
$cat_data[] = array($link, $subcat['description'], $album_count, $pic_count, 'cat_albums' => $cat_albums, 'cat_thumb' => $user_thumb);
}
}
if ($level > 1) {
get_subcat_data($subcat['cid'], $cat_data, $album_set_array, $level -1, $ident . "</td><td><img src=\"images/spacer.gif\" width=\"20\" height=\"1\" border=\"0\" alt=\"\" /></td><td>");
}
change into
if ($pic_count == 0 && $album_count == 0) {
$user_thumb = $ident;
$cat_data[] = array($link, $subcat['description'], 'cat_thumb' => $user_thumb, 'level' => $level);
} else {
// Check if you need to show subcat_level
if ($level == 1) {
$cat_albums = list_cat_albums($subcat['cid']);
} else {
$cat_albums = '';
}
$cat_data[] = array($link, $subcat['description'], $album_count, $pic_count, 'cat_albums' => $cat_albums, 'cat_thumb' => $user_thumb, 'level' => $level);
}
}
if ($level < $CONFIG['subcat_level']) {
get_subcat_data($subcat['cid'], $cat_data, $album_set_array, $level +1, $ident . "</td><td><img src=\"images/spacer.gif\" width=\"20\" height=\"1\" border=\"0\" alt=\"\" /></td><td>");
}
in the get_cat_list function, find
get_subcat_data($cat, $cat_data, $album_set_array, $CONFIG['subcat_level']);
change into
get_subcat_data($cat, $cat_data, $album_set_array, 1);
Open /include/themes.inc.php and /themes/classic/theme.php
in the theme_display_cat_list function, find
if (count($category) == 3) {
change into
if (count($category) == 4) {
Now it would allow to make something like
if (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}' => $category[2],
'{PIC_COUNT}' => $category[3],
'{LEVEL}' => $category[level],
);
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}' => $category[2],
'{PIC_COUNT}' => $category[3],
'{LEVEL}' => $category[level],
);
echo template_eval($template, $params);
}
and use it like
<!-- BEGIN catrow -->
<tr>
<td class="catrow{LEVEL}" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
<td class="catrow{LEVEL}" align="center">{ALB_COUNT}</td>
<td class="catrow{LEVEL}" align="center">{PIC_COUNT}</td>
</tr>
<tr>
<td class="tableb" colspan="3">{CAT_ALBUMS}</td>
</tr>
<!-- END catrow -->
which would also allow to get rid of the $ident and make the indentation with CSS...
I hope I wasn't too confusing ;-)