예제 #1
0
$f=clean($_GET['file']);

//ob_start();

if(@$_GET['size']=='small' || !empty($_GET['info'])) list($w,$h)=array(160,120);
else if(@$_GET['size']=='normal') list($w,$h)=array(220,220);
else if(@$_GET['size']=='big') list($w,$h)=array(620,460);
else die();

$ret = -1;

setreadable($f, true);

if(preg_match('/Darwin/is', PHP_OS))
{
	$cmd = ROOT.'/full/thumbnailer '.escapeshellarg(abs_path($f)).' '.escapeshellarg($pr = get_tmp_dir().'/'.uniqid(rand()).'.jpg').' '.$w.' '.$h;
	
	//echo $cmd."<bR>";
	
	/* Code specially for MAMP, which spoils some environment variables... */
	
	putenv("DYLD_LIBRARY_PATH=");
	
	exec($cmd, $out, $ret);
	
	if($ret == 0)
	{
		header('content-type: image/jpeg');
		
		readfile($pr);
		
예제 #2
0
 function draw_dir_tree($files_path, $files_url, $file_type = '', &$id, $level = 1)
 {
     global $initial_files_path;
     global $initial_files_url;
     global $del_path;
     global $text;
     global $lang;
     global $cur_dir_id;
     //    global $last_id;
     //    global $last_path;
     //    global $last_url;
     //prepare list of files and directories
     $entries = array();
     $files = array();
     $indx = 1;
     $abs_files_path = abs_path($files_path);
     $handle = @opendir($abs_files_path);
     if ($handle) {
         while (($file = readdir($handle)) !== false) {
             if ($file != '.' && $file != '..') {
                 if (is_file($abs_files_path . $file)) {
                     //files
                     $files[] = $file;
                 } else {
                     //directory
                     $entries[$indx]['name'] = $file;
                     $entries[$indx]['is_dir'] = true;
                     $indx++;
                 }
             }
         }
         closedir($handle);
     } else {
         echo $text['WrongFilesPath'] . '&nbsp;"' . $files_path . '"!';
         return;
     }
     usort($entries, "cmp");
     usort($files, "cmp");
     //add list of files to list of directories
     while (list($k, $val) = each($files)) {
         $entries[$indx++]['name'] = $val;
     }
     if ($level > 1 && !($del_path && ereg("^{$files_path}(.*)", $del_path))) {
         $closed = true;
     } else {
         $closed = false;
     }
     if ($level == 1) {
         global $re_set_total_size;
         if ($re_set_total_size) {
             $total_dir_size = get_total_dir_size(abs_path(stripslashes($files_path)));
             echo '<tr><td class="re_remote_dirsize">' . $text['FreeSpace'] . ':&nbsp;' . convert_file_size($re_set_total_size - $total_dir_size) . '/' . convert_file_size($re_set_total_size) . '</td></tr>';
         }
         echo '<tr>';
         echo '<td>';
         echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td>';
         echo '<b><a class="re_remote" id="dir_a' . $id . '" href="javascript: set_cur_dir(' . $id . ',\'' . $initial_files_path . '\',\'' . $initial_files_url . '\');" style="color:red">' . $text['root'] . '</a></b>';
         // style="color:red"
         echo '</td>';
         echo '<td align="right">';
         global $re_set_can_create_dir;
         if ($re_set_can_create_dir) {
             echo '<a class="re_remote" href="#" onclick="window.remote_files_form.submit(); return false;">' . $text['CreateFolder'] . '</a>';
         } else {
             echo '&nbsp';
         }
         echo '</td>';
         echo '</tr>';
         echo '</table>';
         echo '</td>';
         echo '</tr>';
     }
     echo '<tr height=0><td height=0><div id="dir_div' . $id . '"';
     //if just created/renamed or deleted file/dir, make all parent dirs visible
     if ($closed) {
         echo 'style="display:none;"';
     }
     echo '>';
     echo '<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">';
     //adjust row heights
     echo '<tr><td>';
     echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td>';
     echo '</td></tr></table>';
     echo '</td></tr>';
     //draw content of the current directory
     if ($entries) {
         global $re_set_can_rename_file;
         global $re_set_can_delete_file;
         global $re_set_can_rename_dir;
         global $re_set_can_delete_dir;
         while (list($k, $val) = each($entries)) {
             $file = $val['name'];
             if (!isset($val['is_dir']) || !$val['is_dir']) {
                 //files
                 switch ($file_type) {
                     case "image":
                     case "flash":
                         $size = @getimagesize($abs_files_path . $file);
                         if ($size[2] != 4 && $size[2] != 13 && $file_type == 'image' && $size[2] || ($size[2] == 4 || $size[2] == 13) && $file_type == 'flash') {
                             //image&flash
                             echo "<tr onmouseover=\"bgColor='#6699CC';\" onmouseout=\"bgColor='';\"><td width=\"100%\">\n";
                             echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td>';
                             echo indent($level);
                             echo '<a class="re_remote" href="#" onClick="select_remote_file(\'' . correct_path($files_url . $file) . '\',' . $size[0] . ',' . $size[1] . '); return false;">' . $file . '</a>&nbsp;';
                             echo "</td>";
                             echo '<td width="1">';
                             if ($re_set_can_rename_file) {
                                 echo '<a class="re_remote" href="?files_path=' . $initial_files_path . '&files_url=' . $initial_files_url . '&file_type=' . $file_type . '&action=rename&del_path=' . $files_path . '&file=' . rawurlencode($file) . '&lang=' . $lang . (isset($_SESSION) ? '&' . SID : '') . '">r</a>';
                             }
                             echo '&nbsp;</td>';
                             echo '<td width="1">';
                             if ($re_set_can_delete_file) {
                                 echo '<a class="re_remote" href="?files_path=' . $initial_files_path . '&files_url=' . $initial_files_url . '&file_type=' . $file_type . '&action=delete&del_path=' . $files_path . '&file=' . rawurlencode($file) . '&lang=' . $lang . (isset($_SESSION) ? '&' . SID : '') . '" onclick="javascript: if (window.confirm(\'' . $text['Delete'] . ' \\\'' . str_replace('\'', '\\\'', $file) . '\\\'?\')) return true; else return false;">x</a>';
                             }
                             echo '</td>';
                             //                echo '<td width="1"><a class="re_remote" href="javascript: window.location = \'?files_path='.$initial_files_path.'&files_url='.$initial_files_url.'&file_type='.$file_type.'&action=rename&del_path='.$files_path.'&file='.$file.'&lang='.$lang.'\';">r</a>&nbsp;</td>';
                             //                echo '<td width="1"><a class="re_remote" href="javascript: if (window.confirm(\'Delete \\\''.$file.'\\\'?\')) window.location = \'?files_path='.$initial_files_path.'&files_url='.$initial_files_url.'&file_type='.$file_type.'&action=delete&del_path='.$files_path.'&file='.$file.'&lang='.$lang.'\';">x</a></td>';
                             echo '</tr></table></td>';
                             echo "</tr>\n";
                             //adjust row heights
                             echo '<tr><td>';
                             echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td>';
                             echo '</td></tr></table>';
                             echo '</td></tr>';
                         }
                         break;
                     default:
                         echo "<tr onmouseover=\"bgColor='#6699CC';\" onmouseout=\"bgColor='';\"><td width=\"100%\">\n";
                         echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td>';
                         echo indent($level);
                         echo '<a class="re_remote" href="#" onClick="select_remote_file(\'' . correct_path($files_url . $file) . '\'); return false;">' . $file . '</a>&nbsp;';
                         echo "</td>";
                         echo '<td width="1">';
                         if ($re_set_can_rename_file) {
                             echo '<a class="re_remote" href="?files_path=' . $initial_files_path . '&files_url=' . $initial_files_url . '&file_type=' . $file_type . '&action=rename&del_path=' . $files_path . '&file=' . rawurlencode($file) . '&lang=' . $lang . (isset($_SESSION) ? '&' . SID : '') . '">r</a>';
                         }
                         echo '&nbsp;</td>';
                         echo '<td width="1">';
                         if ($re_set_can_delete_file) {
                             echo '<a class="re_remote" href="?files_path=' . $initial_files_path . '&files_url=' . $initial_files_url . '&file_type=' . $file_type . '&action=delete&del_path=' . $files_path . '&file=' . rawurlencode($file) . '&lang=' . $lang . (isset($_SESSION) ? '&' . SID : '') . '" onclick="javascript: if (window.confirm(\'' . $text['Delete'] . ' \\\'' . str_replace('\'', '\\\'', $file) . '\\\'?\')) return true; else return false;">x</a>';
                         }
                         echo '</td>';
                         //              echo '<td width="1"><a class="re_remote" href="javascript: window.location = \'?files_path='.$initial_files_path.'&files_url='.$initial_files_url.'&file_type='.$file_type.'&action=rename&del_path='.$files_path.'&file='.rawurlencode($file).'&lang='.$lang.'\';">r</a>&nbsp;</td>';
                         //              echo '<td width="1"><a class="re_remote" href="javascript: if (window.confirm(\'Delete \\\''.$file.'\\\'?\')) window.location = \'?files_path='.$initial_files_path.'&files_url='.$initial_files_url.'&file_type='.$file_type.'&action=delete&del_path='.$files_path.'&file='.$file.'&lang='.$lang.'\';">x</a></td>';
                         echo '</tr></table></td>';
                         echo "</tr>\n";
                         //adjust row heights
                         echo '<tr><td>';
                         echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td>';
                         echo '</td></tr></table>';
                         echo '</td></tr>';
                         break;
                 }
                 //switch
             } else {
                 //directories
                 $id++;
                 //get unique div id
                 if (!($del_path && ereg("^{$files_path}{$file}/(.*)", $del_path))) {
                     $closed = true;
                 } else {
                     $closed = false;
                     if ($del_path == $files_path . $file . '/') {
                         $cur_dir_id = $id;
                     }
                 }
                 echo "<tr onmouseover=\"bgColor='#6699CC';\" onmouseout=\"bgColor='';\"><td width=\"100%\">\n";
                 echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td>';
                 echo indent($level);
                 echo '<img width="11" height="11" id="dir_img' . $id . '" style="cursor:hand" onclick="switch_div(' . $id . ');" src="images/';
                 if (!$closed) {
                     echo 'minus.gif';
                 } else {
                     echo 'plus.gif';
                 }
                 echo '">&nbsp;';
                 echo '<b><a class="re_remote" id="dir_a' . $id . '" href="javascript: set_cur_dir(' . $id . ',\'' . str_replace('\'', '\\\'', $files_path . $file) . '/\',\'' . str_replace('\'', '\\\'', $files_url . $file) . '/\');">' . $file . '</a></b>&nbsp;</td>';
                 echo '<td width="1">';
                 if ($re_set_can_rename_dir) {
                     echo '<a class="re_remote" href="?files_path=' . $initial_files_path . '&files_url=' . $initial_files_url . '&file_type=' . $file_type . '&action=rename&del_path=' . $files_path . '&file=' . rawurlencode($file) . '&lang=' . $lang . (isset($_SESSION) ? '&' . SID : '') . '">r</a>';
                 }
                 echo '&nbsp;</td>';
                 echo '<td width="1">';
                 if ($re_set_can_delete_dir) {
                     echo '<a class="re_remote" href="?files_path=' . $initial_files_path . '&files_url=' . $initial_files_url . '&file_type=' . $file_type . '&action=delete&del_path=' . $files_path . '&file=' . rawurlencode($file) . '&lang=' . $lang . (isset($_SESSION) ? '&' . SID : '') . '" onclick="javascript: if (window.confirm(\'' . $text['Delete'] . ' \\\'' . str_replace('\'', '\\\'', $file) . '\\\'?\')) return true; else return false;">x</a>';
                 }
                 echo '</td>';
                 //          echo '<td width="1"><a class="re_remote" href="javascript: window.location = \'?files_path='.$initial_files_path.'&files_url='.$initial_files_url.'&file_type='.$file_type.'&action=rename&del_path='.$files_path.'&file='.rawurlencode($file).'&lang='.$lang.'\';">r</a>&nbsp;</td>';
                 //          echo '<td width="1"><a class="re_remote" href="javascript: if (window.confirm(\'Delete \\\''.$file.'\\\'?\')) window.location = \'?files_path='.$initial_files_path.'&files_url='.$initial_files_url.'&file_type='.$file_type.'&action=delete&del_path='.$files_path.'&file='.rawurlencode($file).'&lang='.$lang.'\';">x</a></td>';
                 echo '</tr></table></td>';
                 echo "</tr>\n";
                 draw_dir_tree($files_path . $file . '/', $files_url . $file . '/', $file_type, $id, $level + 1);
             }
         }
     }
     echo '</table></div></td></tr>';
 }
예제 #3
0
 * Also take in account, that if XSLT style sheets are used,
 * special file:/// prefixed path values are needed.
 *
 */
// Always flush output
ob_implicit_flush();
// This script runs for a long time
set_time_limit(0);
// ......:ARGUMENT PARSING:.....................................................
$not_windows = 0 < strcasecmp('WIN', PHP_OS);
// The dir for PHP. If the cygwin wasn't compiled on Cygwin, the path needs to be stripped.
$out_dir = $not_windows || !strcasecmp('CYGWIN', php_uname()) ? '/tmp/svn/doc-en/doc-base' : abs_path(strip_cygdrive('/tmp/svn/doc-en/doc-base'));
$src_dir = $not_windows || !strcasecmp('CYGWIN', php_uname()) ? '/tmp/svn/doc-en/doc-base' : abs_path(strip_cygdrive('/tmp/svn/doc-en/doc-base'));
$base_dir = $not_windows || !strcasecmp('CYGWIN', php_uname()) ? '/tmp/svn/doc-en/doc-base' : abs_path(strip_cygdrive('/tmp/svn/doc-en/doc-base'));
$root_dir = $not_windows || !strcasecmp('CYGWIN', php_uname()) ? '/tmp/svn/doc-en' : abs_path(strip_cygdrive('/tmp/svn/doc-en'));
$only_dir = $not_windows || !strcasecmp('CYGWIN', php_uname()) ? '/tmp/svn/doc-en/en' : abs_path(strip_cygdrive('/tmp/svn/doc-en/en'));
// The language encoding to use
$encoding = 'utf-8';
// ......:ENTITY CREATION:......................................................
// Put all the file entities into $entities
$entities = array();
file_entities($only_dir ?: "{$root_dir}/en", "{$root_dir}/en", "{$root_dir}/en", $entities);
// Open file for appending and write out all entitities
$fp = fopen("{$base_dir}/entities/file-entities.ent", "w");
if (!$fp) {
    die("ERROR: Failed to open {$base_dir}/entities/file-entities.ent for writing\n");
}
echo "Creating file {$base_dir}/entities/file-entities.ent... ";
// File header
fputs($fp, "<!-- DON'T TOUCH - AUTOGENERATED BY file-entities.php -->\n\n");
// The global function index page is special
예제 #4
0
 $new_file_size = filesize($local_file);
 //check if size of the file do not exceed max limit
 if ($re_set_max_size < 0 || $new_file_size <= $re_set_max_size) {
     //calculate total size if necessary as it could be slow if
     //number of files and folder is very big
     if ($re_set_total_size > 0) {
         $total_dir_size = get_total_dir_size(abs_path(stripslashes($initial_files_path)));
     } else {
         $total_dir_size = false;
     }
     if ($re_set_total_size == 0 || $total_dir_size === false || $new_file_size + $total_dir_size <= $re_set_total_size) {
         $name = $_FILES['local_file']['name'];
         if (!$name) {
             $name = $HTTP_POST_FILES['local_file']['name'];
         }
         $upload_file = abs_path(stripslashes($files_path . $name));
         //check if can override existing file if necessary
         if (!file_exists($upload_file) || $re_set_allow_override) {
             $size = @getimagesize($local_file);
             $lower_file_ext = strtolower(file_ext($name));
             if ((!$re_set_avail_files || in_array($lower_file_ext, $re_set_avail_files)) && (!$re_set_not_avail_files || !in_array($lower_file_ext, $re_set_not_avail_files))) {
                 $avail_ext = true;
                 if ($size[2] != 4 && $size[2] != 13 && $size[2]) {
                     //image
                     //determine type of image
                     $lower_file_ext = get_image_ext($size[2]);
                     if ((!$re_set_avail_images || in_array($lower_file_ext, $re_set_avail_images)) && (!$re_set_not_avail_images || !in_array($lower_file_ext, $re_set_not_avail_images))) {
                         //check max image size limit
                         if ((!$re_set_max_image_size[0] || $size[0] <= $re_set_max_image_size[0]) && (!$re_set_max_image_size[1] || $size[1] <= $re_set_max_image_size[1])) {
                         } else {
                             $wrong_image_size = true;
예제 #5
0
파일: ftp.php 프로젝트: bakyt/Dolphin.php
function d_ftpcom($what, $file1=false, $file2=false, $add=false)
{
	global $CFG;
	if(!$CFG['ftp']) return false;
	
	///////
	//global $FTPLOG;
	//if(!$FTPLOG)
	//{
	//	$FTPLOG=fopen(ROOT.'/ftplog.txt','a');
	//	fputs($FTPLOG,"--------------------\n");
	//}
	//fputs($FTPLOG, "$what $file1 $file2 $add\n");
	///////
	
	if(!function_exists($what='d_ftp'.$what)) return d_error('Cannot use FTP: command '.substr($what,5).' is not implemented.');
	
	$home=abs_path($CFG['ftp']['dir'],false);
	if($home[strlen($home)-1]!='/') $home.='/';
	d_ftpchdir($home);
	
	/* As $file1 (or $file2) must look like "$home/$relative_path",
	   the "$home" itself will not be considered as correct path.
	   So, a little trick is used: "$home" is translated to "$home/."
	   and everything works (I hope so :)) */
	
	foreach(array('file1','file2') as $v)
	{
		$$v=abs_path($$v,false);
		if($$v.'/' == $home) $$v .= '/.';
	}
	
	if($file1 && substr($file1,0,strlen($home))!=$home || $file2 && substr($file2,0,strlen($home))!=$home)
	{
		if(!($what=='d_ftpcopy' && is_readable($file1))) return d_error('Cannot use FTP: files are out of the working directory.');
	}
	   
	/* function $what($relpath1, $fullpath1, $relpath2, $fullpath2, $add); */
	return @$what(substr($file1,strlen($home)),$file1,substr($file2,strlen($home)),$file2,$add) || d_error('FTP command failed: '.substr($what,5));
}
예제 #6
0
파일: func.php 프로젝트: bakyt/Dolphin.php
function cpcont($name, &$data)
{
	static $fps = false, $fpd = false; /* File Pointer for Source, ... Destination */
	static $lastfile = false;
	
	global $__perms;
	
	//echo 'Fdadfas';
	
	setwritable(dirname(getcwd().'/'.$name), true);
	
	/* an array( source dir => dest dir ); -- to make copy into the same directory possible */
	if(!isset($data['dirs_replace'])) $data['dirs_replace'] = array();
	
	if(isset($data['lastnewname']))
	{
		$lastnewname = $data['lastnewname'];
	}else
	{
		$lastnewname = false;
	}
	
	if(empty($data['lastfile']) || $data['lastfile'] != $name)
	{
		if(abs_path($data['newdir']) == abs_path(dirname(getcwd().'/'.$name)))
		{
			$lastnewname = abs_path(gen_copy_name($data['newdir'], getcwd().'/'.$name));
			
			$data['dirs_replace'][abs_path(getcwd().'/'.$name)] = abs_path($lastnewname);
		}else
		{
			$lastnewname = abs_path($data['newdir'].'/'.$name);
			
			foreach($data['dirs_replace'] as $k=>$v)
			{
				if(strlen($lastnewname) < strlen($k)) continue;
				
				if(substr($lastnewname,0,strlen($k)) == $k)
				{
					$lastnewname = $v.substr($lastnewname, strlen($k));
					break;
				}
			}
		}
	}
	
	$newname = $data['lastnewname'] = $lastnewname;
	
	if(is_dir($name))
	{
		$lastfile = $data['lastfile'] = $name;
		$_SESSION['DIRS']++;
		return d_mkdir($newname, d_get_rights($name));
	}
	
	if($lastfile != $name)
	{
		if(is_resource($fps)) fclose($fps);
		if(is_resource($fpd)) fclose($fpd);
		
		$lastfile = $data['lastfile'] = $name;
		
		setreadable($name, true);
		
		if(!$fps = fopen($name, 'rb')) return false;
		
		//error_log('name: '.$name.', newname: '.$newname);
		
		setwritable($dn = dirname($newname), true);
		
		//if(!d_chmod($dn, 777)) echo 'F**k!'.reason()."\n";
		
		//echo "rights: ". get_rights($dn,false) ."\n";
		
		if(file_exists($newname))
		{
			setwritable($newname, true);
            $info = get_files_info(array(basename($newname)), $dn);

			if(fseek($fps, sprintf('%u',filesize($newname))) < 0) return false;
		}else
		{
			$_SESSION['FILES']++;
		}
		
		if(!$fpd = fopen($newname, 'ab'))
		{
			$_SESSION['FILES']--; /* this file was counted, so we cancel it's count */
			return false;
		}
		
		$__perms[$newname] = get_rights($name);
	}
	
	$_SESSION['TOTAL_BYTES'] += fwrite($fpd, fread($fps, 65536));
	
	if(feof($fps)) return true;
	
	return array();
}
function Url2Path($name)
{
    $curUrl = dirname($_SERVER["SCRIPT_NAME"]);
    $url = abs_path(trim($name), $curUrl);
    return preg_match('{^/denwer}s', $url) ? '/denwer/www' . $url : getenv("DOCUMENT_ROOT") . $url;
}
예제 #8
0
	break;
case 'paste':
	if(!empty($_SESSION['cut']))
	{
		@set_time_limit(0);
		function full_print($param){ echo $param; }
		
		$_RESULT = paste('full_print');	
	}else
	{
		if(empty($_SESSION['CPCACHE'])) /* CoPy Cache */
		{
			$_SESSION['TOTAL_BYTES'] = $_SESSION['DIRS'] = $_SESSION['FILES'] = 0;
			
			$src = abs_path(dirname($_SESSION['copy'][0]),false).'/';
			$dest = abs_path($_SESSION['DIR'],false).'/';
			
			/*
			if($src!=$dest && substr($dest,0,strlen($src))==$src)
			{
				print('Cannot copy the directory inside itself.');
				$_RESULT = false;
				break;
			}
			*/
			
			foreach($_SESSION['copy'] as $v)
			{
				$v.='/';
				
				if(substr($dest,0,strlen($v))==$v)
예제 #9
0
 public static function getFrameAsData($file, $width, $height, $seconds, $for_html = true, $use_cache = true)
 {
     if ($program = static::findProgram("ffmpeg")) {
         if (file_exists($file)) {
             $param_string = serialize(func_get_args());
             //$hash = sha1(md5_file($file).md5($param_string));
             $time = static::seconds_to_format($seconds);
             $output = abs_path("/upload/frames/out" . md5($param_string) . ".jpg");
             if ($use_cache) {
                 $result = static::getCache(__FUNCTION__ . $param_string);
             }
             if (empty($result['RESULT'])) {
                 $comm = $program . " -ss {$time} -i {$file} -frames:v 1 {$output}";
                 exec($comm);
                 if (file_exists($output)) {
                     if (intval($width) && intval($height)) {
                         $obFile = new CFile();
                         $arFile = \CFile::MakeFileArray($output);
                         $checkfile = $obFile->CheckFile($arFile, 400000, 'image/', 'gif,png,jpeg,jpg');
                         if (empty($checkfile)) {
                             $obFile->ResizeImage($arFile, array("width" => $width, "height" => $height), BX_RESIZE_IMAGE_EXACT);
                             $output = $arFile['tmp_name'];
                         }
                     }
                     $base64data = static::getBase64File($output, $for_html);
                     if (!empty($base64data)) {
                         $result['RESULT'] = $base64data;
                         unlink($output);
                         static::setCache(__FUNCTION__ . $param_string, $result['RESULT']);
                     }
                 }
             }
             return $result['RESULT'];
         }
     }
     return false;
 }
예제 #10
0
function get_info($f)
{
	global $descr;
	
	if(!isset($_REQUEST['type'])) $_REQUEST['type'] = determine_type($f);
	
	if(isset($_REQUEST['file'])) $f = clean($_REQUEST['file'], true);
	
	if($f == lang('My computer'))
	{
		$_RESULT = array(
		'name' => 'details',
		'filename' => htmlspecialchars($f),
		'dir' => false,
		'type' => lang('System folder'),
		);
	}else if(in_array($_REQUEST['type'],array(tDIR,tFILE)))
	{
		if(!@lstat($f)) return null;
		
		$ext=pathinfo($f); @$ext=strtolower($ext['extension']);
		$imgext = array('jpeg','jpe','gif','png','jpg');
		
		if(preg_match('/Darwin/is', PHP_OS)) $imgext = array_merge($imgext, explode(' ','pdf doc docx ppt pptx xls xlsx tiff tif bmp mov avi mpg mp4 tga psd svg eps key pages html'));
		
		$img=in_array($ext,$imgext);
		
		//echo $f;
		
		$real_link = $link_raw = @is_link($f) && function_exists('readlink') ? readlink($f) : false;
		
		if($link_raw !== false && $link_raw[0] != '/') // not absolute link
		{
			$link_raw = abs_path( dirname($f).'/'.$link_raw );
		}
		
		$_RESULT=array(
		'name' => 'details',
		'filename' => htmlspecialchars(basename($f)),
		'filename_encoded' => rawurlencode($f),
		'fullpath' => $f,
		'link' => $link_raw !== false ? htmlspecialchars($real_link) : false,
		'link_raw' => $link_raw,
		'md5(filename)' => md5($f),
		'dir'  => d_is_dir($f),
		'type' => (d_is_dir($f) ? false : get_type($f)),
		'changed' => ((@$t=filemtime($f)) ? date('d F Y, H:i',$t) : false),
		'size' => ( (d_is_dir($f) && !SHOW_DIRSIZE) ? (/*no subdirectories*/!empty($GLOBALS['files']) && sizeof($GLOBALS['dirs'])==0 && !empty($GLOBALS['sz']) ? show_size(true,true,$GLOBALS['sz']) : false) : show_size($f)),
		'size_bytes' => d_filesize($f),
		'thumb' => ($img ? '<div style="padding-bottom: 10px;" align="center"><img src="system/preview.php?file='.rawurlencode($f).'&size=small" align="center"></div>' : false),
		'id3' => (($img && d_filesize($f) < 15*1024*1024 && @$sz=getimagesize($f)) ? 'Dimensions: '.$sz[0].'x'.$sz[1] : ''),
		'owner' => get_owner($f),
		'group' => get_group($f),
		'rights' => d_get_rights($f, false),
		);
	}else if($_REQUEST['type']==tDRIVE)
	{
		$_RESULT=array(
		'name' => 'details',
		'filename' => !empty($_REQUEST['name']) ? $_REQUEST['name'] : $_SESSION['DIR'],
		'type' => $descr[$_REQUEST['icon']],
		'dir' => false,
		);
		if(!empty($_REQUEST['fs'])) $_RESULT['fs'] = $_REQUEST['fs'];
		if($s = disk_free_space($f)) $_RESULT['free']=show_size(true,true,$s);
		if($s = disk_total_space($f)) $_RESULT['total']=show_size(true,true,$s);
	}
	
	return $_RESULT;
}