📄 netdisk.php
字号:
$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;
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";
}
echo "<tr class=\"".$TableLine."\">\n";
echo "<td>\n";
if ( is_editable( $fichier ) || is_image( $fichier ) || is_dir( "{$nom_rep}/{$fichier}" ) )
{
echo "<a href=\"{$lien}\">";
}
echo "<img src=\"images/".mimetype( "{$nom_rep}/{$fichier}", "image" )."\" width=\"20\" height=\"20\" align=\"ABSMIDDLE\" border=\"0\">";
echo "{$fichier}";
if ( is_editable( $fichier ) || is_image( $fichier ) || is_dir( "{$nom_rep}/{$fichier}" ) )
{
echo "</a>\n";
}
if ( stristr( $fichier, ".doc" ) || stristr( $fichier, ".ppt" ) || stristr( $fichier, ".xls" ) )
{
echo " <input type=\"button\" value=\"阅读\" class=\"SmallButton\" onClick=\"window.open('/module/OC_NETDISK?DISK_ID={$DISK_ID}&fichier=".urlencode( $lien1 )."&OP=5',null,'menubar=0,toolbar=0,status=1,scrollbars=1,resizable=1');\"> \n";
if ( find_id( $MANAGE_USER, $LOGIN_USER_ID ) )
{
echo "<input type=\"button\" value=\"编辑\" class=\"SmallButton\" onClick=\"window.open('/module/OC_NETDISK?DISK_ID={$DISK_ID}&fichier=".urlencode( $lien1 )."&OP=4',null,'menubar=0,toolbar=0,status=1,scrollbars=1,resizable=1');\"> \n";
}
}
echo "</td>\n";
echo "<td width=\"11%\" align=\"center\">";
echo taille( "{$nom_rep}/{$fichier}" );
echo "</td>\n";
echo "<td align=center 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%\"> ";
$fichier2 = str_replace( "+", "%2B", $fichier );
if ( find_id( $MANAGE_USER, $LOGIN_USER_ID ) )
{
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 "{$fichier2}&id={$id}\"><img src=\"images/copier.gif\" alt=\"复制\" width=\"20\" height=\"20\" border=\"0\" align=absmiddle></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 "{$fichier2}&id={$id}\"><img src=\"images/deplacer.gif\" alt=\"移动\" width=\"20\" height=\"20\" border=\"0\" align=absmiddle></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 "{$fichier2}&id={$id}\"><img src=\"images/renommer.gif\" alt=\"重命名\" width=\"20\" height=\"20\" border=\"0\" align=absmiddle></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 "{$fichier2}&id={$id}\"><img src=\"images/supprimer.gif\" alt=\"删除\" width=\"20\" height=\"20\" border=\"0\" align=absmiddle></a>\n";
if ( is_editable( $fichier ) && !is_dir( "{$racine}/{$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 "{$fichier2}&id={$id}\"><img src=\"images/editer.gif\" alt=\"编辑\" width=\"20\" height=\"20\" border=\"0\" align=absmiddle></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=telecharger&fichier=";
if ( $rep != "" )
{
echo "{$rep}/";
}
echo "{$fichier2}&id={$id}\" target=_blank>";
echo "<img src=\"images/download.gif\" alt=\"下载\" width=\"20\" height=\"20\" border=\"0\" align=absmiddle></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 "lien=lien.replace(\"+\",\"%2B\");";
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=\"95%\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" align=\"center\">\r\n\t<tr class=\"TableHeader\"><td colspan=\"5\"><b>当前目录:";
if ( $rep == "" )
{
echo $DISK_NAME;
}
else
{
echo $DISK_NAME."/".$rep;
}
echo "</b></td></tr>\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 align=center><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 align=center><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 align=center><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 align=\"center\"><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\" align=\"ABSMIDDLE\" border=\"0\">{$mess['24']}</a></td><td> </td><td> </td><td> </td><td> </td></tr>\n";
}
contenu_dir( $nom_rep );
echo "<tr class=\"TableContent\">\n";
echo "<td> </td>\n";
echo "<td width=\"11%\" align=\"center\">共{$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 );
}
else if ( !is_dir( "{$location}/{$file}" ) )
{
if ( file_exists( "{$location}/{$file}" ) )
{
unlink( "{$location}/{$file}" );
}
unset( $file );
}
}
closedir( $all );
rmdir( $location );
}
else if ( file_exists( "{$location}" ) )
{
unlink( "{$location}" );
}
}
function enlever_controlm( $fichier )
{
$fic = file( $fichier );
$fp = fopen( $fichier, "w" );
while ( list( $cle, $val ) = each( $fic ) )
{
$val = str_replace( chr( 10 ), "", $val );
$val = str_replace( chr( 13 ), "", $val );
fputs( $fp, "{$val}\n" );
}
fclose( $fp );
}
function traite_nom_fichier( $nom )
{
global $max_caracteres;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -