Changeset 35823
- Timestamp:
- 03/22/08 08:43:08 (4 months ago)
- Files:
-
- worst-offenders/trunk/functions.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
worst-offenders/trunk/functions.php
r35682 r35823 119 119 $count = get_current_count(); 120 120 121 wo3_check_user_input(); 122 121 123 if ( isset( $submenu['edit-comments.php'] ) ) 122 124 add_submenu_page('edit-comments.php', __($wo3_title), __($wo3_title . "(" . $count . ")"), 1, __($wo3_title), 'wo3_list' ); … … 166 168 167 169 function reset_current_count() { 168 global $keys ;170 global $keys, $wo3_title; 169 171 wp_cache_delete("current_count", $wo3_title); 170 wp_cache_delete("current_ids", 'worstoffenders');172 wp_cache_delete("current_ids", $wo3_title); 171 173 } 172 174 … … 183 185 184 186 function wo3_list() { 185 global $wpdb, $comment, $wo3_title ;187 global $wpdb, $comment, $wo3_title, $wo3_feedback; 186 188 css(); 187 189 ?> … … 189 191 <h2><?php _e($wo3_title); ?></h2> 190 192 <?php 191 wo3_check_user_input(); 193 if (is_array($wo3_feedback)) { 194 foreach($wo3_feedback as $feedback) { 195 echo $feedback; 196 } 197 $wo3_feedback = array(); 198 } 192 199 wo3_tabs(); 193 200 echo("</div>"); … … 224 231 225 232 function wo3_check_user_input() { 226 global $keys ;233 global $keys, $wo3_feedback; 227 234 if ($_POST['act'] == 'delete') { 228 235 if (!empty($_POST['worst'])) { … … 230 237 $deleted = do_delete($deletionList); 231 238 if ($deleted === false) { 232 echo"<div class='updated'>DB Error - Failed to delete - Boo! Perhaps the DB log can help!</div>";239 $wo3_feedback[] = "<div class='updated'>DB Error - Failed to delete - Boo! Perhaps the DB log can help!</div>"; 233 240 } else { 241 $wo3_feedback[] = "<div class='updated'>Congratulations, you just deleted <strong>$deleted</strong> spam comments!</div>"; 234 242 update_option( $keys['counter'], $deleted + get_option( $keys['counter'] ) ); 235 243 reset_current_count(); 236 244 } 245 } else { 246 $wo3_feedback[] = "<div class='updated'>Nothing selected for deletion.</div>"; 237 247 } 238 248 }
