Changeset 198
- Timestamp:
- 01/24/09 18:34:54 (3 years ago)
- Files:
-
- cheaters.php (modified) (6 diffs)
- message.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cheaters.php
r184 r198 17 17 18 18 if ( isset($_POST['id']) ) { 19 $ids = request_var('id', array(''=>'')); 20 foreach ( $ids AS $_null => $id ) { 21 $ids[] = (int) $id; 22 } 19 $ids = request_var('id', array(0=>0)); 23 20 24 21 meta_refresh(3, append_sid($root_path . 'cheaters.php' . ( $mode == 'stealth_downers' ? '?mode=stealth_downers' : '' ) . ( $show_banned ? '&show_banned=1' : '' ))); … … 51 48 if ( isset($_POST['ban']) ) { 52 49 $sql = 'SELECT u.name, u.uid AS user_id FROM ' . USERS_TABLE . ' u, ' . CHEATERS_TABLE . ' c 53 WHERE u.uid = c.userid AND c.id IN (' . implode(', ', $ids) . ') AND enabled = 1 GROUP BY u.uid';50 WHERE u.uid = c.userid AND u.uid IN (' . implode(', ', $ids) . ') AND enabled = 1 GROUP BY u.uid'; 54 51 $result = $db->sql_query($sql); 55 52 56 53 $modcomment = "\n" . sprintf($lang['modcomment_account_disabled'], 't' . time(), $userdata['name'], $lang['cheater']); 54 57 55 while ( $row = $db->sql_fetchrow($result) ) { 58 56 $sql = 'UPDATE ' . USERS_TABLE . ' SET enabled = 0, warneduntil = 0, modcomment=CONCAT(modcomment,' . "'" . $db->sql_escape($modcomment) . "'" . ') WHERE uid = ' . $row['user_id']; 59 57 $db->sql_query($sql); 58 60 59 $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' WHERE session_user_id = ' . $row['user_id']; 61 60 $db->sql_query($sql); 61 62 62 write_log(sprintf($lang['log_account_disable'], 'userdetails_' . $row['user_id'], $row['name'], $userdata['name'], $lang['cheater']), LOG_VIEW_ADMIN); 63 63 } … … 66 66 67 67 if ( isset($_POST['delete']) ) { 68 $sql = 'DELETE FROM ' . CHEATERS_TABLE . ' WHERE id IN (' . implode(', ', $ids) . ')';68 $sql = 'DELETE FROM ' . CHEATERS_TABLE . ' WHERE userid IN (' . implode(', ', $ids) . ')'; 69 69 $db->sql_query($sql); 70 70 71 trigger_error ($lang['success_delete']); 71 72 } … … 158 159 159 160 default: 160 $sql = 'SELECT COUNT(*) AS count FROM ' . CHEATERS_TABLE;161 $result = $db->sql_query($sql);162 $count = ( $row = $db->sql_fetchrow($result) ) ? intval($row['count']) : 0;163 164 $per_page = 100;165 166 list($pagertop, $pagerbottom, $limit) = pager($per_page, $count, 'cheaters.php?');167 161 168 162 $template->assign_vars(array( 169 163 'S_FORM_ACTION' => append_sid('cheaters.php'), 170 'PAGER_TOP' => $pagertop, 171 'PAGER_BOTTOM' => $pagerbottom) 172 ); 164 )); 173 165 174 166 $sql = 'SELECT c.*, u.uid AS user_id, u.name, u.class, u.downloaded, u.uploaded, u.enabled, u.parked, u.warneduntil, u.donor, u.added AS reg_date, t.name AS torrent_name, t.fid AS torrent_id, t.size 175 167 FROM ' . CHEATERS_TABLE . ' c, ' . USERS_TABLE . ' u, ' . TORRENTS_TABLE . ' t 176 168 WHERE c.userid = u.uid AND c.torrentid = t.fid 177 ORDER BY added DESC ' . $limit;169 ORDER BY added DESC '; 178 170 $result = $db->sql_query($sql); 179 171 … … 182 174 $i = 0; 183 175 184 while ( $row = $db->sql_fetchrow($result) ) {176 /*while ( $row = $db->sql_fetchrow($result) ) { 185 177 $i++; 186 178 $ratio = get_ratio($row['uploaded'], $row['downloaded']); … … 206 198 'REG_DATE' => create_date($config['default_dateformat'], $row['reg_date'], $userdata['tzoffset']) 207 199 )); 200 }*/ 201 202 $users_ary = array(); 203 $i = 0; 204 205 while ( $row = $db->sql_fetchrow($result) ) { 206 207 $ratio = get_ratio($row['uploaded'], $row['downloaded']); 208 $ratio_color = get_ratio_color($ratio); 209 $uppd = mksize($row['upthis']); 210 211 $username = get_user_class_color($row['class'], $row['name']); 212 $reg_date = create_date($config['default_dateformat'], $row['reg_date'], $userdata['tzoffset']); 213 $user_icons = get_user_icons($row); 214 215 $ary_key = $username . '|' . $row['user_id'] . '|' . $row['userip'] . '|' . $reg_date . '|' . $user_icons; 216 217 $users_ary[$ary_key][$row['torrent_id'] . '|' . $row['torrent_name']][] = array( 218 'USERNAME' => get_user_class_color($row['class'], $row['name']), 219 'UPLOADED' => $uppd, 220 'SPEED' => mksize($row['rate']) . '/' . $lang['secs_short'], 221 'WITHIN' => $row['timediff'] . $lang['secs_short'], 222 'CLIENT' => getagent($row['che_useragent'], $row['che_peer_id']), 223 'IP' => $row['userip'], 224 'ID' => $row['id'], 225 'ADDED' => create_date($config['default_dateformat'], $row['added'], $userdata['tzoffset']), 226 'TORRENT_ID' => $row['torrent_id'], 227 'TORRENT_SIZE' => mksize($row['size']) 228 ); 229 } 230 231 @ksort($users_ary); 232 233 foreach ( $users_ary AS $user_id => $ary ) { 234 235 ++$i; 236 237 list($username, $user_id, $user_ip, $reg_date, $user_icons) = explode('|', $user_id); 238 239 $template->assign_block_vars('cheat_users_row', array( 240 'USER_ID' => $user_id, 241 'USERNAME' => $username, 242 'USER_IP' => $user_ip, 243 'U_USERDETAILS' => append_sid('userdetails.php?id=' . $user_id), 244 'REG_DATE' => $reg_date, 245 'USER_ICONS' => $user_icons, 246 'NUMBER' => $i 247 )); 248 249 foreach ( $ary AS $torrent_id => $sub_ary ) { 250 251 list($torrent_id, $torrent_name) = explode('|', $torrent_id); 252 253 $template->assign_block_vars('cheat_users_row.torrents_row', array( 254 'U_TORRENT' => append_sid('details.php?id=' . $torrent_id), 255 'TORRENT_NAME' => $torrent_name, 256 )); 257 258 foreach ( $sub_ary AS $_null => $sub_sub_ary ) { //lol 259 260 $template->assign_block_vars('cheat_users_row.torrents_row.torrents_data', array( 261 'UPLOADED' => $sub_sub_ary['UPLOADED'], 262 'SPEED' => $sub_sub_ary['SPEED'], 263 'WITHIN' => $sub_sub_ary['WITHIN'], 264 'CLIENT' => $sub_sub_ary['CLIENT'], 265 'IP' => $sub_sub_ary['IP'], 266 'ADDED' => $sub_sub_ary['ADDED'], 267 'TORRENT_SIZE' => $sub_sub_ary['TORRENT_SIZE'], 268 )); 269 } 270 } 208 271 } 209 272 message.php
r197 r198 377 377 } 378 378 379 if ( !sizeof($pm_messages) ) { 380 redirect( append_sid('message.php?action=viewmailbox&box=' . $pm_box)); 381 } 382 379 383 $sql = 'SELECT * FROM ' . PRIVATE_MESSAGES_TABLE . ' WHERE id IN (' . implode(', ', $pm_messages) . ')'; 380 384 $result = $db->sql_query($sql);
