Próbowalem przerobic inny skrypt i wyszlo mi cos takiego:
<?php
require "functions.php";
require "mysql.php";
$filee = $skr_sql->query($db, "SELECT * FROM pliki WHERE file_id = '$id'", 1);
$config = $skr_sql->query($db,"SELECT * FROM pafiledb_settings",1);
$db[prefix] = 'kategorie';
$tmp_query = $_ENV['QUERY_STRING'];
$category = $skr_sql->query($db, "SELECT * FROM $db[prefix] WHERE cat_id = '$id'", 1);
if ($category[2] == 0) { $locbar = "<a href=\"catpafile.php\" class=\"small\">$config[1]</a> :: <a href='?$tmp_query'> $category[1]</a>"; }
if ($category[2] > 0) {
$parent = $skr_sql->query($db, "SELECT * FROM $db[prefix] WHERE cat_id = '$category[2]'", 1);
$locbar = "<a href=\"catpafile.php\" class=\"small\">$config[1]</a> :: <a href=\"catpafile.php?action=category&id=$parent[0]\" class=\"small\">$parent[1]</a> :: <a href='?$tmp_query'> $category[1]</a>";
}
if ($logged == 1) {
adlocbar($locbar, $user,$str);
adminlinks_viewcat($str,$id);
} else {
locbar($locbar);
}
$result = $skr_sql->query($db, "SELECT * FROM $db[prefix] WHERE cat_parent = '$id' ORDER BY cat_id", 0);
if ($n > 0) {
echo("<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" class=\"headertable\" bordercolor=\"#000000\"> <tr><td width=\"90%\" class=\"headercell\"><center><b>$str[category]</b></center></td><td width=\"10%\" class=\"headercell\"><center><b>$str[files]</td></tr>");
#$result = $skr_sql->query($db, "SELECT * FROM $db[prefix] WHERE cat_parent = '$id' ORDER BY cat_id", 0);
$filesincat = $skr_sql->query($db, "SELECT * FROM pliki WHERE file_cat = '$sub->cat_id'", 2);
echo "<tr><td width=\"90%\" class=\"datacell\"><a href=\"catpafile.php?action=category&id=$sub->cat_id\">$sub->cat_name</a><br><a class=\"smalltext\">» $sub->cat_desc «</a></td><td width=\"10%\" class=\"datacell\"><center>$filesincat</center></td></tr>"; }
}
$result = $skr_sql->query($db, "SELECT * FROM pliki WHERE file_cat = '$id' AND file_pin = '1' ORDER BY file_id", 0);
$date = date("n/j/y", $file->file_time); $ntv = $file->file_totalvotes - 1;
if ($file->file_rating == 0 or
$ntv == 0
) { $rating = 0; } else {$rating = round($file->file_rating/$ntv, 2
); } if ($file->file_posticon == "none" or $file->file_posticon == "none.gif") {
$posticon = " ";
} else {
$posticon = "<img src=\"images/posticons/$file->file_posticon\">";
}
$filelist .= "<tr><td width=\"5%\" align=\"center\" class=\"datacell\">$posticon</td><td width=\"65%\" class=\"datacell\"><a href=\"catpafile.php?action=file&id=$file->file_id\">$file->file_name</a><br><a class=\"smalltext\">» $file->file_desc «</a></td><td width=\"10%\" class=\"datacell\"><center>$date</center></td><td width=\"10%\" class=\"datacell\"><center>$rating/10</center></td><td width=\"10%\" class=\"datacell\"><center>$file->file_dls</center></td></tr>";
}
$numpages = ceil($filesincat / 35
); if ($start + 35 < $filesincat) {
$newstart = $start + 35;
$next = "<a href=\"catpafile.php?action=category&id=$id&start=$newstart&sortby=$sortby\">$str[next] »</a>";
}
if ($start - 35 >= 0) {
$newstart = $start - 35;
$prev = "<a href=\"catpafile.php?action=category&id=$id&start=$newstart&sortby=$sortby\">« $str[prev]</a>";
}
for ($i = 0; $i < $numpages; $i++) {
$newstart = 35*$i;
$pagenum = $i + 1;
if ($newstart == $start) {
$pages .= "$pagenum ";
} else {
$pages .= "<a href=\"catpafile.php?action=category&id=$id&start=$newstart&sortby=$sortby\">$pagenum</a> ";
}
}
$filelist = trim($filelist); ?>
<table width="450px" border="1" cellpadding="2" cellspacing="0" class="headertable" bordercolor="#cccccc">
<tr><td width="5%" class="headercell"></td><td width="65%" class="headercell"><center><b>
<?php echo $str[file]; ?></b></center></td><td width="10%" class="headercell"><center><b>
<?php echo $str[date]; ?></b></center></td><td width="10%" class="headercell"><center><b>
<?php echo $str[rating
]; ?></b></center></td><td width="10%" class="headercell"><center><b>
<?php echo $str[dls
]; ?></b></center></td></tr>
<?php
?>
Wystarczy, że będzie można dodać jeszcze tylko 1 poziom i starczy.
Narazie jest: Poziom1 -> Poziom2 -> Content dla poziom2
Chciałbym zeby bylo chociaż Poziom1 -> Poziom2 -> Poziom3 -> Content dla poziom2
Nie będe potrzebował więcej Poziomów niż 3 no góra 4.