From 0ddef30d06a5d1d0e6390486ec27f484209d6b5e Mon Sep 17 00:00:00 2001 From: "gemini_13@torba.su" Date: Mon, 11 Mar 2013 00:50:40 +0000 Subject: [PATCH] r496 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Те, кто ставил ранее R495 выполните запрос к БД: ALTER TABLE `bb_users` CHANGE `user_birthday` `user_birthday` date NOT NULL DEFAULT '0000-00-00' Кто только начал обновляться есть инструкция со скриптом: http://torrentpier.me/threads/r495-Инструкция-по-изменению-даты-ДР-в-движке.2231/ git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@496 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- install/sql/mysql.sql | 2 +- upload/admin/admin_user_search.php | 4 + upload/ajax.php | 16 ++- upload/config.php | 4 +- upload/includes/page_header.php | 2 +- upload/includes/ucp/usercp_viewdraft.php | 26 ++--- upload/includes/ucp/usercp_viewprofile.php | 7 -- upload/index.php | 2 +- upload/language/lang_english/lang_main.php | 5 + .../lang_english/lang_user_search.php | 1 + upload/language/lang_russian/lang_main.php | 5 + .../lang_russian/lang_user_search.php | 1 + upload/misc/html/sidebar1.html | 6 +- upload/templates/admin/admin_user_search.tpl | 2 +- .../templates/default/usercp_viewprofile.tpl | 105 +++--------------- 15 files changed, 64 insertions(+), 124 deletions(-) diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index d67a8e1dc..792f60bd1 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -1443,7 +1443,7 @@ CREATE TABLE IF NOT EXISTS `bb_users` ( `user_avatar` varchar(100) NOT NULL DEFAULT '', `user_avatar_type` tinyint(4) NOT NULL DEFAULT '0', `user_gender` tinyint(1) NOT NULL DEFAULT '0', - `user_birthday` date DEFAULT NULL, + `user_birthday` date NOT NULL DEFAULT '0000-00-00', `user_next_birthday_greeting` int(11) NOT NULL DEFAULT '0', `user_email` varchar(255) NOT NULL DEFAULT '', `user_skype` varchar(32) NOT NULL DEFAULT '', diff --git a/upload/admin/admin_user_search.php b/upload/admin/admin_user_search.php index 627136e89..c74c3572d 100644 --- a/upload/admin/admin_user_search.php +++ b/upload/admin/admin_user_search.php @@ -902,6 +902,10 @@ else $text = sprintf($lang['SEARCH_FOR_USERFIELD_ICQ'],$text); $field = 'user_icq'; break; + case 'skype': + $text = sprintf($lang['SEARCH_FOR_USERFIELD_SKYPE'],$text); + $field = 'user_skype'; + break; case 'website': $text = sprintf($lang['SEARCH_FOR_USERFIELD_WEBSITE'],$text); $field = 'user_website'; diff --git a/upload/ajax.php b/upload/ajax.php index e60608b3d..f94d8f55c 100644 --- a/upload/ajax.php +++ b/upload/ajax.php @@ -83,6 +83,7 @@ class ajax_common 'change_torrent' => array('user'), 'change_tor_status' => array('user'), 'modify_draft' => array('user'), + 'view_profile' => array('user'), 'view_post' => array('guest'), 'view_torrent' => array('guest'), @@ -530,13 +531,13 @@ class ajax_common if(!$bb_cfg['status_of_draft']) $this->ajax_die($lang['MODULE_OFF']); - $tid = (int)$this->request["id_draft"]; - $mode = (int)$this->request["mode"]; + $tid = (int)$this->request['id_draft']; + $mode = (int)$this->request['mode']; $sql = "SELECT * FROM ". BB_TOPICS ." WHERE topic_id = {$tid}"; - if (!$row = DB()->fetch_row($sql)) $this->ajax_die("Нет такого черновика"); + if (!$row = DB()->fetch_row($sql)) $this->ajax_die('Нет такого черновика'); - if ($row["topic_poster"] != $userdata["user_id"] && !IS_ADMIN) $this->ajax_die("Нельзя удалять чужие черновики"); + if ($row['topic_poster'] != $userdata['user_id'] && !IS_ADMIN) $this->ajax_die('Нельзя удалять чужие черновики'); if (!$mode) { @@ -546,6 +547,11 @@ class ajax_common { DB()->query("UPDATE ". BB_TOPICS ." SET is_draft = 0 WHERE topic_id = {$tid}"); } - $this->response["tid"] = $tid; + $this->response['tid'] = $tid; + } + + function view_profile() + { + require(AJAX_DIR .'view_profile.php'); } } diff --git a/upload/config.php b/upload/config.php index b16adaa37..17e742aa4 100644 --- a/upload/config.php +++ b/upload/config.php @@ -56,8 +56,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Increase number of revision after update $bb_cfg['tp_version'] = '2.5 pre-stable'; -$bb_cfg['tp_release_date'] = '20-02-2013'; -$bb_cfg['tp_release_state'] = 'R495'; +$bb_cfg['tp_release_date'] = '11-03-2013'; +$bb_cfg['tp_release_state'] = 'R496'; // Database $charset = 'utf8'; diff --git a/upload/includes/page_header.php b/upload/includes/page_header.php index 2a0bd8a44..88c01b6de 100644 --- a/upload/includes/page_header.php +++ b/upload/includes/page_header.php @@ -275,7 +275,7 @@ $template->assign_vars(array( 'READONLY' => HTML_READONLY, 'SELECTED' => HTML_SELECTED, - 'U_SEARCH_SELF_BY_LAST' => "search.php?uid={$userdata['user_id']}&o=5", + 'U_SEARCH_SELF_BY_LAST' => "search.php?uid={$userdata['user_id']}&o=5", )); if (!empty($page_cfg['dl_links_user_id'])) diff --git a/upload/includes/ucp/usercp_viewdraft.php b/upload/includes/ucp/usercp_viewdraft.php index ffe3fb9d3..261ffc754 100644 --- a/upload/includes/ucp/usercp_viewdraft.php +++ b/upload/includes/ucp/usercp_viewdraft.php @@ -8,7 +8,7 @@ if (!$profiledata = get_userdata($_GET[POST_USERS_URL])) bb_die($lang['NO_USER_I if (!$userdata['session_logged_in']) redirect("login.php?redirect={$_SERVER['REQUEST_URI']}"); -if ($profiledata["user_id"] != $userdata["user_id"] && !IS_ADMIN) bb_die("Ты ноги мыла, Дездемона? :)"); +if ($profiledata['user_id'] != $userdata['user_id'] && !IS_ADMIN) bb_die('Ты ноги мыла, Дездемона? :)'); $sql = " SELECT t.*, f.forum_name, f.cat_id, f.forum_parent AS parent_id, f2.forum_name AS parent_name, c.cat_title @@ -16,7 +16,7 @@ $sql = " LEFT JOIN ". BB_FORUMS." f ON (f.forum_id = t.forum_id) LEFT JOIN ". BB_CATEGORIES." c ON (f.cat_id = c.cat_id) LEFT JOIN ". BB_FORUMS." f2 ON (f.forum_parent = f2.forum_id) - WHERE t.topic_poster = ". $profiledata["user_id"] ." + WHERE t.topic_poster = ". $profiledata['user_id'] ." AND t.is_draft = 1 "; @@ -28,28 +28,28 @@ if(!$rows = DB()->fetch_rowset($sql)) $i = 0; foreach ($rows as $row) { - $category = ''. $row["cat_title"] .''; - $forum = ''. $row["forum_name"] .''; - $topic = ''. $row["topic_title"] .''; + $category = ''. $row['cat_title'] .''; + $forum = ''. $row['forum_name'] .''; + $topic = ''. $row['topic_title'] .''; - if($row["parent_id"] != 0) $forum .= ' » '. $row["parent_name"] .''; + if($row["parent_id"] != 0) $forum .= ' » '. $row['parent_name'] .''; - $template->assign_block_vars("DRAFT", array( + $template->assign_block_vars('DRAFT', array( "ROW_CLASS" => ($i % 2) ? 2 : 1, - "TOPIC_ID" => $row["topic_id"], + "TOPIC_ID" => $row['topic_id'], "TOPIC" => $topic, 'FORUM' => $forum, "CATEGORY" => $category, - "DT_CREATE" => bb_date($row["topic_time"], "Y-m-d H:i"), - "EDIT_POST" => make_url('posting.php?mode=editpost&p='. $row["topic_first_post_id"]) + "DT_CREATE" => bb_date($row['topic_time'], 'Y-m-d H:i'), + "EDIT_POST" => make_url('posting.php?mode=editpost&p='. $row['topic_first_post_id']) )); $i++; } $template->assign_vars(array( - "PAGE_TITLE" => $lang["DRAFTS"], - "USERNAME" => $profiledata["username"], - "PROFILE" => profile_url(array('username' => $profiledata["username"], 'user_id' => $profiledata["user_id"])), + "PAGE_TITLE" => $lang['DRAFTS'], + "USERNAME" => $profiledata['username'], + "PROFILE" => profile_url(array('username' => $profiledata['username'], 'user_id' => $profiledata['user_id'])), )); print_page('usercp_viewdraft.tpl'); \ No newline at end of file diff --git a/upload/includes/ucp/usercp_viewprofile.php b/upload/includes/ucp/usercp_viewprofile.php index adf887fe3..e62ec98a0 100644 --- a/upload/includes/ucp/usercp_viewprofile.php +++ b/upload/includes/ucp/usercp_viewprofile.php @@ -191,13 +191,6 @@ else if (IS_MOD) )); } -if (!bf($profiledata['user_opt'], 'user_opt', 'allow_dls') || (IS_AM || $profile_user_id)) -{ - // Show users torrent-profile - define('IN_VIEWPROFILE', TRUE); - include(INC_DIR .'ucp/torrent_userprofile.php'); -} - // Ajax bt_userdata if (IS_AM || $profile_user_id) { diff --git a/upload/index.php b/upload/index.php index 6448cd98e..4656082b4 100644 --- a/upload/index.php +++ b/upload/index.php @@ -181,7 +181,7 @@ if (!empty($mod)) { foreach ($user_ids as $user_id) { - $moderators[$forum_id][] = ''. $mod['name_users'][$user_id] .''; + $moderators[$forum_id][] = ''. $mod['name_users'][$user_id] .''; } } foreach ($mod['mod_groups'] as $forum_id => $group_ids) diff --git a/upload/language/lang_english/lang_main.php b/upload/language/lang_english/lang_main.php index 0a7410e9e..fd68ca80b 100644 --- a/upload/language/lang_english/lang_main.php +++ b/upload/language/lang_english/lang_main.php @@ -36,6 +36,10 @@ $lang['MESSAGE'] = 'Message'; $lang['TORRENT'] = 'Torrent'; $lang['PROFILE'] = 'Profile'; $lang['PERMISSIONS'] = 'Permissions'; +$lang['TYPE'] = 'Type'; +$lang['SEEDER'] = 'Seeder'; +$lang['LEECHER'] = 'Leecher'; +$lang['RELEASER'] = 'Releaser'; $lang['1_DAY'] = '1 Day'; $lang['7_DAYS'] = '7 Days'; @@ -1339,6 +1343,7 @@ $lang['ONLY_1_TOR_PER_POST'] = 'You can register only one torrent in one post'; $lang['ONLY_1_TOR_PER_TOPIC'] = 'You can register only one torrent in one topic'; $lang['VIEWING_USER_BT_PROFILE'] = 'Viewing torrent-profile :: %s'; // %s is username $lang['CUR_ACTIVE_DLS'] = 'Currently active torrents'; +$lang['CUR_ACTIVE_DLS_ERROR'] = 'User does not download and seeding'; $lang['TD_TRAF'] = 'Today'; $lang['YS_TRAF'] = 'Yesterday'; diff --git a/upload/language/lang_english/lang_user_search.php b/upload/language/lang_english/lang_user_search.php index 4fd097e06..17675f76a 100644 --- a/upload/language/lang_english/lang_user_search.php +++ b/upload/language/lang_english/lang_user_search.php @@ -54,6 +54,7 @@ $lang['SEARCH_FOR_POSTCOUNT_LESSER'] = 'Searching for users with a post count le $lang['SEARCH_FOR_POSTCOUNT_RANGE'] = 'Searching for users with a post count between %d and %d'; $lang['SEARCH_FOR_POSTCOUNT_EQUALS'] = 'Searching for users with a post count value of %d'; $lang['SEARCH_FOR_USERFIELD_ICQ'] = 'Searching for users with a ICQ address matching %s'; +$lang['SEARCH_FOR_USERFIELD_SKYPE'] = 'Searching for users with an Skype matching %s'; $lang['SEARCH_FOR_USERFIELD_WEBSITE'] = 'Searching for users with an Website matching %s'; $lang['SEARCH_FOR_USERFIELD_LOCATION'] = 'Searching for users with a Location matching %s'; $lang['SEARCH_FOR_USERFIELD_INTERESTS'] = 'Searching for users with their Interests field matching %s'; diff --git a/upload/language/lang_russian/lang_main.php b/upload/language/lang_russian/lang_main.php index 89d48e794..89ebb1e6a 100644 --- a/upload/language/lang_russian/lang_main.php +++ b/upload/language/lang_russian/lang_main.php @@ -38,6 +38,10 @@ $lang['HOURS'] = 'Часы'; $lang['MESSAGE'] = 'Сообщение'; $lang['TORRENT'] = 'Торрент'; $lang['PERMISSIONS'] = 'Права доступа'; +$lang['TYPE'] = 'Тип'; +$lang['SEEDER'] = 'Сидер'; +$lang['LEECHER'] = 'Личер'; +$lang['RELEASER'] = 'Релизер'; $lang['1_DAY'] = 'за последний день'; $lang['7_DAYS'] = 'за последние 7 дней'; @@ -1342,6 +1346,7 @@ $lang['ONLY_1_TOR_PER_POST'] = 'Вы не можете зарегистриро $lang['ONLY_1_TOR_PER_TOPIC'] = 'Вы не можете зарегистрировать еще один торрент для этого топика'; $lang['VIEWING_USER_BT_PROFILE'] = 'Торрент-профиль'; // %s is username $lang['CUR_ACTIVE_DLS'] = 'Текущие активные торренты'; +$lang['CUR_ACTIVE_DLS_ERROR'] = 'Пользователь ничего не скачивает и не сидирует'; $lang['TD_TRAF'] = 'Сегодня'; $lang['YS_TRAF'] = 'Вчера'; diff --git a/upload/language/lang_russian/lang_user_search.php b/upload/language/lang_russian/lang_user_search.php index 525a9fe1f..3b16b6b49 100644 --- a/upload/language/lang_russian/lang_user_search.php +++ b/upload/language/lang_russian/lang_user_search.php @@ -54,6 +54,7 @@ $lang['SEARCH_FOR_POSTCOUNT_LESSER'] = 'Поиск пользователей с $lang['SEARCH_FOR_POSTCOUNT_RANGE'] = 'Поиск пользователей с количеством сообщений от %d до %d'; $lang['SEARCH_FOR_POSTCOUNT_EQUALS'] = 'Поиск пользователей с количеством сообщений %d'; $lang['SEARCH_FOR_USERFIELD_ICQ'] = 'Поиск пользователей с адресом ICQ %s'; +$lang['SEARCH_FOR_USERFIELD_SKYPE'] = 'Поиск пользователей с логином в Skype %s'; $lang['SEARCH_FOR_USERFIELD_WEBSITE'] = 'Поиск пользователей, чей веб-сайт %s'; $lang['SEARCH_FOR_USERFIELD_LOCATION'] = 'Поиск пользователей из %s'; $lang['SEARCH_FOR_USERFIELD_INTERESTS'] = 'Поиск пользователей с интересами %s'; diff --git a/upload/misc/html/sidebar1.html b/upload/misc/html/sidebar1.html index b72e65aa0..f5c7eaf1d 100644 --- a/upload/misc/html/sidebar1.html +++ b/upload/misc/html/sidebar1.html @@ -4,7 +4,7 @@

BitTorrent клиенты

@@ -13,8 +13,8 @@

FAQ

diff --git a/upload/templates/admin/admin_user_search.tpl b/upload/templates/admin/admin_user_search.tpl index 4d9861996..4475515a3 100644 --- a/upload/templates/admin/admin_user_search.tpl +++ b/upload/templates/admin/admin_user_search.tpl @@ -81,7 +81,7 @@ . - {L_USERFIELD}:    {L_REGULAR_EXPRESSION} + {L_USERFIELD}:    {L_REGULAR_EXPRESSION} {L_SEARCH_USERS_USERFIELD_EXPLAIN} diff --git a/upload/templates/default/usercp_viewprofile.tpl b/upload/templates/default/usercp_viewprofile.tpl index cf85c1ad6..6e03d8bcb 100644 --- a/upload/templates/default/usercp_viewprofile.tpl +++ b/upload/templates/default/usercp_viewprofile.tpl @@ -155,6 +155,19 @@ ajax.callback.gen_passkey = function(data){ + +