📄 netdisk.php
字号:
if ( $ordre == "mod" )
{
$liste_rep[$fichier] = filemtime( "{$nom_rep}/{$fichier}" );
}
else
{
$liste_rep[$fichier] = $fichier;
}
}
else if ( $ordre == "nom" )
{
$liste_fic[$fichier] = mimetype( "{$nom_rep}/{$fichier}", "image" );
}
else if ( $ordre == "taille" )
{
$liste_fic[$fichier] = $poidsfic;
}
else if ( $ordre == "mod" )
{
$liste_fic[$fichier] = filemtime( "{$nom_rep}/{$fichier}" );
}
else if ( $ordre == "type" )
{
$liste_fic[$fichier] = mimetype( "{$nom_rep}/{$fichier}", "type" );
}
else
{
$liste_fic[$fichier] = mimetype( "{$nom_rep}/{$fichier}", "image" );
}
}
}
closedir( $handle );
if ( is_array( $liste_fic ) )
{
if ( $ordre == "nom" )
{
if ( $sens == 0 )
{
ksort( $liste_fic );
}
else
{
krsort( $liste_fic );
}
}
else if ( $ordre == "mod" )
{
if ( $sens == 0 )
{
arsort( $liste_fic );
}
else
{
asort( $liste_fic );
}
}
else if ( $ordre == "taille" || $ordre == "type" )
{
if ( $sens == 0 )
{
asort( $liste_fic );
}
else
{
arsort( $liste_fic );
}
}
else if ( $sens == 0 )
{
ksort( $liste_fic );
}
else
{
krsort( $liste_fic );
}
}
if ( is_array( $liste_rep ) )
{
if ( $ordre == "mod" )
{
if ( $sens == 0 )
{
arsort( $liste_rep );
}
else
{
asort( $liste_rep );
}
}
else if ( $sens == 0 )
{
ksort( $liste_rep );
}
else
{
krsort( $liste_rep );
}
}
$liste = assemble_tableaux( $liste_rep, $liste_fic );
if ( 1073741824 <= $poidstotal )
{
$poidstotal = ( round( $poidstotal / 1073741824 * 100 ) / 100 )." G".$size_unit;
}
else if ( 1048576 <= $poidstotal )
{
$poidstotal = ( round( $poidstotal / 1048576 * 100 ) / 100 )." M".$size_unit;
}
else if ( 1024 <= $poidstotal )
{
$poidstotal = ( round( $poidstotal / 1024 * 100 ) / 100 )." K".$size_unit;
}
else
{
$poidstotal = $poidstotal." ".$size_unit;
}
return array(
$liste,
$poidstotal
);
}
function contenu_dir( $nom_rep )
{
global $font;
global $id;
global $sens;
global $ordre;
global $rep;
global $poidstotal;
global $MANAGE_USER;
global $LOGIN_USER_ID;
global $DISK_ID;
global $mess;
list( $liste, $poidstotal ) = listing( $nom_rep );
if ( is_array( $liste ) )
{
$LINE_COUNT = 0;
while ( list( $fichier, $mime ) = each( $liste ) )
{
if ( is_dir( "{$nom_rep}/{$fichier}" ) )
{
$lien = "netdisk.php?DISK_ID={$DISK_ID}&sens={$sens}&ordre={$ordre}&rep=";
if ( $rep != "" )
{
$lien .= "{$rep}/";
}
$lien .= $fichier."&id={$id}";
$affiche_copier = "non";
}
else
{
$lien = "";
if ( $rep != "" )
{
$lien .= "{$rep}/";
}
$lien .= $fichier;
$lien1 = $lien;
$lien = "javascript:popup('{$lien}')";
$affiche_copier = "oui";
}
++$LINE_COUNT;
if ( $LINE_COUNT % 2 == 1 )
{
$TableLine = "TableLine1";
}
else
{
$TableLine = "TableLine2";
}
$special_char = false;
if ( getspecialstr( $fichier ) == 1 )
{
$special_char = true;
}
echo "<tr class=\"".$TableLine."\">\n";
echo "<td>\n";
if ( ( is_editable( $fichier ) || is_image( $fichier ) || is_dir( "{$nom_rep}/{$fichier}" ) ) && !$special_char )
{
echo "<a href=\"{$lien}\">";
}
echo "<img src=\"images/".mimetype( "{$nom_rep}/{$fichier}", "image" )."\" width=\"20\" height=\"20\" align=\"ABSMIDDLE\" border=\"0\"";
if ( $special_char )
{
echo " style=\"filter:gray()\"";
}
echo ">";
if ( $special_char )
{
echo "<span style=\"color:#999999\">";
}
echo "{$fichier}";
if ( $special_char )
{
echo "</span> <img src='/images/littlegif/murumpyo.gif' title='".$mess[96]."'>";
}
if ( ( is_editable( $fichier ) || is_image( $fichier ) || is_dir( "{$nom_rep}/{$fichier}" ) ) && !$special_char )
{
echo "</a>\n";
}
echo "\t\t \t";
echo "</td>\n";
echo "<td width=\"11%\">";
echo taille( "{$nom_rep}/{$fichier}" );
echo "</td>\n";
echo "<td width=\"15%\">";
echo mimetype( "{$nom_rep}/{$fichier}", "type" );
echo "</td>\n";
echo "<td width=\"17%\">";
echo date_modif( "{$nom_rep}/{$fichier}" );
echo "</td>\n";
echo "<td width=\"23%\"> ";
if ( find_id( $MANAGE_USER, $LOGIN_USER_ID ) && !$special_char )
{
if ( $affiche_copier == "oui" )
{
echo "<a href=\"netdisk.php?DISK_ID={$DISK_ID}&action=copier&sens={$sens}&ordre={$ordre}&rep=";
if ( $rep != "" )
{
echo "{$rep}&fic={$rep}/";
}
else
{
echo "&fic=";
}
echo "{$fichier}&id={$id}\"><img src=\"images/copier.gif\" alt=\"复制\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
}
else
{
echo "<img src=\"images/pixel.gif\" width=\"20\" height=\"20\">\n";
}
if ( $affiche_copier == "oui" )
{
echo "<a href=\"netdisk.php?DISK_ID={$DISK_ID}&action=deplacer&ordre={$ordre}&sens={$sens}&rep=";
if ( $rep != "" )
{
echo "{$rep}&fic={$rep}/";
}
else
{
echo "&fic=";
}
echo "{$fichier}&id={$id}\"><img src=\"images/deplacer.gif\" alt=\"移动\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
}
else
{
echo "<img src=\"images/pixel.gif\" width=\"20\" height=\"20\">\n";
}
echo "<a href=\"netdisk.php?DISK_ID={$DISK_ID}&ordre={$ordre}&sens={$sens}&action=rename&rep=";
if ( $rep != "" )
{
echo "{$rep}&fic={$rep}/";
}
else
{
echo "&fic=";
}
echo "{$fichier}&id={$id}\"><img src=\"images/renommer.gif\" alt=\"重命名\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
echo "<a href=\"netdisk.php?DISK_ID={$DISK_ID}&action=supprimer&ordre={$ordre}&sens={$sens}&rep=";
if ( $rep != "" )
{
echo "{$rep}&fic={$rep}/";
}
else
{
echo "&fic=";
}
echo "{$fichier}&id={$id}\"><img src=\"images/supprimer.gif\" alt=\"删除\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
if ( is_editable( $fichier ) && !is_dir( "{$nom_rep}/{$fichier}" ) )
{
echo "<a href=\"netdisk.php?DISK_ID={$DISK_ID}&ordre={$ordre}&sens={$sens}&action=editer&rep=";
if ( $rep != "" )
{
echo "{$rep}&fic={$rep}/";
}
else
{
echo "&fic=";
}
echo "{$fichier}&id={$id}\"><img src=\"images/editer.gif\" alt=\"编辑\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
}
else
{
echo "<img src=\"images/pixel.gif\" width=\"20\" height=\"20\">\n";
}
}
if ( $affiche_copier == "oui" && !$special_char )
{
echo "<a target='_blank' href=\"netdisk.php?DISK_ID={$DISK_ID}&action=telecharger&fichier=";
if ( $rep != "" )
{
echo "{$rep}/";
}
echo "{$fichier}&id={$id}\">";
echo "<img src=\"images/download.gif\" alt=\"下载\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
}
echo "</td>\n";
echo "</tr>\n";
}
}
}
function lister_rep( $nom_rep )
{
global $rep;
global $url_racine;
global $racine;
global $mess;
global $sens;
global $user;
global $users;
global $id;
global $font;
global $tablecolor;
global $ordre;
global $poidstotal;
global $DISK_ID;
global $DISK_NAME;
if ( eregi( "\\.\\.", $rep ) )
{
$rep = "";
}
$nom_rep = init( $rep );
if ( $sens == 1 )
{
$sens = 0;
}
else
{
$sens = 1;
}
if ( $sens == 1 )
{
$sens = 0;
}
else
{
$sens = 1;
}
echo "<script language=\"javascript\">\n";
echo "function popup(lien) {\n";
echo "var fen=window.open('netdisk.php?DISK_ID={$DISK_ID}&id={$id}&action=voir&fichier='+lien,'filemanager','menubar=yes,status=yes,scrollbars=yes,resizable=yes,width=500,height=400');\n";
echo "}\n";
echo "</script>\n";
echo "\t<table border=\"0\" cellspacing=\"1\" width=\"100%\" cellpadding=\"0\" align=\"center\">\r\n <tr>\r\n <td align=\"left\">当前空间:";
if ( $rep == "" )
{
echo $DISK_NAME;
}
else
{
echo $DISK_NAME."/".$rep;
}
echo "</td>\r\n </tr>\r\n\t</table>\r\n\t<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" cellpadding=\"3\">\r\n";
echo "<tr class=\"TableHeader\">\n";
if ( $rep != "" )
{
$lien = "&rep=".$rep;
}
echo "<td><b><a href=\"netdisk.php?DISK_ID={$DISK_ID}&id={$id}&ordre=nom&sens={$sens}".$lien."\">{$mess['1']}</a>";
if ( $ordre == "nom" || $ordre == "" )
{
echo " <img src=\"images/fleche{$sens}.gif\" width=\"10\" height=\"10\">";
}
echo "</b></td>\n";
echo "<td><b><a href=\"netdisk.php?DISK_ID={$DISK_ID}&id={$id}&ordre=taille&sens={$sens}".$lien."\">{$mess['2']}</a>";
if ( $ordre == "taille" )
{
echo " <img src=\"images/fleche{$sens}.gif\" width=\"10\" height=\"10\">";
}
echo "</b></td>\n";
echo "<td><b><a href=\"netdisk.php?DISK_ID={$DISK_ID}&id={$id}&ordre=type&sens={$sens}".$lien."\">{$mess['3']}</a>";
if ( $ordre == "type" )
{
echo " <img src=\"images/fleche{$sens}.gif\" width=\"10\" height=\"10\">";
}
echo "</b></td>\n";
echo "<td><b><a href=\"netdisk.php?DISK_ID={$DISK_ID}&id={$id}&ordre=mod&sens={$sens}".$lien."\">{$mess['4']}</a>\n";
if ( $ordre == "mod" )
{
echo " <img src=\"images/fleche{$sens}.gif\" width=\"10\" height=\"10\">";
}
echo "</b></td>\n";
echo "<td><b>{$mess['5']}</b></td>\n";
echo "</tr>\n";
if ( $sens == 1 )
{
$sens = 0;
}
else
{
$sens = 1;
}
if ( $rep != "" )
{
$nom = dirname( $rep );
echo "<tr class=\"TableData\"><td><a href=\"netdisk.php?DISK_ID={$DISK_ID}&id={$id}&sens={$sens}&ordre={$ordre}";
if ( $rep != $nom && $nom != "." )
{
echo "&rep={$nom}";
}
echo "\"><img src=\"images/parent.gif\" width=\"20\" height=\"20\" border=\"0\">{$mess['24']}</a></td><td> </td><td> </td><td> </td><td> </td></tr>\n";
}
contenu_dir( $nom_rep );
echo "<tr>\n";
echo "<td> </td>\n";
echo "<td width=\"11%\">共{$poidstotal}</td>\n";
echo "<td width=\"15%\"> </td>\n";
echo "<td width=\"17%\"> </td>\n";
echo "<td width=\"23%\"> </td>\n";
echo "</tr>\n";
echo "</table>\n<br>";
}
function deldir( $location )
{
if ( is_dir( $location ) )
{
$all = opendir( $location );
while ( $file = readdir( $all ) )
{
if ( is_dir( "{$location}/{$file}" ) && $file != ".." && $file != "." )
{
deldir( "{$location}/{$file}" );
if ( file_exists( "{$location}/{$file}" ) )
{
rmdir( "{$location}/{$file}" );
}
unset( $file );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -