From 43b028988dd523534c49f659d442e479a8dac460 Mon Sep 17 00:00:00 2001 From: "glix08@gmail.com" Date: Sun, 2 Feb 2014 21:44:03 +0000 Subject: [PATCH] r580 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Фиксы багов по запросам на форуме, большое спасибо всем запостившим найденное; удаление поиска пользователей с отключенными ЛС (после r600 будет универсальная обработка для поля bf в базе данных); фикс ошибки из-за которой не учитывались сообщения пользователя в счетчике его сообщений; пара фиксов предыдущих ревизий. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@580 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- install/sql/mysql.sql | 42 ++++---- upgrade/r575-poll_upgrade.php | 20 ++++ upload/admin/admin_extensions.php | 11 +- upload/admin/admin_mass_email.php | 23 ++--- upload/admin/admin_topic_templates.php | 2 +- upload/admin/admin_user_search.php | 12 --- upload/ajax.php | 38 +++---- upload/ajax/posts.php | 8 +- upload/config.php | 4 +- upload/groupcp.php | 35 +++---- upload/includes/functions_post.php | 26 ++--- upload/includes/functions_report.php | 2 +- upload/includes/ucp/usercp_activate.php | 2 +- upload/includes/ucp/usercp_email.php | 4 +- upload/includes/ucp/usercp_register.php | 2 +- upload/includes/ucp/usercp_sendpasswd.php | 2 +- upload/language/lang_english/lang_main.php | 5 +- upload/language/lang_russian/lang_main.php | 5 +- upload/memberlist.php | 46 ++++----- upload/poll.php | 2 +- upload/posting.php | 100 +++++++++---------- upload/privmsg.php | 4 +- upload/templates/admin/admin_user_search.tpl | 2 +- upload/templates/default/posting.tpl | 2 - upload/templates/default/posting_poll.tpl | 40 -------- 25 files changed, 193 insertions(+), 246 deletions(-) delete mode 100644 upload/templates/default/posting_poll.tpl diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index 5ca7e9403..a2340f8d3 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -638,27 +638,27 @@ CREATE TABLE IF NOT EXISTS `bb_cron` ( -- Дамп данных таблицы `bb_cron` -- -INSERT INTO `bb_cron` VALUES ('', 0, 'Site backup', 'site_backup.php', 'daily', '1', '05:00:00', 10, '', '', NULL, 1, '', 0, 1, 0); -INSERT INTO `bb_cron` VALUES ('', 0, 'DB backup', 'db_backup.php', 'daily', '1', '05:00:00', 20, '', '', NULL, 1, '', 0, 1, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Avatars cleanup', 'avatars_cleanup.php', 'weekly', '1', '05:00:00', 30, '', '', NULL, 1, '', 0, 1, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Board maintenance', 'bb_maintenance.php', 'daily', NULL, '05:00:00', 40, '', '', NULL, 1, '', 0, 1, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Prune forums', 'prune_forums.php', 'daily', NULL, '05:00:00', 50, '', '', NULL, 1, '', 0, 1, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Prune topic moved stubs', 'prune_topic_moved.php', 'daily', NULL, '05:00:00', 60, '', '', NULL, 1, '', 0, 1, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Logs cleanup', 'clean_log.php', 'daily', NULL, '05:00:00', 70, '', '', NULL, 1, '', 0, 1, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Tracker maintenance', 'tr_maintenance.php', 'daily', NULL, '05:00:00', 90, '', '', NULL, 1, '', 0, 1, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Clean dlstat', 'clean_dlstat.php', 'daily', NULL, '05:00:00', 100, '', '', NULL, 1, '', 0, 1, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Prune inactive users', 'prune_inactive_users.php', 'daily', NULL, '05:00:00', 110, '', '', NULL, 1, '', 0, 1, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Sessions cleanup', 'sessions_cleanup.php', 'interval', NULL, NULL, 255, '', '', '00:03:00', 0, '', 0, 0, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'DS update ''cat_forums''', 'ds_update_cat_forums.php', 'interval', NULL, NULL, 255, '', '', '00:05:00', 0, '', 0, 0, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'DS update ''stats''', 'ds_update_stats.php', 'interval', NULL, NULL, 255, '', '', '00:10:00', 0, '', 0, 0, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Flash topic view', 'flash_topic_view.php', 'interval', NULL, NULL, 255, '', '', '00:10:00', 0, '', 0, 0, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Clean search results', 'clean_search_results.php', 'interval', NULL, NULL, 255, '', '', '00:10:00', 0, '', 0, 0, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Tracker cleanup and dlstat', 'tr_cleanup_and_dlstat.php', 'interval', NULL, NULL, 20, '', '', '00:15:00', 0, '', 0, 0, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Make tracker snapshot', 'tr_make_snapshot.php', 'interval', NULL, NULL, 10, '', '', '00:10:00', 0, '', 0, 0, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Seeder last seen', 'tr_update_seeder_last_seen.php', 'interval', NULL, NULL, 255, '', '', '01:00:00', 0, '', 0, 0, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Captcha', 'captcha_gen_gc.php', 'daily', NULL, '05:00:00', 120, '', '', NULL, 0, '', 0, 0, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Tracker dl-complete count', 'tr_complete_count.php', 'interval', NULL, NULL, 255, '', '', '06:00:00', 0, '', 0, 0, 0); -INSERT INTO `bb_cron` VALUES ('', 1, 'Cache garbage collector', 'cache_gc.php', 'interval', NULL, NULL, 255, '', '', '00:05:00', 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (1, 0, 'Site backup', 'site_backup.php', 'daily', '1', '05:00:00', 10, '', '', NULL, 1, '', 0, 1, 0); +INSERT INTO `bb_cron` VALUES (2, 0, 'DB backup', 'db_backup.php', 'daily', '1', '05:00:00', 20, '', '', NULL, 1, '', 0, 1, 0); +INSERT INTO `bb_cron` VALUES (3, 1, 'Avatars cleanup', 'avatars_cleanup.php', 'weekly', '1', '05:00:00', 30, '', '', NULL, 1, '', 0, 1, 0); +INSERT INTO `bb_cron` VALUES (4, 1, 'Board maintenance', 'bb_maintenance.php', 'daily', NULL, '05:00:00', 40, '', '', NULL, 1, '', 0, 1, 0); +INSERT INTO `bb_cron` VALUES (5, 1, 'Prune forums', 'prune_forums.php', 'daily', NULL, '05:00:00', 50, '', '', NULL, 1, '', 0, 1, 0); +INSERT INTO `bb_cron` VALUES (6, 1, 'Prune topic moved stubs', 'prune_topic_moved.php', 'daily', NULL, '05:00:00', 60, '', '', NULL, 1, '', 0, 1, 0); +INSERT INTO `bb_cron` VALUES (7, 1, 'Logs cleanup', 'clean_log.php', 'daily', NULL, '05:00:00', 70, '', '', NULL, 1, '', 0, 1, 0); +INSERT INTO `bb_cron` VALUES (8, 1, 'Tracker maintenance', 'tr_maintenance.php', 'daily', NULL, '05:00:00', 90, '', '', NULL, 1, '', 0, 1, 0); +INSERT INTO `bb_cron` VALUES (9, 1, 'Clean dlstat', 'clean_dlstat.php', 'daily', NULL, '05:00:00', 100, '', '', NULL, 1, '', 0, 1, 0); +INSERT INTO `bb_cron` VALUES (10, 1, 'Prune inactive users', 'prune_inactive_users.php', 'daily', NULL, '05:00:00', 110, '', '', NULL, 1, '', 0, 1, 0); +INSERT INTO `bb_cron` VALUES (11, 1, 'Sessions cleanup', 'sessions_cleanup.php', 'interval', NULL, NULL, 255, '', '', '00:03:00', 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (12, 1, 'DS update ''cat_forums''', 'ds_update_cat_forums.php', 'interval', NULL, NULL, 255, '', '', '00:05:00', 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (13, 1, 'DS update ''stats''', 'ds_update_stats.php', 'interval', NULL, NULL, 255, '', '', '00:10:00', 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (14, 1, 'Flash topic view', 'flash_topic_view.php', 'interval', NULL, NULL, 255, '', '', '00:10:00', 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (15, 1, 'Clean search results', 'clean_search_results.php', 'interval', NULL, NULL, 255, '', '', '00:10:00', 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (16, 1, 'Tracker cleanup and dlstat', 'tr_cleanup_and_dlstat.php', 'interval', NULL, NULL, 20, '', '', '00:15:00', 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (17, 1, 'Make tracker snapshot', 'tr_make_snapshot.php', 'interval', NULL, NULL, 10, '', '', '00:10:00', 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (18, 1, 'Seeder last seen', 'tr_update_seeder_last_seen.php', 'interval', NULL, NULL, 255, '', '', '01:00:00', 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (19, 1, 'Captcha', 'captcha_gen_gc.php', 'daily', NULL, '05:00:00', 120, '', '', NULL, 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (20, 1, 'Tracker dl-complete count', 'tr_complete_count.php', 'interval', NULL, NULL, 255, '', '', '06:00:00', 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (21, 1, 'Cache garbage collector', 'cache_gc.php', 'interval', NULL, NULL, 255, '', '', '00:05:00', 0, '', 0, 0, 0); -- -------------------------------------------------------- diff --git a/upgrade/r575-poll_upgrade.php b/upgrade/r575-poll_upgrade.php index d45797f6c..b3efecbbd 100644 --- a/upgrade/r575-poll_upgrade.php +++ b/upgrade/r575-poll_upgrade.php @@ -13,6 +13,26 @@ $confirm = request_var('confirm', ''); if ($confirm) { + DB()->query(" + CREATE TABLE IF NOT EXISTS `bb_poll_users` ( + `topic_id` int(10) unsigned NOT NULL, + `user_id` int(11) NOT NULL, + `vote_ip` varchar(32) NOT NULL, + `vote_dt` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`topic_id`,`user_id`) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8 + "); + + DB()->query(" + CREATE TABLE IF NOT EXISTS `bb_poll_votes` ( + `topic_id` int(10) unsigned NOT NULL, + `vote_id` tinyint(4) unsigned NOT NULL, + `vote_text` varchar(255) NOT NULL, + `vote_result` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`topic_id`,`vote_id`) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8 + "); + DB()->query(" INSERT INTO bb_poll_votes (topic_id, vote_id, vote_text, vote_result) diff --git a/upload/admin/admin_extensions.php b/upload/admin/admin_extensions.php index 06aa3120d..479ea1316 100644 --- a/upload/admin/admin_extensions.php +++ b/upload/admin/admin_extensions.php @@ -88,10 +88,7 @@ if ($submit && $mode == 'extensions') $extensions['_' . $extension_change_list[$i]]['group_id'] = intval($group_select_list[$i]); } - $sql = 'SELECT * - FROM ' . BB_EXTENSIONS . ' - ORDER BY ext_id'; - + $sql = 'SELECT * FROM ' . BB_EXTENSIONS . ' ORDER BY ext_id'; if ( !($result = DB()->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Couldn\'t get Extension Informations.', '', __LINE__, __FILE__, $sql); @@ -153,7 +150,7 @@ if ($submit && $mode == 'extensions') 'ADD_EXTENSION_EXPLAIN' => $extension_explain) ); - if (!$error) + if (!@$error) { // check extension $sql = 'SELECT extension @@ -184,7 +181,7 @@ if ($submit && $mode == 'extensions') } } - if (!$error) + if (!@$error) { $sql_ary = array( 'group_id' => (int) $extension_group, @@ -394,7 +391,7 @@ if ($submit && $mode == 'groups') } } - if (!$error) + if (!@$error) { $filesize = ($size_select == 'kb') ? round($filesize * 1024) : ( ($size_select == 'mb') ? round($filesize * 1048576) : $filesize ); diff --git a/upload/admin/admin_mass_email.php b/upload/admin/admin_mass_email.php index c509e0f96..3a20c2a7b 100644 --- a/upload/admin/admin_mass_email.php +++ b/upload/admin/admin_mass_email.php @@ -19,20 +19,20 @@ $errors = $user_id_sql = array(); if (isset($_POST['submit'])) { - if(!$subject) $errors[] = $lang['EMPTY_SUBJECT']; - if(!$message) $errors[] = $lang['EMPTY_MESSAGE']; - if(!$group_id) $errors[] = $lang['GROUP_NOT_EXIST']; - - if(!$errors) + if (!$subject) $errors[] = $lang['EMPTY_SUBJECT']; + if (!$message) $errors[] = $lang['EMPTY_MESSAGE']; + if (!$group_id) $errors[] = $lang['GROUP_NOT_EXIST']; + + if (!$errors) { $sql = DB()->fetch_rowset("SELECT ban_userid FROM ". BB_BANLIST ." WHERE ban_userid != 0"); - + foreach ($sql as $row) { $user_id_sql[] = ','. $row['ban_userid']; } $user_id_sql = join('', $user_id_sql); - + if ($group_id != -1) { $user_list = DB()->fetch_rowset(" @@ -54,9 +54,9 @@ if (isset($_POST['submit'])) AND user_id NOT IN(". EXCLUDED_USERS_CSV . $user_id_sql .") "); } - + require(INC_DIR .'emailer.class.php'); - + foreach ($user_list as $i => $row) { $emailer = new emailer($bb_cfg['smtp_delivery']); @@ -76,11 +76,9 @@ if (isset($_POST['submit'])) } } - // // Generate page // - $sql = "SELECT group_id, group_name FROM ". BB_GROUPS ." WHERE group_single_user = 0 @@ -93,7 +91,6 @@ foreach (DB()->fetch_rowset($sql) as $row) $groups[$row['group_name']] = $row['group_id']; } - $template->assign_vars(array( 'MESSAGE' => $message, 'SUBJECT' => $subject, @@ -104,4 +101,4 @@ $template->assign_vars(array( 'S_GROUP_SELECT' => build_select(POST_GROUPS_URL, $groups), )); -print_page('admin_mass_email.tpl', 'admin'); +print_page('admin_mass_email.tpl', 'admin'); \ No newline at end of file diff --git a/upload/admin/admin_topic_templates.php b/upload/admin/admin_topic_templates.php index 9a274a682..01d197986 100644 --- a/upload/admin/admin_topic_templates.php +++ b/upload/admin/admin_topic_templates.php @@ -83,7 +83,7 @@ elseif ($mode == 'add' || $mode == 'edit') { DB()->query("INSERT INTO ". BB_TOPIC_TPL_OLD ." (tpl_name, tpl_script, tpl_template, tpl_desc) VALUES ('". DB()->escape($tpl_name) ."', '". DB()->escape($tpl_script) ."', '". DB()->escape($tpl_template) ."', '". DB()->escape($tpl_desc) ."')"); - $message = $lang['ADEDD']; + $message = $lang['ADDED']; } bb_die($message); diff --git a/upload/admin/admin_user_search.php b/upload/admin/admin_user_search.php index a2d226b32..6cbb085c0 100644 --- a/upload/admin/admin_user_search.php +++ b/upload/admin/admin_user_search.php @@ -1118,18 +1118,6 @@ else $select_sql .= " WHERE u.user_active = 0 AND u.user_id <> ".GUEST_UID; - break; - case 'disabled_pms': - $text = $lang['SEARCH_FOR_DISABLED_PMS']; - - $total_sql .= "SELECT COUNT(user_id) AS total - FROM ".BB_USERS." - WHERE user_allow_pm = 0 - AND user_id <> ".GUEST_UID; - - $select_sql .= " WHERE u.user_allow_pm = 0 - AND u.user_id <> ".GUEST_UID; - break; default: message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID']); diff --git a/upload/ajax.php b/upload/ajax.php index 8210c68fc..b7013459a 100644 --- a/upload/ajax.php +++ b/upload/ajax.php @@ -16,7 +16,7 @@ if (file_exists(BB_DISABLED)) } // Load actions required modules -switch ($ajax->action) +switch ($ajax->action) { case 'view_post': require(INC_DIR . 'bbcode.php'); @@ -120,17 +120,17 @@ class ajax_common // Check that requested action is valid $action = $this->action; - if (!$action || !is_string($action)) + if (!$action || !is_string($action)) { $this->ajax_die('no action specified'); } - elseif (!$action_params =& $this->valid_actions[$action]) + elseif (!$action_params =& $this->valid_actions[$action]) { $this->ajax_die('invalid action: ' . $action); } // Auth check - switch ($action_params[AJAX_AUTH]) + switch ($action_params[AJAX_AUTH]) { // GUEST case 'guest': @@ -138,7 +138,7 @@ class ajax_common // USER case 'user': - if (IS_GUEST) + if (IS_GUEST) { $this->ajax_die($lang['NEED_TO_LOGIN_FIRST']); } @@ -146,7 +146,7 @@ class ajax_common // MOD case 'mod': - if (!IS_AM) + if (!IS_AM) { $this->ajax_die($lang['ONLY_FOR_MOD']); } @@ -155,7 +155,7 @@ class ajax_common // ADMIN case 'admin': - if (!IS_ADMIN) + if (!IS_ADMIN) { $this->ajax_die($lang['ONLY_FOR_ADMIN']); } @@ -164,7 +164,7 @@ class ajax_common // SUPER_ADMIN case 'super_admin': - if (!IS_SUPER_ADMIN) + if (!IS_SUPER_ADMIN) { $this->ajax_die($lang['ONLY_FOR_SUPER_ADMIN']); } @@ -209,7 +209,7 @@ class ajax_common { $this->response['action'] = $this->action; - if (DBG_USER && SQL_DEBUG && !empty($_COOKIE['sql_log'])) + if (DBG_USER && SQL_DEBUG && !empty($_COOKIE['sql_log'])) { $this->response['sql_log'] = get_sql_log(); } @@ -223,9 +223,9 @@ class ajax_common */ function ob_handler($contents) { - if (DBG_USER) + if (DBG_USER) { - if ($contents) + if ($contents) { $this->response['raw_output'] = $contents; } @@ -233,9 +233,9 @@ class ajax_common $response_js = bb_json_encode($this->response); - if (GZIP_OUTPUT_ALLOWED && !defined('NO_GZIP')) + if (GZIP_OUTPUT_ALLOWED && !defined('NO_GZIP')) { - if (UA_GZIP_SUPPORTED && strlen($response_js) > 2000) + if (UA_GZIP_SUPPORTED && strlen($response_js) > 2000) { header('Content-Encoding: gzip'); $response_js = gzencode($response_js, 1); @@ -252,19 +252,19 @@ class ajax_common { global $user; - if (!$user->data['session_admin']) + if (!$user->data['session_admin']) { - if (empty($this->request['user_password'])) + if (empty($this->request['user_password'])) { $this->prompt_for_password(); - } - else + } + else { $login_args = array( 'login_username' => $user->data['username'], 'login_password' => $_POST['user_password'], ); - if (!$user->login($login_args, true)) + if (!$user->login($login_args, true)) { $this->ajax_die('Wrong password'); } @@ -302,7 +302,7 @@ class ajax_common $is_auth = auth(AUTH_MOD, $forum_id, $userdata); - if (!$is_auth['auth_mod']) + if (!$is_auth['auth_mod']) { $this->ajax_die($lang['ONLY_FOR_MOD']); } diff --git a/upload/ajax/posts.php b/upload/ajax/posts.php index 9e11c12a1..339b0e484 100644 --- a/upload/ajax/posts.php +++ b/upload/ajax/posts.php @@ -138,7 +138,7 @@ switch($this->request['type']) $this->ajax_die(sprintf($lang['MAX_SMILIES_PER_POST'], $bb_cfg['max_smilies'])); } } - DB()->query("UPDATE ". BB_POSTS_TEXT ." SET post_text = '". DB()->escape($text) ."' WHERE post_id = $post_id"); + DB()->query("UPDATE ". BB_POSTS_TEXT ." SET post_text = '". DB()->escape($text) ."' WHERE post_id = $post_id LIMIT 1"); if ($post['topic_last_post_id'] != $post['post_id'] && $userdata['user_id'] == $post['poster_id']) { DB()->query("UPDATE ". BB_POSTS ." SET post_edit_time = '". TIMENOW ."', post_edit_count = post_edit_count + 1 WHERE post_id = $post_id LIMIT 1"); @@ -298,14 +298,14 @@ switch($this->request['type']) 'post_id' => $post_id, 'post_text' => $message, )); - + if ($bb_cfg['topic_notify_enabled']) { $notify = !empty($this->request['notify']); user_notification('reply', $post, $post['topic_title'], $post['forum_id'], $topic_id, $notify); } - - $this->response['redirect'] = make_url(POST_URL ."$post_id#$post_id"); + + $this->response['redirect'] = make_url(POST_URL . "$post_id#$post_id"); break; default: diff --git a/upload/config.php b/upload/config.php index f91e97552..ac729576b 100644 --- a/upload/config.php +++ b/upload/config.php @@ -54,9 +54,9 @@ $domain_name = 'torrentpier.me'; // Enter here your primary d $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $domain_name; // Increase number of revision after update -$bb_cfg['tp_version'] = '2.5 (unstable)'; +$bb_cfg['tp_version'] = '2.6 (unstable)'; $bb_cfg['tp_release_date'] = '02-02-2014'; -$bb_cfg['tp_release_state'] = 'R579'; +$bb_cfg['tp_release_state'] = 'R580'; // Database $charset = 'utf8'; diff --git a/upload/groupcp.php b/upload/groupcp.php index 04d30278e..a0b8447cc 100644 --- a/upload/groupcp.php +++ b/upload/groupcp.php @@ -248,15 +248,16 @@ else if (@$_POST['joingroup']) $emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>"); $emailer->email_address($moderator['username'] ." <{$moderator['user_email']}>"); - + $emailer->use_template('group_request', $moderator['user_lang']); - + $emailer->assign_vars(array( 'USER' => $userdata['username'], 'SITENAME' => $bb_cfg['sitename'], 'GROUP_MODERATOR' => $moderator['username'], 'U_GROUPCP' => make_url(GROUP_URL . $group_id), )); + $emailer->send(); $emailer->reset(); } @@ -305,15 +306,15 @@ else $emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>"); $emailer->email_address($row['username'] ." <{$row['user_email']}>"); - + $emailer->use_template('group_added', $row['user_lang']); - + $emailer->assign_vars(array( 'SITENAME' => $bb_cfg['sitename'], 'GROUP_NAME' => $group_info['group_name'], 'U_GROUPCP' => make_url(GROUP_URL . $group_id), )); - + $emailer->send(); $emailer->reset(); } @@ -380,13 +381,13 @@ else $emailer->use_template('group_approved', $row['user_lang']); $emailer->email_address($row['username'] ." <{$row['user_email']}>"); } - + $emailer->assign_vars(array( 'SITENAME' => $bb_cfg['sitename'], 'GROUP_NAME' => $group_info['group_name'], 'U_GROUPCP' => make_url(GROUP_URL . $group_id), )); - + $emailer->send(); $emailer->reset(); } @@ -402,7 +403,7 @@ else WHERE user_id = ". $group_info['group_moderator'] ." "); - // Members + // Members $count_members = DB()->fetch_rowset(" SELECT u.username, u.user_rank, u.user_id, u.user_opt, u.user_posts, u.user_regdate, u.user_from, u.user_website, u.user_email, ug.user_pending, ug.user_time FROM ". BB_USER_GROUP ." ug, ". BB_USERS ." u @@ -412,7 +413,7 @@ else AND u.user_id = ug.user_id ORDER BY u.username "); - $count_members = count($count_members); + $count_members = count($count_members); // Get user information for this group $modgroup_pending_count = 0; @@ -514,16 +515,16 @@ else generate_user_info($group_moderator, $bb_cfg['default_dateformat'], $is_moderator, $from, $posts, $joined, $pm, $email, $www, $user_time); - $group_type = ''; - if($group_info['group_type'] == GROUP_OPEN) - { - $group_type = $lang['GROUP_OPEN']; - } - elseif($group_info['group_type'] == GROUP_CLOSED) + $group_type = ''; + if ($group_info['group_type'] == GROUP_OPEN) + { + $group_type = $lang['GROUP_OPEN']; + } + elseif ($group_info['group_type'] == GROUP_CLOSED) { $group_type = $lang['GROUP_CLOSED']; } - elseif($group_info['group_type'] == GROUP_HIDDEN) + elseif ($group_info['group_type'] == GROUP_HIDDEN) { $group_type = $lang['GROUP_HIDDEN']; } @@ -546,7 +547,7 @@ else 'MOD_WWW' => $www, 'MOD_TIME' => ( !empty($group_info['group_time']) ) ? bb_date($group_info['group_time']) : $lang['NONE'], 'U_SEARCH_USER' => "search.php?mode=searchuser", - 'GROUP_TYPE' => $group_type, + 'GROUP_TYPE' => $group_type, 'S_GROUP_OPEN_TYPE' => GROUP_OPEN, 'S_GROUP_CLOSED_TYPE' => GROUP_CLOSED, 'S_GROUP_HIDDEN_TYPE' => GROUP_HIDDEN, diff --git a/upload/includes/functions_post.php b/upload/includes/functions_post.php index fa5b78eb7..354e63840 100644 --- a/upload/includes/functions_post.php +++ b/upload/includes/functions_post.php @@ -272,9 +272,7 @@ function update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $u } else if ($post_data['first_post']) { - $sql = "SELECT MIN(post_id) AS first_post_id - FROM " . BB_POSTS . " - WHERE topic_id = $topic_id"; + $sql = "SELECT MIN(post_id) AS first_post_id FROM " . BB_POSTS . " WHERE topic_id = $topic_id"; if (!($result = DB()->sql_query($sql))) { message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql); @@ -290,7 +288,7 @@ function update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $u $topic_update_sql .= 'topic_replies = topic_replies - 1'; } } - else if ($mode != 'poll_delete') + else { $forum_update_sql .= ", forum_last_post_id = $post_id" . (($mode == 'newtopic') ? ", forum_topics = forum_topics $sign" : ""); $topic_update_sql = "topic_last_post_id = $post_id, topic_last_post_time = ". TIMENOW . (($mode == 'reply') ? ", topic_replies = topic_replies $sign" : ", topic_first_post_id = $post_id"); @@ -304,14 +302,18 @@ function update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $u if ($topic_update_sql != '') { - $sql = "UPDATE " . BB_TOPICS . " SET - $topic_update_sql - WHERE topic_id = $topic_id"; + $sql = "UPDATE " . BB_TOPICS . " SET $topic_update_sql WHERE topic_id = $topic_id"; if (!DB()->sql_query($sql)) { message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql); } } + + $sql = "UPDATE " . BB_USERS . " SET user_posts = user_posts $sign WHERE user_id = $user_id"; + if (!DB()->sql_query($sql)) + { + message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql); + } } // @@ -365,18 +367,18 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi { require(INC_DIR .'emailer.class.php'); $emailer = new emailer($bb_cfg['smtp_delivery']); - + $orig_word = $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); - + if (count($orig_word)) { $topic_title = preg_replace($orig_word, $replacement_word, $topic_title); } - + $u_topic = make_url(TOPIC_URL . $topic_id .'&view=newest#newest'); $unwatch_topic = make_url(TOPIC_URL ."$topic_id&unwatch=topic"); - + foreach ($watch_list as $row) { $emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>"); @@ -393,7 +395,7 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi $emailer->send(); $emailer->reset(); - + $update_watched_sql[] = $row['user_id']; } $update_watched_sql = join(',', $update_watched_sql); diff --git a/upload/includes/functions_report.php b/upload/includes/functions_report.php index 8cb7f173d..901d75925 100644 --- a/upload/includes/functions_report.php +++ b/upload/includes/functions_report.php @@ -496,7 +496,7 @@ function report_notify($mode) require(INC_DIR .'emailer.class.php'); $emailer = new emailer($bb_cfg['smtp_delivery']); - + $emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>"); // Send emails diff --git a/upload/includes/ucp/usercp_activate.php b/upload/includes/ucp/usercp_activate.php index 4f379a982..ddfa030b4 100644 --- a/upload/includes/ucp/usercp_activate.php +++ b/upload/includes/ucp/usercp_activate.php @@ -52,7 +52,7 @@ if ( $row = DB()->sql_fetchrow($result) ) $emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>"); $emailer->email_address($row['username'] ." <{$row['user_email']}>"); - + $emailer->use_template('admin_welcome_activated', $row['user_lang']); $emailer->assign_vars(array( diff --git a/upload/includes/ucp/usercp_email.php b/upload/includes/ucp/usercp_email.php index a1f1a7908..69fa48db0 100644 --- a/upload/includes/ucp/usercp_email.php +++ b/upload/includes/ucp/usercp_email.php @@ -30,7 +30,7 @@ $sql = "SELECT username, user_id, user_rank, user_email, user_lang FROM " . BB_USERS . " WHERE user_id = $user_id "; - + if ($row = DB()->fetch_row($sql)) { $username = $row['username']; @@ -54,7 +54,7 @@ if ($row = DB()->fetch_row($sql)) $emailer->from($userdata['username'] ." <{$userdata['user_email']}>"); $emailer->email_address($username ." <$user_email>"); - + $emailer->use_template('profile_send_email', $user_lang); $emailer->set_subject($subject); diff --git a/upload/includes/ucp/usercp_register.php b/upload/includes/ucp/usercp_register.php index 6091af81b..766d9305a 100644 --- a/upload/includes/ucp/usercp_register.php +++ b/upload/includes/ucp/usercp_register.php @@ -905,7 +905,7 @@ if ($submit && !$errors) $sql_args = DB()->build_array('UPDATE', $db_data); - DB()->query("UPDATE ". BB_USERS ." SET $sql_args WHERE user_id = {$pr_data['user_id']}"); + DB()->query("UPDATE ". BB_USERS ." SET $sql_args WHERE user_id = {$pr_data['user_id']} LIMIT 1"); if ($pr_data['user_id'] != $userdata['user_id']) { diff --git a/upload/includes/ucp/usercp_sendpasswd.php b/upload/includes/ucp/usercp_sendpasswd.php index 180c62056..8666d354b 100644 --- a/upload/includes/ucp/usercp_sendpasswd.php +++ b/upload/includes/ucp/usercp_sendpasswd.php @@ -47,7 +47,7 @@ if ( isset($_POST['submit']) ) $emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>"); $emailer->email_address("$username <{$row['user_email']}>"); - + $emailer->use_template('user_activate_passwd', $row['user_lang']); $emailer->assign_vars(array( diff --git a/upload/language/lang_english/lang_main.php b/upload/language/lang_english/lang_main.php index cc8572d44..8cf151026 100644 --- a/upload/language/lang_english/lang_main.php +++ b/upload/language/lang_english/lang_main.php @@ -2703,8 +2703,7 @@ $lang['LIST_OF_PATTERNS'] = 'List of patterns'; $lang['ADD_TEMPLATE'] = 'Add the template'; $lang['TEMPLATE_DISABLE'] = 'Template disabled'; $lang['FOR_NEW_TEMPLATE'] = 'for new patterns!'; -$lang['ADEDD'] = 'added'; -$lang['CHANGED'] = 'changed'; +$lang['CHANGED'] = 'Changed'; $lang['REMOVED'] = 'Removed'; $lang['QUESTION'] = 'Are you sure want to delete?'; $lang['NOT_CHOOSE'] = 'you do not choose'; @@ -3138,7 +3137,6 @@ $lang['SEARCH_FOR_BANNED'] = 'Searching banned users'; $lang['SEARCH_FOR_ADMINS'] = 'Searching Administrators'; $lang['SEARCH_FOR_MODS'] = 'Searching Moderators'; $lang['SEARCH_FOR_DISABLED'] = 'Searching for disabled users'; -$lang['SEARCH_FOR_DISABLED_PMS'] = 'Searching for users with disabled Private Messages'; $lang['SEARCH_FOR_POSTCOUNT_GREATER'] = 'Searching for users with a post count greater than %d'; $lang['SEARCH_FOR_POSTCOUNT_LESSER'] = 'Searching for users with a post count less than %d'; $lang['SEARCH_FOR_POSTCOUNT_RANGE'] = 'Searching for users with a post count between %d and %d'; @@ -3171,7 +3169,6 @@ $lang['SEARCH_USERS_GROUPS_EXPLAIN'] = 'View all members of the selected group.' $lang['SEARCH_USERS_RANKS_EXPLAIN'] = 'View all carriers of the selected rank.'; $lang['BANNED_USERS'] = 'Banned Users'; $lang['DISABLED_USERS'] = 'Disabled Users'; -$lang['USERS_DISABLED_PMS'] = 'Users with disabled PMs'; $lang['SEARCH_USERS_MISC_EXPLAIN'] = 'Administrators - All users with Administrator powers; Moderators - All forum moderators; Banned Users - All accounts that have been banned on these forums; Disabled Users - All users with disabled accounts (either manually disabled or never verified their email address); Users with disabled PMs - Selects users who have the Private Messages priviliges removed (Done via User Management)'; $lang['POSTCOUNT'] = 'Postcount'; $lang['EQUALS'] = 'Equals'; diff --git a/upload/language/lang_russian/lang_main.php b/upload/language/lang_russian/lang_main.php index 925fd6649..02ab28a86 100644 --- a/upload/language/lang_russian/lang_main.php +++ b/upload/language/lang_russian/lang_main.php @@ -2718,8 +2718,7 @@ $lang['LIST_OF_PATTERNS'] = 'Список шаблонов'; $lang['ADD_TEMPLATE'] = 'Добавить шаблон'; $lang['TEMPLATE_DISABLE'] = 'Шаблон отключен'; $lang['FOR_NEW_TEMPLATE'] = 'для новых шаблонов!'; -$lang['ADEDD_TPL'] = 'добавлено'; -$lang['CHANGED'] = 'изменено'; +$lang['CHANGED'] = 'Изменено'; $lang['REMOVED'] = 'Удалено'; $lang['QUESTION'] = 'Вы уверены, что хотите удалить?'; $lang['NOT_CHOOSE'] = 'вы ничего не выбрали'; @@ -3164,7 +3163,6 @@ $lang['SEARCH_FOR_BANNED'] = 'Поиск забаненных пользоват $lang['SEARCH_FOR_ADMINS'] = 'Поиск администраторов'; $lang['SEARCH_FOR_MODS'] = 'Поиск модераторов'; $lang['SEARCH_FOR_DISABLED'] = 'Поиск отключенных пользователей'; -$lang['SEARCH_FOR_DISABLED_PMS'] = 'Поиск пользователей с отключенными личными сообщениями'; $lang['SEARCH_FOR_POSTCOUNT_GREATER'] = 'Поиск пользователей с количеством сообщений более %d'; $lang['SEARCH_FOR_POSTCOUNT_LESSER'] = 'Поиск пользователей с количеством сообщений менее %d'; $lang['SEARCH_FOR_POSTCOUNT_RANGE'] = 'Поиск пользователей с количеством сообщений от %d до %d'; @@ -3197,7 +3195,6 @@ $lang['SEARCH_USERS_GROUPS_EXPLAIN'] = 'Просмотреть всех член $lang['SEARCH_USERS_RANKS_EXPLAIN'] = 'Просмотреть всех носителей выбранного звания.'; $lang['BANNED_USERS'] = 'Забаненные пользователи'; $lang['DISABLED_USERS'] = 'Отключенные пользователи'; -$lang['USERS_DISABLED_PMS'] = 'Пользователи с отключенными ЛС'; $lang['SEARCH_USERS_MISC_EXPLAIN'] = 'Администраторы - все пользователи с правами администратора; Модераторы - все модераторы форумов; Забаненные пользователи - все учётные записи, запрещённые на трекере; отключенные пользователи - все пользователи с отключенными учётными записями (вручную, или не подтвердившие свой адрес email); Пользователи с отключенными ЛС - Пользователи, не имеющие права пользоваться личными сообщениями (установлено через управление пользователями)'; $lang['POSTCOUNT'] = 'Число сообщений'; $lang['EQUALS'] = 'Равно'; diff --git a/upload/memberlist.php b/upload/memberlist.php index 6d0e51b88..83f5df5da 100644 --- a/upload/memberlist.php +++ b/upload/memberlist.php @@ -138,7 +138,7 @@ for ($i=ord('A'), $cnt=ord('Z'); $i <= $cnt; $i++) $select_letter .= ': '; for ($i=224, $cnt=255; $i <= $cnt; $i++) { - $select_letter .= ($by_letter == iconv('windows-1251', 'UTF-8', chr($i))) ? ''. iconv('windows-1251', 'UTF-8', chr($i-32)) .' ' : ''. iconv('windows-1251', 'UTF-8', chr($i-32)) .' '; + $select_letter .= ($by_letter == iconv('windows-1251', 'UTF-8', chr($i))) ? ''. iconv('windows-1251', 'UTF-8', chr($i-32)) .' ' : ''. iconv('windows-1251', 'UTF-8', chr($i-32)) .' '; } $select_letter .= ': '; @@ -152,9 +152,7 @@ $template->assign_vars(array( )); // per-letter selection end -$sql = "SELECT username, user_id, user_rank, user_opt, user_posts, user_regdate, user_from, user_website, user_email - FROM ". BB_USERS ." - WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .")"; +$sql = "SELECT username, user_id, user_rank, user_opt, user_posts, user_regdate, user_from, user_website, user_email FROM ". BB_USERS ." WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .")"; if ( $username ) { $username = preg_replace('/\*/', '%', clean_username($username)); @@ -173,25 +171,24 @@ if ($result = DB()->fetch_rowset($sql)) $posts = $row['user_posts']; $pm = ($bb_cfg['text_buttons']) ? ''. $lang['SEND_PM_TXTB'] .'' : '' . $lang['SEND_PRIVATE_MESSAGE'] . ''; - if (bf($row['user_opt'], 'user_opt', 'viewemail') || IS_AM) - { - $email_uri = ($bb_cfg['board_email_form']) ? ("profile.php?mode=email&". POST_USERS_URL ."=$user_id") : 'mailto:'. $row['user_email']; + if (bf($row['user_opt'], 'user_opt', 'viewemail') || IS_AM) + { + $email_uri = ($bb_cfg['board_email_form']) ? ("profile.php?mode=email&". POST_USERS_URL ."=$user_id") : 'mailto:'. $row['user_email']; $email = ''. $row['user_email'] .''; + } + else + { + $email = ''; + } - } - else - { - $email = ''; - } - - if ($row['user_website']) -{ - $www = ($bb_cfg['text_buttons']) ? ''. $lang['VISIT_WEBSITE_TXTB'] .'' : '' . $lang['VISIT_WEBSITE'] . ''; - } - else - { - $www = ''; - } + if ($row['user_website']) + { + $www = ($bb_cfg['text_buttons']) ? ''. $lang['VISIT_WEBSITE_TXTB'] .'' : '' . $lang['VISIT_WEBSITE'] . ''; + } + else + { + $www = ''; + } $row_class = !($i % 2) ? 'row1' : 'row2'; $template->assign_block_vars('memberrow', array( @@ -211,10 +208,11 @@ if ($result = DB()->fetch_rowset($sql)) } else { - $template->assign_block_vars('no_username', array( - 'NO_USER_ID_SPECIFIED' => $lang['NO_USER_ID_SPECIFIED'] ) - ); + $template->assign_block_vars('no_username', array( + 'NO_USER_ID_SPECIFIED' => $lang['NO_USER_ID_SPECIFIED'], + )); } + $paginationurl = "memberlist.php?mode=$mode&order=$sort_order&letter=$by_letter"; if ($paginationusername) $paginationurl .= "&username=$paginationusername"; if ( $mode != 'topten' || $bb_cfg['topics_per_page'] < 10 ) diff --git a/upload/poll.php b/upload/poll.php index 7179fbc86..1369a7475 100644 --- a/upload/poll.php +++ b/upload/poll.php @@ -86,7 +86,7 @@ switch ($mode) bb_die('Вы не выбрали, за что голосуете'); } - DB()->query("INSERT IGNORE INTO ". BB_POLL_USERS ." (topic_id, user_id, vote_dt) VALUES ($topic_id, {$userdata['user_id']}, ". TIMENOW .")"); + DB()->query("INSERT IGNORE INTO ". BB_POLL_USERS ." (topic_id, user_id, vote_ip, vote_dt) VALUES ($topic_id, {$userdata['user_id']}, '". USER_IP ."', ". TIMENOW .")"); CACHE('bb_poll_data')->rm("poll_$topic_id"); diff --git a/upload/posting.php b/upload/posting.php index 0b470855a..5c98b02a4 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -167,11 +167,11 @@ if ($post_info = DB()->fetch_row($sql)) if ($post_info['forum_status'] == FORUM_LOCKED && !$is_auth['auth_mod']) { - message_die(GENERAL_MESSAGE, $lang['FORUM_LOCKED']); + message_die(GENERAL_MESSAGE, $lang['FORUM_LOCKED']); } elseif ($mode != 'newtopic' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) { - message_die(GENERAL_MESSAGE, $lang['TOPIC_LOCKED']); + message_die(GENERAL_MESSAGE, $lang['TOPIC_LOCKED']); } if ($mode == 'editpost' || $mode == 'delete') @@ -246,21 +246,21 @@ if (!$is_auth[$is_auth_type]) if ($mode == 'newtopic' && $topic_tpl && $post_info['topic_tpl_id']) { - if($tor_status = join(',', $bb_cfg['tor_cannot_new'])) - { + if ($tor_status = join(',', $bb_cfg['tor_cannot_new'])) + { $sql = DB()->fetch_rowset("SELECT t.topic_title, t.topic_id, tor.tor_status FROM ". BB_BT_TORRENTS ." tor, ". BB_TOPICS ." t WHERE poster_id = {$userdata['user_id']} AND tor.topic_id = t.topic_id AND tor.tor_status IN ($tor_status) - ORDER BY tor.reg_time + ORDER BY tor.reg_time "); - $topics = ''; - foreach($sql as $row) - { - $topics .= $bb_cfg['tor_icons'][$row['tor_status']] .''. $row['topic_title'] .'
'; - } + $topics = ''; + foreach($sql as $row) + { + $topics .= $bb_cfg['tor_icons'][$row['tor_status']] .''. $row['topic_title'] .'
'; + } if ($topics) bb_die($topics . $lang['UNEXECUTED_RELEASE']); } require(INC_DIR .'topic_templates.php'); @@ -415,38 +415,38 @@ elseif ( ($submit || $confirm) && !$topic_has_new_posts ) if (defined('TORRENT_ATTACH_ID') && $bb_cfg['bt_newtopic_auto_reg'] && !$error_msg) { include(INC_DIR .'functions_torrent.php'); - if(!DB()->fetch_row("SELECT attach_id FROM ". BB_BT_TORRENTS ." WHERE attach_id = ". TORRENT_ATTACH_ID)) + if (!DB()->fetch_row("SELECT attach_id FROM ". BB_BT_TORRENTS ." WHERE attach_id = ". TORRENT_ATTACH_ID)) { - if($bb_cfg['premod']) + if ($bb_cfg['premod']) { - // Получение списка id форумов начиная с parent - $forum_parent = $forum_id; - if ($post_info['forum_parent']) $forum_parent = $post_info['forum_parent']; - $count_sql = " - SELECT forum_id - FROM ". BB_FORUMS ." - WHERE forum_parent = $forum_parent - "; - $count_rowset = DB()->fetch_rowset($count_sql); - $sub_forums = array(); - foreach ($count_rowset as $count_row) - { - if ($count_row['forum_id'] != $forum_id) $sub_forums[] = $count_row['forum_id']; - } - $sub_forums[] = $forum_id; - $sub_forums = join(',', $sub_forums); - // Подсчёт проверенных релизов в форумах раздела - $count_checked_releases = DB()->fetch_row(" - SELECT COUNT(*) AS checked_releases - FROM ". BB_BT_TORRENTS ." - WHERE poster_id = ". $userdata['user_id'] ." - AND forum_id IN($sub_forums) - AND tor_status IN(". TOR_APPROVED .",". TOR_DOUBTFUL .",". TOR_TMP .") - LIMIT 1 - ", 'checked_releases'); - - if ($count_checked_releases || IS_AM) tracker_register(TORRENT_ATTACH_ID, 'newtopic', TOR_NOT_APPROVED); - else tracker_register(TORRENT_ATTACH_ID, 'newtopic', TOR_PREMOD); + // Получение списка id форумов начиная с parent + $forum_parent = $forum_id; + if ($post_info['forum_parent']) $forum_parent = $post_info['forum_parent']; + $count_rowset = DB()->fetch_rowset("SELECT forum_id FROM ". BB_FORUMS ." WHERE forum_parent = $forum_parent"); + $sub_forums = array(); + foreach ($count_rowset as $count_row) + { + if ($count_row['forum_id'] != $forum_id) $sub_forums[] = $count_row['forum_id']; + } + $sub_forums[] = $forum_id; + $sub_forums = join(',', $sub_forums); + // Подсчёт проверенных релизов в форумах раздела + $count_checked_releases = DB()->fetch_row(" + SELECT COUNT(*) AS checked_releases + FROM ". BB_BT_TORRENTS ." + WHERE poster_id = ". $userdata['user_id'] ." + AND forum_id IN($sub_forums) + AND tor_status IN(". TOR_APPROVED .",". TOR_DOUBTFUL .",". TOR_TMP .") + LIMIT 1 + ", 'checked_releases'); + if ($count_checked_releases || IS_AM) + { + tracker_register(TORRENT_ATTACH_ID, 'newtopic', TOR_NOT_APPROVED); + } + else + { + tracker_register(TORRENT_ATTACH_ID, 'newtopic', TOR_PREMOD); + } } else tracker_register(TORRENT_ATTACH_ID, 'newtopic', TOR_NOT_APPROVED); } @@ -467,7 +467,7 @@ elseif ( ($submit || $confirm) && !$topic_has_new_posts ) } } -if( $refresh || $error_msg || ($submit && $topic_has_new_posts) ) +if ($refresh || $error_msg || ($submit && $topic_has_new_posts)) { $username = ( !empty($_POST['username']) ) ? clean_username($_POST['username']) : ''; $subject = ( !empty($_POST['subject']) ) ? clean_title($_POST['subject']) : ''; @@ -518,7 +518,7 @@ else define('WORD_LIST_OBTAINED', TRUE); } - if($post_info['post_attachment'] && !IS_AM) $message = $post_info['topic_title']; + if ($post_info['post_attachment'] && !IS_AM) $message = $post_info['topic_title']; // Use trim to get rid of spaces placed there by MS-SQL 2000 $quote_username = ( trim($post_info['post_username']) != '' ) ? $post_info['post_username'] : $post_info['username']; @@ -528,10 +528,10 @@ else // hide sid $message = preg_replace('#(?<=[\?&;]sid=)[a-zA-Z0-9]{12}#', 'sid', $message); - if ( !empty($orig_word) ) + if (!empty($orig_word)) { - $subject = ( !empty($subject) ) ? preg_replace($orig_word, $replace_word, $subject) : ''; - $message = ( !empty($message) ) ? preg_replace($orig_word, $replace_word, $message) : ''; + $subject = (!empty($subject)) ? preg_replace($orig_word, $replace_word, $subject) : ''; + $message = (!empty($message)) ? preg_replace($orig_word, $replace_word, $message) : ''; } if ( !preg_match('/^Re:/', $subject) && strlen($subject) > 0 ) @@ -560,9 +560,7 @@ if (IS_GUEST || ($mode == 'editpost' && $post_info['poster_id'] == GUEST_UID)) $template->assign_var('POSTING_USERNAME'); } -// // Notify checkbox -// if (!IS_GUEST) { if ($mode != 'editpost' || ($mode == 'editpost' && $post_info['poster_id'] != GUEST_UID)) @@ -571,9 +569,7 @@ if (!IS_GUEST) } } -// // Topic type selection -// $topic_type_toggle = ''; if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) ) { @@ -616,7 +612,7 @@ if ($post_info['allow_reg_tracker'] && $post_data['first_post'] && ($topic_dl_ty WHERE p.post_id = $post_id "; $result = DB()->fetch_row($sql); - if(!empty($result['attach_id'])) + if (!empty($result['attach_id'])) { if (!$topic_type_toggle) { @@ -669,9 +665,7 @@ $template->set_filenames(array( 'body' => 'posting.tpl', )); -// // Output the data to the template -// $template->assign_vars(array( 'FORUM_NAME' => htmlCHR($forum_name), 'PAGE_TITLE' => $page_title, @@ -708,9 +702,7 @@ if ($mode == 'editpost' && $post_data['last_post'] && !$post_data['first_post']) )); } -// // Topic review -// if( $mode == 'reply' && $is_auth['auth_read'] ) { topic_review($topic_id); diff --git a/upload/privmsg.php b/upload/privmsg.php index e09139d7b..29d8fb58e 100644 --- a/upload/privmsg.php +++ b/upload/privmsg.php @@ -1100,7 +1100,7 @@ else if ( $submit || $refresh || $mode != '' ) message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql); } - cache_rm_user_sessions ($to_userdata['user_id']); + cache_rm_user_sessions ($to_userdata['user_id']); if ( bf($to_userdata['user_opt'], 'user_opt', 'notify_pm') && !empty($to_userdata['user_email']) && $to_userdata['user_active'] && $bb_cfg['pm_notify_enabled'] ) { @@ -1109,7 +1109,7 @@ else if ( $submit || $refresh || $mode != '' ) $emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>"); $emailer->email_address($to_userdata['username'] ." <{$to_userdata['user_email']}>"); - + $emailer->use_template('privmsg_notify', $to_userdata['user_lang']); $emailer->assign_vars(array( diff --git a/upload/templates/admin/admin_user_search.tpl b/upload/templates/admin/admin_user_search.tpl index e4a436219..e683375a3 100644 --- a/upload/templates/admin/admin_user_search.tpl +++ b/upload/templates/admin/admin_user_search.tpl @@ -128,7 +128,7 @@ -   +   {L_SEARCH_USERS_MISC_EXPLAIN} diff --git a/upload/templates/default/posting.tpl b/upload/templates/default/posting.tpl index bebf12520..50a6170fd 100644 --- a/upload/templates/default/posting.tpl +++ b/upload/templates/default/posting.tpl @@ -147,8 +147,6 @@ - - diff --git a/upload/templates/default/posting_poll.tpl b/upload/templates/default/posting_poll.tpl deleted file mode 100644 index 7abaac0e7..000000000 --- a/upload/templates/default/posting_poll.tpl +++ /dev/null @@ -1,40 +0,0 @@ - - - {L_ADD_POLL} - - - {L_POLL_QUESTION} - - - - - {L_POLL_OPTION} - -   -   - - - - - - {L_POLL_OPTION} - -   - - - - - {L_POLL_FOR} - -   - {L_DAYS}   - {L_POLL_FOR_EXPLAIN} - - - - - {L_DELETE_POLL} - - - - \ No newline at end of file