}
    echo "<br>Current_file:";
    echo "<a href=" . $surl . "?&" . $word . "&file_browser&file=";
    echo urlencode($p);
    echo ">" . $p . "</a>";
}
echo "<br>";
echo "Start_dir:";
echo "&ensp;&ensp;&ensp;";
echo "<a href=" . $surl . "?&" . $word . "&file_browser&file=";
echo urlencode($ps);
echo ">" . $ps . "</a>";
echo "<br>";
if (isset($_GET['file'])) {
    echo "Free Space:";
    get_space(urldecode($_GET['file']));
    echo "gb";
}
echo "</td>";
?>

<style type="text/css">
body { background-color:#8B8989;font-family:trebuchet Ms; color:black }

textarea {
border-top-width: 1px; 
font-weight: bold; 
border-left-width: 1px; 
font-size: 10px; 
border-left-color: #8B8989; 
background:#8B8989; 
Пример #2
0
        $bytes /= 1024;
        $index++;
    }
    $bytes = round($bytes, 2);
    return array($bytes, $index, $type[$index] . "b");
}
function get_space()
{
    //    ini_set("display_errors", 1);
    $data = humanSize(disk_total_space("/"));
    $str = $data[0] . " " . $data[2];
    $data = humanSize(disk_free_space("/"), $data[1]);
    $str = $data[0] . "/" . $str;
    return $str;
}
$f_data[] = array('space_use', get_space());
// получение времени работы системы (сервера) - функция не используется
function get_uptime()
{
    $uptime = exec("uptime");
    $uptime = explode(",", substr($uptime, strpos($uptime, "up") + 3));
    $time = explode(":", $uptime[1]);
    if (!isset($time[1])) {
        $time[1] = str_replace(" min", "", $time[0]);
        $time[0] = 0;
    }
    $uptime = $uptime[0] . " " . trim($time[0]) . "h " . trim($time[1]) . "m";
    // добавил функцию trim к двум переменным
    return $uptime;
}
// $f_data[] = array('uptime', get_uptime());
Пример #3
0
function get_cate_list($pid = 0, $child = false, $type = 'article')
{
    global $menu_lev;
    $menu_lev++;
    $rearr = array();
    if (!$child and empty($rearr)) {
        $rearr[0] = '请选择----';
    }
    $where['status'] = 1;
    $where['pid'] = $pid;
    $where['category_type'] = $type;
    //if(!APP_DEBUG)$where['dev_show']=0;
    $list = M('category')->where($where)->order('sort asc')->select();
    if ($list) {
        foreach ($list as $val) {
            if ($child) {
                $rearr[$val['category_id']] = get_space($menu_lev) . $val['title'];
            } else {
                $rearr[$val['category_id']] = $val['title'];
            }
            $temarr = get_cate_list($val['category_id'], true, $type);
            foreach ($temarr as $key => $v) {
                $rearr[$key] = $v;
            }
        }
    }
    $menu_lev--;
    return $rearr;
}