Beispiel #1
0
    exit;
}
$query = "SELECT * from " . $module_name . " where id=" . $id;
$Q->query($DB, $query);
$count = $Q->numrows();
if ($count == 0) {
    exit;
}
$row = $Q->getrow();
$parent = $row[rid];
if ($parent == "" || $parent == 0 || !isset($parent)) {
    $parent = "";
}
if ($parent != "") {
    $query = "SELECT * from " . $module_name . " where id=" . $parent;
    $Q->query($DB, $query);
    $row1 = $Q->getrow();
    $aaname = $row1[aname];
} else {
    exit;
}
$fields = getfieldsname($aaname, $module_adminconf . $adminusername . ".txt");
if ($fields[5] != "") {
    include "_inc/_att.php";
} else {
    exit;
}
?>

</body>
</html>
Beispiel #2
0
function loadmenu($rid, $sshow, $sadd, $slist, $sedit, $rule24)
{
    global $menurows, $level, $adminlanguage, $module_name, $lt, $structure, $root, $adminusername, $module_adminconf;
    $rule24 = trim($rule24);
    $rule24 = ereg_replace("\\\\\\'", "'", $rule24);
    if ($rule24 != "") {
        $rule24 = "and " . $rule24;
    }
    //$query="select * from ".$module_name." where lang='".$adminlanguage."' and rid=".$rid." ".$rule24." order by date desc";
    //$Q->query($DB,$query);
    $count = count($menurows);
    $rows = "";
    $cc2 = 0;
    for ($i = 0; $i < $count; $i++) {
        if ($menurows[$i][rid] == $rid) {
            $rows[] = $menurows[$i];
            $cc2++;
        }
    }
    $count = $cc2;
    if (strlen(trim($sshow)) == 0) {
        array_pop($structure);
        return 0;
    }
    $color = "#746541";
    $eadd[0] = "<font color=" . $color . ">[ " . $lt[1] . " ]</font>";
    $eadd[1] = "module/index.php?page=add&parent=" . $rid;
    $eadd[2] = $level;
    $elist[0] = "<font color=" . $color . ">[ " . $lt[2] . " ]</font>";
    $elist[1] = "module/index.php?page=view&parent=" . $rid;
    $elist[2] = $level;
    $eedit[0] = "<font color=" . $color . ">[ " . $lt[3] . " ]</font>";
    $eedit[1] = "module/index.php?page=edit&id=" . $rid;
    $eedit[2] = $level;
    if ($root != "") {
        $structure[] = $eadd;
        $structure[] = $elist;
        $structure[] = $eedit;
    } else {
        if ($sadd != "no") {
            $structure[] = $eadd;
        }
        if ($slist != "no") {
            $structure[] = $elist;
        }
        if ($sedit != "no") {
            $structure[] = $eedit;
        }
    }
    if ($level == 0) {
        $ss2[0] = "---";
        $ss2[1] = "#";
        $ss2[2] = $level;
        $structure[] = $ss2;
    }
    for ($i = 0; $i < $count; $i++) {
        $item[0] = ereg_replace("'", "&#39;", $rows[$i][name]);
        //	$item[0]=ereg_replace("\"","&quot;",$item[0]);
        $item[1] = "#";
        $item[2] = $level;
        $structure[] = $item;
        $fields = getfieldsname($rows[$i][aname], $module_adminconf . $adminusername . ".txt");
        $sshow = trim($fields[18]) != "" ? "yes" : "";
        $level++;
        loadmenu($rows[$i][id], $sshow, $fields[19], $fields[20], $fields[21], $fields[24]);
        $level--;
    }
    return 0;
}