Beiliegend hab ich mal das Skript eingefügt, vielleicht hat ja einer der Benutzer des Forums mal eine Idee und postet es. Ich würde mich mich auch sehr freuen, wenn AWSW sich dem annimmt und sein Mod verbessert, da diese Darstellungsproblem eigentlich ungewöhnlich sind bei den Mods von AWSW. *dackelblick aufsetzen*
MfG
Firestarter
Code: Alles auswählen
<?php
/***************************************************************************
* DELETE UNUSED AVATARS
* -----------------------
* Version : Version 1.00 - 18.10.2003
* copyright : (C) 2003 AWSW
* URL : http://www.awsw.de
*
* $Id: admin_avatar_delete.php,v 1.00 2003/10/18 AWSW Exp $
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', 1);
if( !empty($setmodules) )
{
$filename = basename(__FILE__);
$module['General']['Avatar_Delete'] = $filename;
return;
}
$phpbb_root_path = './../';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
$page_title = $lang['Avatar_Delete'];
$gen_simple_header = TRUE;
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
// User = Admin, Mod or Junior Admin ? Start
if ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD || $userdata['user_level'] == JUNIOR_ADMIN )
{
}
else
{
message_die(GENERAL_MESSAGE, $lang['Not_Authorised'], $lang['Not_Authorised']);
exit;
}
// User = Admin, Mod or Junior Admin ? End
// Delete files START
if($_POST[submit_update1])
{
foreach($_POST[check] as $file)
{
$base_dir = "./../" . $board_config['avatar_path'] . "/";
$path = $base_dir;
unlink($path.$file);
}
}
// Delete files END
echo "<br><table width='100%' border='0' cellpadding='1' cellspacing='1' style='border-collapse: collapse' class='forumline'>";
echo "<tr>";
echo "<td class='catHead' width='100%' colspan='4' height='25'><span class='cattitle'><center><b>" . $lang['Avatar_Delete_1'] . " in: " . $board_config['avatar_path'] . "/" . "</b></center></span></td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan='4' height='1' class='row3'><img src='images/spacer.gif' width='1' height='1' alt='.'></td>";
echo "</tr>";
echo "<tr>";
echo "<th align='center' height='25' width='30%' class='toprow' nowrap='nowrap'> " . $lang['Avatar_Delete_2'] . ": </th>";
echo "<th align='center' height='25' width='30%' class='toprow' nowrap='nowrap'> " . $lang['Avatar_Delete_3'] . ": </th>";
echo "<th align='center' height='25' width='30%' class='toprow' nowrap='nowrap'> " . $lang['Avatar_Delete_4'] . ": </th>";
echo "<th align='center' height='25' width='10%' class='toprow' nowrap='nowrap'> " . $lang['Avatar_Delete_5'] . ": </th>";
echo "</tr>";
echo "<form method='post' name='post' action='./admin_avatar_delete.php'>";
// Read directory Start
$base_dir = "./../" . $board_config['avatar_path'] . "/";
$path = $base_dir;
$dir_handle = @opendir($path) or die($lang['Avatar_Delete_6']);
$space=" ";
if ($path != "."){
while ($file = readdir($dir_handle)) {
// Ignore following files Start
if($file=='.'||$file=='..'||$file=='index.htm'||$file=='index.html'||$file==substr(strrchr($board_config['avatar_gallery_path'], '/'), 1))
continue;
$sql = "SELECT COUNT( * ) AS total FROM " . $table_prefix . "users WHERE user_avatar = '" . $file . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_MESSAGE, $lang['Avatar_Delete_7'], '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
if($row['total'] > 0)
continue;
// Ignore following files End
$t="<tr>
<td align='center' class='row2'> <span class='genmed'><a href=$path$file target='_blank' class='gensmall'><img src=$path$file border='0'></a></img></span> </td><td align='center' class='row2'> <span class='genmed'><a href=$path$file target='_blank' class='gensmall'>$file</a></span> </td>";
echo $t.substr($space,0,40-strlen($file)) ;
$t=(filesize($path.$file)/1024);
$t=sprintf("<td align='center' class='row3'> <span class='genmed'>%01.2f",$t). $lang['uploadmod20'] . "</span> </td>
<td align='center' class='row3'> <span class='gensmall'><input type='checkbox' name='check[]' value='$file'></span> </td>";
echo substr($space,0,10-strlen($t)) . $t ;
}
} elseif ($path = ".") {
while ($file = readdir($dir_handle)) {
$t="<a href=$file>$file</a>";
echo $t.substr($space,0,40-strlen($file)) ;
$t=(filesize($file)/1024);
$t=sprintf("%01.2f",$t)."kb ";
echo substr($space,0,10-strlen($t)) . $t;
}
}
closedir($dir_handle);
echo "</tr></table>";
// Read directory End
?>
<script language="Javascript" type="text/javascript">
function select_switch(status)
{
for (i = 0; i < document.post.length; i++)
{
document.post.elements[i].checked = status;
}
}
</script>
<?PHP
echo "<br><center><span class='gen'>";
echo "<b><a href='javascript:select_switch(true);' class='gen'>" . $lang['Avatar_Delete_8'] . "</a> :: <a href='javascript:select_switch(false);' class='gen'>" . $lang['Avatar_Delete_9'] . "</a></b></span>";
echo "<br><br><input class='liteoption' type='submit' name='submit_update1' value='" . $lang['Avatar_Delete_10'] . "'/>";
echo "</form><a href='http://www.awsw.de' class='gensmall'>MOD Version 1.00 by AWSW</a>";
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>