Example #1
0
function folder_list($pid, $dbcon, $vor, $zieldatei)
{
    global $current_dirname;
    $folder = $_SESSION["folder"];
    $pid = intval($pid);
    $userID = intval($_SESSION["wcs_user_id"]);
    $sql = "SELECT f_id, f_name, f_aktiv, f_public FROM " . DB_PREPEND . "phpwcms_file WHERE " . "f_pid=" . intval($pid) . " AND f_aktiv=1 AND f_kid=0 AND f_trash=0 AND " . "(f_public=1 OR f_uid=" . $userID . ") ORDER BY f_sort, f_name";
    $result = mysql_query($sql, $dbcon);
    while ($row = mysql_fetch_array($result)) {
        $dirname = html_specialchars($row["f_name"]);
        //Ermitteln des Aufolderwertes
        if (!isset($folder[$row["f_id"]])) {
            $folder[$row["f_id"]] = 0;
        }
        $folder_status = true_false($folder[$row["f_id"]]);
        //Ermitteln, ob überhaupt abhängige Dateien/Ordner existieren
        $count_sql = "SELECT COUNT(f_id) FROM " . DB_PREPEND . "phpwcms_file WHERE " . "f_pid=" . $row["f_id"] . " AND f_trash=0 AND f_aktiv=1 AND " . "(f_public=1 OR f_uid=" . $userID . ") LIMIT 1";
        if ($count_result = mysql_query($count_sql, $dbcon)) {
            if ($count_row = mysql_fetch_row($count_result)) {
                $count = '<img src="img/leer.gif" height="1" width="2" alt="" border="0" /><a href="' . $zieldatei . "folder=" . $row["f_id"] . '%7C' . $folder_status . '">' . on_off($folder_status, $dirname, 0) . '</a>';
                $count_wert = $count_row[0];
            }
            mysql_free_result($count_result);
        }
        $dirname = '<a href="' . $zieldatei . "files=" . $row["f_id"] . '" title="' . $GLOBALS['BL']['SHOW_FILES1'] . '">' . $dirname . '</a>';
        if ($row["f_id"] == $_SESSION["imgdir"]) {
            $bgcol = ' bgcolor="#FED83F"';
            $current_dirname = $row["f_name"];
        } else {
            $bgcol = '';
        }
        //Aufbau der Zeile
        echo "<tr" . $bgcol . "><td colspan=\"2\"><img src=\"img/leer.gif\" height=\"2\" width=\"1\" alt=\"\" border=\"0\" /></td></tr>\n";
        //Abstand vor
        echo "<tr" . $bgcol . "><td class=\"msglist\" nowrap=\"nowrap\">";
        echo $count . "<img src=\"img/leer.gif\" height=\"1\" width=\"" . ($vor + 6) . "\" border=\"0\" alt=\"\" /><img src=\"img/icons/folder_zu.gif\" border=\"0\" alt=\"\" />";
        //Zellinhalt 1. Spalte
        echo "<img src=\"img/leer.gif\" height=\"1\" width=\"5\" alt=\"\" border=\"0\" />" . $dirname . "</td><td><img src=\"img/leer.gif\" height=\"1\" width=\"5\" alt=\"\" border=\"0\" /></td></tr>\n";
        //Aufbau trennende Tabellen-Zeile
        echo "<tr" . $bgcol . "><td colspan=\"2\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\" alt=\"\" border=\"0\" /></td></tr>\n";
        //Abstand nach
        echo "<tr bgcolor=\"#CDDEE4\"><td colspan=\"2\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\" alt=\"\" border=\"0\" /></td></tr>\n";
        //Trennlinie<img src='img/lines/line-lightgrey-dotted-538.gif'>
        //Weiter, wenn Unterstruktur
        if (!$folder_status && $count_wert) {
            folder_list($row["f_id"], $dbcon, $vor + 18, $zieldatei);
            //, $userID
        }
        //Zaehler mitführen
        $_SESSION["list_zaehler"]++;
    }
    mysql_free_result($result);
}
Example #2
0
    location_folder($dir);
}
xoops_cp_header();
include "mymenu.php";
echo "<h2>" . _AM_UPLOAD_TITLE . "</h2>";
// special files
$sysfile = array('/blank.gif', '/index.html');
if (isset($_GET['ren'])) {
    $file = filename_filter($myts->stripSlashesGPC($_GET['ren']));
    rename_form($file);
} else {
    $dir = isset($_GET['dir']) ? filename_filter($myts->stripSlashesGPC($_GET['dir'])) : '';
    if (!is_dir(UPLOAD_BASE)) {
        mkdir(UPLOAD_BASE);
    }
    folder_list($dir);
    upload_form($dir);
    mkdir_form($dir);
}
xoops_cp_footer();
function unit_kiro($v)
{
    if ($v > 10240 * 1024) {
        return round($v / 1024 / 1024) . "G";
    }
    if ($v > 10240) {
        return round($v / 1024) . "M";
    }
    return $v . "K";
}
function folder_list($dir)