From 8bec4dc91f59fb155b8b397f58c04ba20a7b2653 Mon Sep 17 00:00:00 2001 From: "glix08@gmail.com" Date: Sat, 18 Jan 2014 21:23:13 +0000 Subject: [PATCH] r561 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Фикс критичного бага с обновлением времени сообщений из r506 (спасибо PheRum); фикс ненулевого числа сообщений у гостя в пустой базе; фикс вывода блока с новостями трекера, в случае если они отключены (спасибо greencell); удаление пустых строк в конце всех .php-файлов; пара мелочей на будущие релизы. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@561 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- install/sql/mysql.sql | 2 +- upload/admin/admin_disallow.php | 2 +- upload/admin/admin_forums.php | 2 +- upload/admin/admin_groups.php | 2 +- upload/admin/admin_mass_email.php | 2 +- upload/admin/admin_ranks.php | 2 +- upload/admin/admin_smilies.php | 2 +- upload/admin/admin_topic_templates.php | 71 +++++++------- upload/admin/admin_ug_auth.php | 2 +- upload/admin/admin_words.php | 2 +- upload/admin/index.php | 2 +- upload/admin/pagestart.php | 8 +- upload/admin/xs_cache.php | 1 + upload/admin/xs_config.php | 1 + upload/admin/xs_frameset.php | 1 + upload/admin/xs_index.php | 1 + upload/ajax/change_tor_status.php | 58 ++++++------ upload/ajax/index_data.php | 83 ++++++++--------- upload/ajax/manage_user.php | 93 ++++++++++--------- upload/ajax/mod_action.php | 54 +++++------ upload/ajax/posts.php | 86 ++++++++--------- upload/ajax/topic_tpl.php | 2 +- upload/ajax/user_register.php | 13 ++- upload/ajax/view_profile.php | 6 +- upload/ajax/view_torrent.php | 12 +-- upload/bt/includes/init_tr.php | 2 +- upload/config.php | 4 +- upload/develop/benchmark/timer.php | 2 +- upload/develop/dbg_config.php | 3 +- upload/develop/error_handler.php | 3 +- upload/develop/functions_debug.php | 2 +- upload/develop/init_debug.php | 2 +- upload/develop/profiler/profiler.css | 2 +- upload/develop/profiler/profiler.php | 2 +- upload/develop/profiler/profiler_dbg.php | 8 +- upload/includes/captcha/captcha.php | 2 +- upload/includes/cron/jobs/bb_maintenance.php | 2 +- upload/includes/cron/jobs/cache_gc.php | 2 +- upload/includes/cron/jobs/db_backup.php | 2 +- .../cron/jobs/prune_inactive_users.php | 2 +- .../cron/jobs/tr_cleanup_and_dlstat.php | 2 +- .../includes/cron/jobs/tr_complete_count.php | 2 +- upload/includes/cron/jobs/tr_maintenance.php | 2 +- .../includes/cron/jobs/tr_make_snapshot.php | 2 +- .../cron/jobs/tr_update_seeder_last_seen.php | 2 +- .../datastore/build_attach_extensions.php | 2 +- .../includes/datastore/build_cat_forums.php | 48 +++++----- upload/includes/datastore/build_ranks.php | 2 +- upload/includes/datastore/build_smilies.php | 4 +- upload/includes/functions.php | 43 ++++----- upload/includes/functions_post.php | 53 ++++------- upload/includes/functions_selects.php | 6 +- upload/includes/functions_validate.php | 2 +- upload/includes/init_bb.php | 5 +- upload/includes/online_userlist.php | 2 +- upload/includes/page_footer.php | 2 +- upload/includes/page_header.php | 2 +- upload/includes/posting_tpl.php | 4 +- upload/includes/sphinxapi.php | 2 +- .../includes/topic_templates/video_guide.php | 1 + upload/includes/ucp/usercp_attachcp.php | 2 +- upload/includes/ucp/usercp_bonus.php | 26 +++--- upload/includes/ucp/usercp_email.php | 4 +- upload/includes/ucp/usercp_sendpasswd.php | 2 +- upload/index.php | 2 +- upload/language/lang_english/lang_admin.php | 2 +- .../language/lang_english/lang_callseed.php | 2 +- upload/language/lang_russian/lang_admin.php | 2 +- .../language/lang_russian/lang_admin_cron.php | 2 +- .../language/lang_russian/lang_callseed.php | 2 +- .../language/lang_russian/lang_faq_attach.php | 2 +- upload/login.php | 2 +- upload/memberlist.php | 2 +- upload/misc.php | 2 +- upload/misc/html/copyright_holders.html | 3 +- upload/misc/html/not_found.html | 3 +- upload/misc/html/user_agreement.html | 2 +- upload/privmsg.php | 2 +- upload/search.php | 2 +- upload/stats/tracker.php | 3 +- upload/templates/default/page_header.tpl | 85 +++++++++-------- upload/viewforum.php | 2 +- upload/viewonline.php | 2 +- 83 files changed, 441 insertions(+), 455 deletions(-) diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index ad1e14606..41df08673 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -1434,7 +1434,7 @@ CREATE TABLE IF NOT EXISTS `bb_users` ( -- Дамп данных таблицы `bb_users` -- -INSERT INTO `bb_users` VALUES (-1, 0, 'Guest', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 5, 0.00, '', 0, 0, 0, 0, 0, '', 0, 0, 0, 0, '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default'); +INSERT INTO `bb_users` VALUES (-1, 0, 'Guest', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 0, 0, '', 0, 0, 0, 0, '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default'); INSERT INTO `bb_users` VALUES (2, 1, 'admin', 'c3284d0f94606de1fd2af172aba15bf3', 0, 0, '0', 0, '0', 1, 1, 4.00, '', 0, 0, 0, 304, 1, '', 1, 0, 0, 0, 'admin@admin.com', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default'); INSERT INTO `bb_users` VALUES (-746, 0, 'bot', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 144, 0, 'bot.gif', 1, 0, 0, 0, 'bot@bot.bot', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default'); diff --git a/upload/admin/admin_disallow.php b/upload/admin/admin_disallow.php index b56c6b34e..3be9c0222 100644 --- a/upload/admin/admin_disallow.php +++ b/upload/admin/admin_disallow.php @@ -96,4 +96,4 @@ $template->assign_vars(array( 'S_FORM_ACTION' => "admin_disallow.php", )); -print_page('admin_disallow.tpl', 'admin'); +print_page('admin_disallow.tpl', 'admin'); \ No newline at end of file diff --git a/upload/admin/admin_forums.php b/upload/admin/admin_forums.php index 944adfc01..202dfffba 100644 --- a/upload/admin/admin_forums.php +++ b/upload/admin/admin_forums.php @@ -1243,4 +1243,4 @@ function change_sf_cat ($parent_id, $new_cat_id, $order_shear) forum_order = forum_order + $order_shear WHERE forum_parent = $parent_id "); -} +} \ No newline at end of file diff --git a/upload/admin/admin_groups.php b/upload/admin/admin_groups.php index 64891b66d..30b819a04 100644 --- a/upload/admin/admin_groups.php +++ b/upload/admin/admin_groups.php @@ -183,4 +183,4 @@ else )); } -print_page('admin_groups.tpl', 'admin'); +print_page('admin_groups.tpl', 'admin'); \ No newline at end of file diff --git a/upload/admin/admin_mass_email.php b/upload/admin/admin_mass_email.php index 631d42459..58f6f61ee 100644 --- a/upload/admin/admin_mass_email.php +++ b/upload/admin/admin_mass_email.php @@ -157,4 +157,4 @@ $template->assign_vars(array( 'S_GROUP_SELECT' => $select_list) ); -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_ranks.php b/upload/admin/admin_ranks.php index 289152c8a..c5bbb3aa5 100644 --- a/upload/admin/admin_ranks.php +++ b/upload/admin/admin_ranks.php @@ -265,4 +265,4 @@ else } } -print_page('admin_ranks.tpl', 'admin'); +print_page('admin_ranks.tpl', 'admin'); \ No newline at end of file diff --git a/upload/admin/admin_smilies.php b/upload/admin/admin_smilies.php index bab0566d8..e200842f5 100644 --- a/upload/admin/admin_smilies.php +++ b/upload/admin/admin_smilies.php @@ -451,4 +451,4 @@ else } } -print_page('admin_smilies.tpl', 'admin'); +print_page('admin_smilies.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 396015c84..ffafafb67 100644 --- a/upload/admin/admin_topic_templates.php +++ b/upload/admin/admin_topic_templates.php @@ -26,53 +26,53 @@ if ($mode == 'templates') )); } - $template->assign_vars(array( + $template->assign_vars(array( 'TPL_LIST' => true, 'S_ACTION' => "admin_topic_templates.php?mode=delete", )); } else if ($mode == 'add' || $mode == 'edit') { - $template->assign_vars(array( + $template->assign_vars(array( 'TPL' => true, )); - if($mode == 'edit') - { - $tpl_id = (int) request_var('tpl', ''); - if(!$tpl_id) bb_die(''); + if ($mode == 'edit') + { + $tpl_id = (int) request_var('tpl', ''); + if (!$tpl_id) bb_die(''); - $row = DB()->fetch_row("SELECT * FROM ". BB_TOPIC_TPL_OLD ." WHERE tpl_id = $tpl_id"); - if(!$row) bb_die(''); + $row = DB()->fetch_row("SELECT * FROM ". BB_TOPIC_TPL_OLD ." WHERE tpl_id = $tpl_id"); + if (!$row) bb_die(''); - $template->assign_vars(array( + $template->assign_vars(array( 'S_ACTION' => "admin_topic_templates.php?mode=edit&tpl=$tpl_id", )); - } - else - { - $template->assign_vars(array( + } + else + { + $template->assign_vars(array( 'S_ACTION' => "admin_topic_templates.php?mode=add", )); - } + } - $tpl_name = isset($_POST['tpl_name']) ? $_POST['tpl_name'] : @$row['tpl_name']; - $tpl_script = isset($_POST['tpl_script']) ? $_POST['tpl_script'] : @$row['tpl_script']; - $tpl_template = isset($_POST['tpl_template']) ? $_POST['tpl_template'] : @$row['tpl_template']; - $tpl_desc = isset($_POST['tpl_desc']) ? $_POST['tpl_desc'] : @$row['tpl_desc']; + $tpl_name = isset($_POST['tpl_name']) ? $_POST['tpl_name'] : @$row['tpl_name']; + $tpl_script = isset($_POST['tpl_script']) ? $_POST['tpl_script'] : @$row['tpl_script']; + $tpl_template = isset($_POST['tpl_template']) ? $_POST['tpl_template'] : @$row['tpl_template']; + $tpl_desc = isset($_POST['tpl_desc']) ? $_POST['tpl_desc'] : @$row['tpl_desc']; - $template->assign_vars(array( + $template->assign_vars(array( 'NAME' => $tpl_name, 'SCRIPT' => $tpl_script, 'TEMP' => $tpl_template, 'DESC' => $tpl_desc, )); - if(isset($_POST['submit'])) - { - if($mode == 'edit') - { - DB()->query("UPDATE ". BB_TOPIC_TPL_OLD ." SET + if (isset($_POST['submit'])) + { + if ($mode == 'edit') + { + DB()->query("UPDATE ". BB_TOPIC_TPL_OLD ." SET tpl_name = '". DB()->escape($tpl_name) ."', tpl_script = '". DB()->escape($tpl_script) ."', tpl_template = '". DB()->escape($tpl_template) ."', @@ -80,27 +80,27 @@ else if ($mode == 'add' || $mode == 'edit') WHERE tpl_id = $tpl_id "); $message = $lang['CHANGED']; - } - else - { - DB()->query("INSERT INTO ". BB_TOPIC_TPL_OLD ." (tpl_name, tpl_script, tpl_template, tpl_desc) + } + else + { + 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']; - } + } - bb_die($message); + bb_die($message); } } -else if ($mode == 'delete') +elseif ($mode == 'delete') { - $tpl_ids = isset($_POST['tpl_id']) ? $_POST['tpl_id'] : bb_die($lang['NOT_CHOOSE']); + $tpl_ids = isset($_POST['tpl_id']) ? $_POST['tpl_id'] : bb_die($lang['NOT_CHOOSE']); - foreach ($tpl_ids as $tpl_id) + foreach ($tpl_ids as $tpl_id) { $hidden_fields['tpl_id'][] = $tpl_id; } - if (isset($_POST['confirm'])) + if (isset($_POST['confirm'])) { DB()->query("DELETE FROM ". BB_TOPIC_TPL_OLD ." WHERE tpl_id IN(". join(',', $tpl_ids) .")"); bb_die($lang['REMOVED']); @@ -193,4 +193,5 @@ else 'S_ACTION' => "admin_topic_templates.php", )); } -print_page('admin_topic_templates.tpl', 'admin'); + +print_page('admin_topic_templates.tpl', 'admin'); \ No newline at end of file diff --git a/upload/admin/admin_ug_auth.php b/upload/admin/admin_ug_auth.php index 70d34752f..0612f257d 100644 --- a/upload/admin/admin_ug_auth.php +++ b/upload/admin/admin_ug_auth.php @@ -473,4 +473,4 @@ $template->assign_vars(array( 'U_ALL_FORUMS' => !empty($base_url) ? "$base_url&c=all" : '', )); -print_page('admin_ug_auth.tpl', 'admin'); +print_page('admin_ug_auth.tpl', 'admin'); \ No newline at end of file diff --git a/upload/admin/admin_words.php b/upload/admin/admin_words.php index 4a749530d..6d573b43c 100644 --- a/upload/admin/admin_words.php +++ b/upload/admin/admin_words.php @@ -166,4 +166,4 @@ else } } -print_page('admin_words.tpl', 'admin'); +print_page('admin_words.tpl', 'admin'); \ No newline at end of file diff --git a/upload/admin/index.php b/upload/admin/index.php index ad0d51a55..e49aae6d4 100644 --- a/upload/admin/index.php +++ b/upload/admin/index.php @@ -335,4 +335,4 @@ function inarray($needle, $haystack) } } return false; -} +} \ No newline at end of file diff --git a/upload/admin/pagestart.php b/upload/admin/pagestart.php index dd9b2bfad..8d97483ee 100644 --- a/upload/admin/pagestart.php +++ b/upload/admin/pagestart.php @@ -15,12 +15,14 @@ if (IS_GUEST) { redirect("login.php?redirect=admin/index.php"); } + if (!IS_ADMIN) { message_die(GENERAL_MESSAGE, $lang['NOT_ADMIN']); } + if (!$userdata['session_admin']) { - $redirect = url_arg($_SERVER['REQUEST_URI'], 'admin', 1); - redirect("login.php?redirect=$redirect"); -} + $redirect = url_arg($_SERVER['REQUEST_URI'], 'admin', 1); + redirect("login.php?redirect=$redirect"); +} \ No newline at end of file diff --git a/upload/admin/xs_cache.php b/upload/admin/xs_cache.php index 508b35496..36a646672 100644 --- a/upload/admin/xs_cache.php +++ b/upload/admin/xs_cache.php @@ -245,4 +245,5 @@ $template->assign_vars(array( ); $template->pparse('body'); + xs_exit(); \ No newline at end of file diff --git a/upload/admin/xs_config.php b/upload/admin/xs_config.php index b05dce8d0..2e6c34a46 100644 --- a/upload/admin/xs_config.php +++ b/upload/admin/xs_config.php @@ -112,4 +112,5 @@ $template->assign_vars(array( $template->set_filenames(array('body' => XS_TPL_PATH . 'config.tpl')); $template->pparse('body'); + xs_exit(); \ No newline at end of file diff --git a/upload/admin/xs_frameset.php b/upload/admin/xs_frameset.php index 7b2b337fa..4ede54cd4 100644 --- a/upload/admin/xs_frameset.php +++ b/upload/admin/xs_frameset.php @@ -69,4 +69,5 @@ $template->assign_vars(array( )); $template->pparse('body'); + xs_exit(); \ No newline at end of file diff --git a/upload/admin/xs_index.php b/upload/admin/xs_index.php index 943f66683..039706b21 100644 --- a/upload/admin/xs_index.php +++ b/upload/admin/xs_index.php @@ -35,4 +35,5 @@ $template->assign_vars(array( $template->set_filenames(array('body' => XS_TPL_PATH . 'index.tpl')); $template->pparse('body'); + xs_exit(); \ No newline at end of file diff --git a/upload/ajax/change_tor_status.php b/upload/ajax/change_tor_status.php index c0efc350d..135bb2826 100644 --- a/upload/ajax/change_tor_status.php +++ b/upload/ajax/change_tor_status.php @@ -9,9 +9,9 @@ if (!isset($this->request['attach_id'])) $this->ajax_die($lang['EMPTY_ATTACH_ID' $attach_id = (int) $this->request['attach_id']; $mode = (string) $this->request['mode']; -if($bb_cfg['tor_comment']) +if ($bb_cfg['tor_comment']) { - $comment = (string) $this->request['comment']; + $comment = (string) $this->request['comment']; } $tor = DB()->fetch_row(" @@ -23,24 +23,25 @@ $tor = DB()->fetch_row(" WHERE tor.attach_id = $attach_id LIMIT 1 "); + if (!$tor) $this->ajax_die($lang['TORRENT_FAILED']); switch($mode) -{ +{ case 'status': - $new_status = (int) $this->request['status']; + $new_status = (int) $this->request['status']; // Валидность статуса if (!isset($lang['TOR_STATUS_NAME'][$new_status])) $this->ajax_die($lang['TOR_STATUS_FAILED']); if (!isset($this->request['status'])) $this->ajax_die($lang['TOR_DONT_CHANGE']); - if(!IS_AM) $this->ajax_die($lang['NOT_MODERATOR']); + if (!IS_AM) $this->ajax_die($lang['NOT_MODERATOR']); // Тот же статус if ($tor['tor_status'] == $new_status) { $this->ajax_die($lang['TOR_STATUS_DUB']); } - + // Запрет на изменение/присвоение CH-статуса модератором if ($new_status == TOR_CLOSED_CPHOLD && !IS_ADMIN) { @@ -71,36 +72,35 @@ switch($mode) } change_tor_status($attach_id, $new_status); - - $this->response['status'] = $bb_cfg['tor_icons'][$new_status] .' '. $lang['TOR_STATUS_NAME'][$new_status]. ' · '. profile_url($userdata) .' · '. delta_time(TIMENOW) . $lang['BACK']. ''; - - if($bb_cfg['tor_comment'] && (($comment && $comment != $lang['COMMENT']) || in_array($new_status, $bb_cfg['tor_reply']))) - { - if($tor['poster_id'] > 0) - { - $subject = sprintf($lang['TOR_MOD_TITLE'], $tor['topic_title']); - $message = sprintf($lang['TOR_MOD_MSG'], get_username($tor['poster_id']), make_url(TOPIC_URL . $tor['topic_id']), $bb_cfg['tor_icons'][$new_status] .' '.$lang['TOR_STATUS_NAME'][$new_status]); - if($comment && $comment != $lang['COMMENT']) $message .= "\n\n[b]". $lang['COMMENT'] .'[/b]: '. $comment; - send_pm($tor['poster_id'], $subject, $message, $userdata['user_id']); - - cache_rm_user_sessions($tor['poster_id']); + $this->response['status'] = $bb_cfg['tor_icons'][$new_status] .' '. $lang['TOR_STATUS_NAME'][$new_status]. ' · '. profile_url($userdata) .' · '. delta_time(TIMENOW) . $lang['BACK']. ''; + + if ($bb_cfg['tor_comment'] && (($comment && $comment != $lang['COMMENT']) || in_array($new_status, $bb_cfg['tor_reply']))) + { + if ($tor['poster_id'] > 0) + { + $subject = sprintf($lang['TOR_MOD_TITLE'], $tor['topic_title']); + $message = sprintf($lang['TOR_MOD_MSG'], get_username($tor['poster_id']), make_url(TOPIC_URL . $tor['topic_id']), $bb_cfg['tor_icons'][$new_status] .' '.$lang['TOR_STATUS_NAME'][$new_status]); + + if ($comment && $comment != $lang['COMMENT']) $message .= "\n\n[b]". $lang['COMMENT'] .'[/b]: '. $comment; + + send_pm($tor['poster_id'], $subject, $message, $userdata['user_id']); + cache_rm_user_sessions($tor['poster_id']); } - } + } break; - case 'status_reply': - if(!$bb_cfg['tor_comment']) $this->ajax_die($lang['MODULE_OFF']); - + case 'status_reply': + if (!$bb_cfg['tor_comment']) $this->ajax_die($lang['MODULE_OFF']); + $subject = sprintf($lang['TOR_AUTH_TITLE'], $tor['topic_title']); - - $message = sprintf($lang['TOR_AUTH_MSG'], get_username($tor['checked_user_id']), make_url(TOPIC_URL . $tor['topic_id']), $tor['topic_title']); + $message = sprintf($lang['TOR_AUTH_MSG'], get_username($tor['checked_user_id']), make_url(TOPIC_URL . $tor['topic_id']), $tor['topic_title']); + if($comment && $comment != $lang['COMMENT']) $message .= "\n\n[b]". $lang['COMMENT'] .'[/b]: '. $comment; - - send_pm($tor['checked_user_id'], $subject, $message, $userdata['user_id']); - + + send_pm($tor['checked_user_id'], $subject, $message, $userdata['user_id']); cache_rm_user_sessions($tor['checked_user_id']); break; } -$this->response['attach_id'] = $attach_id; +$this->response['attach_id'] = $attach_id; \ No newline at end of file diff --git a/upload/ajax/index_data.php b/upload/ajax/index_data.php index 44eea4fd7..2c0a5e42b 100644 --- a/upload/ajax/index_data.php +++ b/upload/ajax/index_data.php @@ -12,16 +12,16 @@ switch($mode) case 'birthday_week': $stats = $datastore->get('stats'); $datastore->enqueue(array( - 'stats', - )); - + 'stats', + )); + if ($stats['birthday_week_list']) { foreach($stats['birthday_week_list'] as $week) { $html[] = profile_url($week) .' ('. birthday_age($week['age']) .')'; } - $html = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], join(', ', $html)); + $html = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], join(', ', $html)); } else $html = sprintf($lang['NOBIRTHDAY_WEEK'], $bb_cfg['birthday_check_day']); break; @@ -29,8 +29,8 @@ switch($mode) case 'birthday_today': $stats = $datastore->get('stats'); $datastore->enqueue(array( - 'stats', - )); + 'stats', + )); if ($stats['birthday_today_list']) { @@ -42,41 +42,40 @@ switch($mode) } else $html = $lang['NOBIRTHDAY_TODAY']; break; - + case 'get_forum_mods': - $forum_id = (int) $this->request['forum_id']; - + $forum_id = (int) $this->request['forum_id']; + $datastore->enqueue(array( - 'moderators', - )); - + 'moderators', + )); + $moderators = array(); $mod = $datastore->get('moderators'); - if (isset($mod['mod_users'][$forum_id])) - { - foreach ($mod['mod_users'][$forum_id] as $user_id) - { - $moderators[] = ''. $mod['name_users'][$user_id] .''; - } - } - - if (isset($mod['mod_groups'][$forum_id])) - { - foreach ($mod['mod_groups'][$forum_id] as $group_id) - { - $moderators[] = ''. $mod['name_groups'][$group_id] .''; - } - } - - $html = ': '; - $html .= ($moderators) ? join(', ', $moderators) : $lang['NONE']; - unset($moderators, $mod); - $datastore->rm('moderators'); + if (isset($mod['mod_users'][$forum_id])) + { + foreach ($mod['mod_users'][$forum_id] as $user_id) + { + $moderators[] = ''. $mod['name_users'][$user_id] .''; + } + } + if (isset($mod['mod_groups'][$forum_id])) + { + foreach ($mod['mod_groups'][$forum_id] as $group_id) + { + $moderators[] = ''. $mod['name_groups'][$group_id] .''; + } + } + + $html = ': '; + $html .= ($moderators) ? join(', ', $moderators) : $lang['NONE']; + unset($moderators, $mod); + $datastore->rm('moderators'); break; - - case 'change_tz': + + case 'change_tz': $tz = (int) $this->request['tz']; if ($tz < -12) $tz = -12; if ($tz > 13) $tz = 13; @@ -88,18 +87,18 @@ switch($mode) cache_rm_user_sessions ($userdata['user_id']); } break; - + case 'get_traf_stats': $user_id = (int) $this->request['user_id']; $btu = get_bt_userdata($user_id); $profiledata = get_userdata($user_id); - + $speed_up = ($btu['speed_up']) ? humn_size($btu['speed_up']).'/s' : '0 KB/s'; $speed_down = ($btu['speed_down']) ? humn_size($btu['speed_down']).'/s' : '0 KB/s'; $user_ratio = ($btu['u_down_total'] > MIN_DL_FOR_RATIO) ? ''. get_bt_ratio($btu) .'' : $lang['IT_WILL_BE_DOWN'] .' '. humn_size(MIN_DL_FOR_RATIO) .''; - + $html = ' - + '. $lang['DOWNLOADED'] .' '. $lang['UPLOADED'] .' @@ -113,7 +112,7 @@ switch($mode) ' .humn_size($btu['u_up_total']) .' '. humn_size($btu['u_up_release']) .' '. humn_size($btu['u_up_bonus']) .''; - $html .= ($bb_cfg['seed_bonus_enabled']) ? ''. $profiledata['user_points'] .'' : ''; + $html .= ($bb_cfg['seed_bonus_enabled']) ? ''. $profiledata['user_points'] .'' : ''; $html .= ' '. $lang['MAX_SPEED'] .' @@ -123,11 +122,11 @@ switch($mode) $html .= ''; $this->response['user_ratio'] = ' - '. $lang['USER_RATIO'] .': + '. $lang['USER_RATIO'] .': '. $user_ratio .' '; break; } -$this->response['html'] = $html; -$this->response['mode'] = $mode; +$this->response['html'] = $html; +$this->response['mode'] = $mode; \ No newline at end of file diff --git a/upload/ajax/manage_user.php b/upload/ajax/manage_user.php index 9fb2fcf2e..f74f170a0 100644 --- a/upload/ajax/manage_user.php +++ b/upload/ajax/manage_user.php @@ -7,23 +7,23 @@ global $userdata, $lang, $bb_cfg; $mode = (string) $this->request['mode']; $user_id = $this->request['user_id']; -switch($mode) +switch ($mode) { case 'clear_cache': $gc_cache = array( - 'tr_cache', - 'bb_cache', - 'session_cache', - 'bb_login_err', - 'bb_cap_sid', - ); + 'tr_cache', + 'bb_cache', + 'session_cache', + 'bb_login_err', + 'bb_cap_sid', + ); - foreach ($gc_cache as $cache_name) - { - CACHE($cache_name)->rm(); - } + foreach ($gc_cache as $cache_name) + { + CACHE($cache_name)->rm(); + } - $this->response['cache_html'] = ''. $lang['ALL_CACHE_CLEARED'] .''; + $this->response['cache_html'] = ''. $lang['ALL_CACHE_CLEARED'] .''; break; case 'clear_datastore': @@ -36,71 +36,72 @@ switch($mode) case 'delete_profile': if ($userdata['user_id'] == $user_id) $this->ajax_die($lang['USER_DELETE_ME']); - if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['USER_DELETE_CONFIRM']); + if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['USER_DELETE_CONFIRM']); if ($user_id != BOT_UID) - { - delete_user_sessions($user_id); + { + delete_user_sessions($user_id); user_delete($user_id); - $this->response['info'] = $lang['USER_DELETED']; - } - else $this->ajax_die($lang['USER_DELETE_CSV']); - break; + $this->response['info'] = $lang['USER_DELETED']; + } + else $this->ajax_die($lang['USER_DELETE_CSV']); + break; - case 'delete_topics': - if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']); - if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['DELETE_USER_ALL_POSTS_CONFIRM']); + case 'delete_topics': + if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']); + if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['DELETE_USER_ALL_POSTS_CONFIRM']); if (IS_ADMIN) - { - $user_topics = DB()->fetch_rowset("SELECT topic_id FROM ". BB_TOPICS ." WHERE topic_poster = $user_id", 'topic_id'); + { + $user_topics = DB()->fetch_rowset("SELECT topic_id FROM ". BB_TOPICS ." WHERE topic_poster = $user_id", 'topic_id'); $deleted_topics = topic_delete($user_topics); $deleted_posts = post_delete('user', $user_id); - $this->response['info'] = $lang['USER_DELETED_POSTS']; - } - else $this->ajax_die($lang['NOT_ADMIN']); - break; + $this->response['info'] = $lang['USER_DELETED_POSTS']; + } + else $this->ajax_die($lang['NOT_ADMIN']); + break; - case 'delete_message': - if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']); - if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_CONFIRM']); + case 'delete_message': + if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']); + if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_CONFIRM']); if (IS_ADMIN) - { - post_delete('user', $user_id); + { + post_delete('user', $user_id); - $this->response['info'] = $lang['USER_DELETED_POSTS']; - } - else $this->ajax_die($lang['NOT_ADMIN']); - break; + $this->response['info'] = $lang['USER_DELETED_POSTS']; + } + else $this->ajax_die($lang['NOT_ADMIN']); + break; case 'user_activate': if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['DEACTIVATE_CONFIRM']); - DB()->query("UPDATE ". BB_USERS ." SET user_active = '1' WHERE user_id = ". $user_id); + DB()->query("UPDATE ". BB_USERS ." SET user_active = '1' WHERE user_id = ". $user_id); - $this->response['info'] = $lang['USER_ACTIVATE_ON']; + $this->response['info'] = $lang['USER_ACTIVATE_ON']; break; case 'user_deactivate': - if ($userdata['user_id'] == $user_id) $this->ajax_die($lang['USER_DEACTIVATE_ME']); + if ($userdata['user_id'] == $user_id) $this->ajax_die($lang['USER_DEACTIVATE_ME']); if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['ACTIVATE_CONFIRM']); - DB()->query("UPDATE ". BB_USERS ." SET user_active = '0' WHERE user_id = ". $user_id); - delete_user_sessions($user_id); + DB()->query("UPDATE ". BB_USERS ." SET user_active = '0' WHERE user_id = ". $user_id); + delete_user_sessions($user_id); - $this->response['info'] = $lang['USER_ACTIVATE_OFF']; + $this->response['info'] = $lang['USER_ACTIVATE_OFF']; break; + case "indexer": exec("indexer --config {$bb_cfg['sphinx_config_path']} --all --rotate", $result); - if(!is_file($bb_cfg['sphinx_config_path'].".log")) + if (!is_file($bb_cfg['sphinx_config_path'].".log")) { file_put_contents($bb_cfg['sphinx_config_path'].".log", "####Logger from dimka3210.####".date("H:i:s", TIMENOW)."##############################\r\n\r\n\r\n\r\n", FILE_APPEND); } file_put_contents($bb_cfg['sphinx_config_path'].".log", "##############################".date("H:i:s", TIMENOW)."##############################\r\n", FILE_APPEND); - foreach($result as $row) + foreach ($result as $row) { file_put_contents($bb_cfg['sphinx_config_path'].".log", $row."\r\n", FILE_APPEND); } @@ -111,5 +112,5 @@ switch($mode) break; } -$this->response['mode'] = $mode; +$this->response['mode'] = $mode; $this->response['url'] = html_entity_decode(make_url('/') . PROFILE_URL . $user_id); \ No newline at end of file diff --git a/upload/ajax/mod_action.php b/upload/ajax/mod_action.php index 1ce57855f..022f12e78 100644 --- a/upload/ajax/mod_action.php +++ b/upload/ajax/mod_action.php @@ -9,10 +9,10 @@ $mode = (string) $this->request['mode']; switch ($mode) { case 'tor_status': - $topics = (string) $this->request['topic_ids']; - $status = (int) $this->request['status']; + $topics = (string) $this->request['topic_ids']; + $status = (int) $this->request['status']; - // Валидность статуса + // Валидность статуса if (!isset($lang['TOR_STATUS_NAME'][$status])) { $this->ajax_die($lang['STATUS_DOES_EXIST'] . $new_status); @@ -26,10 +26,10 @@ switch ($mode) } $this->response['status'] = $bb_cfg['tor_icons'][$status]; $this->response['topics'] = explode(',', $topics); - break; + break; case 'edit_topic_title': - $topic_id = (int) $this->request['topic_id']; + $topic_id = (int) $this->request['topic_id']; $topic_title = (string) $this->request['topic_title']; $new_title = clean_title($topic_title); @@ -46,32 +46,32 @@ switch ($mode) DB()->query("UPDATE ". BB_TOPICS ." SET topic_title = '$topic_title_sql' WHERE topic_id = $topic_id LIMIT 1"); - //Обновление кеша новостей на главной + // Обновление кеша новостей на главной $news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id'])); - if(isset($news_forums[$t_data['forum_id']]) && $bb_cfg['show_latest_news']) + if (isset($news_forums[$t_data['forum_id']]) && $bb_cfg['show_latest_news']) { $datastore->enqueue('latest_news'); $datastore->update('latest_news'); } - + $net_forums = array_flip(explode(',', $bb_cfg['network_news_forum_id'])); - if(isset($net_forums[$t_data['forum_id']]) && $bb_cfg['show_network_news']) + if (isset($net_forums[$t_data['forum_id']]) && $bb_cfg['show_network_news']) { $datastore->enqueue('network_news'); $datastore->update('network_news'); } - $this->response['topic_id'] = $topic_id; + $this->response['topic_id'] = $topic_id; $this->response['topic_title'] = $new_title; - break; - - case 'profile_ip': - $user_id = (int) $this->request['user_id']; - $profiledata = get_userdata($user_id); - - if(!$user_id) $this->ajax_die($lang['NO_USER_ID_SPECIFIED']); + break; - $reg_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM ". BB_USERS ." + case 'profile_ip': + $user_id = (int) $this->request['user_id']; + $profiledata = get_userdata($user_id); + + if (!$user_id) $this->ajax_die($lang['NO_USER_ID_SPECIFIED']); + + $reg_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM ". BB_USERS ." WHERE user_reg_ip = '{$profiledata['user_reg_ip']}' AND user_reg_ip != '' AND user_id != {$profiledata['user_id']} @@ -83,8 +83,8 @@ switch ($mode) AND user_id != {$profiledata['user_id']}"); $link_reg_ip = $link_last_ip = ''; - - if(!empty($reg_ip)) + + if (!empty($reg_ip)) { $link_reg_ip .= $lang['OTHER_IP'] .' '; foreach ($reg_ip as $row) @@ -93,7 +93,7 @@ switch ($mode) } } - if(!empty($last_ip)) + if (!empty($last_ip)) { $link_last_ip .= $lang['OTHER_IP'] .' '; foreach ($last_ip as $row) @@ -111,20 +111,20 @@ switch ($mode) $reg_ip = ''. $user_reg_ip .''; $last_ip = ''. $user_last_ip .''; } - + $this->response['ip_list_html'] = '
- + - + -
'. $lang['REG_IP'] .' '. $reg_ip .'
'. $link_reg_ip .'
'. $lang['LAST_IP'] .' '. $last_ip .'
'. $link_last_ip .'

+
'; - break; -} + break; +} \ No newline at end of file diff --git a/upload/ajax/posts.php b/upload/ajax/posts.php index 6193621ac..615226225 100644 --- a/upload/ajax/posts.php +++ b/upload/ajax/posts.php @@ -50,7 +50,7 @@ if (!defined('WORD_LIST_OBTAINED')) switch($this->request['type']) { case 'delete'; - if($post['post_id'] != $post['topic_first_post_id'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $is_auth['auth_delete'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600*3 > TIMENOW))) + if ($post['post_id'] != $post['topic_first_post_id'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $is_auth['auth_delete'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600*3 > TIMENOW))) { if (empty($this->request['confirmed'])) { @@ -64,14 +64,14 @@ switch($this->request['type']) { $this->ajax_die(sprintf($lang['DELETE_OWN_POSTS'], strip_tags($is_auth['auth_delete_type']))); } - break; + break; case 'reply'; if(bf($userdata['user_opt'], 'user_opt', 'allow_post')) { $this->ajax_die($lang['RULES_REPLY_CANNOT']); } - else if(!$is_auth['auth_reply']) + else if(!$is_auth['auth_reply']) { $this->ajax_die(sprintf($lang['SORRY_AUTH_REPLY'], strip_tags($is_auth['auth_reply_type']))); } @@ -89,55 +89,55 @@ switch($this->request['type']) $message = (!empty($message)) ? preg_replace($orig_word, $replace_word, $message) : ''; } - if($post['post_id'] == $post['topic_first_post_id']) + if ($post['post_id'] == $post['topic_first_post_id']) { - $message = "[quote]". $post['topic_title'] ."[/quote]\n"; + $message = "[quote]". $post['topic_title'] ."[/quote]\n"; } - if(mb_strlen($message, 'UTF-8') > 1000) + if (mb_strlen($message, 'UTF-8') > 1000) { $this->response['redirect'] = make_url('posting.php?mode=quote&p='. $post_id); } $this->response['quote'] = true; $this->response['message'] = $message; - break; + break; case 'view_message': $message = (string) $this->request['message']; if(!trim($message)) $this->ajax_die($lang['EMPTY_MESSAGE']); $message = htmlCHR($message, false, ENT_NOQUOTES); - $this->response['message_html'] = bbcode2html($message); - $this->response['res_id'] = @$this->request['res_id']; - break; + $this->response['message_html'] = bbcode2html($message); + $this->response['res_id'] = @$this->request['res_id']; + break; case 'edit': - case 'editor': - if ($post['poster_id'] != $userdata['user_id'] && !$is_auth['auth_mod']) + case 'editor': + if ($post['poster_id'] != $userdata['user_id'] && !$is_auth['auth_mod']) { $this->ajax_die($lang['EDIT_OWN_POSTS']); } - if((mb_strlen($post['post_text'], 'UTF-8') > 1000) || $post['post_attachment'] || ($post['topic_first_post_id'] == $post_id)) - { - $this->response['redirect'] = make_url('posting.php?mode=editpost&p='. $post_id); - } - else if($this->request['type'] == 'editor') + if ((mb_strlen($post['post_text'], 'UTF-8') > 1000) || $post['post_attachment'] || ($post['topic_first_post_id'] == $post_id)) + { + $this->response['redirect'] = make_url('posting.php?mode=editpost&p='. $post_id); + } + elseif ($this->request['type'] == 'editor') { $text = (string) $this->request['text']; $text = prepare_message($text); - if(mb_strlen($text) > 2) + if (mb_strlen($text) > 2) { - if($text != $post['post_text']) + if ($text != $post['post_text']) { - if($bb_cfg['max_smilies']) - { + if ($bb_cfg['max_smilies']) + { $count_smilies = substr_count(bbcode2html($text), 'request['type']) $s_text = str_replace('\n', "\n", $text); $s_topic_title = str_replace('\n', "\n", $post['topic_title']); add_search_words($post_id, stripslashes($s_text), stripslashes($s_topic_title)); - update_post_html(array( + update_post_html(array( 'post_id' => $post_id, 'post_text' => $text, )); @@ -163,7 +163,7 @@ switch($this->request['type']) { $this->ajax_die($lang['TOPIC_LOCKED']); } - else if(!$is_auth['auth_edit']) + elseif (!$is_auth['auth_edit']) { $this->ajax_die(sprintf($lang['SORRY_AUTH_EDIT'], strip_tags($is_auth['auth_edit_type']))); } @@ -173,7 +173,7 @@ switch($this->request['type']) $hidden_form .= ''; $this->response['text'] = ' -
+ '. $hidden_form .'
@@ -217,28 +217,28 @@ switch($this->request['type']) break; case 'add': - if (!isset($this->request['topic_id'])) + if (!isset($this->request['topic_id'])) { $this->ajax_die('empty topic_id'); } - if(bf($userdata['user_opt'], 'user_opt', 'allow_post')) + if (bf($userdata['user_opt'], 'user_opt', 'allow_post')) { $this->ajax_die($lang['RULES_REPLY_CANNOT']); } - else if(!$is_auth['auth_reply']) + elseif (!$is_auth['auth_reply']) { $this->ajax_die(sprintf($lang['SORRY_AUTH_REPLY'], strip_tags($is_auth['auth_reply_type']))); } - if ($post['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) + if ($post['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) { - $this->ajax_die($lang['TOPIC_LOCKED']); + $this->ajax_die($lang['TOPIC_LOCKED']); } - $message = (string) $this->request['message']; + $message = (string) $this->request['message']; $message = prepare_message($message); - // Flood control + // Flood control $where_sql = (IS_GUEST) ? "p.poster_ip = '". USER_IP ."'" : "p.poster_id = {$userdata['user_id']}"; $sql = "SELECT MAX(p.post_time) AS last_post_time FROM ". BB_POSTS ." p WHERE $where_sql"; @@ -276,33 +276,33 @@ switch($this->request['type']) } } - if($bb_cfg['max_smilies']) - { + if ($bb_cfg['max_smilies']) + { $count_smilies = substr_count(bbcode2html($message), 'sql_nextid(); + $post_id = DB()->sql_nextid(); DB()->sql_query("INSERT INTO " . BB_POSTS_TEXT . " (post_id, post_text) VALUES ($post_id, '". DB()->escape($message) ."')"); - update_post_stats('reply', $post, $post['forum_id'], $topic_id, $post_id, $userdata['user_id']); + update_post_stats('reply', $post, $post['forum_id'], $topic_id, $post_id, $userdata['user_id']); $s_message = str_replace('\n', "\n", $message); $s_topic_title = str_replace('\n', "\n", $post['topic_title']); add_search_words($post_id, stripslashes($s_message), stripslashes($s_topic_title)); - update_post_html(array( + update_post_html(array( 'post_id' => $post_id, 'post_text' => $message, )); $this->response['redirect'] = make_url(POST_URL . $post_id .'#'. $post_id); - break; + break; default: $this->ajax_die('empty type'); - break; -} + break; +} \ No newline at end of file diff --git a/upload/ajax/topic_tpl.php b/upload/ajax/topic_tpl.php index 5b9a0e65c..e5524cc75 100644 --- a/upload/ajax/topic_tpl.php +++ b/upload/ajax/topic_tpl.php @@ -169,4 +169,4 @@ if ($sql_error) // выход $this->response['mode'] = $mode; -$this->response['timestamp'] = TIMENOW; +$this->response['timestamp'] = TIMENOW; \ No newline at end of file diff --git a/upload/ajax/user_register.php b/upload/ajax/user_register.php index b7dbed8d9..3120da2bd 100644 --- a/upload/ajax/user_register.php +++ b/upload/ajax/user_register.php @@ -20,7 +20,8 @@ switch($mode) { $html = ' '. $err .''; } - break; + break; + case 'check_email': $email = (string) $this->request['email']; @@ -32,7 +33,8 @@ switch($mode) { $html = ' '. $err .''; } - break; + break; + case 'check_pass': $pass = (string) $this->request['pass']; $pass_confirm = (string) $this->request['pass_confirm']; @@ -42,7 +44,7 @@ switch($mode) } else { - if ($pass != $pass_confirm) + if ($pass != $pass_confirm) { $html = ' '. $lang['CHOOSE_PASS_ERR'] .''; } @@ -60,12 +62,13 @@ switch($mode) { $text = (IS_GUEST) ? $lang['CHOOSE_PASS_REG_OK'] : $lang['CHOOSE_PASS_OK']; $html = ' '. $text .''; - } + } } } break; + case 'refresh_captcha'; - $html = CAPTCHA()->get_html(); + $html = CAPTCHA()->get_html(); break; } diff --git a/upload/ajax/view_profile.php b/upload/ajax/view_profile.php index 373827f97..5fbfe40fb 100644 --- a/upload/ajax/view_profile.php +++ b/upload/ajax/view_profile.php @@ -9,10 +9,10 @@ $mode = (string) $this->request['mode']; switch ($mode) { case 'active_torrents': - $user_id = (int) $this->request['user_id']; - if(!$user_id) $this->ajax_die($lang['NO_USER_ID_SPECIFIED']); + $user_id = (int) $this->request['user_id']; + if (!$user_id) $this->ajax_die($lang['NO_USER_ID_SPECIFIED']); $user_info = get_userdata($user_id); - if(!bf($user_info['user_opt'], 'user_opt', 'allow_dls') && !IS_AM && $user_id != $userdata['user_id']) $this->ajax_die($lang['CUR_ACTIVE_DLS_DISALLOWED']); + if (!bf($user_info['user_opt'], 'user_opt', 'allow_dls') && !IS_AM && $user_id != $userdata['user_id']) $this->ajax_die($lang['CUR_ACTIVE_DLS_DISALLOWED']); $excluded_forums_csv = $user->get_excluded_forums(AUTH_VIEW); $not_auth_forums_sql = ($excluded_forums_csv) ? " diff --git a/upload/ajax/view_torrent.php b/upload/ajax/view_torrent.php index b81d7b5db..426445279 100644 --- a/upload/ajax/view_torrent.php +++ b/upload/ajax/view_torrent.php @@ -10,11 +10,8 @@ if (!isset($this->request['attach_id'])) } $attach_id = (int) $this->request['attach_id']; -$torrent = DB()->fetch_row("SELECT at.attach_id, at.physical_filename - FROM ". BB_ATTACHMENTS_DESC ." at - WHERE at.attach_id = $attach_id - LIMIT 1"); -if(!$torrent) $this->ajax_die($lang['EMPTY_ATTACH_ID']); +$torrent = DB()->fetch_row("SELECT at.attach_id, at.physical_filename FROM ". BB_ATTACHMENTS_DESC ." at WHERE at.attach_id = $attach_id LIMIT 1"); +if (!$torrent) $this->ajax_die($lang['EMPTY_ATTACH_ID']); $filename = get_attachments_dir() .'/'. $torrent['physical_filename']; if (($file_contents = @file_get_contents($filename)) === false) @@ -34,7 +31,7 @@ $tor_filelist = build_tor_filelist($file_contents); function build_tor_filelist ($file_contents) { - global $lang; + global $lang; if (!$tor = bdecode($file_contents)) { @@ -172,5 +169,4 @@ function clean_tor_dirname ($dirname) return str_replace(array('[', ']', '<', '>', "'"), array('[', ']', '<', '>', '''), $dirname); } -$this->response['html'] = $tor_filelist; - +$this->response['html'] = $tor_filelist; \ No newline at end of file diff --git a/upload/bt/includes/init_tr.php b/upload/bt/includes/init_tr.php index 50c093a8f..5c4276809 100644 --- a/upload/bt/includes/init_tr.php +++ b/upload/bt/includes/init_tr.php @@ -489,4 +489,4 @@ class sql_db $msg[] = ''; bb_log($msg, 'sql_error_tr'); } -} +} \ No newline at end of file diff --git a/upload/config.php b/upload/config.php index 2f4263829..9ce68bfdf 100644 --- a/upload/config.php +++ b/upload/config.php @@ -55,8 +55,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Increase number of revision after update $bb_cfg['tp_version'] = '2.5 (unstable)'; -$bb_cfg['tp_release_date'] = '17-01-2014'; -$bb_cfg['tp_release_state'] = 'R560'; +$bb_cfg['tp_release_date'] = '19-01-2014'; +$bb_cfg['tp_release_state'] = 'R561'; // Database $charset = 'utf8'; diff --git a/upload/develop/benchmark/timer.php b/upload/develop/benchmark/timer.php index 70dedd20b..bf5576a37 100644 --- a/upload/develop/benchmark/timer.php +++ b/upload/develop/benchmark/timer.php @@ -354,4 +354,4 @@ class Benchmark_Timer { $microtime = explode(' ', microtime()); return $microtime[1] . substr($microtime[0], 1); } -} +} \ No newline at end of file diff --git a/upload/develop/dbg_config.php b/upload/develop/dbg_config.php index ef3be8899..66c2960c6 100644 --- a/upload/develop/dbg_config.php +++ b/upload/develop/dbg_config.php @@ -3,5 +3,4 @@ // Open file in Editor $bb_cfg['dbg']['interpreter'] = 'cmd.exe /c START'; $bb_cfg['dbg']['editor_path'] = 'D:\Programs\TextPad\TextPad.exe'; -$bb_cfg['dbg']['editor_args'] = '%s(%s)'; // %s - file_to_open path, %s - line number - +$bb_cfg['dbg']['editor_args'] = '%s(%s)'; // %s - file_to_open path, %s - line number \ No newline at end of file diff --git a/upload/develop/error_handler.php b/upload/develop/error_handler.php index e25fd5033..7ef78c873 100644 --- a/upload/develop/error_handler.php +++ b/upload/develop/error_handler.php @@ -103,5 +103,4 @@ class bb_error_handler } $errHandler = new bb_error_handler; -set_error_handler(array(&$errHandler, 'bb_error_handler')); - +set_error_handler(array(&$errHandler, 'bb_error_handler')); \ No newline at end of file diff --git a/upload/develop/functions_debug.php b/upload/develop/functions_debug.php index 89f04b22b..b127a6a27 100644 --- a/upload/develop/functions_debug.php +++ b/upload/develop/functions_debug.php @@ -99,4 +99,4 @@ function showSource ($file, $line, $prev = 10, $next = 10, $add_view_full_link = echo 'View Full Source'; } return ob_get_clean(); -} +} \ No newline at end of file diff --git a/upload/develop/init_debug.php b/upload/develop/init_debug.php index 56c55c9d9..bbfac4d57 100644 --- a/upload/develop/init_debug.php +++ b/upload/develop/init_debug.php @@ -38,4 +38,4 @@ function prepend_debug_info ($contents) return $contents; } -ob_start('prepend_debug_info'); +ob_start('prepend_debug_info'); \ No newline at end of file diff --git a/upload/develop/profiler/profiler.css b/upload/develop/profiler/profiler.css index cb690d1a4..492f98783 100644 --- a/upload/develop/profiler/profiler.css +++ b/upload/develop/profiler/profiler.css @@ -116,4 +116,4 @@ font { font-size: 12px; background: #FBFBFB; font-family: Courier, monospace; -} +} \ No newline at end of file diff --git a/upload/develop/profiler/profiler.php b/upload/develop/profiler/profiler.php index a594399c1..050553706 100644 --- a/upload/develop/profiler/profiler.php +++ b/upload/develop/profiler/profiler.php @@ -32,4 +32,4 @@ class profiler trigger_error("Unsupported profiler extension: $extension_name", E_USER_ERROR); } } -} +} \ No newline at end of file diff --git a/upload/develop/profiler/profiler_dbg.php b/upload/develop/profiler/profiler_dbg.php index 898051eb0..1db4f508e 100644 --- a/upload/develop/profiler/profiler_dbg.php +++ b/upload/develop/profiler/profiler_dbg.php @@ -156,7 +156,7 @@ class profiler_dbg extends profiler var $min_time = 0; var $total_time = 0; - // $min_time - ( %) + // $min_time - минимальное время выполнения для вывода в подробной построковой информации (в секундах или %) // function print_profile_data ($min_time = 0) { @@ -370,8 +370,4 @@ class profiler_dbg extends profiler if ($a['time'] == $b['time']) return 0; return ($a['time'] > $b['time']) ? -1 : 1; } -} - - - - +} \ No newline at end of file diff --git a/upload/includes/captcha/captcha.php b/upload/includes/captcha/captcha.php index db4296db2..59b11ec11 100644 --- a/upload/includes/captcha/captcha.php +++ b/upload/includes/captcha/captcha.php @@ -397,4 +397,4 @@ class captcha_kcaptcha extends captcha_common return $this->keystring; } -} +} \ No newline at end of file diff --git a/upload/includes/cron/jobs/bb_maintenance.php b/upload/includes/cron/jobs/bb_maintenance.php index cee9fa4f6..9936447b6 100644 --- a/upload/includes/cron/jobs/bb_maintenance.php +++ b/upload/includes/cron/jobs/bb_maintenance.php @@ -258,4 +258,4 @@ DB()->query(" if ($posts_days = intval($bb_cfg['posts_cache_days_keep'])) { DB()->query("DELETE FROM ". BB_POSTS_HTML ." WHERE post_html_time < DATE_SUB(NOW(), INTERVAL $posts_days DAY)"); -} +} \ No newline at end of file diff --git a/upload/includes/cron/jobs/cache_gc.php b/upload/includes/cron/jobs/cache_gc.php index 55737f71a..8e8c16e82 100644 --- a/upload/includes/cron/jobs/cache_gc.php +++ b/upload/includes/cron/jobs/cache_gc.php @@ -17,4 +17,4 @@ foreach ($gc_cache as $cache_name) $changes = CACHE($cache_name)->gc(); $cron_runtime_log .= date('Y-m-d H:i:s') ." -- tr -- $changes rows deleted\n"; } -} +} \ No newline at end of file diff --git a/upload/includes/cron/jobs/db_backup.php b/upload/includes/cron/jobs/db_backup.php index d9abb1da4..3efbfa8c2 100644 --- a/upload/includes/cron/jobs/db_backup.php +++ b/upload/includes/cron/jobs/db_backup.php @@ -34,4 +34,4 @@ if ($exec_return_status && !$bb_cfg['emailer_disabled'] && $bb_cfg['tech_admin_e sleep(10); -DB()->expect_slow_query(16*60, 100); +DB()->expect_slow_query(16*60, 100); \ No newline at end of file diff --git a/upload/includes/cron/jobs/prune_inactive_users.php b/upload/includes/cron/jobs/prune_inactive_users.php index e134aaf26..bbf9b1964 100644 --- a/upload/includes/cron/jobs/prune_inactive_users.php +++ b/upload/includes/cron/jobs/prune_inactive_users.php @@ -63,4 +63,4 @@ while (true) sleep(3); } -unset($prune_users, $not_activated_users, $not_active_users); +unset($prune_users, $not_activated_users, $not_active_users); \ No newline at end of file diff --git a/upload/includes/cron/jobs/tr_cleanup_and_dlstat.php b/upload/includes/cron/jobs/tr_cleanup_and_dlstat.php index d38e2b3a1..d81f834e8 100644 --- a/upload/includes/cron/jobs/tr_cleanup_and_dlstat.php +++ b/upload/includes/cron/jobs/tr_cleanup_and_dlstat.php @@ -207,4 +207,4 @@ if($bb_cfg['seed_bonus_enabled'] && $bb_cfg['seed_bonus_points'] && $bb_cfg['see } DB()->query("DROP TEMPORARY TABLE IF EXISTS tmp_bonus"); -} +} \ No newline at end of file diff --git a/upload/includes/cron/jobs/tr_complete_count.php b/upload/includes/cron/jobs/tr_complete_count.php index 8a816b8f3..fee5ff427 100644 --- a/upload/includes/cron/jobs/tr_complete_count.php +++ b/upload/includes/cron/jobs/tr_complete_count.php @@ -27,4 +27,4 @@ DB()->query(" "); // Drop tmp table -DB()->query("DROP TEMPORARY TABLE tmp_complete_count"); +DB()->query("DROP TEMPORARY TABLE tmp_complete_count"); \ No newline at end of file diff --git a/upload/includes/cron/jobs/tr_maintenance.php b/upload/includes/cron/jobs/tr_maintenance.php index 33093c7aa..b51fa8359 100644 --- a/upload/includes/cron/jobs/tr_maintenance.php +++ b/upload/includes/cron/jobs/tr_maintenance.php @@ -53,4 +53,4 @@ if ($dead_tor_sql && $attach_sql) DELETE FROM ". BB_BT_TORRENTS ." WHERE topic_id IN($dead_tor_sql) "); -} +} \ No newline at end of file diff --git a/upload/includes/cron/jobs/tr_make_snapshot.php b/upload/includes/cron/jobs/tr_make_snapshot.php index 43cecde1f..c70156a6f 100644 --- a/upload/includes/cron/jobs/tr_make_snapshot.php +++ b/upload/includes/cron/jobs/tr_make_snapshot.php @@ -164,4 +164,4 @@ if ($bb_cfg['torhelp_enabled']) DB()->query("DROP TABLE IF EXISTS ". NEW_BB_BT_TORHELP .", ". OLD_BB_BT_TORHELP); } -DB()->expect_slow_query(10); +DB()->expect_slow_query(10); \ No newline at end of file diff --git a/upload/includes/cron/jobs/tr_update_seeder_last_seen.php b/upload/includes/cron/jobs/tr_update_seeder_last_seen.php index 75025a25b..d9f868d9e 100644 --- a/upload/includes/cron/jobs/tr_update_seeder_last_seen.php +++ b/upload/includes/cron/jobs/tr_update_seeder_last_seen.php @@ -12,4 +12,4 @@ DB()->query(" tor.topic_id = b.topic_id "); -DB()->query("TRUNCATE TABLE ". BUF_LAST_SEEDER); +DB()->query("TRUNCATE TABLE ". BUF_LAST_SEEDER); \ No newline at end of file diff --git a/upload/includes/datastore/build_attach_extensions.php b/upload/includes/datastore/build_attach_extensions.php index ee543eb8b..5317d9585 100644 --- a/upload/includes/datastore/build_attach_extensions.php +++ b/upload/includes/datastore/build_attach_extensions.php @@ -14,4 +14,4 @@ $extensions = DB()->fetch_rowset(" AND g.allow_group = 1 "); -$this->store('attach_extensions', $extensions); +$this->store('attach_extensions', $extensions); \ No newline at end of file diff --git a/upload/includes/datastore/build_cat_forums.php b/upload/includes/datastore/build_cat_forums.php index ed5097991..263f45ea2 100644 --- a/upload/includes/datastore/build_cat_forums.php +++ b/upload/includes/datastore/build_cat_forums.php @@ -24,14 +24,14 @@ $data = array( // Store only these fields from BB_FORUMS in $data['f'] $forum_store_fields = array_flip(array_keys($bf['forum_perm'])); $forum_store_fields += array_flip(array( - 'forum_id', - 'cat_id', - 'forum_name', - 'forum_desc', - 'forum_status', - 'forum_posts', - 'forum_topics', - 'forum_parent', + 'forum_id', + 'cat_id', + 'forum_name', + 'forum_desc', + 'forum_status', + 'forum_posts', + 'forum_topics', + 'forum_parent', )); // Categories @@ -73,7 +73,7 @@ foreach (DB()->fetch_rowset($sql) as $row) $not_auth['user_read'][] = $fid; } - $data['forum'][$fid] = $row; + $data['forum'][$fid] = $row; // Store forums data if ($parent_id = $row['forum_parent']) @@ -136,7 +136,7 @@ if ($bb_cfg['show_latest_news'] AND $news_forum_ids = $bb_cfg['latest_news_forum SELECT topic_id, topic_time, topic_title, forum_id FROM ". BB_TOPICS ." WHERE forum_id IN ($news_forum_ids) - AND topic_moved_id = 0 + AND topic_moved_id = 0 ORDER BY topic_time DESC LIMIT $news_count "); @@ -149,18 +149,18 @@ if ($bb_cfg['show_latest_news'] AND $news_forum_ids = $bb_cfg['latest_news_forum // if ($bb_cfg['show_network_news'] AND $net_forum_ids = $bb_cfg['network_news_forum_id']) { - $net_count = max($bb_cfg['network_news_count'], 1); + $net_count = max($bb_cfg['network_news_count'], 1); - $data = DB()->fetch_rowset(" - SELECT topic_id, topic_time, topic_title, forum_id - FROM ". BB_TOPICS ." - WHERE forum_id IN ($net_forum_ids) - AND topic_moved_id = 0 - ORDER BY topic_time DESC - LIMIT $net_count - "); + $data = DB()->fetch_rowset(" + SELECT topic_id, topic_time, topic_title, forum_id + FROM ". BB_TOPICS ." + WHERE forum_id IN ($net_forum_ids) + AND topic_moved_id = 0 + ORDER BY topic_time DESC + LIMIT $net_count + "); - $this->store('network_news', $data); + $this->store('network_news', $data); } // @@ -174,8 +174,8 @@ if ($bb_cfg['show_ads']) SELECT * FROM ". BB_ADS ." WHERE ad_status = 1 - AND ad_start_time < NOW() - AND DATE_ADD(ad_start_time, INTERVAL ad_active_days DAY) > NOW() + AND ad_start_time < NOW() + AND DATE_ADD(ad_start_time, INTERVAL ad_active_days DAY) > NOW() "); foreach ($active_ads as $ad) @@ -187,9 +187,9 @@ if ($bb_cfg['show_ads']) $ad_block_assignment[$block_id][] = $ad['ad_id']; } } - $ad_html[$ad['ad_id']] = $ad['ad_html']; } + $this->store('ads', $ad_html); bb_update_config(array('active_ads' => serialize($ad_block_assignment))); -} +} \ No newline at end of file diff --git a/upload/includes/datastore/build_ranks.php b/upload/includes/datastore/build_ranks.php index 9e5dd40ac..e428b3a11 100644 --- a/upload/includes/datastore/build_ranks.php +++ b/upload/includes/datastore/build_ranks.php @@ -11,4 +11,4 @@ foreach (DB()->fetch_rowset($sql) as $row) $ranks[$row['rank_id']] = $row; } -$this->store('ranks', $ranks); +$this->store('ranks', $ranks); \ No newline at end of file diff --git a/upload/includes/datastore/build_smilies.php b/upload/includes/datastore/build_smilies.php index f7c52f63e..0bc49996a 100644 --- a/upload/includes/datastore/build_smilies.php +++ b/upload/includes/datastore/build_smilies.php @@ -13,7 +13,7 @@ foreach ($rowset as $smile) { $smilies['orig'][] = '#(?<=^|\W)'. preg_quote($smile['code'], '#') .'(?=$|\W)#'; $smilies['repl'][] = ' '. $smile['emoticon'] .''; - $smilies['smile'][] = $smile; + $smilies['smile'][] = $smile; } -$this->store('smile_replacements', $smilies); +$this->store('smile_replacements', $smilies); \ No newline at end of file diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 0c5d6df4a..87fcf76ec 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -2745,26 +2745,26 @@ function get_path_from_id ($id, $ext_id, $base_path, $first_div, $sec_div) return ($base_path ? "$base_path/" : '') . ($id % $sec_div) .'/'. $id . ($ext ? ".$ext" : ''); } -function send_pm($user_id, $subject, $message, $poster_id = BOT_UID) +function send_pm ($user_id, $subject, $message, $poster_id = BOT_UID) { global $userdata; $subject = DB()->escape($subject); $message = DB()->escape($message); - if($poster_id == BOT_UID) - { - $poster_ip = '7f000001'; - } - else if($row = DB()->fetch_row("SELECT user_reg_ip FROM ". BB_USERS ." WHERE user_id = $poster_id")) - { - $poster_ip = $row['user_reg_ip']; - } - else - { - $poster_id = $userdata['user_id']; - $poster_ip = USER_IP; - } + if ($poster_id == BOT_UID) + { + $poster_ip = '7f000001'; + } + elseif ($row = DB()->fetch_row("SELECT user_reg_ip FROM ". BB_USERS ." WHERE user_id = $poster_id")) + { + $poster_ip = $row['user_reg_ip']; + } + else + { + $poster_id = $userdata['user_id']; + $poster_ip = USER_IP; + } DB()->sql_query("INSERT INTO ". BB_PRIVMSGS ." (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip) VALUES (". PRIVMSGS_NEW_MAIL .", '$subject', {$poster_id}, $user_id, ". TIMENOW .", '$poster_ip')"); @@ -2780,7 +2780,7 @@ function send_pm($user_id, $subject, $message, $poster_id = BOT_UID) WHERE user_id = $user_id"); } -function profile_url($data) +function profile_url ($data) { global $bb_cfg, $lang, $datastore; @@ -2792,22 +2792,22 @@ function profile_url($data) $user_rank = !empty($data['user_rank']) ? $data['user_rank'] : 0; - if(isset($ranks[$user_rank])) + if (isset($ranks[$user_rank])) { $title = $ranks[$user_rank]['rank_title']; $style = $ranks[$user_rank]['rank_style']; } - if(empty($title)) $title = $lang['USER']; - if(empty($style)) $style = 'colorUser'; + if (empty($title)) $title = $lang['USER']; + if (empty($style)) $style = 'colorUser'; - if(!$bb_cfg['color_nick']) $style = ''; + if (!$bb_cfg['color_nick']) $style = ''; $username = !empty($data['username']) ? $data['username'] : $lang['GUEST']; $user_id = (!empty($data['user_id']) && $username != $lang['GUEST']) ? $data['user_id'] : GUEST_UID; $profile = ''. $username .''; - if(!in_array($user_id, array('', GUEST_UID, BOT_UID)) && $username) + if (!in_array($user_id, array('', GUEST_UID, BOT_UID)) && $username) { $profile = ''. $profile .''; } @@ -2815,7 +2815,8 @@ function profile_url($data) return $profile; } -function seo_link_header($str){ +function seo_link_header ($str) +{ /** * Функция обработки url. Сверяет url с переданным выражением. */ diff --git a/upload/includes/functions_post.php b/upload/includes/functions_post.php index 6da94a84e..debce337e 100644 --- a/upload/includes/functions_post.php +++ b/upload/includes/functions_post.php @@ -159,41 +159,26 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_ $topic_dl_type = (isset($_POST['topic_dl_type']) && ($post_info['allow_reg_tracker'] || $is_auth['auth_mod'])) ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL; - if (($mode == 'editpost' && $post_data['first_post'])) - { - $sql_update = " - UPDATE - ". BB_POSTS ." p, - ". BB_TOPICS ." t - SET - p.post_time = ". TIMENOW .", - t.topic_title = '$post_subject', - t.topic_type = $topic_type, - t.topic_dl_type = $topic_dl_type " . ((@$post_data['edit_vote'] || !empty($poll_title)) ? ", - t.topic_vote = " . $topic_vote : "") . ", - t.topic_last_post_time = ". TIMENOW .", - t.topic_time = ". TIMENOW ." - WHERE - t.topic_id = $topic_id - AND t.topic_first_post_id = p.post_id - "; - } - else - { - $sql_update = " - UPDATE - " . BB_TOPICS . " - SET - topic_title = '$post_subject', - topic_type = $topic_type, - topic_dl_type = $topic_dl_type " . ((@$post_data['edit_vote'] || !empty($poll_title)) ? ", - topic_vote = " . $topic_vote : "") . " - WHERE - topic_id = $topic_id - "; - } + $sql_insert = " + INSERT INTO + " . BB_TOPICS . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_dl_type, topic_vote) + VALUES + ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_dl_type, $topic_vote) + "; - $sql = ($mode != "editpost") ? "INSERT INTO " . BB_TOPICS . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_dl_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_dl_type, $topic_vote)" : $sql_update; + $sql_update = " + UPDATE + " . BB_TOPICS . " + SET + topic_title = '$post_subject', + topic_type = $topic_type, + topic_dl_type = $topic_dl_type + ". ((@$post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = ". $topic_vote : "") ." + WHERE + topic_id = $topic_id + "; + + $sql = ($mode != "editpost") ? $sql_insert : $sql_update; if (!DB()->sql_query($sql)) { diff --git a/upload/includes/functions_selects.php b/upload/includes/functions_selects.php index 7a3f957ab..1109aea6a 100644 --- a/upload/includes/functions_selects.php +++ b/upload/includes/functions_selects.php @@ -5,7 +5,7 @@ if (!defined('BB_ROOT')) die(basename(__FILE__)); // // Pick a language, any language // -function language_select($default, $select_name = "language", $dirname="language") +function language_select ($default, $select_name = "language", $dirname="language") { global $bb_cfg; if(!$default) $default = $bb_cfg['default_lang']; @@ -43,7 +43,7 @@ function language_select($default, $select_name = "language", $dirname="language // // Pick a timezone // -function tz_select($default, $select_name = 'timezone') +function tz_select ($default, $select_name = 'timezone') { global $sys_timezone, $lang; @@ -66,7 +66,7 @@ function tz_select($default, $select_name = 'timezone') // // Templates // -function templates_select($default_style, $select_name = 'tpl_name') +function templates_select ($default_style, $select_name = 'tpl_name') { global $bb_cfg; diff --git a/upload/includes/functions_validate.php b/upload/includes/functions_validate.php index 05dfe74d9..9696cbf73 100644 --- a/upload/includes/functions_validate.php +++ b/upload/includes/functions_validate.php @@ -111,4 +111,4 @@ function validate_email ($email, $check_ban_and_taken = true) } return false; -} +} \ No newline at end of file diff --git a/upload/includes/init_bb.php b/upload/includes/init_bb.php index 873ee4bee..c0adabd3f 100644 --- a/upload/includes/init_bb.php +++ b/upload/includes/init_bb.php @@ -580,9 +580,8 @@ $dl_status_css = array( DL_STATUS_CANCEL => 'dlCancel', ); - -// Show 'Board is disabled' message if needed. +// Show 'Board is disabled' message if needed if ($bb_cfg['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN')) { message_die(GENERAL_MESSAGE, 'BOARD_DISABLE'); -} +} \ No newline at end of file diff --git a/upload/includes/online_userlist.php b/upload/includes/online_userlist.php index 56ad2303c..9453194ed 100644 --- a/upload/includes/online_userlist.php +++ b/upload/includes/online_userlist.php @@ -150,4 +150,4 @@ $online['cnt'] = $online_short['cnt'] = <<set('online', $online, 45); -CACHE('bb_cache')->set('online_short', $online_short, 45); +CACHE('bb_cache')->set('online_short', $online_short, 45); \ No newline at end of file diff --git a/upload/includes/page_footer.php b/upload/includes/page_footer.php index 87c707057..09235ff96 100644 --- a/upload/includes/page_footer.php +++ b/upload/includes/page_footer.php @@ -112,4 +112,4 @@ if (defined('REQUESTED_PAGE') && !defined('DISABLE_CACHING_OUTPUT')) } } -bb_exit(); +bb_exit(); \ No newline at end of file diff --git a/upload/includes/page_header.php b/upload/includes/page_header.php index ce3e2fb17..8a9e69bc9 100644 --- a/upload/includes/page_header.php +++ b/upload/includes/page_header.php @@ -352,7 +352,7 @@ $template->pparse('page_header'); define('PAGE_HEADER_SENT', true); -if(!$bb_cfg['gzip_compress']) +if (!$bb_cfg['gzip_compress']) { flush(); } \ No newline at end of file diff --git a/upload/includes/posting_tpl.php b/upload/includes/posting_tpl.php index acdc881ac..8e7edf320 100644 --- a/upload/includes/posting_tpl.php +++ b/upload/includes/posting_tpl.php @@ -66,6 +66,7 @@ if ($edit_tpl_mode) 'NO_TPL_ASSIGNED' => !($f_data['forum_tpl_id']), 'TPL_SELECT' => get_select('forum_tpl', $f_data['forum_tpl_id']), )); + if ($tpl_data) { $template->assign_vars(array( @@ -78,5 +79,4 @@ if ($edit_tpl_mode) } } -print_page('posting_tpl.tpl'); - +print_page('posting_tpl.tpl'); \ No newline at end of file diff --git a/upload/includes/sphinxapi.php b/upload/includes/sphinxapi.php index f5f4eab72..a25136f5a 100644 --- a/upload/includes/sphinxapi.php +++ b/upload/includes/sphinxapi.php @@ -1648,4 +1648,4 @@ class SphinxClient extends cache_common // // $Id: sphinxapi.php 2055 2009-11-06 23:09:58Z shodan $ -// +// \ No newline at end of file diff --git a/upload/includes/topic_templates/video_guide.php b/upload/includes/topic_templates/video_guide.php index cba236540..ed54ba8c4 100644 --- a/upload/includes/topic_templates/video_guide.php +++ b/upload/includes/topic_templates/video_guide.php @@ -18,4 +18,5 @@ $lang['TPL']['GUIDE'] = array( 'audio' => 330984, 'torrent' => 330985, ); + $lang['TPL']['GUIDE'] = array(); \ No newline at end of file diff --git a/upload/includes/ucp/usercp_attachcp.php b/upload/includes/ucp/usercp_attachcp.php index 2d937b23b..0e9aa9a51 100644 --- a/upload/includes/ucp/usercp_attachcp.php +++ b/upload/includes/ucp/usercp_attachcp.php @@ -315,4 +315,4 @@ if ($do_pagination && $total_rows > $bb_cfg['topics_per_page']) generate_pagination(BB_ROOT ."profile.php?mode=attachcp&mode_a=$mode&order=$sort_order&" . POST_USERS_URL . '=' . $profiledata['user_id'] . '&sid=' . $userdata['session_id'], $total_rows, $bb_cfg['topics_per_page'], $start).' '; } -print_page('usercp_attachcp.tpl'); +print_page('usercp_attachcp.tpl'); \ No newline at end of file diff --git a/upload/includes/ucp/usercp_bonus.php b/upload/includes/ucp/usercp_bonus.php index e2bb3a106..b1e3fd290 100644 --- a/upload/includes/ucp/usercp_bonus.php +++ b/upload/includes/ucp/usercp_bonus.php @@ -24,18 +24,18 @@ if (isset($_POST['bonus_id'])) generate_passkey($user_id, true); $btu = get_bt_userdata($user_id); } - + $upload = $upload_row[$id]*1024*1024*1024; $points = $price_row[$id]; - - if($userdata['user_points'] < $points) + + if ($userdata['user_points'] < $points) { - meta_refresh('index.php', 5); - - $message = $lang['BONUS_NOT_SUCCES'] .'

'. $lang['BONUS_RETURN'] .'

'. $lang['RETURN_PROFILE'] .'

'. sprintf($lang['CLICK_RETURN_INDEX'], '', ''); - - bb_die($message); - } + meta_refresh('index.php', 5); + + $message = $lang['BONUS_NOT_SUCCES'] .'

'. $lang['BONUS_RETURN'] .'

'. $lang['RETURN_PROFILE'] .'

'. sprintf($lang['CLICK_RETURN_INDEX'], '', ''); + + bb_die($message); + } DB()->query("UPDATE ". BB_BT_USERS ." bu, ". BB_USERS ." u SET @@ -47,12 +47,12 @@ if (isset($_POST['bonus_id'])) "); cache_rm_user_sessions($user_id); - meta_refresh(BONUS_URL, 5); - + meta_refresh(BONUS_URL, 5); + $message = sprintf($lang['BONUS_SUCCES'], humn_size($upload_row[$id]*1024*1024*1024)); $message .= '

'. $lang['BONUS_RETURN'] .'

'. $lang['RETURN_PROFILE'] .'

'. sprintf($lang['CLICK_RETURN_INDEX'], '', ''); - - bb_die($message); + + bb_die($message); } else { diff --git a/upload/includes/ucp/usercp_email.php b/upload/includes/ucp/usercp_email.php index d882a1c51..7cdb3c3c7 100644 --- a/upload/includes/ucp/usercp_email.php +++ b/upload/includes/ucp/usercp_email.php @@ -22,9 +22,7 @@ if ( !$userdata['session_logged_in'] ) redirect("login.php?redirect=profile.php&mode=email&" . POST_USERS_URL . "=$user_id"); } -$sql = "SELECT username, user_email, user_lang - FROM " . BB_USERS . " - WHERE user_id = $user_id"; +$sql = "SELECT username, user_email, user_lang FROM " . BB_USERS . " WHERE user_id = $user_id"; if ( $row = DB()->fetch_row($sql) ) { $username = $row['username']; diff --git a/upload/includes/ucp/usercp_sendpasswd.php b/upload/includes/ucp/usercp_sendpasswd.php index c96c36a5e..3843b8323 100644 --- a/upload/includes/ucp/usercp_sendpasswd.php +++ b/upload/includes/ucp/usercp_sendpasswd.php @@ -88,4 +88,4 @@ $template->assign_vars(array( 'S_PROFILE_ACTION' => "profile.php?mode=sendpassword") ); -print_page('usercp_sendpasswd.tpl'); +print_page('usercp_sendpasswd.tpl'); \ No newline at end of file diff --git a/upload/index.php b/upload/index.php index 37e5e00ab..e1ff5df75 100644 --- a/upload/index.php +++ b/upload/index.php @@ -433,4 +433,4 @@ if (IS_AM) // Display page define('SHOW_ONLINE', $show_online_users); -print_page('index.tpl'); +print_page('index.tpl'); \ No newline at end of file diff --git a/upload/language/lang_english/lang_admin.php b/upload/language/lang_english/lang_admin.php index f9804da50..1a33dd9d9 100644 --- a/upload/language/lang_english/lang_admin.php +++ b/upload/language/lang_english/lang_admin.php @@ -660,4 +660,4 @@ $lang['SEED_BONUS_TOR_SIZE'] = '

Minimum distribution for which will be award $lang['SEED_BONUS_USER_REGDATA'] = '

Minimum length of user tracker, after which will be awarded bonuses

If you want to accrue bonuses to all users, leave blank.
'; $lang['SEED_BONUS_WARNING'] = 'ATTENTION! Seed Bonuses should be in ascending order'; $lang['SEED_BONUS_EXCHANGE'] = 'Configuring Exchange Sid Bonuses'; -$lang['SEED_BONUS_ROPORTION'] = 'Proportion addition for an exchange of bonuses on GB'; +$lang['SEED_BONUS_ROPORTION'] = 'Proportion addition for an exchange of bonuses on GB'; \ No newline at end of file diff --git a/upload/language/lang_english/lang_callseed.php b/upload/language/lang_english/lang_callseed.php index 7234b8a31..4c5b2df99 100644 --- a/upload/language/lang_english/lang_callseed.php +++ b/upload/language/lang_english/lang_callseed.php @@ -13,4 +13,4 @@ $lang['CALLSEED_MSG_POPUP'] = 'Error of popup'; $lang['CALLSEED_MSG_TIME'] = 'Unable to set the last query'; $lang['CALLSEED_HAVE_SEED'] = 'Topic does not require help (Seeders: %d, Leechers: %d)'; -$lang['CALLSEED_RETURN'] = '

Back to the topic'; +$lang['CALLSEED_RETURN'] = '

Back to the topic'; \ No newline at end of file diff --git a/upload/language/lang_russian/lang_admin.php b/upload/language/lang_russian/lang_admin.php index 038eba97c..5dd5d2a93 100644 --- a/upload/language/lang_russian/lang_admin.php +++ b/upload/language/lang_russian/lang_admin.php @@ -657,4 +657,4 @@ $lang['SEED_BONUS_TOR_SIZE'] = '

Минимальный размер разд $lang['SEED_BONUS_USER_REGDATA'] = '

Минимальный стаж пользователя на трекере, после которого будут начисляться бонусы

Если хотите начислять бонусы всем пользователям, оставьте поле пустым.
'; $lang['SEED_BONUS_WARNING'] = 'ВНИМАНИЕ! Сид Бонусы должны быть в порядке возрастания'; $lang['SEED_BONUS_EXCHANGE'] = 'Настройка обмена Сид Бонусов'; -$lang['SEED_BONUS_ROPORTION'] = 'Добавление пропорции для обмена бонусов на GB'; +$lang['SEED_BONUS_ROPORTION'] = 'Добавление пропорции для обмена бонусов на GB'; \ No newline at end of file diff --git a/upload/language/lang_russian/lang_admin_cron.php b/upload/language/lang_russian/lang_admin_cron.php index 97089c738..378a5b600 100644 --- a/upload/language/lang_russian/lang_admin_cron.php +++ b/upload/language/lang_russian/lang_admin_cron.php @@ -61,4 +61,4 @@ $lang['JOB_REMOVED'] = 'Задача была успешно удалена'; $lang['SCRIPT_DUPLICATE'] = 'Скрипт '. @$_POST['cron_script'] .' уже существует!'; $lang['TITLE_DUPLICATE'] = 'Название задачи '. @$_POST['cron_title'] .' уже существует!'; $lang['CLICK_RETURN_JOBS_ADDED'] = '%sВернуться к добавлению задачи%s'; -$lang['CLICK_RETURN_JOBS'] = '%sВернуться к планировщику задач%s'; +$lang['CLICK_RETURN_JOBS'] = '%sВернуться к планировщику задач%s'; \ No newline at end of file diff --git a/upload/language/lang_russian/lang_callseed.php b/upload/language/lang_russian/lang_callseed.php index 19f667bc3..73cd5b3a8 100644 --- a/upload/language/lang_russian/lang_callseed.php +++ b/upload/language/lang_russian/lang_callseed.php @@ -13,4 +13,4 @@ $lang['CALLSEED_MSG_POPUP'] = 'Ошибка работы всплывающе $lang['CALLSEED_MSG_TIME'] = 'Не удалось установить время последнего запроса'; $lang['CALLSEED_HAVE_SEED'] = 'Раздача не нуждается в помощи (Сидеров: %d, Личеров: %d)'; -$lang['CALLSEED_RETURN'] = '

Вернуться в тему'; +$lang['CALLSEED_RETURN'] = '

Вернуться в тему'; \ No newline at end of file diff --git a/upload/language/lang_russian/lang_faq_attach.php b/upload/language/lang_russian/lang_faq_attach.php index 3e6a35645..ad50773d6 100644 --- a/upload/language/lang_russian/lang_faq_attach.php +++ b/upload/language/lang_russian/lang_faq_attach.php @@ -28,4 +28,4 @@ $faq[] = array("Почему я не могу добавить вложение? $faq[] = array("Я получил разрешение, почему я всё ещё не могу добавлять приложения?", "Размер файлов, разрешённые расширения и другие вещи зависят от администратора форума. Может быть модератор или администратор изменили ваши права, или запретили приложения в определённых форумах. Когда вы пытаетесь добавить файл, форум должен выдать подробное описание проблемы, почему приложения не работают. Если этого недостаточно, свяжитесь с модератором или администратором, чтобы решить проблему."); $faq[] = array("Почему я не могу удалить вложение?", "В некоторых форумах удаление вложений разрешено только определённым пользователям или группам. Чтобы удалить вложение, необходимы права, которые могут дать только модератор или администратор форума, поэтому свяжитесь с ними."); $faq[] = array("Почему я не могу просмотреть/скачать вложение?", "В некоторых форумах скачивание файлов может быть разрешено только определённым пользователям или группам. Чтобы скачать файлы, нужны определённые права, и только модератор и администратор могут их вам дать, так что свяжитесь с ними."); -$faq[] = array("С кем мне надо связаться, чтобы сообщить о незаконных приложениях?", "Свяжитесь с администратором форума. Если вы не знаете, кто это, свяжитесь сначала с модераторами и спросите их, как связаться с администратором. Если вы не получите ответа, вам нужно будет связаться с владельцем домена (с помощью whois поиска), или, если сайт находится на бесплатном хостинге, вроде yahoo/tripod,, свяжитесь с администратором того сёрвера. Заметьте, что phpBB Group не принимает никакой ответственности за то, как или кто использует форум. Поэтому совершенно бесполезно контактировать phpBB Group с просьбами о прекращении какой бы то ни было нелегальной деятельности совершённой 3-ми лицами."); +$faq[] = array("С кем мне надо связаться, чтобы сообщить о незаконных приложениях?", "Свяжитесь с администратором форума. Если вы не знаете, кто это, свяжитесь сначала с модераторами и спросите их, как связаться с администратором. Если вы не получите ответа, вам нужно будет связаться с владельцем домена (с помощью whois поиска), или, если сайт находится на бесплатном хостинге, вроде yahoo/tripod,, свяжитесь с администратором того сёрвера. Заметьте, что phpBB Group не принимает никакой ответственности за то, как или кто использует форум. Поэтому совершенно бесполезно контактировать phpBB Group с просьбами о прекращении какой бы то ни было нелегальной деятельности совершённой 3-ми лицами."); \ No newline at end of file diff --git a/upload/login.php b/upload/login.php index 8a64d5236..e23b8725f 100644 --- a/upload/login.php +++ b/upload/login.php @@ -134,4 +134,4 @@ if (IS_GUEST || $mod_admin_login) print_page('login.tpl'); } -redirect($redirect_url); +redirect($redirect_url); \ No newline at end of file diff --git a/upload/memberlist.php b/upload/memberlist.php index dafc2ed8c..6509d1277 100644 --- a/upload/memberlist.php +++ b/upload/memberlist.php @@ -238,4 +238,4 @@ $template->assign_vars(array( 'PAGE_TITLE' => $lang['MEMBERLIST'], )); -print_page('memberlist.tpl'); +print_page('memberlist.tpl'); \ No newline at end of file diff --git a/upload/misc.php b/upload/misc.php index 735f32987..2c2e827c0 100644 --- a/upload/misc.php +++ b/upload/misc.php @@ -141,4 +141,4 @@ elseif ($do == 'info') else { message_die(GENERAL_ERROR, 'Invalid mode
'.mb_convert_case($lang['BACK'], MB_CASE_TITLE).''); -} +} \ No newline at end of file diff --git a/upload/misc/html/copyright_holders.html b/upload/misc/html/copyright_holders.html index cf887b1f9..5ece2bb88 100644 --- a/upload/misc/html/copyright_holders.html +++ b/upload/misc/html/copyright_holders.html @@ -49,5 +49,4 @@

[ Закрыть ]

- - + \ No newline at end of file diff --git a/upload/misc/html/not_found.html b/upload/misc/html/not_found.html index ca2188a23..ba91f4f97 100644 --- a/upload/misc/html/not_found.html +++ b/upload/misc/html/not_found.html @@ -20,5 +20,4 @@

[ Закрыть ]

- - + \ No newline at end of file diff --git a/upload/misc/html/user_agreement.html b/upload/misc/html/user_agreement.html index eaf16e1da..4b79006bb 100644 --- a/upload/misc/html/user_agreement.html +++ b/upload/misc/html/user_agreement.html @@ -102,4 +102,4 @@

[ Закрыть ]

- + \ No newline at end of file diff --git a/upload/privmsg.php b/upload/privmsg.php index 800c19e51..27115a6b6 100644 --- a/upload/privmsg.php +++ b/upload/privmsg.php @@ -1743,4 +1743,4 @@ function pm_message_die ($msg) $msg .= sprintf($lang['CLICK_RETURN_INDEX'], '', ''); message_die(GENERAL_MESSAGE, $msg); -} +} \ No newline at end of file diff --git a/upload/search.php b/upload/search.php index 8ae5e922f..323976349 100644 --- a/upload/search.php +++ b/upload/search.php @@ -955,4 +955,4 @@ function username_search ($search_match) )); print_page('search.tpl', 'simple'); -} +} \ No newline at end of file diff --git a/upload/stats/tracker.php b/upload/stats/tracker.php index 8e557b979..5798b3d17 100644 --- a/upload/stats/tracker.php +++ b/upload/stats/tracker.php @@ -137,5 +137,4 @@ echo ''; DB()->query("DROP TEMPORARY TABLE ". TMP_TRACKER_TABLE); -bb_exit(); - +bb_exit(); \ No newline at end of file diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl index e8867d611..f5e984075 100644 --- a/upload/templates/default/page_header.tpl +++ b/upload/templates/default/page_header.tpl @@ -17,6 +17,10 @@ +