Location: PHPKode > projects > ZompLog > admin/file_manager.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Zomplog File Manager</title>

<style type="text/css">
   @import "style.css";
   
   body{
   background-color: #FFFFFF;
   background-image: url();
   }
  </style>
  
  <script src="jscripts/multifile_compressed.js"></script>
  
<style type="text/css">
<!--



span.txt
{
	font-family: "Courier New", Courier, monospace;
	font-size: 10pt;
	color: Navy;
}

.box
{
	border: solid 0px #000000;
}

-->
</style>

<script language="javascript" type="text/javascript">
<!--

function showPreview(url, border, width, height, desc)
{

  border = typeof(border) == "undefined" ? 0 : border;
  width = typeof(width) == "undefined" ? 100 : width;
  height = typeof(height) == "undefined" ? 100 : height;
  desc = typeof(desc) == "undefined" ? "" : desc;

  parent.document.getElementById("sp").innerHTML = '<img src="' + url + '" border="' + border + '" width="' + width + '" height="' + height + '"><br>' + desc;

}


/***************************************************
THIS FUNCTION WILL CLEAR THE GENERATED PREVIEW. IT
DOES NOT TAKE ANY ARGUMENTS.
****************************************************/
function clearPreview()
{

  //document.getElementById("sp").innerHTML = "";

}

//-->
</script>
  
</head>

<body>

<?php
include_once("functions.php");
include('config.php');
include("session.php");

include("loadsettings.php");
include("../language/$settings[language].php"); 

//print_r($_FILES);

if(!$_SESSION["loggedIn"]){
	echo ("You are not allowed to view this page, please log in first.");
}
else  
{
// **********************************************************************
// **********************************************************************
// START loggedIn


?>
<div style="width: 98%; background-color: #FFFFFF;">

<table width="100%" border="0">
  <tr>
    <td width="50%"><fieldset>
<legend><?php echo $lang_img_in_upload; ?></legend>



<table width="95%" border="0" cellspacing="0" cellpadding="0">

<tr><td valign="top" width="73%">

<ul type="square">

<?php

$dir = "../upload/";
$dh  = opendir($dir);
while (false !== ($filename = readdir($dh))) {
    $files[] = $filename;
}

sort($files);

foreach($files as $item){
?>

<?php

if(substr($item,0,1)!='.' && $item != 'force_download.php' && $item != 'index.html' && $item != 'thumbnail.php'){
?>

<?php if(substr($item, strlen($item)-3,strlen($item)) == 'jpg' || substr($item, strlen($item)-3,strlen($item)) == 'JPG' || substr($item, strlen($item)-3,strlen($item)) == 'gif' || substr($item, strlen($item)-3,strlen($item)) == 'png'){ ?>
<!-- CALLING THE imgPreview() FUNCTION WITH ONLY 1 PARAMETER -->
<li><a href="javascript:void(0);" onclick="parent.tinyMCE.execCommand('mceFocus',false,'text'); parent.tinyMCE.execInstanceCommand('text', 'mceInsertContent', false, '<img src=\'../thumbs/<?php echo $item?>\' border=\'0\' />');" onMouseOver='showPreview("../upload/<?php echo $item?>", 0, 100, 100);' onMouseOut="clearPreview();" class="ln" title="<?php echo $lang_insert_image; ?>"><?php echo $lang_small; ?></a> | 

<a href="javascript:void(0);" onclick="parent.tinyMCE.execCommand('mceFocus',false,'text'); parent.tinyMCE.execInstanceCommand('text', 'mceInsertContent', false, '<img src=\'../upload/<?php echo $item?>\' border=\'0\' />');" onMouseOver='showPreview("../upload/<?php echo $item?>", 0, 100, 100);' onMouseOut="clearPreview();" class="ln" title="<?php echo $lang_insert_image; ?>"><?php echo $lang_large; ?></a> | <?php if(file_exists('../thumbs/'.$item)){ ?><a href=schredder.php?unlink_both=<?php echo $item?>><?php echo $lang_delete; ?></a><?php } ?> <?php echo substr($item, 13, strlen($item));?></li>


<?php } 

}

}
?>
</ul>

</td>


</table>
</fieldset>
<br /></td>
    <td valign="top"><fieldset>
<legend><?php echo $lang_files_in_upload; ?></legend>

<table width="95%" border="0" cellspacing="0" cellpadding="0">

<tr><td valign="top" width="73%">

<ul type="square">

<?php

$dir = "../upload/";
$dh  = opendir($dir);
while (false !== ($filename = readdir($dh))) {
    $files2[] = $filename;
}

sort($files2);

foreach($files2 as $item){
?>

<?php

if(substr($item,0,1)!='.' && $item != 'force_download.php' && $item != 'index.html' && $item != 'thumbnail.php' && substr($item, strlen($item)-3,strlen($item)) != 'jpg' && substr($item, strlen($item)-3,strlen($item)) != 'gif' && substr($item, strlen($item)-3,strlen($item)) != 'png' && substr($item, strlen($item)-3,strlen($item)) != 'JPG'){
?>


<!-- CALLING THE imgPreview() FUNCTION WITH ONLY 1 PARAMETER -->
<li><a href="javascript:void(0);" onclick="parent.tinyMCE.execCommand('mceFocus',false,'text'); parent.tinyMCE.execInstanceCommand('text', 'mceInsertContent', false, '<a href=\'../upload/<?php echo $item?>\' target=\'blank\'><?php echo substr($item, 18, strlen($item));?></a> ');" onMouseOver='showPreview("icons/lightning.png", 0, 0, 0, "<?php echo substr($item, 18, strlen($item));?><br />filesize: <?php echo round(filesize('../upload/'.$item)/1024);?>k");' onMouseOut="clearPreview();" class="ln" title="<?php echo $lang_insert_file; ?>"><?php echo $lang_insert; ?></a> | <a href="schredder.php?unlink_file=<?php echo $item?>&dir=upload"><?php echo $lang_delete; ?></a> <?php echo substr($item, 18, strlen($item));?></li>


<?php

}

}
?>
</ul>

</td>


</table>

</fieldset>
<br />
</td>
  </tr>
</table>





</div>
<?php } ?>
</body>
</html>
Return current item: ZompLog