- Timestamp:
- 12/07/10 22:45:36 (1 year ago)
- Files:
-
- admin/admin_categories.php (modified) (2 diffs)
- admin/admin_mass_email.php (modified) (6 diffs)
- admin/admin_users.php (modified) (5 diffs)
- admin/admin_voting.php (modified) (5 diffs)
- admin/pagestart.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
admin/admin_categories.php
r294 r324 97 97 $template_file = file_get_contents($root_path . 'templates/upload_templates/' . $cat_id . '.html'); 98 98 99 //preg_match_all('/<tr(.*?)>(.*?)<\/tr>/si', $template_file, $tr_content);100 99 preg_match_all('/<!-- IF(.*?)>(.*?)<!-- ENDIF -->/si', $template_file, $tr_content); 101 100 … … 462 461 463 462 if ( !isset($_POST['move_torrents']) ) { 464 $sql = 'SELECT fid FROM ' . TORRENTS_TABLE . ' WHERE category = ' . $cat_id;463 $sql = 'SELECT fid, info_hash FROM ' . TORRENTS_TABLE . ' WHERE category = ' . $cat_id; 465 464 $result = $db->sql_query($sql); 466 465 $ids = array(); 467 466 while ( $row = $db->sql_fetchrow($result) ) { 468 $ids[ ] = $row['fid'];467 $ids[$row['info_hash']] = $row['fid']; 469 468 } 470 469 deletetorrent($ids); admin/admin_mass_email.php
r317 r324 44 44 @set_time_limit(0); 45 45 @ignore_user_abort(true); 46 @ini_set('memory_limit', -1); 46 47 47 48 $message = ''; … … 74 75 $group_id = ( isset($_POST[POST_GROUPS_URL]) ? intval($_POST[POST_GROUPS_URL]) : 0 ); 75 76 76 $sql = ( $group_id != -1 ) ? "SELECT u.email , u.name FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND u.uid = ug.user_id" : "SELECT email, nameFROM " . USERS_TABLE;77 $sql = ( $group_id != -1 ) ? "SELECT u.email FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND u.uid = ug.user_id" : "SELECT email FROM " . USERS_TABLE; 77 78 $result = $db->sql_query($sql); 78 79 … … 82 83 83 84 // Send with BCC, no more than 50 recipients for one mail (to not exceed the limit) 84 $max_chunk_size = 50;85 $max_chunk_size = 150; 85 86 $email_list = array(); 86 87 … … 98 99 99 100 $email_list[$j][$i]['email'] = $row['email']; 100 $email_list[$j][$i]['name'] = $row['name'];101 101 $i++; 102 102 } … … 112 112 for ($i = 0, $size = sizeof($email_list); $i < $size; $i++) 113 113 { 114 $send_to = false; 114 115 for ($j = 0, $list_size = sizeof($email_list[$i]); $j < $list_size; $j++) 115 116 { 116 117 $email_row = $email_list[$i][$j]; 117 118 118 $messenger->{((sizeof($email_list[$i]) == 1) ? 'to' : 'bcc')}($email_row['email'], $email_row['name']); 119 if ( sizeof($email_list[$i]) == 1 ) { 120 $messenger->to($email_row['email']); 121 } 122 else { 123 $messenger->bcc($email_row['email']); 124 $send_to = true; 125 } 119 126 } 120 127 if ( $send_to ) { 128 $messenger->to($config['sitemail']); 129 } 121 130 $messenger->template('admin_send_email'); 122 123 /*$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);124 $messenger->headers('X-AntiAbuse: User_id - ' . $userdata['uid']);125 $messenger->headers('X-AntiAbuse: Username - ' . $userdata['name']);126 $messenger->headers('X-AntiAbuse: User IP - ' . $user_ip);*/127 128 131 $messenger->subject($subject); 129 132 $messenger->set_mail_priority($priority); … … 133 136 'MESSAGE' => $message 134 137 )); 135 136 if (!($messenger->send(NOTIFY_EMAIL))) 137 { 138 $error = true; 139 } 138 unset($email_list[$i]); 139 140 $messenger->send(NOTIFY_EMAIL); 140 141 141 142 } 142 unset($email_list);143 143 144 144 $messenger->save_queue(); admin/admin_users.php
r319 r324 116 116 'year' => 0, 117 117 'month' => 0, 118 'day' => 0 118 'day' => 0, 119 'bonus' => 0 119 120 ); 120 121 … … 265 266 $updateset[] = 'uploaded = uploaded + ' . $add_upload * 1024 * 1024 * 1024; 266 267 $modcomment[] = sprintf($lang['modcomment_add_upload_text'], 't' . time(), $add_upload, $userdata['name'], $add_upload_reason ); 268 } 269 270 if ( $bonus ) { 271 $updateset[] = 'total_seed_time = total_seed_time + ' . ( ( 3600 * $bonus ) / $config['my_bonus_points'] ); 272 $modcomment[] = sprintf($lang['modcomment_add_bonus_text'], 't' . time(), $bonus, $userdata['name']); 267 273 } 268 274 … … 420 426 $user_status = $this_userdata['enabled']; 421 427 $invites = intval($this_userdata['invites']); 428 $bonus = number_format( $config['my_bonus_points'] * ( $this_userdata['total_seed_time'] / 3600 ), 2 ); 422 429 423 430 … … 426 433 $s_hidden_fields .= '<input type="hidden" name="add_upload_reason" value="" />'; 427 434 //$s_hidden_fields .= '<input type="hidden" name="signature" value="' . str_replace("\"", """, $signature) . '" />'; 428 $avatar_prefix = ( ( strpos($this_userdata['avatar'], 'user_avatar_' . $this_userdata['uid']) === false && strpos($this_userdata['avatar'], '/') !== false ) || !$this_userdata['avatar'] ? '' : generate_base_url() . '/' . $config['avatar_path'] . '/' ); 429 $avatar = ( $this_userdata['avatar']? ' <img src="' . $avatar_prefix . $this_userdata['avatar'] . '" alt="" />' : '' ); 435 436 $avatar = get_user_avatar($this_userdata['uid'], $this_userdata['avatar']); 437 $avatar = ( $this_userdata['avatar']? ' <img src="' . $avatar . '" alt="" />' : '' ); 430 438 431 439 $cats = $cache->obtain_cats(); … … 563 571 564 572 'S_HIDDEN_FIELDS' => $s_hidden_fields, 565 'S_PROFILE_ACTION' => append_sid("admin_users.$phpEx")) 566 ); 573 'S_PROFILE_ACTION' => append_sid("admin_users.$phpEx"), 574 575 'BONUS' => $bonus 576 )); 567 577 568 578 $template->display('body'); admin/admin_voting.php
r269 r324 37 37 include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_admin_voting.' . $phpEx); 38 38 39 if ( isset($_GET['action']) && $_GET['action'] == 'show_voted_users' ) { 40 $poll_id = ( isset($_POST['poll_id']) ? intval($_POST['poll_id']) : 0 ); 41 include($root_path . 'include/functions_admin.' . $phpEx); 42 admin_ajax_show_vote_users($poll_id); 43 exit(); 44 } 45 // 46 // Set mode 47 // 48 if( isset( $_POST['mode'] ) || isset( $_GET['mode'] ) ) 49 { 50 $mode = ( isset( $_POST['mode']) ) ? $_POST['mode'] : $_GET['mode']; 51 $mode = htmlspecialchars($mode); 52 } 53 else 54 { 55 $mode = ''; 56 } 39 $mode = request_var('mode', ''); 40 57 41 if ( $mode == 'delete' ) { 58 42 $vote_id = ( isset($_GET['vote_id']) ? intval($_GET['vote_id']) : 0 ); … … 81 65 trigger_error('Invalid poll id'); 82 66 } 67 } 68 69 if ( $mode == 'show_poll_results' ) { 70 $poll_id = request_var('poll_id', 0); 71 72 // Assign Username array 73 $sql = "SELECT DISTINCT u.uid, u.name AS username, u.class, u.warneduntil, u.enabled, u.donor, u.parked, vote_id, vote_user_id, vote_cast 74 FROM " . USERS_TABLE . " AS u , " . VOTE_USERS_TABLE . " AS vv 75 WHERE u.uid = vv.vote_user_id AND vote_id = " . $poll_id; 76 $result = $db->sql_query($sql); 77 while ( $row = $db->sql_fetchrow($result) ) { 78 $voter_arr[$row['vote_cast']][] = parse_username($row); 79 } 80 81 // Assign poll options array 82 $sql = "SELECT vote_option_id, vote_option_text, vote_result FROM ". VOTE_RESULTS_TABLE . " WHERE vote_id = " . $poll_id; 83 $result = $db->sql_query($sql); 84 85 while ( $row = $db->sql_fetchrow($result) ) { 86 $option_arr[$row['vote_option_id']] = $row; 87 } 88 89 $result_ary = array(); 90 91 foreach( $option_arr AS $vote_option_id => $elem ) { 92 $option_text = $elem["vote_option_text"]; 93 $option_result = $elem["vote_result"]; 94 $user = ( isset($voter_arr[$vote_option_id]) ? $voter_arr[$vote_option_id] : array() ); 95 $user = implode(', ', $user); 96 //$user = substr($user, "0", strrpos($user, ", ")); 97 98 $result_ary[$option_text][] = array('result' => $option_result, 'users' => $user); 99 } 100 gc(json_encode(array('results' => $result_ary))); 83 101 } 84 102 … … 354 372 )); 355 373 356 // Assign Username array357 $sql = "SELECT DISTINCT u.uid, u.name AS username, u.class, u.warneduntil, u.enabled, u.donor, u.parked358 FROM " . USERS_TABLE . " AS u , " . VOTE_USERS_TABLE . " AS vv359 WHERE u.uid = vv.vote_user_id";360 361 $result = $db->sql_query($sql);362 363 while ( $row = $db->sql_fetchrow($result) )364 {365 $user_arr[$row['uid']] = get_user_class_color($row['class'], $row['username']) . get_user_icons($row);366 }367 368 // Assign poll options array369 $sql = "SELECT *370 FROM ". VOTE_RESULTS_TABLE .371 " ORDER BY vote_id";372 373 $result = $db->sql_query($sql);374 375 while ( $row = $db->sql_fetchrow($result) )376 {377 $vote_id = $row['vote_id'];378 $vote_option_id = $row['vote_option_id'];379 $vote_option_text = $row['vote_option_text'];380 $vote_result = $row['vote_result'];381 $option_arr[$vote_id][$vote_option_id]["text"] = $vote_option_text;382 $option_arr[$vote_id][$vote_option_id]["result"] = $vote_result;383 }384 385 // Assign individual vote results386 $sql = "SELECT vote_id, vote_user_id, vote_cast387 FROM ". VOTE_USERS_TABLE .388 " ORDER BY vote_id";389 390 $result = $db->sql_query($sql);391 392 while ( $row = $db->sql_fetchrow($result) )393 {394 $vote_id = $row['vote_id'];395 $vote_user_id = $row['vote_user_id'];396 $vote_cast = $row['vote_cast'];397 $voter_arr[$vote_id][$vote_user_id] = $vote_cast;398 }399 400 374 401 375 $sql ="SELECT * … … 459 433 ); 460 434 461 if ( isset($voter_arr[$vote_id]) && sizeof($voter_arr[$vote_id]) )462 {463 foreach($option_arr[$vote_id] as $vote_option_id => $elem)464 {465 $option_text = $elem["text"];466 $option_result = $elem["result"];467 $user = ( isset($user_option_arr[$vote_option_id]) ? $user_option_arr[$vote_option_id] : 0 );468 $user = substr($user, "0", strrpos($user, ", "));469 470 $template->assign_block_vars("viewresult.votes.detail", array(471 'OPTION' => censor_text($option_text),472 'RESULT' => $option_result,473 'USER' => $user )474 );475 }476 }477 478 $i++;479 480 435 } 481 436 … … 491 446 { 492 447 $total_polls = $total['total']; 493 $pagination = generate_pagination( "admin_voting.$phpEx?mode=$sort_field&order=$sort_order", $total_polls, $config['posts_per_page'], $start). ' ';448 $pagination = generate_pagination($admin_path . "admin_voting.$phpEx?mode=$sort_field&order=$sort_order", $total_polls, $config['posts_per_page'], $start). ' '; 494 449 } 495 450 admin/pagestart.php
r294 r324 36 36 $userdata = session_pagestart($user_ip); 37 37 init_userprefs($userdata); 38 $session_id = ( isset($_GET['sid']) ? $_GET['sid'] : '' ); 38 $session_id = request_var('sid', ''); 39 $no_page_header = ( !empty($no_page_header) ? $no_page_header : request_var('no_page_header', 0) ); 39 40 40 41 $current_page = extract_current_page(); … … 55 56 } 56 57 57 if ( ! isset($no_page_header))58 if ( !$no_page_header ) 58 59 { 59 60 // Not including the pageheader can be neccesarry if META tags are
