From 3ed9f6e039fefe4220c6fc11619bb50c65f9e0c1 Mon Sep 17 00:00:00 2001 From: Exile Date: Fri, 1 Aug 2014 03:11:48 +0400 Subject: [PATCH] r593 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Старт ветки develop. В ней будут публиковаться промежуточные изменения, опубликованные до включения в ветку master (соответственно до объявления о выходе новой "ревизии"). Изменения: - чистка от пустых строк, пустых окончаний строк; - фикс настроек системы сидбонусов в админке; - фикс функции вывода картинки пола пользователя; - удаление неактуальной информации из шаблона; - изменения в работе tidy. --- other/converter/TBDevYSE_pre6/ReadMe.txt | 4 +- .../TBDevYSE_pre6/for_tbdev/announce.php | 4 +- .../TBDevYSE_pre6/for_tbdev/pass.php | 16 +- .../converter/TBDevYSE_pre6/root/convert.php | 36 ++-- .../root/converter/functions.php | 85 +++----- .../root/converter/passwords.php | 3 +- .../converter/TBDevYSE_pre6/root/recover.php | 24 +-- other/recover/converter/functions.php | 80 ++++---- other/recover/converter/passwords.php | 3 +- other/recover/recover.php | 25 ++- upload/admin/admin_attach_cp.php | 1 - upload/admin/admin_board.php | 8 +- upload/admin/admin_forumauth_list.php | 1 - upload/admin/admin_forums.php | 1 - upload/admin/admin_log.php | 1 - upload/admin/admin_mass_email.php | 12 +- upload/admin/admin_ranks.php | 1 - upload/admin/admin_user_search.php | 5 +- upload/ajax.php | 4 +- upload/ajax/edit_user_profile.php | 2 +- upload/ajax/mod_action.php | 8 +- upload/ajax/post_mod_comment.php | 2 +- upload/ajax/view_torrent.php | 2 +- .../includes/functions_includes.php | 16 -- upload/attach_mod/posting_attachments.php | 1 - upload/config.php | 22 +- upload/download.php | 1 - upload/includes/class.correct.php | 6 +- upload/includes/class.reflection.php | 2 +- upload/includes/class.utf8.php | 3 +- upload/includes/datastore/build_stats.php | 8 +- upload/includes/functions.php | 9 +- upload/includes/functions_post.php | 4 +- upload/includes/functions_report.php | 1 - upload/includes/functions_validate.php | 4 +- upload/includes/init_bb.php | 5 +- upload/includes/sessions.php | 4 - upload/includes/template.php | 5 +- upload/includes/ucp/email.php | 2 +- upload/includes/ucp/register.php | 10 +- upload/includes/ucp/viewprofile.php | 20 +- upload/includes/ucp/viewtorrent.php | 86 ++++---- upload/index.php | 4 +- upload/language/en/email/admin_send_email.tpl | 2 +- .../language/en/html/copyright_holders.html | 1 - upload/language/en/html/user_agreement.html | 2 +- upload/language/en/main.php | 3 - upload/language/ru/email/admin_send_email.tpl | 2 +- .../language/ru/html/copyright_holders.html | 1 - upload/language/ru/html/user_agreement.html | 2 +- upload/language/ru/main.php | 3 - upload/language/ua/email/admin_send_email.tpl | 2 +- .../language/ua/html/copyright_holders.html | 1 - upload/language/ua/html/user_agreement.html | 2 +- upload/language/ua/main.php | 3 - upload/login.php | 8 +- upload/misc.php | 2 +- upload/poll.php | 1 - upload/search.php | 10 +- upload/stats/tracker.php | 10 - upload/templates/admin/admin_cron.tpl | 1 - upload/templates/admin/admin_forumauth.tpl | 5 +- upload/templates/admin/admin_log.tpl | 4 +- upload/templates/admin/admin_mass_email.tpl | 2 +- .../admin/report_module_edit_body.tpl | 2 +- .../templates/admin/report_modules_body.tpl | 2 +- .../admin/report_reason_edit_body.tpl | 4 +- upload/templates/default/css/main.css | 5 +- upload/templates/default/groupcp.tpl | 3 +- upload/templates/default/index.tpl | 5 - upload/templates/default/login.tpl | 1 - upload/templates/default/modcp.tpl | 2 - upload/templates/default/page_header.tpl | 10 +- upload/templates/default/posting.tpl | 7 +- upload/templates/default/posting_attach.tpl | 1 - upload/templates/default/posting_smilies.tpl | 52 ++--- upload/templates/default/posting_tpl.tpl | 3 - upload/templates/default/privmsgs.tpl | 16 -- .../templates/default/report_change_body.tpl | 2 +- upload/templates/default/report_form_body.tpl | 10 +- .../templates/default/report_index_body.tpl | 11 +- upload/templates/default/report_open_body.tpl | 4 +- upload/templates/default/search.tpl | 1 - upload/templates/default/search_results.tpl | 1 - upload/templates/default/usercp_register.tpl | 14 +- .../templates/default/usercp_topic_watch.tpl | 1 - .../templates/default/usercp_viewprofile.tpl | 188 +++++++++--------- upload/templates/default/viewtopic.tpl | 18 +- upload/templates/default/viewtopic_attach.tpl | 3 +- .../default/viewtopic_attach_guest.tpl | 6 +- .../templates/default/viewtopic_torrent.tpl | 4 +- upload/viewforum.php | 2 +- upload/viewtopic.php | 3 +- 93 files changed, 412 insertions(+), 577 deletions(-) diff --git a/other/converter/TBDevYSE_pre6/ReadMe.txt b/other/converter/TBDevYSE_pre6/ReadMe.txt index 2ffa0d7a1..be2b8a36e 100644 --- a/other/converter/TBDevYSE_pre6/ReadMe.txt +++ b/other/converter/TBDevYSE_pre6/ReadMe.txt @@ -14,8 +14,8 @@ Quick guide: copy two files: automatically generated 'converter/passwords.php' and 'for_tbdev/pass.php' to your TBDevYSE root and run pass.php (Don't forget to remove these files after completion). You allow to change message text, see $msg in pass.php for this. -10. If you want to redirect peers from older announce to new announce everytime, replace original TBDev's announce.php with - 'for_tbdev/announce.php' +10. If you want to redirect peers from older announce to new announce everytime, replace original TBDev's announce.php with + 'for_tbdev/announce.php' Cheers, RoadTrain. http://torrentpier.me/ \ No newline at end of file diff --git a/other/converter/TBDevYSE_pre6/for_tbdev/announce.php b/other/converter/TBDevYSE_pre6/for_tbdev/announce.php index 7385a89f8..b69fed877 100644 --- a/other/converter/TBDevYSE_pre6/for_tbdev/announce.php +++ b/other/converter/TBDevYSE_pre6/for_tbdev/announce.php @@ -42,10 +42,10 @@ mysql_close(); mysql_query("SET NAMES $dbcharset"); // Get passkey for TorrentPier -$user_id += USER_ID_DIFF; +$user_id += USER_ID_DIFF; $res = mysql_query("SELECT auth_key FROM bb_bt_users WHERE user_id = $user_id") or err(mysql_error()); -if (mysql_affected_rows() == 0) +if (mysql_affected_rows() == 0) { err('Passkey doesn\'t created on new tracker or user doesn\'t exist'); } diff --git a/other/converter/TBDevYSE_pre6/for_tbdev/pass.php b/other/converter/TBDevYSE_pre6/for_tbdev/pass.php index 2e9794d83..617242a18 100644 --- a/other/converter/TBDevYSE_pre6/for_tbdev/pass.php +++ b/other/converter/TBDevYSE_pre6/for_tbdev/pass.php @@ -8,14 +8,12 @@ loggedinorreturn(); $new_tr_url = "http://torrentpier.me/"; // with ending slash $subject = "Переезд на новый движок"; -$msg = '[b]Внимание![/b] Наш трекер переехал на новый движок! Адрес трекера - [url='.$new_tr_url.']'.$new_tr_url.'[/url] - Вся база перенесена на новый движок, регистрироваться заново не надо. - Войти на трекер можно [url='.$new_tr_url.'login.php]здесь[/url]. Ваши данные на новом трекере: - [b]Логин:[/b] %s - [b]Пароль:[/b] %s +$msg = '[b]Внимание![/b] Наш трекер переехал на новый движок! Адрес трекера - [url='.$new_tr_url.']'.$new_tr_url.'[/url] + Вся база перенесена на новый движок, регистрироваться заново не надо. + Войти на трекер можно [url='.$new_tr_url.'login.php]здесь[/url]. Ваши данные на новом трекере: + [b]Логин:[/b] %s + [b]Пароль:[/b] %s Сменить пароль можно после входа на трекер в [url='.$new_tr_url.'profile.php?mode=editprofile]настройках[/url].'; - - if (empty($_POST['confirm'])) { @@ -32,14 +30,14 @@ if (empty($_POST['confirm'])) else { if(!file_exists('passwords.php')) stderr($tracker_lang['error'], 'passwords.php not exists'); - + include('passwords.php'); stdhead(); foreach ($passwords as $user) { $msg_sql = sprintf($msg, $user['username'], $user['new_passwd']); sql_query("INSERT INTO messages (receiver, added, subject, msg) VALUES({$user['tb_user_id']}, NOW(), ".sqlesc($subject).", ".sqlesc($msg_sql).")"); - } + } stdmsg('OK', 'Mass PM succesful'); } diff --git a/other/converter/TBDevYSE_pre6/root/convert.php b/other/converter/TBDevYSE_pre6/root/convert.php index b65022264..bee3f2a4b 100644 --- a/other/converter/TBDevYSE_pre6/root/convert.php +++ b/other/converter/TBDevYSE_pre6/root/convert.php @@ -81,18 +81,18 @@ if (CONVERT_USERS) { $start = $i * C_USERS_PER_ONCE; $offset = C_USERS_PER_ONCE; - + $sql = " - SELECT - id, username, email, status, UNIX_TIMESTAMP(added) AS added, UNIX_TIMESTAMP(last_access) AS last_access, + SELECT + id, username, email, status, UNIX_TIMESTAMP(added) AS added, UNIX_TIMESTAMP(last_access) AS last_access, class, icq, msn, aim, yahoo, website, $_sql uploaded, downloaded, enabled, language - FROM ". TB_USERS_TABLE ." + FROM ". TB_USERS_TABLE ." ORDER BY id LIMIT $start, $offset"; $users = DB()->fetch_rowset($sql); - DB()->sql_freeresult(); + DB()->sql_freeresult(); foreach ($users as $user) { @@ -159,17 +159,17 @@ if (CONVERT_TORRENTS) print_ok ("Categories from TBDev converted"); unset($cats); - // Start of torrents converting + // Start of torrents converting switch(TR_TYPE) - { + { case 'yse': $_sql = 'image1, image2, '; break; - + case 'sky': $_sql = 'poster, screenshot1, screenshot2, screenshot3, screenshot4, '; break; - + default: $_sql = ''; break; @@ -187,9 +187,9 @@ if (CONVERT_TORRENTS) $start = $i * C_TORRENTS_PER_ONCE; $offset = C_TORRENTS_PER_ONCE; $sql = " - SELECT + SELECT id, info_hash, name, filename, search_text, descr, $_sql - category, UNIX_TIMESTAMP(added) AS added, size, views, + category, UNIX_TIMESTAMP(added) AS added, size, views, UNIX_TIMESTAMP(last_action) AS lastseed, times_completed, owner, sticky FROM ". TB_TORRENTS_TABLE ." ORDER BY id @@ -197,7 +197,7 @@ if (CONVERT_TORRENTS) $torrents = DB()->fetch_rowset($sql); DB()->sql_freeresult(); - + foreach ($torrents as $torrent) { $torrent['topic_id'] = $torrent['id'] + $max_topic_id; @@ -219,16 +219,16 @@ if (CONVERT_TORRENTS) $max_post_id = (int) get_max_val(BB_POSTS, 'post_id'); $max_topic_id = (int) get_max_val(BB_TOPICS, 'topic_id'); $max_attach_id = (int) get_max_val(BB_ATTACHMENTS, 'attach_id'); - + $comments_count = (int) get_count(TB_COMMENTS_TABLE, 'id'); $loops = (int) ceil($comments_count / C_COMMENTS_PER_ONCE); - + for ($i = 0; $i < $loops; $i++) { $start = $i * C_COMMENTS_PER_ONCE; - $offset = C_COMMENTS_PER_ONCE; + $offset = C_COMMENTS_PER_ONCE; $sql = " - SELECT + SELECT c.id, c.user, c.torrent, c.text, tor.category, UNIX_TIMESTAMP(c.added) AS added, UNIX_TIMESTAMP(c.editedat) AS editedat, c.ip FROM ". TB_COMMENTS_TABLE ." c @@ -236,10 +236,10 @@ if (CONVERT_TORRENTS) WHERE c.torrent <> 0 ORDER BY c.id LIMIT $start, $offset"; - + $comments = DB()->fetch_rowset($sql); DB()->sql_freeresult(); - + foreach ($comments as $comment) { $comment['user'] += $max_uid; diff --git a/other/converter/TBDevYSE_pre6/root/converter/functions.php b/other/converter/TBDevYSE_pre6/root/converter/functions.php index f014f5307..65b1fde53 100644 --- a/other/converter/TBDevYSE_pre6/root/converter/functions.php +++ b/other/converter/TBDevYSE_pre6/root/converter/functions.php @@ -21,7 +21,7 @@ function hex2bin($h) } function get_max_val($table_name, $column) -{ +{ $row = DB()->fetch_row("SELECT MAX($column) AS $column FROM $table_name LIMIT 1"); return $row[$column]; } @@ -43,19 +43,9 @@ function set_auto_increment($table_name, $column, $val = null) DB()->query("ALTER TABLE $table_name auto_increment = $val"); } -//Users functions +// Users functions function tp_users_cleanup() { - /* - if (!function_exists('user_delete')) require_once(INC_DIR .'functions_admin.php'); - - if ($row = DB()->fetch_row("SELECT user_id FROM ". BB_USERS ." WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .');')) - { - foreach ($row as $user) - { - user_delete($user['user_id']); - } - }*/ DB()->query('DELETE FROM '. BB_USERS .' WHERE user_id NOT IN('. EXCLUDED_USERS_CSV .')'); DB()->query('TRUNCATE '. BB_BT_USERS); } @@ -91,7 +81,7 @@ function convert_user($user) "user_id" => $user['id'], "user_active" => ($user['enabled'] == 'yes') ? true : false, "username" => $user['username'], - "user_password" => md5($user['password']), + "user_password" => md5($user['password']), "user_lastvisit" => $user['last_access'], "user_regdate" => $user['added'], "user_level" => tp_user_level($user['class']), @@ -101,11 +91,11 @@ function convert_user($user) "user_avatar" => !empty($user['avatar']) ? $user['avatar'] : null, "user_avatar_type" => !empty($user['avatar']) ? 2 : null, "user_email" => $user['email'], - "user_website" => $user['website'], + "user_website" => $user['website'], ); $columns = $values = array(); - + foreach ($user_data as $column => $value) { $columns[] = $column; @@ -113,9 +103,9 @@ function convert_user($user) } $sql_columns = implode(',', $columns); $sql_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO ". BB_USERS . " ($sql_columns) VALUES($sql_values);"); - + $bt_user_data = array( "user_id" => $user['id'], "auth_key" => make_rand_str(BT_AUTH_KEY_LENGTH), @@ -123,7 +113,7 @@ function convert_user($user) "u_down_total" => $user['downloaded'], ); $columns = $values = array(); - + foreach ($bt_user_data as $column => $value) { $columns[] = $column; @@ -131,7 +121,7 @@ function convert_user($user) } $sql_bt_columns = implode(',', $columns); $sql_bt_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO ". BB_BT_USERS . " ($sql_bt_columns) VALUES($sql_bt_values);"); } @@ -143,7 +133,7 @@ function tp_categories_cleanup() function tp_add_category_old($id, $cat_title) { - DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES ." (cat_id, cat_title) + DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES ." (cat_id, cat_title) VALUES ($id, '". DB()->escape($cat_title) ."')"); return; } @@ -151,7 +141,7 @@ function tp_add_category_old($id, $cat_title) function tp_add_category($cat_data) { $columns = $values = array(); - + foreach ($cat_data as $column => $value) { $columns[] = $column; @@ -159,7 +149,7 @@ function tp_add_category($cat_data) } $sql_bt_columns = implode(',', $columns); $sql_bt_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES . " ($sql_bt_columns) VALUES($sql_bt_values);"); } @@ -173,16 +163,7 @@ function tp_topics_cleanup() DB()->query("TRUNCATE ". BB_POSTS_SEARCH); DB()->query("TRUNCATE ". BB_POSTS_TEXT); DB()->query("TRUNCATE ". BB_TOPICS); - /*if (!function_exists('topic_delete')) require_once(INC_DIR .'functions_admin.php'); - - if ($row = DB()->fetch_row("SELECT topic_id FROM ". BB_TOPICS)) - { - foreach ($row as $topic) - { - topic_delete($topic['topic_id']); - } - }*/ - + return; } @@ -196,7 +177,7 @@ function tp_add_topic($topic_data) } $sql_columns = implode(',', $columns); $sql_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO ". BB_TOPICS . " ($sql_columns) VALUES($sql_values);"); return; } @@ -213,7 +194,7 @@ function tp_add_post($post_data) } $sql_columns = implode(',', $columns); $sql_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES($sql_values);"); } return; @@ -231,7 +212,7 @@ function tp_add_attach($attach_data) } $sql_columns = implode(',', $columns); $sql_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES($sql_values);"); } return; @@ -248,19 +229,19 @@ function append_images($tor) { $poster = $screens = ''; switch(TR_TYPE) - { + { case 'yse': - if(!empty($tor['image1'])) + if(!empty($tor['image1'])) { $poster = "[img=right]".make_img_path($tor['image1'])."[/img]"; } - if(!empty($tor['image2'])) + if(!empty($tor['image2'])) { $screens = '[spoiler="Скриншоты"][img]'.make_img_path($tor['image2'])."[/img][/spoiler]"; } break; case 'sky': - if(!empty($tor['poster'])) + if(!empty($tor['poster'])) { $poster = "[img=right]".make_img_path($tor['poster'])."[/img]"; } @@ -270,7 +251,7 @@ function append_images($tor) $screens .= '[spoiler="Скриншоты"]'; for ($i = 1; $i<=4; $i++) { - if(!empty($tor['screenshot'.$i])) + if(!empty($tor['screenshot'.$i])) { $screens .= "[img]".make_img_path($tor['screenshot'.$i])."[/img] \n"; } @@ -299,9 +280,8 @@ function convert_torrent($torrent) "topic_last_post_time" => $torrent['added'], ); tp_add_topic($topic_data); - //$post_text = prepare_message($torrent['descr'], true, true); $post_text = stripslashes(prepare_message(addslashes(unprepare_message($torrent['descr'])), true, true)); - + $post_data = array( "posts" => array( "post_id" => $torrent['post_id'], @@ -321,7 +301,7 @@ function convert_torrent($torrent) ), ); tp_add_post($post_data); - + $attach_data = array( "attachments" => array( "attach_id" => $torrent['attach_id'], @@ -340,11 +320,11 @@ function convert_torrent($torrent) ), ); tp_add_attach($attach_data); - + //Torrents if (BDECODE) { - $filename = get_attachments_dir() .'/'. $torrent['id'] .".torrent"; + $filename = get_attachments_dir() .'/'. $torrent['id'] .".torrent"; if (!file_exists($filename)) { return; @@ -359,7 +339,7 @@ function convert_torrent($torrent) { $info_hash_sql = hex2bin($torrent['info_hash']); } - + $torrent_data = array( "info_hash" => $info_hash_sql, "post_id" => $torrent['post_id'], @@ -374,7 +354,7 @@ function convert_torrent($torrent) ); $columns = $values = array(); - + foreach ($torrent_data as $column => $value) { $columns[] = $column; @@ -382,16 +362,16 @@ function convert_torrent($torrent) } $sql_columns = implode(', ', $columns); $sql_values = implode(', ', $values); - + DB()->query("INSERT IGNORE INTO ". BB_BT_TORRENTS . " ($sql_columns) VALUES($sql_values);"); return; } -//Comments functions +// Comments functions function convert_comment($comment) { $post_text = prepare_message($comment['text'], true, true); - + $post_data = array( "posts" => array( "post_id" => $comment['id'], @@ -409,7 +389,6 @@ function convert_comment($comment) ), ); tp_add_post($post_data); - //add_search_words($comment['id'], stripslashes($post_text)); return; } @@ -431,7 +410,7 @@ function convert_cat($forum, $allow_torrents = true) ); $columns = $values = array(); - + foreach ($forum_data as $column => $value) { $columns[] = $column; @@ -439,7 +418,7 @@ function convert_cat($forum, $allow_torrents = true) } $sql_columns = implode(',', $columns); $sql_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO ". BB_FORUMS . " ($sql_columns) VALUES($sql_values);"); return; } diff --git a/other/converter/TBDevYSE_pre6/root/converter/passwords.php b/other/converter/TBDevYSE_pre6/root/converter/passwords.php index 5f7aafe87..63c2de744 100644 --- a/other/converter/TBDevYSE_pre6/root/converter/passwords.php +++ b/other/converter/TBDevYSE_pre6/root/converter/passwords.php @@ -1,2 +1,3 @@ -fetch_rowset($sql); DB()->sql_freeresult(); - + foreach ($torrents as $torrent) { - $filename = $attach_dir . $torrent['physical_filename']; + $filename = $attach_dir . $torrent['physical_filename']; if (!file_exists($filename)) { $not_exist[] = ''. $filename .''; } else - { + { $tor = bdecode_file($filename); $info = (!empty($tor['info'])) ? $tor['info'] : array(); $info_hash = pack('H*', sha1(bencode($info))); $info_hash_sql = rtrim(DB()->escape($info_hash), ' '); - + DB()->query("UPDATE ". BB_BT_TORRENTS ." SET info_hash = '$info_hash_sql' WHERE attach_id = {$torrent['attach_id']}"); @@ -91,9 +91,9 @@ for ($i = 0; $i < $loops; $i++) print_ok ("Completed"); -if(!empty($not_exist)) +if (!empty($not_exist)) { print_ok ("These torrents doesn't exist in filesystem: ". implode(', ', array_unique($not_exist))); } -} +} \ No newline at end of file diff --git a/other/recover/converter/functions.php b/other/recover/converter/functions.php index ebed5f614..640832cab 100644 --- a/other/recover/converter/functions.php +++ b/other/recover/converter/functions.php @@ -100,7 +100,7 @@ function convert_user($user) ); $columns = $values = array(); - + foreach ($user_data as $column => $value) { $columns[] = $column; @@ -108,9 +108,9 @@ function convert_user($user) } $sql_columns = implode(',', $columns); $sql_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO ". BB_USERS . " ($sql_columns) VALUES ($sql_values);"); - + $bt_user_data = array( "user_id" => $user['id'], "auth_key" => make_rand_str(BT_AUTH_KEY_LENGTH), @@ -118,7 +118,7 @@ function convert_user($user) "u_down_total" => $user['downloaded'], ); $columns = $values = array(); - + foreach ($bt_user_data as $column => $value) { $columns[] = $column; @@ -126,7 +126,7 @@ function convert_user($user) } $sql_bt_columns = implode(',', $columns); $sql_bt_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO ". BB_BT_USERS . " ($sql_bt_columns) VALUES ($sql_bt_values);"); } @@ -138,7 +138,7 @@ function tp_categories_cleanup() function tp_add_category_old($id, $cat_title) { - DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES ." (cat_id, cat_title) + DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES ." (cat_id, cat_title) VALUES ($id, '". DB()->escape($cat_title) ."')"); return; } @@ -146,7 +146,7 @@ function tp_add_category_old($id, $cat_title) function tp_add_category($cat_data) { $columns = $values = array(); - + foreach ($cat_data as $column => $value) { $columns[] = $column; @@ -154,12 +154,12 @@ function tp_add_category($cat_data) } $sql_bt_columns = implode(',', $columns); $sql_bt_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES . " ($sql_bt_columns) VALUES ($sql_bt_values);"); } function tp_topics_cleanup() -{ +{ DB()->query("TRUNCATE ". BB_ATTACHMENTS); DB()->query("TRUNCATE ". BB_ATTACHMENTS_DESC); DB()->query("TRUNCATE ". BB_BT_TORRENTS); @@ -168,21 +168,12 @@ function tp_topics_cleanup() DB()->query("TRUNCATE ". BB_POSTS_SEARCH); DB()->query("TRUNCATE ". BB_POSTS_TEXT); DB()->query("TRUNCATE ". BB_TOPICS); - /*if (!function_exists('topic_delete')) require_once('./includes/functions_admin.php'); - - if ($row = DB()->fetch_row("SELECT topic_id FROM ". TOPICS)) - { - foreach ($row as $topic) - { - topic_delete($topic['topic_id']); - } - }*/ - + return; } function tp_add_topic($topic_data) -{ +{ $columns = $values = array(); foreach ($topic_data as $column => $value) { @@ -191,13 +182,13 @@ function tp_add_topic($topic_data) } $sql_columns = implode(',', $columns); $sql_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO ". BB_TOPICS . " ($sql_columns) VALUES ($sql_values);"); return; } function tp_add_post($post_data) -{ +{ foreach ($post_data as $key => $data) { $columns = $values = array(); @@ -208,14 +199,14 @@ function tp_add_post($post_data) } $sql_columns = implode(',', $columns); $sql_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES ($sql_values);"); } return; } function tp_add_attach($attach_data) -{ +{ foreach ($attach_data as $key => $data) { $columns = $values = array(); @@ -226,7 +217,7 @@ function tp_add_attach($attach_data) } $sql_columns = implode(',', $columns); $sql_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES ($sql_values);"); } return; @@ -243,19 +234,19 @@ function append_images($tor) { $poster = $screens = ''; switch(TR_TYPE) - { + { case 'yse': - if(!empty($tor['image1'])) + if(!empty($tor['image1'])) { $poster = "[img=right]".make_img_path($tor['image1'])."[/img]"; } - if(!empty($tor['image2'])) + if(!empty($tor['image2'])) { $screens = '[spoiler="Скриншоты"][img]'.make_img_path($tor['image2'])."[/img][/spoiler]"; } break; case 'sky': - if(!empty($tor['poster'])) + if(!empty($tor['poster'])) { $poster = "[img=right]".make_img_path($tor['poster'])."[/img]"; } @@ -265,7 +256,7 @@ function append_images($tor) $screens .= '[spoiler="Скриншоты"]'; for ($i = 1; $i<=4; $i++) { - if(!empty($tor['screenshot'.$i])) + if(!empty($tor['screenshot'.$i])) { $screens .= "[img]".make_img_path($tor['screenshot'.$i])."[/img] \n"; } @@ -294,9 +285,9 @@ function convert_torrent($torrent) "topic_last_post_time" => $torrent['added'], ); tp_add_topic($topic_data); - + $post_text = stripslashes(prepare_message(addslashes(unprepare_message($torrent['descr'])), true, true)); - + $post_data = array( "posts" => array( "post_id" => $torrent['post_id'], @@ -316,7 +307,7 @@ function convert_torrent($torrent) ), ); tp_add_post($post_data); - + $attach_data = array( "attachments" => array( "attach_id" => $torrent['attach_id'], @@ -335,11 +326,11 @@ function convert_torrent($torrent) ), ); tp_add_attach($attach_data); - + //Torrents if (BDECODE) { - $filename = get_attachments_dir() .'/'. $torrent['id'] .".torrent"; + $filename = get_attachments_dir() .'/'. $torrent['id'] .".torrent"; if (!file_exists($filename)) { return; @@ -354,7 +345,7 @@ function convert_torrent($torrent) { $info_hash_sql = hex2bin($torrent['info_hash']); } - + $torrent_data = array( "info_hash" => $info_hash_sql, "post_id" => $torrent['post_id'], @@ -362,14 +353,14 @@ function convert_torrent($torrent) "topic_id" => $torrent['topic_id'], "forum_id" => $torrent['category'], "attach_id" => $torrent['attach_id'], - "size" => $torrent['size'], + "size" => $torrent['size'], "reg_time" => $torrent['added'], "complete_count" => $torrent['times_completed'], "seeder_last_seen" => $torrent['lastseed'], ); $columns = $values = array(); - + foreach ($torrent_data as $column => $value) { $columns[] = $column; @@ -377,7 +368,7 @@ function convert_torrent($torrent) } $sql_columns = implode(', ', $columns); $sql_values = implode(', ', $values); - + DB()->query("INSERT IGNORE INTO ". BB_BT_TORRENTS . " ($sql_columns) VALUES($sql_values);"); return; } @@ -386,7 +377,7 @@ function convert_torrent($torrent) function convert_comment($comment) { $post_text = prepare_message($comment['text'], true, true); - + $post_data = array( "posts" => array( "post_id" => $comment['id'], @@ -404,13 +395,12 @@ function convert_comment($comment) ), ); tp_add_post($post_data); - //add_search_words($comment['id'], stripslashes($post_text)); return; } //Forums functions function tp_forums_cleanup() -{ +{ DB()->query('TRUNCATE '. BB_FORUMS); } @@ -426,7 +416,7 @@ function convert_cat($forum, $allow_torrents = true) ); $columns = $values = array(); - + foreach ($forum_data as $column => $value) { $columns[] = $column; @@ -434,7 +424,7 @@ function convert_cat($forum, $allow_torrents = true) } $sql_columns = implode(',', $columns); $sql_values = implode(',', $values); - + DB()->query("INSERT IGNORE INTO ". BB_FORUMS . " ($sql_columns) VALUES ($sql_values);"); return; -} +} \ No newline at end of file diff --git a/other/recover/converter/passwords.php b/other/recover/converter/passwords.php index 5f7aafe87..63c2de744 100644 --- a/other/recover/converter/passwords.php +++ b/other/recover/converter/passwords.php @@ -1,2 +1,3 @@ -session_start(); @@ -52,36 +51,36 @@ $loops = (int) ceil($torrents_count / C_TORRENTS_PER_ONCE); $not_exist = array(); $attach_dir = get_attachments_dir() .'/'; - + for ($i = 0; $i < $loops; $i++) { $start = $i * C_TORRENTS_PER_ONCE; - $offset = C_TORRENTS_PER_ONCE; - - $sql = "SELECT + $offset = C_TORRENTS_PER_ONCE; + + $sql = "SELECT tor.attach_id, tor.topic_id, ad.physical_filename FROM ". BB_BT_TORRENTS ." tor LEFT JOIN ". BB_ATTACHMENTS_DESC ." ad ON(ad.attach_id = tor.attach_id) ORDER BY tor.attach_id LIMIT $start, $offset"; - + $torrents = DB()->fetch_rowset($sql); DB()->sql_freeresult(); - + foreach ($torrents as $torrent) { - $filename = $attach_dir . $torrent['physical_filename']; + $filename = $attach_dir . $torrent['physical_filename']; if (!file_exists($filename)) { $not_exist[] = ''. $filename .''; } else - { + { $tor = bdecode_file($filename); $info = (!empty($tor['info'])) ? $tor['info'] : array(); $info_hash = pack('H*', sha1(bencode($info))); $info_hash_sql = rtrim(DB()->escape($info_hash), ' '); - + DB()->query("UPDATE ". BB_BT_TORRENTS ." SET info_hash = '$info_hash_sql' WHERE attach_id = {$torrent['attach_id']}"); @@ -91,9 +90,9 @@ for ($i = 0; $i < $loops; $i++) print_ok ("Completed"); -if(!empty($not_exist)) +if (!empty($not_exist)) { print_ok ("These torrents doesn't exist in filesystem: ". implode(', ', array_unique($not_exist))); } -} +} \ No newline at end of file diff --git a/upload/admin/admin_attach_cp.php b/upload/admin/admin_attach_cp.php index 06da6f604..81cbc3147 100644 --- a/upload/admin/admin_attach_cp.php +++ b/upload/admin/admin_attach_cp.php @@ -76,7 +76,6 @@ else $sort_order = 'ASC'; } - // Pagination ? $do_pagination = ($view != 'stats' && $view != 'search') ? true : false; diff --git a/upload/admin/admin_board.php b/upload/admin/admin_board.php index 2115dcc4e..4fc393b3f 100644 --- a/upload/admin/admin_board.php +++ b/upload/admin/admin_board.php @@ -40,9 +40,7 @@ else if (isset($_POST['submit']) && $row['config_value'] != $new[$config_name]) { - if ($config_name == 'seed_bonus_points' || $config_name == 'seed_bonus_release') $new[$config_name] = serialize($new[$config_name]); - if ($config_name == 'bonus_upload' || $config_name == 'bonus_upload_price') $new[$config_name] = serialize($new[$config_name]); - + if ($config_name == ('seed_bonus_points' || 'seed_bonus_release' || 'bonus_upload' || 'bonus_upload_price')) $new[$config_name] = serialize(str_replace(',', '.', $new[$config_name])); bb_update_config(array($config_name => $new[$config_name])); } } @@ -89,7 +87,7 @@ switch($mode) if ($new['seed_bonus_points'] && $new['seed_bonus_release']) { - $seed_bonus = unserialize($new['seed_bonus_points']); + $seed_bonus = unserialize($new['seed_bonus_points']); $seed_release = unserialize($new['seed_bonus_release']); foreach ($seed_bonus as $i => $row) @@ -106,7 +104,7 @@ switch($mode) if ($new['bonus_upload'] && $new['bonus_upload_price']) { $upload_row = unserialize($new['bonus_upload']); - $price_row = unserialize($new['bonus_upload_price']); + $price_row = unserialize($new['bonus_upload_price']); foreach ($upload_row as $i => $row) { diff --git a/upload/admin/admin_forumauth_list.php b/upload/admin/admin_forumauth_list.php index 54ffe4478..d809c410f 100644 --- a/upload/admin/admin_forumauth_list.php +++ b/upload/admin/admin_forumauth_list.php @@ -9,7 +9,6 @@ if (!empty($setmodules)) require('./pagestart.php'); // ACP Header - END - // View Read Post Reply Edit Delete Sticky Announce Vote Poll PostAttach Download $simple_auth_ary = array( /* Public */ 0 => array(AUTH_ALL, AUTH_ALL, AUTH_ALL, AUTH_ALL, AUTH_REG, AUTH_REG, AUTH_MOD, AUTH_MOD, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_ALL), // Public diff --git a/upload/admin/admin_forums.php b/upload/admin/admin_forums.php index 4ff8e6b2c..1cfa56a58 100644 --- a/upload/admin/admin_forums.php +++ b/upload/admin/admin_forums.php @@ -951,7 +951,6 @@ function renumber_order ($mode, $cat = 0) } $sql .= " ORDER BY $orderfield ASC"; - if (!$result = DB()->sql_query($sql)) { bb_die('Could not get list of categories / forums #2'); diff --git a/upload/admin/admin_log.php b/upload/admin/admin_log.php index 46d4f010f..4dcb6f772 100644 --- a/upload/admin/admin_log.php +++ b/upload/admin/admin_log.php @@ -245,7 +245,6 @@ else generate_pagination($url, $items_count, $per_page, $start); - $filter = array(); if ($log_rowset) diff --git a/upload/admin/admin_mass_email.php b/upload/admin/admin_mass_email.php index 3a20c2a7b..0708c05d1 100644 --- a/upload/admin/admin_mass_email.php +++ b/upload/admin/admin_mass_email.php @@ -36,10 +36,10 @@ if (isset($_POST['submit'])) if ($group_id != -1) { $user_list = DB()->fetch_rowset(" - SELECT u.username, u.user_email, u.user_lang - FROM ". BB_USERS ." u, ". BB_USER_GROUP ." ug - WHERE ug.group_id = $group_id - AND ug.user_pending = 0 + SELECT u.username, u.user_email, u.user_lang + FROM ". BB_USERS ." u, ". BB_USER_GROUP ." ug + WHERE ug.group_id = $group_id + AND ug.user_pending = 0 AND u.user_id = ug.user_id AND u.user_active = 1 AND u.user_id NOT IN(". EXCLUDED_USERS_CSV . $user_id_sql .") @@ -48,8 +48,8 @@ if (isset($_POST['submit'])) else { $user_list = DB()->fetch_rowset(" - SELECT username, user_email, user_lang - FROM ". BB_USERS ." + SELECT username, user_email, user_lang + FROM ". BB_USERS ." WHERE user_active = 1 AND user_id NOT IN(". EXCLUDED_USERS_CSV . $user_id_sql .") "); diff --git a/upload/admin/admin_ranks.php b/upload/admin/admin_ranks.php index 3d2b062a9..4c33bdb72 100644 --- a/upload/admin/admin_ranks.php +++ b/upload/admin/admin_ranks.php @@ -36,7 +36,6 @@ else } } - if ($mode != '') { if ($mode == 'edit' || $mode == 'add') diff --git a/upload/admin/admin_user_search.php b/upload/admin/admin_user_search.php index 66e68ea6f..4fea05511 100644 --- a/upload/admin/admin_user_search.php +++ b/upload/admin/admin_user_search.php @@ -795,10 +795,7 @@ else $base_url .= '&search_moderators=true&moderators_forum='. rawurlencode(stripslashes($moderators_forum)); $moderators_forum = intval($moderators_forum); - $sql = "SELECT forum_name - FROM ".BB_FORUMS." - WHERE forum_id = ".$moderators_forum; - + $sql = "SELECT forum_name FROM ".BB_FORUMS." WHERE forum_id = ".$moderators_forum; if (!$result = DB()->sql_query($sql)) { diff --git a/upload/ajax.php b/upload/ajax.php index 27fad90d5..58539d0c8 100644 --- a/upload/ajax.php +++ b/upload/ajax.php @@ -116,7 +116,7 @@ class ajax_common global $lang; // Exit if we already have errors - if (!empty($this->response['error_code'])) + if (!empty($this->response['error_code'])) { $this->send(); } @@ -127,7 +127,7 @@ class ajax_common if (!$action || !is_string($action)) { $this->ajax_die('no action specified'); - } + } elseif (!$action_params =& $this->valid_actions[$action]) { $this->ajax_die('invalid action: ' . $action); diff --git a/upload/ajax/edit_user_profile.php b/upload/ajax/edit_user_profile.php index af47e593a..458a0ff6d 100644 --- a/upload/ajax/edit_user_profile.php +++ b/upload/ajax/edit_user_profile.php @@ -148,7 +148,7 @@ switch ($field) $btu[$field] = $value; $this->response['update_ids']['u_ratio'] = (string) get_bt_ratio($btu); break; - + case 'user_points': $value = htmlCHR($value); $value = (float) str_replace(',', '.', $this->request['value']); diff --git a/upload/ajax/mod_action.php b/upload/ajax/mod_action.php index 022f12e78..8faf91ae4 100644 --- a/upload/ajax/mod_action.php +++ b/upload/ajax/mod_action.php @@ -72,13 +72,13 @@ switch ($mode) 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']}' + WHERE user_reg_ip = '{$profiledata['user_reg_ip']}' AND user_reg_ip != '' AND user_id != {$profiledata['user_id']} ORDER BY username ASC"); - $last_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM " .BB_USERS ." - WHERE user_last_ip = '{$profiledata['user_last_ip']}' + $last_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM " .BB_USERS ." + WHERE user_last_ip = '{$profiledata['user_last_ip']}' AND user_last_ip != '' AND user_id != {$profiledata['user_id']}"); @@ -101,7 +101,7 @@ switch ($mode) $link_last_ip .= profile_url($row) .' '; } } - + if ($profiledata['user_level'] == ADMIN && !IS_ADMIN) $reg_ip = $last_ip = $lang['HIDDEN']; elseif ($profiledata['user_level'] == MOD && IS_MOD) $reg_ip = $last_ip = $lang['HIDDEN']; else diff --git a/upload/ajax/post_mod_comment.php b/upload/ajax/post_mod_comment.php index d4e9c8fee..0d97d6ba8 100644 --- a/upload/ajax/post_mod_comment.php +++ b/upload/ajax/post_mod_comment.php @@ -10,7 +10,7 @@ $mc_text = (string) $this->request['mc_text']; if (!$mc_text = prepare_message($mc_text)) $this->ajax_die($lang['EMPTY_MESSAGE']); $post = DB()->fetch_row(" - SELECT + SELECT p.post_id, p.poster_id FROM ". BB_POSTS ." p WHERE p.post_id = $post_id diff --git a/upload/ajax/view_torrent.php b/upload/ajax/view_torrent.php index 33609147d..7e0cc5e3f 100644 --- a/upload/ajax/view_torrent.php +++ b/upload/ajax/view_torrent.php @@ -79,7 +79,7 @@ class torrent function build_filelist_array () { global $lang; - + $info = $this->tor_decoded['info']; if (isset($info['name.utf-8'])) diff --git a/upload/attach_mod/includes/functions_includes.php b/upload/attach_mod/includes/functions_includes.php index e15a1cfb1..122314be6 100644 --- a/upload/attach_mod/includes/functions_includes.php +++ b/upload/attach_mod/includes/functions_includes.php @@ -1,21 +1,5 @@
_________________
'; -$bb_cfg['user_signature_end'] = ''; // Это позволит использовать html теги, которые требуют закрытия. Например или +$bb_cfg['user_signature_start'] = '

_________________
'; +$bb_cfg['user_signature_end'] = '
'; // Это позволит использовать html теги, которые требуют закрытия. Например
или // Posts $bb_cfg['use_posts_cache'] = true; // if you switch from ON to OFF, you need to TRUNCATE `bb_posts_html` table @@ -475,7 +475,6 @@ $bb_cfg['max_search_words_per_post'] = 200; $bb_cfg['search_min_word_len'] = 3; $bb_cfg['search_max_word_len'] = 35; $bb_cfg['limit_max_search_results'] = false; -$bb_cfg['tidy_post'] = true; $bb_cfg['spam_filter_file_path'] = ''; //BB_PATH .'/misc/spam_filter_words.txt'; // Posting @@ -502,7 +501,7 @@ $bb_cfg['user_not_active_days_keep'] = 180; // inactive users but only wi $bb_cfg['groupcp_members_per_page'] = 300; // Tidy -if ($bb_cfg['tidy_post'] && !function_exists('tidy_repair_string') or !extension_loaded('tidy')) die('Set $bb_cfg[\'tidy_post\'] = false in config.php'); +$bb_cfg['tidy_post'] = (!extension_loaded('tidy')) ? false : true; // Ads $bb_cfg['show_ads'] = false; @@ -581,15 +580,14 @@ $banned_user_agents = array( # 'wget', ); -$bb_cfg['porno_forums_screenshots_topic_id'] = 0; // (int) 7 -$bb_cfg['trash_forum_id'] = 0; // (int) 7 +$bb_cfg['trash_forum_id'] = 0; // (int) 7 -$bb_cfg['first_logon_redirect_url'] = 'index.php'; -$bb_cfg['terms_and_conditions_url'] = 'index.php'; +$bb_cfg['first_logon_redirect_url'] = 'index.php'; +$bb_cfg['terms_and_conditions_url'] = 'index.php'; -$bb_cfg['user_agreement_url'] = 'misc.php?do=info&show=user_agreement'; -$bb_cfg['copyright_holders_url'] = 'misc.php?do=info&show=copyright_holders'; -$bb_cfg['advert_url'] = 'misc.php?do=info&show=advert'; +$bb_cfg['user_agreement_url'] = 'misc.php?do=info&show=user_agreement'; +$bb_cfg['copyright_holders_url'] = 'misc.php?do=info&show=copyright_holders'; +$bb_cfg['advert_url'] = 'misc.php?do=info&show=advert'; // Captcha $bb_cfg['captcha'] = array( diff --git a/upload/download.php b/upload/download.php index d9c87bb3d..26ffe65a0 100644 --- a/upload/download.php +++ b/upload/download.php @@ -164,7 +164,6 @@ for ($i = 0; $i < $num_auth_pages && $authorised == false; $i++) } } - if (!$authorised) { bb_die($lang['SORRY_AUTH_VIEW_ATTACH']); diff --git a/upload/includes/class.correct.php b/upload/includes/class.correct.php index 2d11556bc..e7552b557 100644 --- a/upload/includes/class.correct.php +++ b/upload/includes/class.correct.php @@ -69,7 +69,7 @@ class Text_LangCorrect #английский (all) private $en = '[a-zA-Z]'; - + #английский (uppercase) private $en_uc = '[A-Z]'; @@ -2822,7 +2822,7 @@ class Text_LangCorrect /** * Исправляет клавиатурные опечатки в тексте. - * + * * @param scalar|null $s Текст в кодировке UTF-8. * @param int $mode Константы self::SIMILAR_CHARS и/или self::KEYBOARD_LAYOUT, * (их можно комбинировать). Описание констант см. выше. @@ -3055,7 +3055,7 @@ class Text_LangCorrect #если в $word были спецсимволы, а в $s их уже нет, возвращаем $s if ($is_sc && ! preg_match('/' . $this->sc . '/sSX', $s)) return $s; - + #если в $s спецсимволов больше чем букв, возвращаем $word $sc_count = 0; $s = preg_replace('/' . $this->sc . '/sSX', '', $s, -1, $sc_count); diff --git a/upload/includes/class.reflection.php b/upload/includes/class.reflection.php index c0f7839ce..653314da5 100644 --- a/upload/includes/class.reflection.php +++ b/upload/includes/class.reflection.php @@ -17,7 +17,7 @@ * Useful links * http://www.ilia.ws/archives/205-Type-hinting-for-PHP-5.3.html * http://php.net/manual/en/language.oop5.typehinting.php - * + * * @example ReflectionTypeHint_example.php * @link http://code.google.com/p/php5-reflection-type-hint/ * @license http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/upload/includes/class.utf8.php b/upload/includes/class.utf8.php index b2f1c5084..6dacc5f9e 100644 --- a/upload/includes/class.utf8.php +++ b/upload/includes/class.utf8.php @@ -2390,7 +2390,7 @@ class UTF8 /** * Convert UTF-16 / UCS-2 encoding string to UTF-8. * Surrogates UTF-16 are supported! - * + * * In Russian: * Преобразует строку из кодировки UTF-16 / UCS-2 в UTF-8. * Суррогаты UTF-16 поддерживаются! @@ -3078,7 +3078,6 @@ class UTF8 return self::convert_case($data, CASE_UPPER); } - /** * Convert all HTML entities to native UTF-8 characters * Функция декодирует гораздо больше именованных сущностей, чем стандартная html_entity_decode() diff --git a/upload/includes/datastore/build_stats.php b/upload/includes/datastore/build_stats.php index 8d2a6282e..30d3cc851 100644 --- a/upload/includes/datastore/build_stats.php +++ b/upload/includes/datastore/build_stats.php @@ -41,7 +41,7 @@ if ($bb_cfg['gender']) $male = DB()->fetch_row("SELECT COUNT(user_id) AS male FROM ". BB_USERS ." WHERE user_gender = ". MALE ." AND user_id NOT IN(". EXCLUDED_USERS_CSV .")"); $female = DB()->fetch_row("SELECT COUNT(user_id) AS female FROM ". BB_USERS ." WHERE user_gender = ". FEMALE ." AND user_id NOT IN(". EXCLUDED_USERS_CSV .")"); $unselect = DB()->fetch_row("SELECT COUNT(user_id) AS unselect FROM ". BB_USERS ." WHERE user_gender = 0 AND user_id NOT IN(". EXCLUDED_USERS_CSV .")"); - + $data['male'] = $male['male']; $data['female'] = $female['female']; $data['unselect'] = $unselect['unselect']; @@ -51,10 +51,10 @@ if ($bb_cfg['gender']) if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled']) { $sql = DB()->fetch_rowset("SELECT user_id, username, user_rank , user_birthday - FROM ". BB_USERS ." - WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .") + FROM ". BB_USERS ." + WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .") AND user_birthday != '0000-00-00' - AND user_active = 1 + AND user_active = 1 ORDER BY user_level DESC, username "); diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 23a49910c..50f64d26f 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -2313,7 +2313,6 @@ function poll_is_active ($t_data) return ($t_data['topic_vote'] == 1 && $t_data['topic_time'] > TIMENOW - $bb_cfg['poll_max_days']*86400); } - function print_confirmation ($tpl_vars) { global $template, $lang; @@ -2778,7 +2777,7 @@ function get_avatar ($user_id, $ext_id, $allow_avatar = true, $size = true, $hei { // TODO } - + $height = ($height != '') ? 'height="'. $height .'"' : ''; $width = ($width != '') ? 'width="'. $width .'"' : ''; @@ -2813,13 +2812,13 @@ function gender_image ($gender) switch ($gender) { case MALE: - $user_gender = ''. $lang['GENDER_SELECT'][1] .''; + $user_gender = ''. $lang['GENDER_SELECT'][MALE] .''; break; case FEMALE: - $user_gender = ''. $lang['GENDER_SELECT'][1] .''; + $user_gender = ''. $lang['GENDER_SELECT'][FEMALE] .''; break; default: - $user_gender = ''. $lang['GENDER_SELECT'][0] .''; + $user_gender = ''. $lang['GENDER_SELECT'][NOGENDER] .''; break; } } diff --git a/upload/includes/functions_post.php b/upload/includes/functions_post.php index 8a208bd94..04129124c 100644 --- a/upload/includes/functions_post.php +++ b/upload/includes/functions_post.php @@ -406,7 +406,7 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi if ($update_watched_sql) { DB()->query("UPDATE ". BB_TOPICS_WATCH ." - SET notify_status = ". TOPIC_WATCH_UN_NOTIFIED ." + SET notify_status = ". TOPIC_WATCH_UNNOTIFIED ." WHERE topic_id = $topic_id AND user_id IN ($update_watched_sql) "); @@ -423,7 +423,7 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi { DB()->query(" INSERT INTO " . BB_TOPICS_WATCH . " (user_id, topic_id, notify_status) - VALUES (". $userdata['user_id'] .", $topic_id, ". TOPIC_WATCH_NOTIFIED .") + VALUES (". $userdata['user_id'] .", $topic_id, ". TOPIC_WATCH_NOTIFIED .") "); } } diff --git a/upload/includes/functions_report.php b/upload/includes/functions_report.php index 6fb0ec122..40f7ab60f 100644 --- a/upload/includes/functions_report.php +++ b/upload/includes/functions_report.php @@ -581,7 +581,6 @@ function report_count_obtain() return $report_count; } - // // Obtains reports (for a specific report module if $module_id is defined) // Includes authorisation check if $auth_check is set to true. diff --git a/upload/includes/functions_validate.php b/upload/includes/functions_validate.php index 3f6fa9ecb..6f47589bb 100644 --- a/upload/includes/functions_validate.php +++ b/upload/includes/functions_validate.php @@ -16,7 +16,7 @@ function validate_username ($username, $check_ban_and_taken = true) if (mb_strlen($username, 'UTF-8') > USERNAME_MAX_LENGTH) { return $lang['USERNAME_TOO_LONG']; - } + } else if (mb_strlen($username, 'UTF-8') < USERNAME_MIN_LENGTH) { return $lang['USERNAME_TOO_SMALL']; @@ -102,7 +102,7 @@ function validate_email ($email, $check_ban_and_taken = true) $email_sql = DB()->escape($email); if ($row = DB()->fetch_row("SELECT `user_email` FROM ". BB_USERS ." WHERE user_email = '$email_sql' LIMIT 1")) - { + { if($row['user_email'] == $userdata['user_email']) return false; else diff --git a/upload/includes/init_bb.php b/upload/includes/init_bb.php index c2b061db1..46cf5c51a 100644 --- a/upload/includes/init_bb.php +++ b/upload/includes/init_bb.php @@ -161,7 +161,7 @@ define('TOPIC_LOCKED', 1); define('TOPIC_MOVED', 2); define('TOPIC_WATCH_NOTIFIED', 1); -define('TOPIC_WATCH_UN_NOTIFIED', 0); +define('TOPIC_WATCH_UNNOTIFIED', 0); // Topic types define('POST_NORMAL', 0); @@ -240,6 +240,7 @@ define('POST_REPORT_REASON_URL', 'r'); // Gender define('MALE', 1); define('FEMALE', 2); +define('NOGENDER', 0); // Poll # 1 - обычный опрос @@ -428,7 +429,7 @@ if (!empty($banned_user_agents)) { if (strstr(USER_AGENT, $agent)) { - $filename = 'Skachivajte fajly brauzerom (скачивайте файлы браузером)'; + $filename = 'Download files by using browser'; $output = '@'; header('Content-Type: text/plain'); header('Content-Disposition: attachment; filename="'. $filename .'"'); diff --git a/upload/includes/sessions.php b/upload/includes/sessions.php index 5e52c32ec..252cd1875 100644 --- a/upload/includes/sessions.php +++ b/upload/includes/sessions.php @@ -657,9 +657,6 @@ class user_common bb_setcookie(COOKIE_TOPIC, ''); bb_setcookie(COOKIE_FORUM, ''); bb_setcookie(COOKIE_MARK, ''); - - // Info message - # $template->assign_var('INFO_MESSAGE', $lang['FORUMS_MARKED_READ']); } } @@ -797,7 +794,6 @@ class user_common } } - // // userdata cache // diff --git a/upload/includes/template.php b/upload/includes/template.php index 6597e49a7..f4436c99b 100644 --- a/upload/includes/template.php +++ b/upload/includes/template.php @@ -33,8 +33,7 @@ define('XS_TAG_ELSEIF', 7); define('XS_TAG_ENDIF', 8); define('XS_TAG_BEGINELSE', 11); - -class Template +class Template { var $classname = "Template"; @@ -528,7 +527,6 @@ class Template return $varref; } - /** * Generates a reference to the array of data values for the given * (possibly nested) block namespace. This is a string of the form: @@ -1134,7 +1132,6 @@ class Template return $tokens; } - /** * Compiles code and writes to cache if needed */ diff --git a/upload/includes/ucp/email.php b/upload/includes/ucp/email.php index 69fa48db0..a1c3c90d0 100644 --- a/upload/includes/ucp/email.php +++ b/upload/includes/ucp/email.php @@ -43,7 +43,7 @@ if ($row = DB()->fetch_row($sql)) { $subject = trim(html_entity_decode($_POST['subject'])); $message = trim(html_entity_decode($_POST['message'])); - + if(!$subject) $errors[] = $lang['EMPTY_SUBJECT_EMAIL']; if(!$message) $errors[] = $lang['EMPTY_MESSAGE_EMAIL']; diff --git a/upload/includes/ucp/register.php b/upload/includes/ucp/register.php index 4084a248c..b2472bbb7 100644 --- a/upload/includes/ucp/register.php +++ b/upload/includes/ucp/register.php @@ -93,7 +93,7 @@ switch ($mode) */ case 'editprofile': if (IS_GUEST) login_redirect(); - + // field => can_edit $profile_fields = array( 'user_active' => IS_ADMIN, @@ -355,7 +355,7 @@ foreach ($profile_fields as $field => $can_edit) $errors[] = sprintf($lang['BIRTHDAY_TO_LOW'], $bb_cfg['birthday_min_age']); } } - + $pr_data['user_birthday'] = $user_birthday; $db_data['user_birthday'] = $user_birthday; } @@ -521,7 +521,6 @@ foreach ($profile_fields as $field => $can_edit) } $tp_data['USER_OCC'] = $pr_data['user_occ']; break; - /** * Интересы @@ -553,8 +552,7 @@ foreach ($profile_fields as $field => $can_edit) } $tp_data['USER_SKYPE'] = $pr_data['user_skype']; break; - - + /** * Twitter */ @@ -571,7 +569,7 @@ foreach ($profile_fields as $field => $can_edit) } $tp_data['USER_TWITTER'] = $pr_data['user_twitter']; break; - + /** * Выбор шаблона (edit) */ diff --git a/upload/includes/ucp/viewprofile.php b/upload/includes/ucp/viewprofile.php index b4b8cb095..ac85b794a 100644 --- a/upload/includes/ucp/viewprofile.php +++ b/upload/includes/ucp/viewprofile.php @@ -120,7 +120,7 @@ $template->assign_vars(array( 'SKYPE' => $profiledata['user_skype'], 'TWITTER' => $profiledata['user_twitter'], 'USER_POINTS' => $profiledata['user_points'], - 'GENDER' => ($bb_cfg['gender'] && $profiledata['user_gender']) ? $lang['GENDER_SELECT'][$profiledata['user_gender']] : '', + 'GENDER' => ($bb_cfg['gender']) ? $lang['GENDER_SELECT'][$profiledata['user_gender']] : '', 'BIRTHDAY' => ($bb_cfg['birthday_enabled'] && $profiledata['user_birthday'] != '0000-00-00') ? $profiledata['user_birthday'] : '', 'AGE' => ($bb_cfg['birthday_enabled'] && $profiledata['user_birthday'] != '0000-00-00') ? birthday_age($profiledata['user_birthday']) : '', @@ -189,13 +189,13 @@ else if (IS_MOD) // Show users torrent-profile if (IS_AM || $profile_user_id || !bf($profiledata['user_opt'], 'user_opt', 'user_dls')) { - require(INC_DIR .'ucp/viewtorrent.php'); + require(INC_DIR .'ucp/viewtorrent.php'); } // Ajax bt_userdata if (IS_AM || $profile_user_id) { - show_bt_userdata($profiledata['user_id']); + show_bt_userdata($profiledata['user_id']); } else { @@ -227,13 +227,13 @@ if (IS_ADMIN) $user_restrictions = array(); -if (bf($profiledata['user_opt'], 'user_opt', 'dis_avatar')) $user_restrictions[] = $lang['HIDE_AVATARS']; -if (bf($profiledata['user_opt'], 'user_opt', 'dis_sig')) $user_restrictions[] = $lang['SHOW_CAPTION']; -if (bf($profiledata['user_opt'], 'user_opt', 'dis_passkey')) $user_restrictions[] = $lang['DOWNLOAD_TORRENT']; -if (bf($profiledata['user_opt'], 'user_opt', 'dis_pm')) $user_restrictions[] = $lang['SEND_PM']; -if (bf($profiledata['user_opt'], 'user_opt', 'dis_post')) $user_restrictions[] = $lang['SEND_MESSAGE']; -if (bf($profiledata['user_opt'], 'user_opt', 'dis_post_edit')) $user_restrictions[] = $lang['EDIT_POST']; -if (bf($profiledata['user_opt'], 'user_opt', 'dis_topic')) $user_restrictions[] = $lang['NEW_THREADS']; +if (bf($profiledata['user_opt'], 'user_opt', 'dis_avatar')) $user_restrictions[] = $lang['HIDE_AVATARS']; +if (bf($profiledata['user_opt'], 'user_opt', 'dis_sig')) $user_restrictions[] = $lang['SHOW_CAPTION']; +if (bf($profiledata['user_opt'], 'user_opt', 'dis_passkey')) $user_restrictions[] = $lang['DOWNLOAD_TORRENT']; +if (bf($profiledata['user_opt'], 'user_opt', 'dis_pm')) $user_restrictions[] = $lang['SEND_PM']; +if (bf($profiledata['user_opt'], 'user_opt', 'dis_post')) $user_restrictions[] = $lang['SEND_MESSAGE']; +if (bf($profiledata['user_opt'], 'user_opt', 'dis_post_edit')) $user_restrictions[] = $lang['EDIT_POST']; +if (bf($profiledata['user_opt'], 'user_opt', 'dis_topic')) $user_restrictions[] = $lang['NEW_THREADS']; $template->assign_var('USER_RESTRICTIONS', join('
  • ', $user_restrictions)); diff --git a/upload/includes/ucp/viewtorrent.php b/upload/includes/ucp/viewtorrent.php index 36d852d71..b3176ff4a 100644 --- a/upload/includes/ucp/viewtorrent.php +++ b/upload/includes/ucp/viewtorrent.php @@ -13,9 +13,9 @@ $not_auth_forums_sql = ($excluded_forums_csv) ? " " : ''; $sql = DB()->fetch_rowset(" - SELECT - f.forum_id, f.forum_name, t.topic_title, - tor.tor_type, tor.size, + SELECT + f.forum_id, f.forum_name, t.topic_title, + tor.tor_type, tor.size, sn.seeders, sn.leechers, tr.* FROM ". BB_FORUMS ." f, ". BB_TOPICS ." t, ". BB_BT_TRACKER ." tr, ". BB_BT_TORRENTS ." tor, ". BB_BT_TRACKER_SNAP ." sn WHERE tr.user_id = {$profiledata['user_id']} @@ -51,18 +51,18 @@ if ($releasing) $is_gold = ''; if ($tr_cfg['gold_silver_enabled']) { - if ($row['tor_type'] == TOR_TYPE_GOLD) - { - $is_gold = ' '; - } - elseif ($row['tor_type'] == TOR_TYPE_SILVER) - { - $is_gold = ' '; - } - } + if ($row['tor_type'] == TOR_TYPE_GOLD) + { + $is_gold = ' '; + } + elseif ($row['tor_type'] == TOR_TYPE_SILVER) + { + $is_gold = ' '; + } + } $topic_title = wbr($row['topic_title']); - + $template->assign_block_vars('released', array( 'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2', 'FORUM_NAME' => htmlCHR($row['forum_name']), @@ -70,11 +70,11 @@ if ($releasing) 'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'], 'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'], 'TOR_TYPE' => $is_gold, - 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0, - 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0, + 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0, + 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0, 'SPEED_UP' => ($row['speed_up']) ? humn_size($row['speed_up'], 0, 'KB') .'/s' : '-', )); - + $releasing_count++; } } @@ -86,18 +86,18 @@ if ($seeding) $is_gold = ''; if ($tr_cfg['gold_silver_enabled']) { - if ($row['tor_type'] == TOR_TYPE_GOLD) - { - $is_gold = ' '; - } - elseif ($row['tor_type'] == TOR_TYPE_SILVER) - { - $is_gold = ' '; - } - } + if ($row['tor_type'] == TOR_TYPE_GOLD) + { + $is_gold = ' '; + } + elseif ($row['tor_type'] == TOR_TYPE_SILVER) + { + $is_gold = ' '; + } + } $topic_title = wbr($row['topic_title']); - + $template->assign_block_vars('seed', array( 'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2', 'FORUM_NAME' => htmlCHR($row['forum_name']), @@ -105,11 +105,11 @@ if ($seeding) 'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'], 'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'], 'TOR_TYPE' => $is_gold, - 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0, - 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0, + 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0, + 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0, 'SPEED_UP' => ($row['speed_up']) ? humn_size($row['speed_up'], 0, 'KB') .'/s' : '-', )); - + $seeding_count++; } } @@ -121,20 +121,20 @@ if ($leeching) $is_gold = ''; if ($tr_cfg['gold_silver_enabled']) { - if ($row['tor_type'] == TOR_TYPE_GOLD) - { - $is_gold = ' '; - } - elseif ($row['tor_type'] == TOR_TYPE_SILVER) - { - $is_gold = ' '; - } - } + if ($row['tor_type'] == TOR_TYPE_GOLD) + { + $is_gold = ' '; + } + elseif ($row['tor_type'] == TOR_TYPE_SILVER) + { + $is_gold = ' '; + } + } $compl_size = ($row['remain'] && $row['size'] && $row['size'] > $row['remain']) ? ($row['size'] - $row['remain']) : 0; $compl_perc = ($compl_size) ? floor($compl_size * 100 / $row['size']) : 0; $topic_title = wbr($row['topic_title']); - + $template->assign_block_vars('leech', array( 'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2', 'FORUM_NAME' => htmlCHR($row['forum_name']), @@ -143,11 +143,11 @@ if ($leeching) 'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'], 'COMPL_PERC' => $compl_perc, 'TOR_TYPE' => $is_gold, - 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0, - 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0, + 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0, + 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0, 'SPEED_DOWN' => ($row['speed_down']) ? humn_size($row['speed_down'], 0, 'KB') .'/s' : '-', )); - + $leeching_count++; } } @@ -159,4 +159,4 @@ $template->assign_vars(array( 'L_SEEDINGS' => "{$lang['SEEDING']}: ". (($seeding_count) ? "$seeding_count" : '0'), 'L_LEECHINGS' => "{$lang['LEECHING']}: ". (($leeching_count) ? "$leeching_count" : '0'), 'USER_DLS' => $releasing_count || $seeding_count || $leeching_count, -)); +)); \ No newline at end of file diff --git a/upload/index.php b/upload/index.php index 5267759c7..4358fb7ec 100644 --- a/upload/index.php +++ b/upload/index.php @@ -24,7 +24,7 @@ if ($bb_cfg['show_latest_news']) } if ($bb_cfg['show_network_news']) { - $datastore->enqueue('network_news'); + $datastore->enqueue('network_news'); } // Init userdata @@ -368,7 +368,7 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled']) { $week_list = $today_list = array(); $week_all = $today_all = false; - + if ($stats['birthday_week_list']) { shuffle($stats['birthday_week_list']); diff --git a/upload/language/en/email/admin_send_email.tpl b/upload/language/en/email/admin_send_email.tpl index d092ee52e..04e6bcc44 100644 --- a/upload/language/en/email/admin_send_email.tpl +++ b/upload/language/en/email/admin_send_email.tpl @@ -4,7 +4,7 @@ The following is an email sent to you by an administrator of "{SITENAME}". If th {BOARD_EMAIL} -Include this full email (particularly the headers). +Include this full email (particularly the headers). Message sent to you follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/upload/language/en/html/copyright_holders.html b/upload/language/en/html/copyright_holders.html index 757cdd10f..9b1e41724 100644 --- a/upload/language/en/html/copyright_holders.html +++ b/upload/language/en/html/copyright_holders.html @@ -10,7 +10,6 @@ -

    Information for copyright holders.

    diff --git a/upload/language/en/html/user_agreement.html b/upload/language/en/html/user_agreement.html index d2e5c6481..786415569 100644 --- a/upload/language/en/html/user_agreement.html +++ b/upload/language/en/html/user_agreement.html @@ -5,7 +5,7 @@
    USER AGREEMENT
    - + -

    Информация для правообладателей.

    diff --git a/upload/language/ru/html/user_agreement.html b/upload/language/ru/html/user_agreement.html index 2af2cda5c..db0cec8d1 100644 --- a/upload/language/ru/html/user_agreement.html +++ b/upload/language/ru/html/user_agreement.html @@ -5,7 +5,7 @@
    ПОЛЬЗОВАТЕЛЬСКОЕ СОГЛАШЕНИЕ
    - + -

    Інформація для правовласників.

    diff --git a/upload/language/ua/html/user_agreement.html b/upload/language/ua/html/user_agreement.html index d41e22b32..36ec9f14a 100644 --- a/upload/language/ua/html/user_agreement.html +++ b/upload/language/ua/html/user_agreement.html @@ -5,7 +5,7 @@
    УГОДА
    - +