Hallo Nakoda,Nakoda hat geschrieben:...ich wurde gerne die Erste Menüebene mit Grafiken der jeweiligen Kategorien versehen.
Ist das machbar und wenn ja, wie?...
kenne das Modul auch nicht, aber probier mal folgende Version:
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : vpNavigation 0.2
* Author : Ingo van Peeren
* Copyright : Ingo van Peeren (ingo@van-peeren.de)
* Created : 30-03-2005
* Modified : 16-07-2005
************************************************/
#Includes
cInclude("frontend", "includes/functions.navigation.php");
cInclude("classes", "class.frontend.permissions.php");
cInclude("classes", "class.frontend.groups.php");
cInclude("classes", "class.frontend.users.php");
$hauptkategorie = "CMS_VALUE[0]";
$navitems = array();
function nav_feld ($cat) {
global $client, $lang, $cfg, $idcat;
if (!is_object($db)) {
$db = new DB_Contenido;
}
$sql = "SELECT
A.idcat,
B.parentid,
C.name,
C.public,
C.idcatlang
FROM
".$cfg["tab"]["cat_tree"]." AS A,
".$cfg["tab"]["cat"]." AS B,
".$cfg["tab"]["cat_lang"]." AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
B.idclient = '$client' AND
C.idlang = '$lang' AND
C.visible = '1' AND
B.parentid = '$cat'
ORDER BY
A.idtree";
$db->query($sql);
while ( $db->next_record() ) {
$visible = checkCatPermission($db->f("idcatlang"),$db->f("public"));
if ($visible) {
$aktiv = "";
$sub_feld = nav_feld($db->f("idcat"));
if ($db->f("idcat") == $idcat) $aktiv = "active";
elseif ($sub_feld["activepath"]) $aktiv = "activepath";
$nav_feld[] = array("idcat" => $db->f("idcat"),
"name" => $db->f("name"),
"active" => $aktiv,
"sub" => $sub_feld);
if ($aktiv != "") $activepath = $aktiv;
}
}
$rv = array("feld" => $nav_feld,
"activepath" => $activepath);
return $rv;
}
function liste ($array, $indent = " ", $level = 1)
{
global $first;
$pos = 1;
if (is_array($array["feld"])) {
if ($first) {
echo $indent . "<ul id=\"nav\">\n";
$first = 0;
}
else echo $indent . "<ul>\n";
foreach ($array["feld"] as $menupunkt) {
if (1 == $level) {
$cssclass = "navitem_" . $level . "_" . $pos++;
} else {
$cssclass = "";
}
if ($menupunkt["active"] == "active") echo $indent . $indent . "<li id=\"active " . $cssclass . "\">\n";
elseif ($menupunkt["active"] == "activepath") echo $indent . $indent . "<li class=\"activepath " . $cssclass . "\">\n";
else echo $indent . $indent . "<li class=\"" . $cssclass . "\">\n";
if (is_array($menupunkt["sub"]["feld"])) {
echo $indent . $indent . $indent . "<a class=\"daddy\" href=\"front_content.php?idcat=" . $menupunkt["idcat"] . "\">" . $menupunkt["name"] . "</a>\n";
liste($menupunkt["sub"], $indent." ", ++$level);
}
else echo $indent . $indent . $indent . "<a href=\"front_content.php?idcat=" . $menupunkt["idcat"] . "\">" . $menupunkt["name"] . "</a>\n";
echo $indent . $indent . "</li>\n";
}
echo $indent . "</ul>\n";
}
}
/* Create Navigation Array */
$navitems = nav_feld($hauptkategorie);
$first = 1;
liste($navitems, " ", 1);
?>
Code: Alles auswählen
// {level} = Die Navigationsebene, is 1 für die erste Ebene
// {position} = Die POosition der Kategorie in der Navigationsebene
navitem_{level}_{position}
Code: Alles auswählen
#nav .navitem_1_1 {background: transparent url('pfad/zum/bild/fuer/erste/kategorie');}
#nav .navitem_1_2 {background: transparent url('pfad/zum/bild/fuer/zweite/kategorie');}
xmurrix