<?PHP
        $link = navcontainer;
        $desc = "Edit nav box inner container style.";
        include "dmtop.php";
        include "dmbot.php";
?><div class="navcontainer"><?PHP
//........................
$table = "$prefix" . "CATEGORIES";
$tablebeta = "$prefix" . "OBJECTS";
//........................
?>
<?PHP $langtable = "$prefix" . "CATEGORIES"; ?>
<h2><?PHP
if (empty($h2)) {
        $link = h2;
        $desc = "Edit category header.";
        include "dmtop.php";
} ?>
<?PHP /* (LANGUAGE) */ $t = "Categories"; $f = "categories"; $altpage = homefront; include "langinc.php"; /* (LANGUAGE) */ ?>
<?PHP
if ($h2 != 2)
        include "dmbot.php";
?></h2>
<?PHP

//........................

$sqlC = "SELECT * FROM $table WHERE PARENT = '$parent' ORDER BY TITLE ASC";
$resultC = @mysql_query($sqlC);
while($rowC = @mysql_fetch_array($resultC)) {
        $crow = $rowC[ID];

        $sqlcount = "SELECT count(*) FROM $tablebeta WHERE CATEGORY LIKE '%$crow%'";
        $rescount = @mysql_query($sqlcount);
        $rowcount = @mysql_fetch_row($rescount);

        $categorylink = "index.php?page=browse&id=$crow&ln=$_GET[ln]";

        if ($rowxxx[MR] == Enabled) {
                if ($rowC[TITLE] != '')
                        $categorylink = EdURL($rowC[TITLE]);
        }

//.....................
?>
<?PHP /* DESIGN */ if (empty($linkmedium)) { $link = linkmedium; $desc = "Edit medium link style."; include "dmtop.php"; } $linkmedium = 1; /* DESIGN */ ?>
<span class="linkmedium"><a href="<?php echo $categorylink; ?>"><?php /* CONTENTLN */ $t = "$rowC[TITLE]"; $field = "TITLE" . "$_GET[ln]"; $id = $crow; include "langinccontent.php"; /* CONTENTLN */ ?></a><?php if (!empty($rowcount[0])) ECHO " ($rowcount[0])"; ?></span><?PHP if ($linkmedium != 2) include "dmbot.php"; $linkmedium = 2; ?><br>
<?PHP
//........................

$sqlD = "SELECT * FROM $table WHERE PARENT = '$rowC[ID]' ORDER BY TITLE ASC";
$resultD = @mysql_query($sqlD);
while($rowD = @mysql_fetch_array($resultD)) {
        $crow = $rowD[ID];
        $sqlcount = "SELECT count(*) FROM $tablebeta WHERE CATEGORY LIKE '%$crow%'";
        $rescount = @@mysql_query($sqlcount);
        $rowcount = @mysql_fetch_row($rescount);

        $categorylink = "index.php?page=browse&id=$crow&ln=$_GET[ln]";

        if ($rowxxx[MR] == Enabled) {
                if ($rowD[TITLE] != '')
                        $categorylink = EdURL($rowD[TITLE]);
}
//.....................
?>
<?PHP /* DESIGN */ if (empty($linksmall)) { $link = linksmall; $desc = "Edit small link style."; include "dmtop.php"; } $linksmall = 1; /* DESIGN */ ?>
<span style="margin-left: 20px;" class="linksmall"><a href="<?php echo $categorylink; ?>"><?php /* CONTENTLN */ $t = "$rowD[TITLE]"; $field = "TITLE" . "$_GET[ln]"; $id = $crow; include "langinccontent.php"; /* CONTENTLN */ ?></a><?php if (!empty($rowcount[0])) ECHO " ($rowcount[0])"; ?></span><?PHP if ($linksmall != 2) include "dmbot.php"; $linksmall = 2; ?><br>
<?PHP
//........................

$sqlE="SELECT * FROM $table WHERE PARENT = '$rowD[ID]' ORDER BY TITLE ASC";
$resultE = @mysql_query($sqlE);
while($rowE = @mysql_fetch_array($resultE)) {
        $crow = $rowE[ID];
        $sqlcount = "SELECT count(*) FROM $tablebeta WHERE CATEGORY LIKE '%$crow%'";
        $rescount = @@mysql_query($sqlcount);
        $rowcount = @mysql_fetch_row($rescount);

        $categorylink = "index.php?page=browse&id=$crow&ln=$_GET[ln]";

        if ($rowxxx[MR] == Enabled) {
                if ($rowE[TITLE] != '')
        $categorylink = EdURL($rowE[TITLE]);
        }
//.....................
?>
<?PHP /* DESIGN */ if (empty($linkverysmall)) { $link = linkverysmall; $desc = "Edit tiny link style."; include "dmtop.php"; } $linkverysmall = 1; /* DESIGN */ ?>
<span style="margin-left: 37px;" class="linkverysmall"><a href="<?php echo $categorylink; ?>"><?php /* CONTENTLN */ $t = "$rowE[TITLE]"; $field = "TITLE" . "$_GET[ln]"; $id = $crow; include "langinccontent.php"; /* CONTENTLN */ ?></a><?php if (!empty($rowcount[0])) ECHO " ($rowcount[0])"; ?></span><?PHP if ($linkverysmall != 2) include "dmbot.php"; $linkverysmall = 2; ?><br>
<?PHP }}} ?></div>
