sql_query("select config_name,config_value from ". CONFIG_TABLE .""); while ($config_row = $db->sql_fetchrow($config_result)) { $board_config[$config_row[config_name]] = $config_row[config_value]; } // Select all avatars and usernames that have an uploaded avatar currently $sql = "SELECT user_id, username, user_avatar FROM " . USERS_TABLE . " WHERE user_avatar_type = " . USER_AVATAR_UPLOAD . " AND user_avatar IS NOT NULL"; if(!$result = $db->sql_query($sql)) { $error = $db->sql_error(); die("Could not get avatar information! $error[code] : $error[message]"); } // Create a hash to keep track of all the user that is using the uploaded avatar while ($avatar_rowset = $db->sql_fetchrow($result)) { $avatar_usage[$avatar_rowset[user_avatar]] = $avatar_rowset[username]; } // This is the variable that points to the path of the avatars // You may need to ajust this to meet your needs ;) $real_avatar_dir = $phpbb_root_path . '../../' . $board_config['avatar_path']; echo '
The table below shows all currently stored uploaded avatars. These are only the avatars which were selected to be uploaded by users, this will not show avatars currently in the gallery. If any of the listed avatars are no longer used by any user an option to delete it will appear. This is a permanent delete, once you have selected to delete an avatar it will be removed from the server and no longer be available. You will be prompted for confirmation (requires Javascript).
'; switch( $mode ) { case "delete": echo 'Success, $target deleted! |
Continue |
Avatar | Size | Usage | Edit user |
---|---|---|---|
$file |
$stats[7] Bytes | $avatar_usage[$file] | Edit $avatar_usage[$file] |
$file |
$stats[7] Bytes | Not Used Delete |