db_Update("user", "user_image='' WHERE user_image='-upload-$image'"); $sql->db_Update("user", "user_sess='' WHERE user_sess='$image'"); $message = $image." ".IMALAN_28; } if (isset($_POST['deleteall'])) { $handle = opendir(e_FILE."public/avatars/"); while ($file = readdir($handle)) { if ($file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db') { $dirlist[] = $file; } } closedir($handle); $count = 0; while (list($key, $image_name) = each($dirlist)) { if (!$sql->db_Select("user", "*", "user_image='-upload-$image_name' OR user_sess='$image_name'")) { unlink(e_FILE."public/avatars/".$image_name); $count ++; } } $message = $count." ".IMALAN_26; } if (isset($_POST['avdelete'])) { require_once(e_HANDLER."avatar_handler.php"); foreach($_POST['avdelete'] as $key => $val) { $key = $tp->toDB($key); // We only need the key if ($sql->db_Select("user", "*", "user_id='$key'")) { $row = $sql->db_Fetch(); extract($row); $avname=avatar($user_image); if (strpos($avname,"http://")===FALSE) { // Internal file, so unlink it @unlink($avname); } $sql->db_Update("user","user_image='' WHERE user_id='$key'"); $message = IMALAN_51.$user_name." ".IMALAN_28; } } $_POST['check_avatar_sizes'] = TRUE; // Force size recheck after doing one or more deletes } if (isset($_POST['update_options'])) { $pref['image_post'] = $_POST['image_post']; $pref['resize_method'] = $_POST['resize_method']; $pref['im_path'] = trim($tp->toDB($_POST['im_path'])); $pref['image_post_class'] = $_POST['image_post_class']; $pref['image_post_disabled_method'] = $_POST['image_post_disabled_method']; $pref['enable_png_image_fix'] = $_POST['enable_png_image_fix']; save_prefs(); $message = IMALAN_9; } if (isset($message)) { $ns->tablerender("", "
".$message."
"); } if (isset($_POST['show_avatars'])) { $handle = opendir(e_FILE."public/avatars/"); while ($file = readdir($handle)) { if ($file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db' && !is_dir($file)) { $dirlist[] = $file; } } closedir($handle); $text = "
\n"; if (!is_array($dirlist)) { $text .= IMALAN_29; } else { while (list($key, $image_name) = each($dirlist)) { $users = IMALAN_21." | "; if ($sql->db_Select("user", "*", "user_image='-upload-$image_name' OR user_sess='$image_name'")) { while ($row = $sql->db_Fetch()) { extract($row); $users .= "$user_name (".($user_sess == $image_name ? IMALAN_24 : IMALAN_23).") | "; } } else { $users = IMALAN_22; } $text .= "
$image_name

$users
"; } $text .= "
"; } $text .= "
"; $ns->tablerender(IMALAN_18, $text); } if (isset($_POST['check_avatar_sizes'])) { // // Set up to track what we've done // $iUserCount = 0; $iAVinternal = 0; $iAVexternal = 0; $iAVnotfound = 0; $iAVtoobig = 0; require_once(e_HANDLER."avatar_handler.php"); $text = "
\n"; $text .= "
"; // // Loop through avatar field for every user // $iUserCount = $sql->db_Count("user"); if ($sql->db_Select("user", "*", "user_image!=''")) { while ($row = $sql->db_Fetch()) { extract($row); // // Check size // $avname=avatar($user_image); if (strpos($avname,"http://")!==FALSE) { $iAVexternal++; $bAVext=TRUE; } else { $iAVinternal++; $bAVext=FALSE; } $image_stats = getimagesize($avname); $sBadImage=""; if (!$image_stats) { $iAVnotfound++; // allow delete $sBadImage=IMALAN_42; } else { $imageWidth = $image_stats[0]; $imageHeight = $image_stats[1]; if ( ($imageHeight > $pref['im_height']) || ($imageWidth>$pref['im_width']) ) { // Too tall or too wide $iAVtoobig++; if ($imageWidth > $pref['im_width']) { $sBadImage = IMALAN_40." ($imageWidth)"; } if ($imageHeight > $pref['im_height']) { if (strlen($sBadImage)) { $sBadImage .= ", "; } $sBadImage .= IMALAN_41." ($imageHeight)"; } } } // // If not found or too big, allow delete // if (strlen($sBadImage)) { $sBadImage .=" [".$avname."]"; // Show all files that have a problem $text .= " "; } } } // // Done, so show stats // $text .= "
".$pref['im_width']." ".IMALAN_38."
".$pref['im_height']." ".IMALAN_39."
".IMALAN_51."".$user_name." ".$sBadImage."
".$iAVnotfound." ".IMALAN_45."
".$iAVtoobig." ".IMALAN_46."
".$iAVinternal." ".IMALAN_47."
".$iAVexternal." ".IMALAN_48."
".($iAVexternal+$iAVinternal)." (".(int)(100.0*(($iAVexternal+$iAVinternal)/$iUserCount)).'%, '.$iUserCount." ".IMALAN_50.") ".IMALAN_49."
"; $text .= "
"; $ns->tablerender(IMALAN_37, $text); } if(function_exists('gd_info')) { $gd_info = gd_info(); $gd_version = $gd_info['GD Version']; } else { $gd_version = " ".IMALAN_55.""; } $IM_NOTE = ""; if($pref['im_path'] != "") { $im_file = $pref['im_path'].'convert'; if(!file_exists($im_file)) { $IM_NOTE = "
".IMALAN_52.""; } else { $cmd = "{$im_file} -version"; $tmp = `$cmd`; if(strpos($tmp, "ImageMagick") === FALSE) { $IM_NOTE = "
".IMALAN_53.""; } } } $text = "
".IMALAN_1."
".IMALAN_2."
". ($pref['image_post'] ? "" : "")."
".IMALAN_10."
".IMALAN_11."
".r_userclass('image_post_class',$pref['image_post_class'],"off","public,guest,nobody,member,admin,main,classes")."
".IMALAN_12."
".IMALAN_13."
".IMALAN_3."
".IMALAN_4."
".IMALAN_54." {$gd_version}
".IMALAN_5."
".IMALAN_6."
{$IM_NOTE}
".IMALAN_34."
".IMALAN_35."
".($pref['enable_png_image_fix'] ? "" : "")."
".IMALAN_16."
".IMALAN_36."
"; $ns->tablerender(IMALAN_7, $text); require_once("footer.php"); $pref['resize_method'] = $_POST['resize_method']; $pref['im_path'] = $_POST['im_path']; ?>