Changeset 45016
- Timestamp:
- 05/09/08 11:29:00 (2 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
worst-offenders/trunk/classes/obvious_name_litmus.php
r44627 r45016 9 9 */ 10 10 11 $obvious_words = "baccarat cas ino casinos cialis consolidation craps credit debit download gambling holdem kasino kredit payday payment poker ringtone ringtones roulette tramadol slotsviagra xxx zocor";11 $obvious_words = "baccarat cash casino casinos cialis consolidation craps credit debit download free gambling holdem kasino kredit loan payday payment poker ringtone ringtones roulette tramadol slots screensaver viagra xxx zocor"; 12 12 $obvious_words_array = explode(" ",$obvious_words); 13 13 … … 32 32 return self::runCachedMatchesQuery( 33 33 self::getName(), 34 "SELECT comment_author, comment_id FROM wp_comments where comment_approved='spam' and MATCH (comment_author) AGAINST ('".$obvious_words."' IN BOOLEAN MODE);"34 "SELECT comment_author, comment_id, MATCH (comment_author) AGAINST ('".$obvious_words."' IN BOOLEAN MODE) as score FROM wp_comments where comment_approved='spam' and MATCH (comment_author) AGAINST ('".$obvious_words."' IN BOOLEAN MODE) order by score desc;" 35 35 ); 36 36 } … … 53 53 $results = array(); 54 54 foreach($comments as $item) { 55 $num=0; 55 56 $new_name_bits = array(); 56 57 $name_bits = explode(" ",strtolower($item->comment_author)); … … 58 59 if (in_array($name_bit,$obvious_words_array)) { 59 60 $name_bit = "<strong>$name_bit</strong>"; 61 $num++; 60 62 } 61 63 $new_name_bits[] = $name_bit; 62 64 } 63 65 $item->comment_author = implode(" ",$new_name_bits); 66 $item->num = $num; 64 67 $results[] = $item; 65 68 }
