made a Nuke-Block that shows categories with their sub-cats and number of pics :
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Block_Gallery_Categories */
/* */
/* zeigt alle Kategorien der Coppermine-Galerie an, die eine bestimmte */
/* Kategorie als "Parent" eingetragen haben */
/* */
/* shows all Categories where "Parent" is set to a specific Number */
/************************************************************************/
/* */
/* written by Siegfried Schlossser (sigi) */
/* for PhpNuke-Community (http://www.phpnuke-community.de) */
/* email me at sigi@sigiberlin.de */
/* */
/************************************************************************/
if (eregi("block-Gallery_Categories.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
global $currentlang,$piccount;
switch($currentlang)
{
case "english":
define("_KATTITEL1","Pictures");
define("_KATTITEL2","Wallpaper");
define("_GALLINK","go to gallery");
define("_NOPICS","no pictures...");
define("_STATSUP","update stats");
define("_STATSSUM","total");
break;
default:
define("_KATTITEL1","Bilder");
define("_KATTITEL2","Wallpaper");
define("_GALLINK","Zur Galerie");
define("_NOPICS","keine Bilder...");
define("_STATSUP","Stats updaten");
define("_STATSSUM","Summe");
break;
}
function GetCat($c)
{
global $prefix,$dbi,$piccount;
###################################################
#
# change the following line if you didn't add the
# PhpNuke $prefix to your cpg tables ...
#
###################################################
$result = sql_query("SELECT cid, namee, pic_count FROM ".$prefix."_cpg_categories where parent = '".$c."' ORDER BY namee ", $dbi);
if (sql_num_rows($result,$dbi) <= 0) {
$content = _NOPICS;
return false;
}
while ($row = sql_fetch_array($result,$dbi)) {
$content .="<td><a href=\"modules.php?name=coppermine&cat=".$row["cid"]."\">" .$row['namee'] . "</a></td><td align=\"right\" valign=\"bottom\"><b> ".$row["pic_count"]." </b></td></tr>\n";
$piccount=$piccount+$row["pic_count"];
}
return $content;
}
$content.="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border: 0px; margin-bottom: 5px;\">\n";
$content.="<tr>";
################# vvvvvv hier den Namen eingeben /put the Category Name here
$content.="<td><b>"._KATTITEL1."</td><td> </td></tr>\n";
################# v hier die Nummer der Kategorie eingeben / put the Catid of the Parent category here
$content.=GetCat("2");
$content .="<tr><td>"._STATSSUM.":</td><td align=\"right\" valign=\"bottom\"><b> ".$piccount." </b></td></tr>\n";
$content.="</table>";
######## und eine zweite Kategorie ...
$content.="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border: 0px; margin-bottom: 5px;\">\n";
$content.="<tr>";
$content.="<td><b>"._KATTITEL2."</td><td> </td></tr>\n";
$piccount=0;
$content.=GetCat("9");
$content .="<tr><td>"._STATSSUM.":</td><td align=\"right\" valign=\"bottom\"><b> ".$piccount." </b></td></tr>\n";
$content.="</table>";
$content .= "<center><a href=\"modules.php?name=coppermine\">"._GALLINK."</a></center>";
?>
See it working at my gallery ...
ahh, btw: its for Nuke 5.5, but should work with higher versions also .-.-.-