private function path($dir, $list_file = true, $check_children = false)
 {
     $path_hidden = $this->config['setting_system']['path_hidden'];
     $ex_name = explode(',', $path_hidden);
     if (strstr($dir, "*share*")) {
         return $this->path_share();
     }
     $list = path_list($dir, $list_file, $check_children);
     $filelist_new = array();
     $folderlist_new = array();
     foreach ($list['filelist'] as $key => $val) {
         if (in_array($val['name'], $ex_name)) {
             continue;
         }
         if ($val['ext'] == 'oexe') {
             $path = iconv_system($val['path']) . '/' . iconv_system($val['name']);
             $json = json_decode(file_get_contents($path), true);
             if (is_array($json)) {
                 $val = array_merge($val, $json);
             }
         }
         $filelist_new[] = $val;
     }
     foreach ($list['folderlist'] as $key => $val) {
         if (in_array($val['name'], $ex_name)) {
             continue;
         }
         $folderlist_new[] = $val;
     }
     $list['filelist'] = $filelist_new;
     $list['folderlist'] = $folderlist_new;
     //读写权限判断
     $list['path_type'] = 'readable';
     if (is_writable($dir)) {
         $list['path_type'] = 'writeable';
     } else {
         if (!is_readable($dir)) {
             $list['path_type'] = 'not_readable';
         }
     }
     _DIR_OUT($list);
     return $list;
 }
Exemple #2
0
//
$image_size = getimagesize($data['files'][$INDEX]['path']);
// FS READ
$file_size = filesize($data['files'][$INDEX]['path']);
// FS READ
// optionally fetch exifer data
//
if ($CFG_use_exifer) {
    include_once 'exif.php';
    $exif_data = read_exif_data_raw($data['files'][$INDEX]['path'], 0);
}
//////////////////////////////////////////////////////////////////////////////
// assign, display templates
//
$T['current'] =& $data['files'][$INDEX];
$T['current']['image_size'] =& $image_size;
$T['current']['view_size'] = calculate_resize($image_size[0], $image_size[1], $CFG_image_width, $CFG_image_height);
$T['current']['file_size'] = round($file_size / 1024, 0) . ' KB';
if ($CFG_use_exifer) {
    $T['current']['exif_data'] =& $exif_data;
}
$T['next'] =& $data['files'][$INDEX + 1];
$T['prev'] =& $data['files'][$INDEX - 1];
$T['path'] = path_list($IMAGE_DIR);
debug('T', $T);
include "{$CFG_path_template}/header.tpl";
// FS READ
include "{$CFG_path_template}/view.tpl";
// FS READ
include "{$CFG_path_template}/footer.tpl";
// FS READ
Exemple #3
0
 if ($op === 'exit') {
     session_destroy();
     unset($_SESSION['user']);
     ob_clean();
     echo "<a href=?op=login>Logout Ok!Click here to login in!</a>";
 } else {
     if ($op === 'down') {
         echo "start download";
         $dfilename = $_GET['dname'];
         file_put_out($dfilename, true);
     } else {
         $folder_name = $_GET['folder_name'];
         if ($folder_name == "") {
             $file_list = path_list("./");
         } else {
             $file_list = path_list(sprintf("%s", $folder_name));
         }
         $folders = $file_list['folderlist'];
         print sprintf("<p> <a href=%s?folder_name=%s>%s</a>", $_SERVER['PHP_SELF'], $folder_name . "/.", ".");
         print sprintf("<p> <a href=%s?folder_name=%s>%s</a>", $_SERVER['PHP_SELF'], $folder_name . "/..", "..");
         for ($i = 0; $i < count($folders); $i++) {
             $links = sprintf("<p> <a href=%s?folder_name=%s%s>%s</a>", $_SERVER['PHP_SELF'], $folders[$i]['path'], $folders[$i]['name'], $folders[$i]['name']);
             print $links;
         }
         echo "</p>";
         $files = $file_list['filelist'];
         for ($i = 0; $i < count($files); $i++) {
             $links = sprintf("<p> <a href=%s>%s</a> %s %s   <a href=?op=down&dname=%s>down</a>", sprintf("%s%s", $files[$i]['path'], $files[$i]['name']), $files[$i]['name'], $files[$i]['size_friendly'], $files[$i]['mode'], $files[$i]['name']);
             print $links;
         }
         echo "<p>";
 private function path($dir, $list_file = true, $check_children = false)
 {
     $list = path_list($dir, $list_file, $check_children);
     $file_parem = array('filelist' => array(), 'folderlist' => array());
     $path_hidden = $this->config['setting_system']['path_hidden'];
     $ex_name = explode(',', $path_hidden);
     foreach ($list['filelist'] as $key => $val) {
         if (in_array($val['name'], $ex_name)) {
             continue;
         }
         if ($val['ext'] == 'oexe') {
             $path = iconv_system($val['path']) . '/' . iconv_system($val['name']);
             $json = json_decode(file_get_contents($path), true);
             if (is_array($json)) {
                 $val = array_merge($val, $json);
             }
         }
         $file_parem['filelist'][] = $val;
     }
     foreach ($list['folderlist'] as $key => $val) {
         if (in_array($val['name'], $ex_name)) {
             continue;
         }
         $file_parem['folderlist'][] = $val;
     }
     _DIR_OUT($file_parem);
     return $file_parem;
 }
 private function path($dir, $list_file = true, $check_children = false)
 {
     $list = path_list($dir, $list_file, $check_children);
     foreach ($list['filelist'] as $key => $val) {
         if ($val['ext'] == 'oexe') {
             $path = iconv_system($val['path']) . '/' . iconv_system($val['name']);
             $json = json_decode(file_get_contents($path), true);
             if (is_array($json)) {
                 $list['filelist'][$key] = array_merge($val, $json);
             }
         }
     }
     _DIR_OUT($list);
     return $list;
 }