initial commit of file from CVS for smeserver-webshare on Sat Sep 7 21:15:27 AEST 2024
This commit is contained in:
85
root/opt/webshare-tools/phpfm/incl/view.inc.php
Normal file
85
root/opt/webshare-tools/phpfm/incl/view.inc.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
if (!@include_once("./incl/auth.inc.php"))
|
||||
include_once("../incl/auth.inc.php");
|
||||
|
||||
if ($AllowView && isset($_GET['filename']))
|
||||
{
|
||||
$filename = stripslashes($_GET['filename']);
|
||||
|
||||
print "<table class='index' width=800 cellpadding=0 cellspacing=0>";
|
||||
print "<tr>";
|
||||
print "<td class='iheadline' height=21>";
|
||||
print "<font class='iheadline'> $StrViewing \"".htmlentities($filename)."\" $StrAt ".$_GET['size']."%</font>";
|
||||
print "</td>";
|
||||
print "<td class='iheadline' align='right' height=21>";
|
||||
print "<font class='iheadline'><a href='$base_url&path=".htmlentities(rawurlencode($path))."'><img src='icon/back.gif' border=0 alt='$StrBack'></a></font>";
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
print "<tr>";
|
||||
print "<td valign='top' colspan=2>";
|
||||
|
||||
print "<center><br />";
|
||||
|
||||
if (is_file($home_directory.$path.$filename) && is_viewable_file($filename))
|
||||
{
|
||||
$image_info = GetImageSize($home_directory.$path.$filename);
|
||||
$size = $_GET['size'];
|
||||
$zoom_in = $ZoomArray[get_current_zoom_level($size, 1)];
|
||||
$zoom_out = $ZoomArray[get_current_zoom_level($size, -1)];
|
||||
$width = $image_info[0] * $size / 100;
|
||||
$height = $image_info[1] * $size / 100;
|
||||
|
||||
$files = array();
|
||||
if ($open = opendir($home_directory.$path))
|
||||
{
|
||||
while ($file = readdir($open))
|
||||
if (is_file($home_directory.$path.$file) && is_viewable_file($file))
|
||||
$files[] = $file;
|
||||
closedir($open);
|
||||
sort($files);
|
||||
|
||||
if (count($files)>1)
|
||||
{
|
||||
for($i=0;$files[$i]!=$filename;$i++);
|
||||
if ($i==0) $prev = $files[$i+count($files)-1];
|
||||
else $prev = $files[$i-1];
|
||||
if ($i==(count($files)-1)) $next = $files[$i-count($files)+1];
|
||||
else $next = $files[$i+1];
|
||||
}
|
||||
else
|
||||
{
|
||||
$prev = $filename;
|
||||
$next = $filename;
|
||||
}
|
||||
}
|
||||
|
||||
print "<table class='menu' cellpadding=2 cellspacing=0>";
|
||||
print "<tr>";
|
||||
print "<td align='center' valign='bottom'><a href='$base_url&path=".htmlentities(rawurlencode($path))."&filename=".htmlentities(rawurlencode($filename))."&action=view&size=$zoom_in'><img src='icon/plus.gif' width=11 height=11 border=0 alt='$StrZoomIn'> $StrZoomIn</a></td>";
|
||||
print "<td align='center' valign='bottom'><a href='$base_url&path=".htmlentities(rawurlencode($path))."&filename=".htmlentities(rawurlencode($filename))."&action=view&size=$zoom_out'><img src='icon/minus.gif' width=11 height=11 border=0 alt='$StrZoomOut'> $StrZoomOut</a></td>";
|
||||
print "<td align='center' valign='bottom'><a href='$base_url&path=".htmlentities(rawurlencode($path))."&filename=".htmlentities(rawurlencode($filename))."&action=view&size=100'><img src='icon/original.gif' width=11 height=11 border=0 alt='$StrOriginalSize'> $StrOriginalSize</a></td>";
|
||||
print "<td align='center' valign='bottom'><a href='$base_url&path=".htmlentities(rawurlencode($path))."&filename=".htmlentities(rawurlencode($prev))."&action=view&size=$size'><img src='icon/previous.gif' width=11 height=11 border=0 alt='$StrPrevious'> $StrPrevious</a></td>";
|
||||
print "<td align='center' valign='bottom'><a href='$base_url&path=".htmlentities(rawurlencode($path))."&filename=".htmlentities(rawurlencode($next))."&action=view&size=$size'><img src='icon/next.gif' width=11 height=11 border=0 alt='$StrNext'> $StrNext</a></td>";
|
||||
print "</tr>";
|
||||
print "</table><br />";
|
||||
print "<img src='incl/libfile.php?path=".htmlentities(rawurlencode($path))."&filename=".htmlentities(rawurlencode($filename))."&action=view' width='$width' height='$height' alt='$StrImage'>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<font color='#CC0000'>$StrViewFail</font><br /><br />";
|
||||
print "$StrViewFailHelp";
|
||||
}
|
||||
|
||||
print "<br /><br /></center>";
|
||||
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
print "</table>";
|
||||
|
||||
print "<input type='hidden' name='path' value=\"".htmlentities($path)."\">";
|
||||
}
|
||||
else
|
||||
print "<font color='#CC0000'>$StrAccessDenied</font>";
|
||||
|
||||
?>
|
Reference in New Issue
Block a user