Example #1
0
function FormatResponse($ligne,$users,$pass){
$page=CurrentPageName();	
$explainPath=null;
	$ligne["PATH"]=trim(urldecode($ligne["PATH"]));
	$f=new filesClass();
	writelogs("Crypt: with $pass",__FUNCTION__,__FILE__,__LINE__);
	$crypt=new SimpleCrypt($pass);
	$uri1="<a href=\"$page?xapian-file=".base64_encode($crypt->encrypt($ligne["PATH"]))."\">";
	$uri=$uri1;
	$text_deco1="color:#0000CC;text-decoration:underline";
	$text_deco=$text_deco1;
	
	if(preg_match("#^file.*#", $ligne["PATH"])){
		$uriE=$ligne["PATH"];
		$uriE=str_replace("file://///", "file://", $uriE);
		$uri="<a href=\"$uriE\" target=_new>";
		$uri1=$uri;
		if(preg_match("#file:\/\/\/\/\/(.+?)\/(.+?)\/(.*?)$#",$ligne["PATH"],$re)){
			$host=$re[1];
			$SharedDir=$re[2];
			$path=dirname($re[3]);
			$explainPath="&nbsp;|&nbsp;<strong style='color:black'>{server}: &laquo;$host&raquo; {folder}: &laquo;$SharedDir&raquo; {path}: &laquo;$path&raquo;</strong>";
		}
	}	
	
	if($_COOKIE["uid"]==null){
		$uri=null;
		$text_deco="font-weight:bold";
	}
	
	
	$ligne["PATH"]=str_replace("'",'`',$ligne["PATH"]);
	$title=$ligne["DATA"];
	if(strlen($title)>200){
		$title=substr($ligne["DATA"],0,200)."...";
	}
	$pourcent="<span style='font-size:28px;text-decoration:none;font-weight:bold;color:black'>{$ligne["PERCENT"]}%&nbsp;</span>";
	
	$body=$ligne["DATA"];
	
	
	$img="img/ext/unknown_small.gif";
	
	$PATH=$ligne["PATH"];
	
	
	$AllowFullPath=AllowFullPath(dirname($PATH));
	$AllowDownload=AllowDownload(dirname($PATH));
	
	
	$file=$PATH;
	if($AllowFullPath==0){
		$file=basename($ligne["PATH"]);
	}
	
	if($AllowDownload==1){
		$text_deco=$text_deco1;$uri=$uri1;
	}
	
	$ext=$f->Get_extension(strtolower($file));
	if(is_file("img/ext/{$ext}_small.gif")){
			$img="img/ext/{$ext}_small.gif";
		}
		
	if(preg_match("#^http.*?#", $ligne["PATH"])){
		$uri="<a href=\"{$ligne["PATH"]}\" target=_new>";
		$text_deco=$text_deco1;
		$img="img/icon-link.png";
	}
	
	$title="$uri<span style='$text_deco;font-size:18px'>$title</span></a>";
	$html="
	
	<table style='width:99%;margin-top:6px'>
	<tr>
		<td>
		<table style='width:100%'>
		<tr>
			
			<td valign='top' width=1%><div style='width:85px'>$pourcent</div></td>
			<td valign='top' width=1% style='background-color:#CCCCCC'>
			<div style='width:30px'>
				<center style='background-color:white;margin-top:3px'><img src='$img' style='margin:5px' align='center'></center>
			</div>
			</td>
			<td valign='top' align='left'>$title
				<div><span style='font-size:small;color:#676767;'>&laquo&nbsp;<strong>{$file}&nbsp;-&nbsp;{size}:{$ligne["SIZE"]}$explainPath</strong>&nbsp;&raquo;&nbsp;-&nbsp;{$ligne["TIME"]}</span></div>
				<div style='font-size:13.5px'>$body</div>
				<div style='font-size:small;color:green;' align='left'>{$ligne["TYPE"]} ({$ligne["SIZE"]})</div>
		</tr>
	
		</table>
	</tr>
	</table>
	";
	
	return $html;	
	
	
	
}
Example #2
0
function FormatResponse($ligne, $users, $pass)
{
    $f = new filesClass();
    $crypt = new SimpleCrypt($pass);
    $uri = "<a href=\"download.attach.php?xapian-file=" . $crypt->encrypt($ligne["PATH"]) . "\">";
    $text_deco = "text-decoration:underline";
    if (!$users->AllowXapianDownload) {
        $text_deco = null;
    }
    $ligne["PATH"] = str_replace("'", '`', $ligne["PATH"]);
    $title = substr($ligne["DATA"], 0, 60);
    $title = "{$uri}<span style='color:#0000CC;{$text_deco};font-size:medium'>{$ligne["PERCENT"]}%&nbsp;{$title}</span></a>";
    $body = $ligne["DATA"];
    $body = wordwrap($body, 100, "<br />\n");
    $img = "img/file_ico/unknown.gif";
    $file = basename($ligne["PATH"]);
    $ext = $f->Get_extension(strtolower($file));
    if (is_file("img/file_ico/{$ext}.gif")) {
        $img = "img/file_ico/{$ext}.gif";
    }
    $html = "\n\t\n\t<table style='width:99%;margin-top:6px'>\n\t<tr>\n\t\t<td>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td valign='top' width=1%><img src='{$img}'></td>\n\t\t\t<td valign='top' width=1%>" . imgtootltip("folderopen.gif", "{path}:{$ligne["PATH"]}<br>{size}:{$ligne["SIZE"]}<br>{date}:{$ligne["TIME"]}") . "</td>\n\t\t\t<td valing='top'>{$title}</td>\n\t\t</tr>\n\t\t</table>\n\t</tr>\n\t<tr>\n\t<td><span style='font-size:small;color:#676767;'>&laquo&nbsp;<strong>{$file}</strong>&nbsp;&raquo;&nbsp;-&nbsp;{$ligne["TIME"]}</span></td>\n\t</tr>\n\t<tr>\n\t<td style='font-size:11px;'>{$body}</td>\n\t</tr>\n\t<tr>\n\t<td style='font-size:small;color:green;' align='left'>{$ligne["TYPE"]} ({$ligne["SIZE"]})</td>\n\t</tr>\t\n\t</table>\n\t";
    return $html;
}