From 040c9fb865963268959dbe587938a0e480b70c69 Mon Sep 17 00:00:00 2001 From: Dark Nightmare Date: Fri, 8 Aug 2014 22:35:32 +0600 Subject: [PATCH 01/24] https bbcode support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Поддержка https для картинок в bbcode --- upload/includes/bbcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload/includes/bbcode.php b/upload/includes/bbcode.php index 8c26496d8..b693ab78c 100644 --- a/upload/includes/bbcode.php +++ b/upload/includes/bbcode.php @@ -498,7 +498,7 @@ class bbcode function init_replacements () { $tpl = $this->tpl; - $img_url_exp = 'http://[^\s\?&;=\#\"<>]+?\.(jpg|jpeg|gif|png)([a-z0-9/?&%;][^\[\]]*)?'; + $img_url_exp = '(https?:)?//[^\s\?&;=\#\"<>]+?\.(jpg|jpeg|gif|png)([a-z0-9/?&%;][^\[\]]*)?'; $email_exp = '[a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+'; $url_exp = '[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+?'; From e6c0b2f9309b8838d796b973fd360afe3b306bc3 Mon Sep 17 00:00:00 2001 From: Exile Date: Sat, 9 Aug 2014 01:06:46 +0400 Subject: [PATCH 02/24] Stupid rating limit remove MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Удаляем дурацкое ограничение на запрет занесения раздачи в стисок будущих на закачку при низком рейтинге. --- upload/config.php | 11 +++++------ upload/dl_list.php | 9 --------- upload/language/en/main.php | 6 ------ upload/language/ru/main.php | 6 ------ upload/language/ua/main.php | 6 ------ upload/templates/default/css/main.css | 2 +- upload/templates/default/search_results.tpl | 2 +- upload/tracker.php | 4 +--- upload/viewforum.php | 2 -- 9 files changed, 8 insertions(+), 40 deletions(-) diff --git a/upload/config.php b/upload/config.php index 35571b489..9371b61bd 100644 --- a/upload/config.php +++ b/upload/config.php @@ -164,9 +164,8 @@ $bb_cfg['ratio_url_help'] = 'viewtopic.php?t=3'; // Рейтинг и $bb_cfg['search_help_url'] = 'viewtopic.php?t=4'; // Помощь по поиску // Torrents -$bb_cfg['bt_min_ratio_allow_dl_tor'] = 0.3; // 0 - disable -$bb_cfg['bt_min_ratio_warning'] = 0.6; // 0 - disable -$bb_cfg['bt_min_ratio_dl_button'] = 0.5; // 0 - disable +$bb_cfg['bt_min_ratio_allow_dl_tor'] = 0.3; // 0 - disable +$bb_cfg['bt_min_ratio_warning'] = 0.6; // 0 - disable $tr_cfg = array( 'autoclean' => true, @@ -218,9 +217,9 @@ $rating_limits = array( '0.6' => 3, ); -// DL-Status -$bb_cfg['dl_will_days_keep'] = 60; // days to keep user's dlstatus records -$bb_cfg['dl_down_days_keep'] = 30; +// DL-Status (days to keep user's dlstatus records) +$bb_cfg['dl_will_days_keep'] = 360; +$bb_cfg['dl_down_days_keep'] = 180; $bb_cfg['dl_complete_days_keep'] = 180; $bb_cfg['dl_cancel_days_keep'] = 30; diff --git a/upload/dl_list.php b/upload/dl_list.php index 9ca159f5d..574c014a0 100644 --- a/upload/dl_list.php +++ b/upload/dl_list.php @@ -64,15 +64,6 @@ if (!$userdata['session_logged_in']) redirect(LOGIN_URL . "?redirect=$redirect_type&$redirect"); } -if ($bb_cfg['bt_min_ratio_dl_button'] && $btu = get_bt_userdata($user->id)) -{ - if (($user_ratio = get_bt_ratio($btu)) < $bb_cfg['bt_min_ratio_dl_button']) - { - set_die_append_msg($forum_id, $topic_id); - bb_die($lang['BT_LOW_RATIO_FUNC']); - } -} - // Check if user did not confirm if (@$_POST['cancel']) { diff --git a/upload/language/en/main.php b/upload/language/en/main.php index 345f8e734..f3a92ba90 100644 --- a/upload/language/en/main.php +++ b/upload/language/en/main.php @@ -1255,11 +1255,6 @@ $lang['DL_DOWN'] = 'Downloading'; $lang['DL_COMPLETE'] = 'Complete'; $lang['DL_CANCEL'] = 'Cancel'; -$lang['DLWILL_2'] = 'Will download'; -$lang['DLDOWN_2'] = 'Downloading'; -$lang['DLCOMPLETE_2'] = 'Complete'; -$lang['DLCANCEL_2'] = 'Cancel'; - $lang['DL_LIST_DEL'] = 'Clear DL-List'; $lang['DL_LIST_DEL_CONFIRM'] = 'Delete DL-List for this topic?'; $lang['SHOW_DL_LIST'] = 'Show DL-List'; @@ -1326,7 +1321,6 @@ $lang['OPEN_IN_SAME_WINDOW'] = 'open in same window'; $lang['SHOW_TIME_TOPICS'] = 'show time of the creation topics'; $lang['SHOW_CURSOR'] = 'highlight the row under the cursor'; -$lang['BT_LOW_RATIO_FUNC'] = "You can not use this option (ratio is too low)"; $lang['BT_LOW_RATIO_FOR_DL'] = "With ratio %s you can not download torrents"; $lang['BT_RATIO_WARNING_MSG'] = 'If your ratio falls below %s, you will not be able to download Torrents! More about the rating.'; diff --git a/upload/language/ru/main.php b/upload/language/ru/main.php index 8d482a76f..28776416a 100644 --- a/upload/language/ru/main.php +++ b/upload/language/ru/main.php @@ -1255,11 +1255,6 @@ $lang['DL_DOWN'] = 'Качаю'; $lang['DL_COMPLETE'] = 'Скачал'; $lang['DL_CANCEL'] = 'Отмена'; -$lang['DLWILL_2'] = 'Будут качать'; -$lang['DLDOWN_2'] = 'Качают'; -$lang['DLCOMPLETE_2'] = 'Скачали'; -$lang['DLCANCEL_2'] = 'Отмена'; - $lang['DL_LIST_DEL'] = 'Очистить DL-List'; $lang['DL_LIST_DEL_CONFIRM'] = 'Вы уверены, что хотите удалить DL-List для этого топика?'; $lang['SHOW_DL_LIST'] = 'Список скачавших'; @@ -1326,7 +1321,6 @@ $lang['OPEN_IN_SAME_WINDOW'] = 'открывать в этом же окне'; $lang['SHOW_TIME_TOPICS'] = 'показывать время создания темы'; $lang['SHOW_CURSOR'] = 'подсвечивать строки под курсором'; -$lang['BT_LOW_RATIO_FUNC'] = 'У вас слишком низкий рейтинг для того, чтобы воспользоваться этой функцией'; $lang['BT_LOW_RATIO_FOR_DL'] = 'Рейтинг %s уже не позволяет вам скачивать новые торренты.

Для поднятия рейтинга вы можете что-либо раздать из ваших прошлых закачек, либо организовать новую раздачу.

Пожалуйста, помните о том, что ваше yчастие в системе BitTorrent не может ограничиваться только скачиванием!'; $lang['BT_RATIO_WARNING_MSG'] = 'Если ваш рейтинг упадет ниже %s, вы не сможете скачивать торренты! Подробнее о рейтинге.'; diff --git a/upload/language/ua/main.php b/upload/language/ua/main.php index 0544aca1f..4f0a45782 100644 --- a/upload/language/ua/main.php +++ b/upload/language/ua/main.php @@ -1255,11 +1255,6 @@ $lang['DL_DOWN'] = 'Качаю'; $lang['DL_COMPLETE'] = 'Скачав'; $lang['DL_CANCEL'] = 'Відміна'; -$lang['DLWILL_2'] = 'Будуть качати'; -$lang['DLDOWN_2'] = 'Качають'; -$lang['DLCOMPLETE_2'] = 'Завантажити'; -$lang['DLCANCEL_2'] = 'Відміна'; - $lang['DL_LIST_DEL'] = 'Очистити DL-List'; $lang['DL_LIST_DEL_CONFIRM'] = 'Ви впевнені, що хочете видалити DL-List для цього топіка?'; $lang['SHOW_DL_LIST'] = 'Список тих хто завантажил'; @@ -1326,7 +1321,6 @@ $lang['OPEN_IN_SAME_WINDOW'] = 'відкрити в цьому ж вікні'; $lang['SHOW_TIME_TOPICS'] = 'показувати час створення теми'; $lang['SHOW_CURSOR'] = 'підсвічувати рядок під курсором'; -$lang['BT_LOW_RATIO_FUNC'] = 'У вас занадто низький рейтинг для того, щоб скористатися цією функцією'; $lang['BT_LOW_RATIO_FOR_DL'] = "Рейтинг %s вже не дозволяє вам викачувати нові торренти.

Для підняття рейтингу ви можете що-небудь роздати ваших минулих закачувань, або організувати нову роздачу.

будь Ласка, пам'ятайте про те, що ваша участь у системі BitTorrent не може обмежуватися тільки скачуванням!"; $lang['BT_RATIO_WARNING_MSG'] = 'Якщо ваш рейтинг впаде нижче %s, ви не зможете скачувати торренти! Детальніше про рейтинг.'; diff --git a/upload/templates/default/css/main.css b/upload/templates/default/css/main.css index d05b4e76e..88d219763 100644 --- a/upload/templates/default/css/main.css +++ b/upload/templates/default/css/main.css @@ -434,7 +434,7 @@ table.message td { } .cat, td.cat, td.catTitle, td.catHead, td.catBottom { - padding: 5px 4px 0; + padding: 5px 4px 6px; background: #E0E5E9 url(../images/cellpic.gif) repeat-x; } .catTitle { diff --git a/upload/templates/default/search_results.tpl b/upload/templates/default/search_results.tpl index dd5ccbdb0..e42270d97 100644 --- a/upload/templates/default/search_results.tpl +++ b/upload/templates/default/search_results.tpl @@ -190,7 +190,7 @@ function show_edit_options () - {L_DEL_LIST_INFO} + {L_DEL_LIST_INFO} diff --git a/upload/tracker.php b/upload/tracker.php index f41b402dc..ae9dceb6d 100644 --- a/upload/tracker.php +++ b/upload/tracker.php @@ -738,7 +738,6 @@ if ($allowed_forums) $forum_id = (!$hide_forum && isset($tor['forum_id'])) ? $tor['forum_id'] : ''; $poster_id = (!$hide_author && isset($tor['poster_id'])) ? $tor['poster_id'] : ''; - // Gold/Silver releases mod $is_gold = ''; if ($tr_cfg['gold_silver_enabled']) { @@ -751,7 +750,6 @@ if ($allowed_forums) $is_gold = ' '; } } - // END Gold/Silver releases mod $template->assign_block_vars('tor', array( 'CAT_ID' => $cat_id, @@ -811,7 +809,7 @@ if ($tor_count) $search_matches = ($tor_count == 1) ? sprintf($lang['FOUND_SEARCH_MATCH'], $tor_count) : sprintf($lang['FOUND_SEARCH_MATCHES'], $tor_count); $search_max = "(max: $tor_search_limit)"; - generate_pagination($base_url, $tor_count, $per_page, $start); + generate_pagination($base_url, $tor_count, $per_page, $start); $template->assign_vars(array( 'MATCHES' => $search_matches, diff --git a/upload/viewforum.php b/upload/viewforum.php index 219e3aace..c58045016 100644 --- a/upload/viewforum.php +++ b/upload/viewforum.php @@ -480,7 +480,6 @@ foreach ($topic_rowset as $topic) } } - // Gold/Silver releases mod $is_gold = ''; if ($tr_cfg['gold_silver_enabled'] && isset($topic['tor_type'])) { @@ -493,7 +492,6 @@ foreach ($topic_rowset as $topic) $is_gold = ' '; } } - // END Gold/Silver releases mod $template->assign_block_vars('t', array( 'FORUM_ID' => $forum_id, From ab3786b02cf4a709e25438a982eb9e274ce8cb64 Mon Sep 17 00:00:00 2001 From: Exile Date: Sat, 9 Aug 2014 01:29:32 +0400 Subject: [PATCH 03/24] Gold image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Вывод картинки золото/серебро через функцию, для предотвращения дублирования кода. --- upload/includes/functions.php | 28 ++++++++++++++++++ upload/includes/ucp/viewtorrent.php | 45 ++--------------------------- upload/tracker.php | 15 +--------- upload/viewforum.php | 15 +--------- 4 files changed, 33 insertions(+), 70 deletions(-) diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 9dc85f7ef..c8c7db0a6 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -2808,4 +2808,32 @@ function gender_image ($gender) } return $user_gender; +} + +function is_gold ($type) +{ + global $lang, $tr_cfg; + + if (!$tr_cfg['gold_silver_enabled']) + { + $is_gold = ''; + return $is_gold; + } + else + { + switch ($type) + { + case TOR_TYPE_GOLD: + $is_gold = ' '; + break; + case TOR_TYPE_SILVER: + $is_gold = ' '; + break; + default: + $is_gold = ''; + break; + } + } + + return $is_gold; } \ No newline at end of file diff --git a/upload/includes/ucp/viewtorrent.php b/upload/includes/ucp/viewtorrent.php index 8456ace87..9a49233be 100644 --- a/upload/includes/ucp/viewtorrent.php +++ b/upload/includes/ucp/viewtorrent.php @@ -48,19 +48,6 @@ if ($releasing) { foreach ($releasing as $i => $row) { - $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 = ' '; - } - } - $topic_title = wbr($row['topic_title']); $template->assign_block_vars('released', array( @@ -69,7 +56,7 @@ if ($releasing) 'TOPIC_TITLE' => ($row['update_time']) ? $topic_title : "$topic_title", 'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'], 'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'], - 'TOR_TYPE' => $is_gold, + 'TOR_TYPE' => is_gold($row['tor_type']), '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' : '-', @@ -83,19 +70,6 @@ if ($seeding) { foreach ($seeding as $i => $row) { - $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 = ' '; - } - } - $topic_title = wbr($row['topic_title']); $template->assign_block_vars('seed', array( @@ -104,7 +78,7 @@ if ($seeding) 'TOPIC_TITLE' => ($row['update_time']) ? $topic_title : "$topic_title", 'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'], 'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'], - 'TOR_TYPE' => $is_gold, + 'TOR_TYPE' => is_gold($row['tor_type']), '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' : '-', @@ -118,19 +92,6 @@ if ($leeching) { foreach ($leeching as $i => $row) { - $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 = ' '; - } - } - $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']); @@ -142,7 +103,7 @@ if ($leeching) 'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'], 'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'], 'COMPL_PERC' => $compl_perc, - 'TOR_TYPE' => $is_gold, + 'TOR_TYPE' => is_gold($row['tor_type']), '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' : '-', diff --git a/upload/tracker.php b/upload/tracker.php index ae9dceb6d..a71ce7380 100644 --- a/upload/tracker.php +++ b/upload/tracker.php @@ -738,19 +738,6 @@ if ($allowed_forums) $forum_id = (!$hide_forum && isset($tor['forum_id'])) ? $tor['forum_id'] : ''; $poster_id = (!$hide_author && isset($tor['poster_id'])) ? $tor['poster_id'] : ''; - $is_gold = ''; - if ($tr_cfg['gold_silver_enabled']) - { - if ($tor['tor_type'] == TOR_TYPE_GOLD) - { - $is_gold = ' '; - } - elseif ($tor['tor_type'] == TOR_TYPE_SILVER) - { - $is_gold = ' '; - } - } - $template->assign_block_vars('tor', array( 'CAT_ID' => $cat_id, 'CAT_TITLE' => ($cat_id) ? $cat_title_html[$cat_id] : '', @@ -771,7 +758,7 @@ if ($allowed_forums) 'ATTACH_ID' => $att_id, 'MAGNET' => $tor_magnet, - 'TOR_TYPE' => $is_gold, + 'TOR_TYPE' => is_gold($tor['tor_type']), 'TOR_FROZEN' => (!IS_AM) ? isset($bb_cfg['tor_frozen'][$tor['tor_status']]) : '', 'TOR_STATUS_ICON' => $bb_cfg['tor_icons'][$tor['tor_status']], diff --git a/upload/viewforum.php b/upload/viewforum.php index c58045016..44a4deaaf 100644 --- a/upload/viewforum.php +++ b/upload/viewforum.php @@ -480,19 +480,6 @@ foreach ($topic_rowset as $topic) } } - $is_gold = ''; - if ($tr_cfg['gold_silver_enabled'] && isset($topic['tor_type'])) - { - if ($topic['tor_type'] == TOR_TYPE_GOLD) - { - $is_gold = ' '; - } - elseif ($topic['tor_type'] == TOR_TYPE_SILVER) - { - $is_gold = ' '; - } - } - $template->assign_block_vars('t', array( 'FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, @@ -506,7 +493,7 @@ foreach ($topic_rowset as $topic) 'VIEWS' => $topic['topic_views'], 'TOR_STALED' => ($forum_data['allow_reg_tracker'] && !($t_type == POST_ANNOUNCE || $t_type == POST_STICKY || $topic['tor_size'])), 'TOR_FROZEN' => isset($topic['tor_status']) ? ((!IS_AM) ? isset($bb_cfg['tor_frozen'][$topic['tor_status']]) : '') : '', - 'TOR_TYPE' => $is_gold, + 'TOR_TYPE' => is_gold($topic['tor_type']), 'TOR_STATUS_ICON' => isset($topic['tor_status']) ? $bb_cfg['tor_icons'][$topic['tor_status']] : '', 'TOR_STATUS_TEXT' => isset($topic['tor_status']) ? $lang['TOR_STATUS_NAME'][$topic['tor_status']] : '', From 13e3af62d9cc949b1548430082155e0230c30793 Mon Sep 17 00:00:00 2001 From: Exile Date: Sat, 9 Aug 2014 10:25:46 +0400 Subject: [PATCH 04/24] Download -> dl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Переименование скрипта закачки торрентов. --- upload/admin/admin_attach_cp.php | 2 +- upload/attach_mod/displaying.php | 16 ++++++++-------- upload/attach_mod/displaying_torrent.php | 2 +- upload/attach_mod/posting_attachments.php | 2 +- upload/{download.php => dl.php} | 2 +- upload/includes/init_bb.php | 2 +- upload/robots.txt | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) rename upload/{download.php => dl.php} (99%) diff --git a/upload/admin/admin_attach_cp.php b/upload/admin/admin_attach_cp.php index 5ec630366..06a253f7c 100644 --- a/upload/admin/admin_attach_cp.php +++ b/upload/admin/admin_attach_cp.php @@ -524,7 +524,7 @@ if ($view == 'attachments') 'S_DELETE_BOX' => $delete_box, 'S_HIDDEN' => $hidden_field, - 'U_VIEW_ATTACHMENT' => BB_ROOT . 'download.php?id=' . $attachments[$i]['attach_id'], + 'U_VIEW_ATTACHMENT' => BB_ROOT . 'dl.php?id=' . $attachments[$i]['attach_id'], )); } diff --git a/upload/attach_mod/displaying.php b/upload/attach_mod/displaying.php index 1efd81481..dd0a72038 100644 --- a/upload/attach_mod/displaying.php +++ b/upload/attach_mod/displaying.php @@ -271,14 +271,14 @@ function display_attachments($post_id) if ($image) { // Images - // NOTE: If you want to use the download.php everytime an image is displayed inlined, replace the + // NOTE: If you want to use the dl.php everytime an image is displayed inlined, replace the // Section between BEGIN and END with (Without the // of course): - // $img_source = BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id']; + // $img_source = BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id']; // $download_link = TRUE; // Check if we can reach the file or if it is stored outside of the webroot if ($attach_config['upload_dir'][0] == '/' || ( $attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) { - $img_source = BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id']; + $img_source = BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id']; $download_link = TRUE; } else @@ -315,13 +315,13 @@ function display_attachments($post_id) if ($thumbnail) { // Images, but display Thumbnail - // NOTE: If you want to use the download.php everytime an thumnmail is displayed inlined, replace the + // NOTE: If you want to use the dl.php everytime an thumnmail is displayed inlined, replace the // Section between BEGIN and END with (Without the // of course): - // $thumb_source = BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; + // $thumb_source = BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; // Check if we can reach the file or if it is stored outside of the webroot if ($attach_config['upload_dir'][0] == '/' || ( $attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) { - $thumb_source = BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; + $thumb_source = BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; } else { @@ -334,7 +334,7 @@ function display_attachments($post_id) 'DOWNLOAD_NAME' => $display_name, 'S_UPLOAD_IMAGE' => $upload_image, - 'IMG_SRC' => BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id'], + 'IMG_SRC' => BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id'], 'IMG_THUMB_SRC' => $thumb_source, 'FILESIZE' => $filesize, 'COMMENT' => $comment, @@ -352,7 +352,7 @@ function display_attachments($post_id) // display attachment $template->assign_block_vars('postrow.attach.attachrow', array( - 'U_DOWNLOAD_LINK' => BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id'], + 'U_DOWNLOAD_LINK' => BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id'], 'S_UPLOAD_IMAGE' => $upload_image, 'DOWNLOAD_NAME' => $display_name, diff --git a/upload/attach_mod/displaying_torrent.php b/upload/attach_mod/displaying_torrent.php index 0c8d478ce..d9dfbd90b 100644 --- a/upload/attach_mod/displaying_torrent.php +++ b/upload/attach_mod/displaying_torrent.php @@ -75,7 +75,7 @@ $tor_auth_del = ($tor_auth && $tor_reged); $tracker_link = ($tor_reged) ? $lang['BT_REG_YES'] : $lang['BT_REG_NO']; -$download_link = "download.php?id=$attach_id"; +$download_link = "dl.php?id=$attach_id"; $description = ($comment) ? $comment : preg_replace("#.torrent$#i", '', $display_name); if ($tor_auth_reg || $tor_auth_del) diff --git a/upload/attach_mod/posting_attachments.php b/upload/attach_mod/posting_attachments.php index 6e8a7f50a..4ae925b00 100644 --- a/upload/attach_mod/posting_attachments.php +++ b/upload/attach_mod/posting_attachments.php @@ -806,7 +806,7 @@ class attach_parent } else { - $download_link = BB_ROOT . 'download.php?id=' . $this->attachment_id_list[$i]; + $download_link = BB_ROOT . 'dl.php?id=' . $this->attachment_id_list[$i]; } $template->assign_block_vars('attach_row', array( diff --git a/upload/download.php b/upload/dl.php similarity index 99% rename from upload/download.php rename to upload/dl.php index aeb524e18..dfdb7398f 100644 --- a/upload/download.php +++ b/upload/dl.php @@ -1,7 +1,7 @@ Date: Sun, 10 Aug 2014 19:46:09 +0600 Subject: [PATCH 05/24] Using constant links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Использование заранее определенных констант для ссылок Исправление некорректного редиректа viewtopic.php --- upload/admin/admin_attach_cp.php | 2 +- upload/attach_mod/displaying.php | 12 ++++++------ upload/attach_mod/displaying_torrent.php | 2 +- upload/attach_mod/posting_attachments.php | 2 +- upload/groupcp.php | 2 +- upload/posting.php | 2 +- upload/viewforum.php | 5 ++--- upload/viewtopic.php | 20 ++++++++++---------- 8 files changed, 23 insertions(+), 24 deletions(-) diff --git a/upload/admin/admin_attach_cp.php b/upload/admin/admin_attach_cp.php index 06a253f7c..274b673bb 100644 --- a/upload/admin/admin_attach_cp.php +++ b/upload/admin/admin_attach_cp.php @@ -524,7 +524,7 @@ if ($view == 'attachments') 'S_DELETE_BOX' => $delete_box, 'S_HIDDEN' => $hidden_field, - 'U_VIEW_ATTACHMENT' => BB_ROOT . 'dl.php?id=' . $attachments[$i]['attach_id'], + 'U_VIEW_ATTACHMENT' => BB_ROOT . DOWNLOAD_URL . $attachments[$i]['attach_id'], )); } diff --git a/upload/attach_mod/displaying.php b/upload/attach_mod/displaying.php index dd0a72038..dda71b925 100644 --- a/upload/attach_mod/displaying.php +++ b/upload/attach_mod/displaying.php @@ -273,12 +273,12 @@ function display_attachments($post_id) // Images // NOTE: If you want to use the dl.php everytime an image is displayed inlined, replace the // Section between BEGIN and END with (Without the // of course): - // $img_source = BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id']; + // $img_source = BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id']; // $download_link = TRUE; // Check if we can reach the file or if it is stored outside of the webroot if ($attach_config['upload_dir'][0] == '/' || ( $attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) { - $img_source = BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id']; + $img_source = BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id']; $download_link = TRUE; } else @@ -317,11 +317,11 @@ function display_attachments($post_id) // Images, but display Thumbnail // NOTE: If you want to use the dl.php everytime an thumnmail is displayed inlined, replace the // Section between BEGIN and END with (Without the // of course): - // $thumb_source = BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; + // $thumb_source = BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; // Check if we can reach the file or if it is stored outside of the webroot if ($attach_config['upload_dir'][0] == '/' || ( $attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) { - $thumb_source = BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; + $thumb_source = BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; } else { @@ -334,7 +334,7 @@ function display_attachments($post_id) 'DOWNLOAD_NAME' => $display_name, 'S_UPLOAD_IMAGE' => $upload_image, - 'IMG_SRC' => BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id'], + 'IMG_SRC' => BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'], 'IMG_THUMB_SRC' => $thumb_source, 'FILESIZE' => $filesize, 'COMMENT' => $comment, @@ -352,7 +352,7 @@ function display_attachments($post_id) // display attachment $template->assign_block_vars('postrow.attach.attachrow', array( - 'U_DOWNLOAD_LINK' => BB_ROOT . 'dl.php?id=' . $attachments['_' . $post_id][$i]['attach_id'], + 'U_DOWNLOAD_LINK' => BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'], 'S_UPLOAD_IMAGE' => $upload_image, 'DOWNLOAD_NAME' => $display_name, diff --git a/upload/attach_mod/displaying_torrent.php b/upload/attach_mod/displaying_torrent.php index d9dfbd90b..6ee7e12f6 100644 --- a/upload/attach_mod/displaying_torrent.php +++ b/upload/attach_mod/displaying_torrent.php @@ -75,7 +75,7 @@ $tor_auth_del = ($tor_auth && $tor_reged); $tracker_link = ($tor_reged) ? $lang['BT_REG_YES'] : $lang['BT_REG_NO']; -$download_link = "dl.php?id=$attach_id"; +$download_link = DOWNLOAD_URL . $attach_id; $description = ($comment) ? $comment : preg_replace("#.torrent$#i", '', $display_name); if ($tor_auth_reg || $tor_auth_del) diff --git a/upload/attach_mod/posting_attachments.php b/upload/attach_mod/posting_attachments.php index 4ae925b00..60e91d161 100644 --- a/upload/attach_mod/posting_attachments.php +++ b/upload/attach_mod/posting_attachments.php @@ -806,7 +806,7 @@ class attach_parent } else { - $download_link = BB_ROOT . 'dl.php?id=' . $this->attachment_id_list[$i]; + $download_link = BB_ROOT . DOWNLOAD_URL . $this->attachment_id_list[$i]; } $template->assign_block_vars('attach_row', array( diff --git a/upload/groupcp.php b/upload/groupcp.php index f5e09354b..0b715176d 100644 --- a/upload/groupcp.php +++ b/upload/groupcp.php @@ -556,7 +556,7 @@ else 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_MODE_SELECT' => $select_sort_mode, 'S_ORDER_SELECT' => $select_sort_order, - 'S_GROUPCP_ACTION' => "groupcp.php?" . POST_GROUPS_URL . "=$group_id", + 'S_GROUPCP_ACTION' => GROUP_URL . $group_id, )); // Dump out the remaining users diff --git a/upload/posting.php b/upload/posting.php index acef3fa9f..922229a2e 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -671,7 +671,7 @@ $template->assign_vars(array( 'SUBJECT' => $subject, 'MESSAGE' => $message, - 'U_VIEWTOPIC' => ( $mode == 'reply' ) ? "viewtopic.php?" . POST_TOPIC_URL . "=$topic_id&postorder=desc" : '', + 'U_VIEWTOPIC' => ( $mode == 'reply' ) ? POST_URL ."$topic_id&postorder=desc" : '', 'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '', 'S_TYPE_TOGGLE' => $topic_type_toggle, diff --git a/upload/viewforum.php b/upload/viewforum.php index 44a4deaaf..105831625 100644 --- a/upload/viewforum.php +++ b/upload/viewforum.php @@ -68,9 +68,8 @@ if (!$is_auth['auth_view']) { if (IS_GUEST) { - $redirect = "f=$forum_id"; $redirect .= ($start) ? "&start=$start" : ''; - redirect(LOGIN_URL . "?redirect=viewforum.php&$redirect"); + redirect(LOGIN_URL . "?redirect=". FORUM_URL . $forum_id ."&$redirect"); } // The user is not authed to read this forum ... $message = sprintf($lang['SORRY_AUTH_VIEW'], $is_auth['auth_view_type']); @@ -282,7 +281,7 @@ if (!empty($_REQUEST['topicdays'])) // Correct $start value if ($start > $forum_topics) { - redirect("viewforum.php?f=$forum_id"); + redirect(FORUM_URL . $forum_id); } // Generate SORT and ORDER selects diff --git a/upload/viewtopic.php b/upload/viewtopic.php index 088e8e77e..3e85082ef 100644 --- a/upload/viewtopic.php +++ b/upload/viewtopic.php @@ -179,7 +179,7 @@ if (!$is_auth['auth_read']) { $redirect = ($post_id) ? POST_URL ."$post_id#$post_id" : TOPIC_URL . $topic_id; $redirect .= ($start && !$post_id) ? "&start=$start" : ''; - redirect(LOGIN_URL . "?redirect=viewtopic.php&$redirect"); + redirect(LOGIN_URL . "?redirect=$redirect"); } bb_die($lang['TOPIC_POST_NOT_EXIST']); } @@ -313,7 +313,7 @@ if ($bb_cfg['topic_notify_enabled']) { if ($_GET['unwatch'] == 'topic') { - redirect(LOGIN_URL . "?redirect=viewtopic.php&t=$topic_id&unwatch=topic"); + redirect(LOGIN_URL . "?redirect=". TOPIC_URL . "$topic_id&unwatch=topic"); } } } @@ -434,9 +434,9 @@ if ( count($orig_word) ) // $new_topic_url = POSTING_URL . "?mode=newtopic&f=$forum_id"; $reply_topic_url = POSTING_URL . "?mode=reply&t=$topic_id"; -$view_forum_url = "viewforum.php?f=$forum_id"; -$view_prev_topic_url = "viewtopic.php?t=$topic_id&view=previous#newest"; -$view_next_topic_url = "viewtopic.php?t=$topic_id&view=next#newest"; +$view_forum_url = FORUM_URL . $forum_id; +$view_prev_topic_url = TOPIC_URL ."$topic_id&view=previous#newest"; +$view_next_topic_url = TOPIC_URL ."$topic_id&view=next#newest"; $reply_img = ( $t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED) ? $images['reply_locked'] : $images['reply_new']; $reply_alt = ( $t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED) ? $lang['TOPIC_LOCKED_SHORT'] : $lang['REPLY_TO_TOPIC']; @@ -518,13 +518,13 @@ if ( $can_watch_topic ) { if ( $is_watching_topic ) { - $s_watching_topic = "' . $lang['STOP_WATCHING_TOPIC'] . ''; - $s_watching_topic_img = ( isset($images['topic_un_watch']) ) ? "' . $lang['STOP_WATCHING_TOPIC'] . '' : ''; + $s_watching_topic = "' . $lang['STOP_WATCHING_TOPIC'] . ''; + $s_watching_topic_img = ( isset($images['topic_un_watch']) ) ? "' . $lang['STOP_WATCHING_TOPIC'] . '' : ''; } else { - $s_watching_topic = "' . $lang['START_WATCHING_TOPIC'] . ''; - $s_watching_topic_img = ( isset($images['Topic_watch']) ) ? "' . $lang['START_WATCHING_TOPIC'] . '' : ''; + $s_watching_topic = "' . $lang['START_WATCHING_TOPIC'] . ''; + $s_watching_topic_img = ( isset($images['Topic_watch']) ) ? "' . $lang['START_WATCHING_TOPIC'] . '' : ''; } } @@ -601,7 +601,7 @@ $template->assign_vars(array( 'S_SELECT_POST_DAYS' => build_select('postdays', array_flip($sel_previous_days), $post_days), 'S_SELECT_POST_ORDER' => build_select('postorder', $sel_post_order_ary, $post_order), - 'S_POST_DAYS_ACTION' => "viewtopic.php?t=$topic_id&start=$start", + 'S_POST_DAYS_ACTION' => TOPIC_URL ."$topic_id&start=$start", 'S_AUTH_LIST' => $s_auth_can, 'S_TOPIC_ADMIN' => $topic_mod, 'S_WATCH_TOPIC' => $s_watching_topic, From d4be38e08855bb4d95f5620f74964388fac17734 Mon Sep 17 00:00:00 2001 From: Dark Nightmare Date: Mon, 11 Aug 2014 00:45:30 +0600 Subject: [PATCH 06/24] Using constant links 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Использование заранее определенных констант для ссылок Небольшая правка --- upload/memberlist.php | 2 +- upload/viewforum.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/upload/memberlist.php b/upload/memberlist.php index 91cd53ca7..fc0ff96bd 100644 --- a/upload/memberlist.php +++ b/upload/memberlist.php @@ -202,7 +202,7 @@ if ($result = DB()->fetch_rowset($sql)) 'PM' => $pm, 'EMAIL' => $email, 'WWW' => $www, - 'U_VIEWPROFILE' => "profile.php?mode=viewprofile&". POST_USERS_URL ."=$user_id", + 'U_VIEWPROFILE' => PROFILE_URL . $user_id, )); } } diff --git a/upload/viewforum.php b/upload/viewforum.php index 105831625..87f012a21 100644 --- a/upload/viewforum.php +++ b/upload/viewforum.php @@ -68,7 +68,7 @@ if (!$is_auth['auth_view']) { if (IS_GUEST) { - $redirect .= ($start) ? "&start=$start" : ''; + $redirect = ($start) ? "&start=$start" : ''; redirect(LOGIN_URL . "?redirect=". FORUM_URL . $forum_id ."&$redirect"); } // The user is not authed to read this forum ... From d1f87716afb29dcc024b069038e35a2f420c471f Mon Sep 17 00:00:00 2001 From: Exile Date: Mon, 11 Aug 2014 16:07:37 +0400 Subject: [PATCH 07/24] Admin cron ulock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Разблокировка форума заблокированного крон на аяксе, GMT -> UTC, мелкие фиксы (золото, доступ к статистике, пара переменных). --- upload/admin/index.php | 4 +- upload/ajax.php | 23 +++-- upload/ajax/manage_admin.php | 10 ++- upload/attach_mod/displaying.php | 54 ++++-------- upload/language/en/main.php | 141 ++++++++++++++++--------------- upload/language/ru/main.php | 141 ++++++++++++++++--------------- upload/language/ua/main.php | 141 ++++++++++++++++--------------- upload/posting.php | 2 +- upload/stats/tracker.php | 4 + upload/templates/admin/index.tpl | 18 ++++ upload/viewforum.php | 6 +- upload/viewtopic.php | 40 ++++----- 12 files changed, 310 insertions(+), 274 deletions(-) diff --git a/upload/admin/index.php b/upload/admin/index.php index cd5f5d4d2..1334f3d8b 100644 --- a/upload/admin/index.php +++ b/upload/admin/index.php @@ -58,7 +58,9 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') { $template->assign_vars(array( - 'TPL_ADMIN_MAIN' => true, + 'TPL_ADMIN_MAIN' => true, + 'ADMIN_LOCK' => ($bb_cfg['board_disable']) ? true : false, + 'ADMIN_LOCK_CRON' => (file_exists(BB_DISABLED)) ? true :false, )); // Get forum statistics diff --git a/upload/ajax.php b/upload/ajax.php index f32feb163..34845418f 100644 --- a/upload/ajax.php +++ b/upload/ajax.php @@ -9,14 +9,20 @@ require('./common.php'); $ajax->init(); +// Init userdata +$user->session_start(); + // Exit if board is disabled via ON/OFF trigger or by admin -if ($bb_cfg['board_disable']) +if ($ajax->action != 'manage_admin') { - $ajax->ajax_die($lang['BOARD_DISABLE']); -} -else if (file_exists(BB_DISABLED)) -{ - $ajax->ajax_die($lang['BOARD_DISABLE_CRON']); + if ($bb_cfg['board_disable']) + { + $ajax->ajax_die($lang['BOARD_DISABLE']); + } + else if (file_exists(BB_DISABLED)) + { + $ajax->ajax_die($lang['BOARD_DISABLE_CRON']); + } } // Load actions required modules @@ -65,10 +71,9 @@ switch ($ajax->action) break; } -// position in $ajax->valid_actions['xxx'] -define('AJAX_AUTH', 0); // 'guest', 'user', 'mod', 'admin', 'super_admin' +// Position in $ajax->valid_actions['xxx'] +define('AJAX_AUTH', 0); // 'guest', 'user', 'mod', 'admin', 'super_admin' -$user->session_start(); $ajax->exec(); // diff --git a/upload/ajax/manage_admin.php b/upload/ajax/manage_admin.php index 559f4753d..74311b2ac 100644 --- a/upload/ajax/manage_admin.php +++ b/upload/ajax/manage_admin.php @@ -99,7 +99,15 @@ switch ($mode) sync('user_posts', 'all'); - $this->response['sync_user_posts_html'] = ''. $lang['USER POSTS COUNT SYNCHRONIZED'] .''; + $this->response['sync_user_posts_html'] = ''. $lang['USER_POSTS_COUNT_SYNCHRONIZED'] .''; + + break; + + case 'unlock_cron': + + cron_enable_board(); + + $this->response['unlock_cron_html'] = ''. $lang['ADMIN_UNLOCKED'] .''; break; } diff --git a/upload/attach_mod/displaying.php b/upload/attach_mod/displaying.php index dda71b925..d1c6e3e6e 100644 --- a/upload/attach_mod/displaying.php +++ b/upload/attach_mod/displaying.php @@ -99,11 +99,6 @@ function display_post_attachments($post_id, $switch_attachment) { display_attachments($post_id); } - else - { - // Display Notice (attachment there but not having permissions to view it) - // Not included because this would mean template and language file changes (at this stage this is not a wise step. ;)) - } } /** @@ -271,11 +266,6 @@ function display_attachments($post_id) if ($image) { // Images - // NOTE: If you want to use the dl.php everytime an image is displayed inlined, replace the - // Section between BEGIN and END with (Without the // of course): - // $img_source = BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id']; - // $download_link = TRUE; - // Check if we can reach the file or if it is stored outside of the webroot if ($attach_config['upload_dir'][0] == '/' || ( $attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) { $img_source = BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id']; @@ -283,19 +273,16 @@ function display_attachments($post_id) } else { - // BEGIN $img_source = $filename; $download_link = FALSE; - // END } $template->assign_block_vars('postrow.attach.cat_images', array( - 'DOWNLOAD_NAME' => $display_name, + 'DOWNLOAD_NAME' => $display_name, 'S_UPLOAD_IMAGE' => $upload_image, - - 'IMG_SRC' => $img_source, - 'FILESIZE' => $filesize, - 'COMMENT' => $comment, + 'IMG_SRC' => $img_source, + 'FILESIZE' => $filesize, + 'COMMENT' => $comment, )); // Directly Viewed Image ... update the download count @@ -315,29 +302,22 @@ function display_attachments($post_id) if ($thumbnail) { // Images, but display Thumbnail - // NOTE: If you want to use the dl.php everytime an thumnmail is displayed inlined, replace the - // Section between BEGIN and END with (Without the // of course): - // $thumb_source = BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; - // Check if we can reach the file or if it is stored outside of the webroot if ($attach_config['upload_dir'][0] == '/' || ( $attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) { $thumb_source = BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; } else { - // BEGIN $thumb_source = $thumbnail_filename; - // END } $template->assign_block_vars('postrow.attach.cat_thumb_images', array( - 'DOWNLOAD_NAME' => $display_name, + 'DOWNLOAD_NAME' => $display_name, 'S_UPLOAD_IMAGE' => $upload_image, - - 'IMG_SRC' => BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'], - 'IMG_THUMB_SRC' => $thumb_source, - 'FILESIZE' => $filesize, - 'COMMENT' => $comment, + 'IMG_SRC' => BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'], + 'IMG_THUMB_SRC' => $thumb_source, + 'FILESIZE' => $filesize, + 'COMMENT' => $comment, )); } @@ -352,15 +332,13 @@ function display_attachments($post_id) // display attachment $template->assign_block_vars('postrow.attach.attachrow', array( - 'U_DOWNLOAD_LINK' => BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'], - 'S_UPLOAD_IMAGE' => $upload_image, - - 'DOWNLOAD_NAME' => $display_name, - 'FILESIZE' => $filesize, - 'COMMENT' => $comment, - 'TARGET_BLANK' => $target_blank, - - 'DOWNLOAD_COUNT' => sprintf($lang['DOWNLOAD_NUMBER'], $attachments['_' . $post_id][$i]['download_count']), + 'U_DOWNLOAD_LINK' => BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'], + 'S_UPLOAD_IMAGE' => $upload_image, + 'DOWNLOAD_NAME' => $display_name, + 'FILESIZE' => $filesize, + 'COMMENT' => $comment, + 'TARGET_BLANK' => $target_blank, + 'DOWNLOAD_COUNT' => sprintf($lang['DOWNLOAD_NUMBER'], $attachments['_' . $post_id][$i]['download_count']), )); } } diff --git a/upload/language/en/main.php b/upload/language/en/main.php index f3a92ba90..11c470b06 100644 --- a/upload/language/en/main.php +++ b/upload/language/en/main.php @@ -103,6 +103,13 @@ $lang['DATASTORE'] = 'Datastore'; $lang['DATASTORE_CLEARED'] = 'Datastore has been cleared'; $lang['BOARD_DISABLE'] = 'Sorry, this forum is disabled. Try to come back later'; $lang['BOARD_DISABLE_CRON'] = 'Forum is down for maintenance. Try to come back later'; +$lang['ADMIN_DISABLE'] = 'the forum is disabled by administrator, you can enable it at any time'; +$lang['ADMIN_DISABLE_CRON'] = 'forum locked by the trigger cron job, you can remove a lock at any time'; +$lang['ADMIN_DISABLE_TITLE'] = 'The forum is disabled'; +$lang['ADMIN_DISABLE_CRON_TITLE'] = 'Forum is down for maintenance'; +$lang['ADMIN_UNLOCK'] = 'Enable forum'; +$lang['ADMIN_UNLOCKED'] = 'Unlocked'; +$lang['ADMIN_UNLOCK_CRON'] = 'Remove lock'; $lang['LOADING'] = 'Loading...'; $lang['JUMPBOX_TITLE'] = 'Select forum'; @@ -895,74 +902,74 @@ $lang['LOOKUP_IP'] = 'Look up IP address'; // // Timezones ... for display on each page // -$lang['ALL_TIMES'] = 'All times are %s'; // eg. All times are GMT - 12 Hours (times from next block) +$lang['ALL_TIMES'] = 'All times are %s'; // eg. All times are UTC - 12 Hours (times from next block) -$lang['-12'] = 'GMT - 12 Hours'; -$lang['-11'] = 'GMT - 11 Hours'; -$lang['-10'] = 'GMT - 10 Hours'; -$lang['-9'] = 'GMT - 9 Hours'; -$lang['-8'] = 'GMT - 8 Hours'; -$lang['-7'] = 'GMT - 7 Hours'; -$lang['-6'] = 'GMT - 6 Hours'; -$lang['-5'] = 'GMT - 5 Hours'; -$lang['-4'] = 'GMT - 4 Hours'; -$lang['-3.5'] = 'GMT - 3.5 Hours'; -$lang['-3'] = 'GMT - 3 Hours'; -$lang['-2'] = 'GMT - 2 Hours'; -$lang['-1'] = 'GMT - 1 Hours'; -$lang['0'] = 'GMT'; -$lang['1'] = 'GMT + 1 Hour'; -$lang['2'] = 'GMT + 2 Hours'; -$lang['3'] = 'GMT + 3 Hours'; -$lang['3.5'] = 'GMT + 3.5 Hours'; -$lang['4'] = 'GMT + 4 Hours'; -$lang['4.5'] = 'GMT + 4.5 Hours'; -$lang['5'] = 'GMT + 5 Hours'; -$lang['5.5'] = 'GMT + 5.5 Hours'; -$lang['6'] = 'GMT + 6 Hours'; -$lang['6.5'] = 'GMT + 6.5 Hours'; -$lang['7'] = 'GMT + 7 Hours'; -$lang['8'] = 'GMT + 8 Hours'; -$lang['9'] = 'GMT + 9 Hours'; -$lang['9.5'] = 'GMT + 9.5 Hours'; -$lang['10'] = 'GMT + 10 Hours'; -$lang['11'] = 'GMT + 11 Hours'; -$lang['12'] = 'GMT + 12 Hours'; -$lang['13'] = 'GMT + 13 Hours'; +$lang['-12'] = 'UTC - 12'; +$lang['-11'] = 'UTC - 11'; +$lang['-10'] = 'UTC - 10'; +$lang['-9'] = 'UTC - 9'; +$lang['-8'] = 'UTC - 8'; +$lang['-7'] = 'UTC - 7'; +$lang['-6'] = 'UTC - 6'; +$lang['-5'] = 'UTC - 5'; +$lang['-4'] = 'UTC - 4'; +$lang['-3.5'] = 'UTC - 3.5'; +$lang['-3'] = 'UTC - 3'; +$lang['-2'] = 'UTC - 2'; +$lang['-1'] = 'UTC - 1'; +$lang['0'] = 'UTC ± 0'; +$lang['1'] = 'UTC + 1'; +$lang['2'] = 'UTC + 2'; +$lang['3'] = 'UTC + 3'; +$lang['3.5'] = 'UTC + 3.5'; +$lang['4'] = 'UTC + 4'; +$lang['4.5'] = 'UTC + 4.5'; +$lang['5'] = 'UTC + 5'; +$lang['5.5'] = 'UTC + 5.5'; +$lang['6'] = 'UTC + 6'; +$lang['6.5'] = 'UTC + 6.5'; +$lang['7'] = 'UTC + 7'; +$lang['8'] = 'UTC + 8'; +$lang['9'] = 'UTC + 9'; +$lang['9.5'] = 'UTC + 9.5'; +$lang['10'] = 'UTC + 10'; +$lang['11'] = 'UTC + 11'; +$lang['12'] = 'UTC + 12'; +$lang['13'] = 'UTC + 13'; // These are displayed in the timezone select box -$lang['TZ']['-12'] = 'GMT - 12 Hours'; -$lang['TZ']['-11'] = 'GMT - 11 Hours'; -$lang['TZ']['-10'] = 'GMT - 10 Hours'; -$lang['TZ']['-9'] = 'GMT - 9 Hours'; -$lang['TZ']['-8'] = 'GMT - 8 Hours'; -$lang['TZ']['-7'] = 'GMT - 7 Hours'; -$lang['TZ']['-6'] = 'GMT - 6 Hours'; -$lang['TZ']['-5'] = 'GMT - 5 Hours'; -$lang['TZ']['-4'] = 'GMT - 4 Hours'; -$lang['TZ']['-3.5'] = 'GMT - 3.5 Hours'; -$lang['TZ']['-3'] = 'GMT - 3 Hours'; -$lang['TZ']['-2'] = 'GMT - 2 Hours'; -$lang['TZ']['-1'] = 'GMT - 1 Hours'; -$lang['TZ']['0'] = 'GMT'; -$lang['TZ']['1'] = 'GMT + 1 Hour'; -$lang['TZ']['2'] = 'GMT + 2 Hours'; -$lang['TZ']['3'] = 'GMT + 3 Hours'; -$lang['TZ']['3.5'] = 'GMT + 3.5 Hours'; -$lang['TZ']['4'] = 'GMT + 4 Hours'; -$lang['TZ']['4.5'] = 'GMT + 4.5 Hours'; -$lang['TZ']['5'] = 'GMT + 5 Hours'; -$lang['TZ']['5.5'] = 'GMT + 5.5 Hours'; -$lang['TZ']['6'] = 'GMT + 6 Hours'; -$lang['TZ']['6.5'] = 'GMT + 6.5 Hours'; -$lang['TZ']['7'] = 'GMT + 7 Hours'; -$lang['TZ']['8'] = 'GMT + 8 Hours'; -$lang['TZ']['9'] = 'GMT + 9 Hours'; -$lang['TZ']['9.5'] = 'GMT + 9.5 Hours'; -$lang['TZ']['10'] = 'GMT + 10 Hours'; -$lang['TZ']['11'] = 'GMT + 11 Hours'; -$lang['TZ']['12'] = 'GMT + 12 Hours'; -$lang['TZ']['13'] = 'GMT + 13 Hours'; +$lang['TZ']['-12'] = 'UTC - 12'; +$lang['TZ']['-11'] = 'UTC - 11'; +$lang['TZ']['-10'] = 'UTC - 10'; +$lang['TZ']['-9'] = 'UTC - 9'; +$lang['TZ']['-8'] = 'UTC - 8'; +$lang['TZ']['-7'] = 'UTC - 7'; +$lang['TZ']['-6'] = 'UTC - 6'; +$lang['TZ']['-5'] = 'UTC - 5'; +$lang['TZ']['-4'] = 'UTC - 4'; +$lang['TZ']['-3.5'] = 'UTC - 3.5'; +$lang['TZ']['-3'] = 'UTC - 3'; +$lang['TZ']['-2'] = 'UTC - 2'; +$lang['TZ']['-1'] = 'UTC - 1'; +$lang['TZ']['0'] = 'UTC ± 0'; +$lang['TZ']['1'] = 'UTC + 1'; +$lang['TZ']['2'] = 'UTC + 2'; +$lang['TZ']['3'] = 'UTC + 3'; +$lang['TZ']['3.5'] = 'UTC + 3.5'; +$lang['TZ']['4'] = 'UTC + 4'; +$lang['TZ']['4.5'] = 'UTC + 4.5'; +$lang['TZ']['5'] = 'UTC + 5'; +$lang['TZ']['5.5'] = 'UTC + 5.5'; +$lang['TZ']['6'] = 'UTC + 6'; +$lang['TZ']['6.5'] = 'UTC + 6.5'; +$lang['TZ']['7'] = 'UTC + 7'; +$lang['TZ']['8'] = 'UTC + 8'; +$lang['TZ']['9'] = 'UTC + 9'; +$lang['TZ']['9.5'] = 'UTC + 9.5'; +$lang['TZ']['10'] = 'UTC + 10'; +$lang['TZ']['11'] = 'UTC + 11'; +$lang['TZ']['12'] = 'UTC + 12'; +$lang['TZ']['13'] = 'UTC + 13'; $lang['DATETIME']['TODAY'] = 'Today'; $lang['DATETIME']['YESTERDAY'] = 'Yesterday'; @@ -1784,7 +1791,7 @@ $lang['USER_LEVELS_UPDATED'] = 'User levels have been updated'; $lang['SYNCHRONIZE'] = 'Synchronize'; $lang['TOPICS_DATA_SYNCHRONIZED'] = 'Topics data have been synchronized'; $lang['USER_POSTS_COUNT'] = 'User posts count'; -$lang['USER POSTS COUNT SYNCHRONIZED'] = 'User posts count has been synchronized'; +$lang['USER_POSTS_COUNT_SYNCHRONIZED'] = 'User posts count has been synchronized'; // Online Userlist $lang['SHOW_ONLINE_USERLIST'] = 'Show the list of online users'; @@ -2893,7 +2900,7 @@ $lang['SEARCH_FOR_USERFIELD_OCCUPATION'] = 'Searching for users with their Occup $lang['SEARCH_FOR_LASTVISITED_INTHELAST'] = 'Searching for users who have visited in the last %s %s'; $lang['SEARCH_FOR_LASTVISITED_AFTERTHELAST'] = 'Searching for users who have visited after the last %s %s'; $lang['SEARCH_FOR_LANGUAGE'] = 'Searching for users who have set %s as their language'; -$lang['SEARCH_FOR_TIMEZONE'] = 'Searching for users who have set GMT %s as their timezone'; +$lang['SEARCH_FOR_TIMEZONE'] = 'Searching for users who have set UTC %s as their timezone'; $lang['SEARCH_FOR_STYLE'] = 'Searching for users who have set %s as their style'; $lang['SEARCH_FOR_MODERATORS'] = 'Search for moderators of the Forum -> %s'; $lang['SEARCH_USERS_ADVANCED'] = 'Advanced User Search'; diff --git a/upload/language/ru/main.php b/upload/language/ru/main.php index 28776416a..1a1828a55 100644 --- a/upload/language/ru/main.php +++ b/upload/language/ru/main.php @@ -103,6 +103,13 @@ $lang['DATASTORE'] = 'Datastore'; $lang['DATASTORE_CLEARED'] = 'Datastore очищен'; $lang['BOARD_DISABLE'] = 'Извините, этот форум отключен. Попробуйте зайти позднее'; $lang['BOARD_DISABLE_CRON'] = 'Форум отключен на техническое обслуживание. Попробуйте зайти позднее'; +$lang['ADMIN_DISABLE'] = 'форум отключен администратором, вы можете включить его в любое время'; +$lang['ADMIN_DISABLE_CRON'] = 'форум заблокирован триггером cron-заданий, вы можете снять блокировку в любое время'; +$lang['ADMIN_DISABLE_TITLE'] = 'Форум отключен'; +$lang['ADMIN_DISABLE_CRON_TITLE'] = 'Форум отключен на техническое обслуживание'; +$lang['ADMIN_UNLOCK'] = 'Включить форум'; +$lang['ADMIN_UNLOCKED'] = 'Разблокировано'; +$lang['ADMIN_UNLOCK_CRON'] = 'Снять блокировку'; $lang['LOADING'] = 'Загружается…'; $lang['JUMPBOX_TITLE'] = 'Выберите форум для перехода'; @@ -895,74 +902,74 @@ $lang['LOOKUP_IP'] = 'Посмотреть хост для IP'; // // Timezones ... for display on each page // -$lang['ALL_TIMES'] = 'Часовой пояс: %s'; // This is followed by GMT and the timezone offset +$lang['ALL_TIMES'] = 'Часовой пояс: %s'; // This is followed by UTC and the timezone offset -$lang['-12'] = 'GMT - 12'; -$lang['-11'] = 'GMT - 11'; -$lang['-10'] = 'GMT - 10'; -$lang['-9'] = 'GMT - 9'; -$lang['-8'] = 'GMT - 8'; -$lang['-7'] = 'GMT - 7'; -$lang['-6'] = 'GMT - 6'; -$lang['-5'] = 'GMT - 5'; -$lang['-4'] = 'GMT - 4'; -$lang['-3.5'] = 'GMT - 3:30'; -$lang['-3'] = 'GMT - 3'; -$lang['-2'] = 'GMT - 2'; -$lang['-1'] = 'GMT - 1'; -$lang['0'] = 'GMT'; -$lang['1'] = 'GMT + 1'; -$lang['2'] = 'GMT + 2'; -$lang['3'] = 'GMT + 3'; -$lang['3.5'] = 'GMT + 3:30'; -$lang['4'] = 'GMT + 4'; -$lang['4.5'] = 'GMT + 4:30'; -$lang['5'] = 'GMT + 5'; -$lang['5.5'] = 'GMT + 5:30'; -$lang['6'] = 'GMT + 6'; -$lang['6.5'] = 'GMT + 6:30'; -$lang['7'] = 'GMT + 7'; -$lang['8'] = 'GMT + 8'; -$lang['9'] = 'GMT + 9'; -$lang['9.5'] = 'GMT + 9:30'; -$lang['10'] = 'GMT + 10'; -$lang['11'] = 'GMT + 11'; -$lang['12'] = 'GMT + 12'; -$lang['13'] = 'GMT + 13'; +$lang['-12'] = 'UTC - 12'; +$lang['-11'] = 'UTC - 11'; +$lang['-10'] = 'UTC - 10'; +$lang['-9'] = 'UTC - 9'; +$lang['-8'] = 'UTC - 8'; +$lang['-7'] = 'UTC - 7'; +$lang['-6'] = 'UTC - 6'; +$lang['-5'] = 'UTC - 5'; +$lang['-4'] = 'UTC - 4'; +$lang['-3.5'] = 'UTC - 3:30'; +$lang['-3'] = 'UTC - 3'; +$lang['-2'] = 'UTC - 2'; +$lang['-1'] = 'UTC - 1'; +$lang['0'] = 'UTC ± 0'; +$lang['1'] = 'UTC + 1'; +$lang['2'] = 'UTC + 2'; +$lang['3'] = 'UTC + 3'; +$lang['3.5'] = 'UTC + 3:30'; +$lang['4'] = 'UTC + 4'; +$lang['4.5'] = 'UTC + 4:30'; +$lang['5'] = 'UTC + 5'; +$lang['5.5'] = 'UTC + 5:30'; +$lang['6'] = 'UTC + 6'; +$lang['6.5'] = 'UTC + 6:30'; +$lang['7'] = 'UTC + 7'; +$lang['8'] = 'UTC + 8'; +$lang['9'] = 'UTC + 9'; +$lang['9.5'] = 'UTC + 9:30'; +$lang['10'] = 'UTC + 10'; +$lang['11'] = 'UTC + 11'; +$lang['12'] = 'UTC + 12'; +$lang['13'] = 'UTC + 13'; // это для выпадающего меню, раньше тут еще были города -$lang['TZ']['-12'] = 'GMT - 12'; -$lang['TZ']['-11'] = 'GMT - 11'; -$lang['TZ']['-10'] = 'GMT - 10'; -$lang['TZ']['-9'] = 'GMT - 9'; -$lang['TZ']['-8'] = 'GMT - 8'; -$lang['TZ']['-7'] = 'GMT - 7'; -$lang['TZ']['-6'] = 'GMT - 6'; -$lang['TZ']['-5'] = 'GMT - 5'; -$lang['TZ']['-4'] = 'GMT - 4'; -$lang['TZ']['-3.5'] = 'GMT - 3:30'; -$lang['TZ']['-3'] = 'GMT - 3'; -$lang['TZ']['-2'] = 'GMT - 2'; -$lang['TZ']['-1'] = 'GMT - 1'; -$lang['TZ']['0'] = 'GMT (время по Гринвичу)'; -$lang['TZ']['1'] = 'GMT + 1'; -$lang['TZ']['2'] = 'GMT + 2'; -$lang['TZ']['3'] = 'GMT + 3'; -$lang['TZ']['3.5'] = 'GMT + 3:30'; -$lang['TZ']['4'] = 'GMT + 4 (Московское время)'; -$lang['TZ']['4.5'] = 'GMT + 4:30'; -$lang['TZ']['5'] = 'GMT + 5'; -$lang['TZ']['5.5'] = 'GMT + 5:30'; -$lang['TZ']['6'] = 'GMT + 6'; -$lang['TZ']['6.5'] = 'GMT + 6:30'; -$lang['TZ']['7'] = 'GMT + 7'; -$lang['TZ']['8'] = 'GMT + 8'; -$lang['TZ']['9'] = 'GMT + 9'; -$lang['TZ']['9.5'] = 'GMT + 9:30'; -$lang['TZ']['10'] = 'GMT + 10'; -$lang['TZ']['11'] = 'GMT + 11'; -$lang['TZ']['12'] = 'GMT + 12'; -$lang['TZ']['13'] = 'GMT + 13'; +$lang['TZ']['-12'] = 'UTC - 12'; +$lang['TZ']['-11'] = 'UTC - 11'; +$lang['TZ']['-10'] = 'UTC - 10'; +$lang['TZ']['-9'] = 'UTC - 9'; +$lang['TZ']['-8'] = 'UTC - 8'; +$lang['TZ']['-7'] = 'UTC - 7'; +$lang['TZ']['-6'] = 'UTC - 6'; +$lang['TZ']['-5'] = 'UTC - 5'; +$lang['TZ']['-4'] = 'UTC - 4'; +$lang['TZ']['-3.5'] = 'UTC - 3:30'; +$lang['TZ']['-3'] = 'UTC - 3'; +$lang['TZ']['-2'] = 'UTC - 2'; +$lang['TZ']['-1'] = 'UTC - 1'; +$lang['TZ']['0'] = 'UTC ± 0'; +$lang['TZ']['1'] = 'UTC + 1'; +$lang['TZ']['2'] = 'UTC + 2'; +$lang['TZ']['3'] = 'UTC + 3'; +$lang['TZ']['3.5'] = 'UTC + 3:30'; +$lang['TZ']['4'] = 'UTC + 4 (Московское время)'; +$lang['TZ']['4.5'] = 'UTC + 4:30'; +$lang['TZ']['5'] = 'UTC + 5'; +$lang['TZ']['5.5'] = 'UTC + 5:30'; +$lang['TZ']['6'] = 'UTC + 6'; +$lang['TZ']['6.5'] = 'UTC + 6:30'; +$lang['TZ']['7'] = 'UTC + 7'; +$lang['TZ']['8'] = 'UTC + 8'; +$lang['TZ']['9'] = 'UTC + 9'; +$lang['TZ']['9.5'] = 'UTC + 9:30'; +$lang['TZ']['10'] = 'UTC + 10'; +$lang['TZ']['11'] = 'UTC + 11'; +$lang['TZ']['12'] = 'UTC + 12'; +$lang['TZ']['13'] = 'UTC + 13'; $lang['DATETIME']['TODAY'] = 'Сегодня, в'; $lang['DATETIME']['YESTERDAY'] = 'Вчера, в'; @@ -1784,7 +1791,7 @@ $lang['USER_LEVELS_UPDATED'] = 'Уровни и права пользовате $lang['SYNCHRONIZE'] = 'Синхронизировать'; $lang['TOPICS_DATA_SYNCHRONIZED'] = 'Темы синхронизированы'; $lang['USER_POSTS_COUNT'] = 'Количество сообщений пользователей'; -$lang['USER POSTS COUNT SYNCHRONIZED'] = 'Количество сообщений пользователей синхронизированы'; +$lang['USER_POSTS_COUNT_SYNCHRONIZED'] = 'Количество сообщений пользователей синхронизировано'; // Online Userlist $lang['SHOW_ONLINE_USERLIST'] = 'Показать список пользователей онлайн'; @@ -2893,7 +2900,7 @@ $lang['SEARCH_FOR_USERFIELD_OCCUPATION'] = 'Поиск пользователе $lang['SEARCH_FOR_LASTVISITED_INTHELAST'] = 'Поиск пользователей, посетивших трекер в последние %s %s'; $lang['SEARCH_FOR_LASTVISITED_AFTERTHELAST'] = 'Поиск пользователей, посетивших трекер после %s %s'; $lang['SEARCH_FOR_LANGUAGE'] = 'Поиск пользователей, у которых выбран %s язык'; -$lang['SEARCH_FOR_TIMEZONE'] = 'Поиск пользователей с часовым поясом GMT %s'; +$lang['SEARCH_FOR_TIMEZONE'] = 'Поиск пользователей с часовым поясом UTC %s'; $lang['SEARCH_FOR_STYLE'] = 'Поиск пользователей, использующих стиль %s'; $lang['SEARCH_FOR_MODERATORS'] = 'Поиск модареторов форума -> %s'; $lang['SEARCH_USERS_ADVANCED'] = 'Расширенный поиск пользователя'; diff --git a/upload/language/ua/main.php b/upload/language/ua/main.php index 4f0a45782..4a011ed2b 100644 --- a/upload/language/ua/main.php +++ b/upload/language/ua/main.php @@ -103,6 +103,13 @@ $lang['DATASTORE'] = 'Datastore'; $lang['DATASTORE_CLEARED'] = 'Datastore очищено'; $lang['BOARD_DISABLE'] = 'Вибачте, цей форум відключений. Спробуйте зайти пізніше'; $lang['BOARD_DISABLE_CRON'] = 'Форум відключений на технічне обслуговування. Спробуйте зайти пізніше'; +$lang['ADMIN_DISABLE'] = 'форум відключений адміністратором, ви можете включити його в будь-який час'; +$lang['ADMIN_DISABLE_CRON'] = 'форум заблокований тригером cron-завдань, ви можете зняти блокування в будь-який час'; +$lang['ADMIN_DISABLE_TITLE'] = 'Форум відключений'; +$lang['ADMIN_DISABLE_CRON_TITLE'] = 'Форум відключений на технічне обслуговування'; +$lang['ADMIN_UNLOCK'] = 'Включити форум'; +$lang['ADMIN_UNLOCKED'] = 'Розблоковано'; +$lang['ADMIN_UNLOCK_CRON'] = 'Зняти блокування'; $lang['LOADING'] = 'Завантаження...'; $lang['JUMPBOX_TITLE'] = 'Оберіть форум для переходу'; @@ -895,74 +902,74 @@ $lang['LOOKUP_IP'] = 'Показати хост для IP'; // // Timezones ... for display on each page // -$lang['ALL_TIMES'] = 'Часовий пояс: %s'; // This is followed by GMT and the timezone offset +$lang['ALL_TIMES'] = 'Часовий пояс: %s'; // This is followed by UTC and the timezone offset -$lang['-12'] = 'GMT - 12'; -$lang['-11'] = 'GMT - 11'; -$lang['-10'] = 'GMT - 10'; -$lang['-9'] = 'GMT - 9'; -$lang['-8'] = 'GMT - 8'; -$lang['-7'] = 'GMT - 7'; -$lang['-6'] = 'GMT - 6'; -$lang['-5'] = 'GMT - 5'; -$lang['-4'] = 'GMT - 4'; -$lang['-3.5'] = 'GMT - 3:30'; -$lang['-3'] = 'GMT - 3'; -$lang['-2'] = 'GMT - 2'; -$lang['-1'] = 'GMT - 1'; -$lang['0'] = 'GMT'; -$lang['1'] = 'GMT + 1'; -$lang['2'] = 'GMT + 2'; -$lang['3'] = 'GMT + 3'; -$lang['3.5'] = 'GMT + 3:30'; -$lang['4'] = 'GMT + 4'; -$lang['4.5'] = 'GMT + 4:30'; -$lang['5'] = 'GMT + 5'; -$lang['5.5'] = 'GMT + 5:30'; -$lang['6'] = 'GMT + 6'; -$lang['6.5'] = 'GMT + 6:30'; -$lang['7'] = 'GMT + 7'; -$lang['8'] = 'GMT + 8'; -$lang['9'] = 'GMT + 9'; -$lang['9.5'] = 'GMT + 9:30'; -$lang['10'] = 'GMT + 10'; -$lang['11'] = 'GMT + 11'; -$lang['12'] = 'GMT + 12'; -$lang['13'] = 'GMT + 13'; +$lang['-12'] = 'UTC - 12'; +$lang['-11'] = 'UTC - 11'; +$lang['-10'] = 'UTC - 10'; +$lang['-9'] = 'UTC - 9'; +$lang['-8'] = 'UTC - 8'; +$lang['-7'] = 'UTC - 7'; +$lang['-6'] = 'UTC - 6'; +$lang['-5'] = 'UTC - 5'; +$lang['-4'] = 'UTC - 4'; +$lang['-3.5'] = 'UTC - 3:30'; +$lang['-3'] = 'UTC - 3'; +$lang['-2'] = 'UTC - 2'; +$lang['-1'] = 'UTC - 1'; +$lang['0'] = 'UTC ± 0'; +$lang['1'] = 'UTC + 1'; +$lang['2'] = 'UTC + 2'; +$lang['3'] = 'UTC + 3'; +$lang['3.5'] = 'UTC + 3:30'; +$lang['4'] = 'UTC + 4'; +$lang['4.5'] = 'UTC + 4:30'; +$lang['5'] = 'UTC + 5'; +$lang['5.5'] = 'UTC + 5:30'; +$lang['6'] = 'UTC + 6'; +$lang['6.5'] = 'UTC + 6:30'; +$lang['7'] = 'UTC + 7'; +$lang['8'] = 'UTC + 8'; +$lang['9'] = 'UTC + 9'; +$lang['9.5'] = 'UTC + 9:30'; +$lang['10'] = 'UTC + 10'; +$lang['11'] = 'UTC + 11'; +$lang['12'] = 'UTC + 12'; +$lang['13'] = 'UTC + 13'; // це для випадного меню, раніше тут ще були міста -$lang['TZ']['-12'] = 'GMT - 12'; -$lang['TZ']['-11'] = 'GMT - 11'; -$lang['TZ']['-10'] = 'GMT - 10'; -$lang['TZ']['-9'] = 'GMT - 9'; -$lang['TZ']['-8'] = 'GMT - 8'; -$lang['TZ']['-7'] = 'GMT - 7'; -$lang['TZ']['-6'] = 'GMT - 6'; -$lang['TZ']['-5'] = 'GMT - 5'; -$lang['TZ']['-4'] = 'GMT - 4'; -$lang['TZ']['-3.5'] = 'GMT - 3:30'; -$lang['TZ']['-3'] = 'GMT - 3'; -$lang['TZ']['-2'] = 'GMT - 2'; -$lang['TZ']['-1'] = 'GMT - 1'; -$lang['TZ']['0'] = 'GMT (час по Грінвічу)'; -$lang['TZ']['1'] = 'GMT + 1'; -$lang['TZ']['2'] = 'GMT + 2'; -$lang['TZ']['3'] = 'GMT + 3 (Київський час)'; -$lang['TZ']['3.5'] = 'GMT + 3:30'; -$lang['TZ']['4'] = 'GMT + 4'; -$lang['TZ']['4.5'] = 'GMT + 4:30'; -$lang['TZ']['5'] = 'GMT + 5'; -$lang['TZ']['5.5'] = 'GMT + 5:30'; -$lang['TZ']['6'] = 'GMT + 6'; -$lang['TZ']['6.5'] = 'GMT + 6:30'; -$lang['TZ']['7'] = 'GMT + 7'; -$lang['TZ']['8'] = 'GMT + 8'; -$lang['TZ']['9'] = 'GMT + 9'; -$lang['TZ']['9.5'] = 'GMT + 9:30'; -$lang['TZ']['10'] = 'GMT + 10'; -$lang['TZ']['11'] = 'GMT + 11'; -$lang['TZ']['12'] = 'GMT + 12'; -$lang['TZ']['13'] = 'GMT + 13'; +$lang['TZ']['-12'] = 'UTC - 12'; +$lang['TZ']['-11'] = 'UTC - 11'; +$lang['TZ']['-10'] = 'UTC - 10'; +$lang['TZ']['-9'] = 'UTC - 9'; +$lang['TZ']['-8'] = 'UTC - 8'; +$lang['TZ']['-7'] = 'UTC - 7'; +$lang['TZ']['-6'] = 'UTC - 6'; +$lang['TZ']['-5'] = 'UTC - 5'; +$lang['TZ']['-4'] = 'UTC - 4'; +$lang['TZ']['-3.5'] = 'UTC - 3:30'; +$lang['TZ']['-3'] = 'UTC - 3'; +$lang['TZ']['-2'] = 'UTC - 2'; +$lang['TZ']['-1'] = 'UTC - 1'; +$lang['TZ']['0'] = 'UTC ± 0'; +$lang['TZ']['1'] = 'UTC + 1'; +$lang['TZ']['2'] = 'UTC + 2'; +$lang['TZ']['3'] = 'UTC + 3 (Київський час)'; +$lang['TZ']['3.5'] = 'UTC + 3:30'; +$lang['TZ']['4'] = 'UTC + 4'; +$lang['TZ']['4.5'] = 'UTC + 4:30'; +$lang['TZ']['5'] = 'UTC + 5'; +$lang['TZ']['5.5'] = 'UTC + 5:30'; +$lang['TZ']['6'] = 'UTC + 6'; +$lang['TZ']['6.5'] = 'UTC + 6:30'; +$lang['TZ']['7'] = 'UTC + 7'; +$lang['TZ']['8'] = 'UTC + 8'; +$lang['TZ']['9'] = 'UTC + 9'; +$lang['TZ']['9.5'] = 'UTC + 9:30'; +$lang['TZ']['10'] = 'UTC + 10'; +$lang['TZ']['11'] = 'UTC + 11'; +$lang['TZ']['12'] = 'UTC + 12'; +$lang['TZ']['13'] = 'UTC + 13'; $lang['DATETIME']['TODAY'] = 'Сьогодні, в'; $lang['DATETIME']['YESTERDAY'] = 'Вчора, в'; @@ -1784,7 +1791,7 @@ $lang['USER_LEVELS_UPDATED'] = 'Рівні та права користувач $lang['SYNCHRONIZE'] = 'Синхронізувати'; $lang['TOPICS_DATA_SYNCHRONIZED'] = 'Теми синхронізовані'; $lang['USER_POSTS_COUNT'] = 'Кількість повідомлень користувачів'; -$lang['USER POSTS COUNT SYNCHRONIZED'] = 'Кількість повідомлень користувачів синхронізовані'; +$lang['USER_POSTS_COUNT_SYNCHRONIZED'] = 'Кількість повідомлень користувачів синхронізовано'; // Online Userlist $lang['SHOW_ONLINE_USERLIST'] = 'Показувати список користувачів онлайн'; @@ -2893,7 +2900,7 @@ $lang['SEARCH_FOR_USERFIELD_OCCUPATION'] = 'Пошук користувачів $lang['SEARCH_FOR_LASTVISITED_INTHELAST'] = 'Пошук користувачів, що відвідали трекер в останні %s %s'; $lang['SEARCH_FOR_LASTVISITED_AFTERTHELAST'] = 'Пошук користувачів, що відвідали трекер після %s %s'; $lang['SEARCH_FOR_LANGUAGE'] = 'Пошук користувачів, у яких обрана %s мова'; -$lang['SEARCH_FOR_TIMEZONE'] = 'Пошук користувачів з годинним поясом GMT %s'; +$lang['SEARCH_FOR_TIMEZONE'] = 'Пошук користувачів з годинним поясом UTC %s'; $lang['SEARCH_FOR_STYLE'] = 'Пошук користувачів, які використовують стиль %s'; $lang['SEARCH_FOR_MODERATORS'] = 'Пошук модераторів форуму -> %s'; $lang['SEARCH_USERS_ADVANCED'] = 'Розширений пошук користувача'; diff --git a/upload/posting.php b/upload/posting.php index 922229a2e..1eee18c3e 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -671,7 +671,7 @@ $template->assign_vars(array( 'SUBJECT' => $subject, 'MESSAGE' => $message, - 'U_VIEWTOPIC' => ( $mode == 'reply' ) ? POST_URL ."$topic_id&postorder=desc" : '', + 'U_VIEWTOPIC' => ( $mode == 'reply' ) ? TOPIC_URL . $topic_id . "&postorder=desc" : '', 'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '', 'S_TYPE_TOGGLE' => $topic_type_toggle, diff --git a/upload/stats/tracker.php b/upload/stats/tracker.php index e2018cbea..2c847eb6e 100644 --- a/upload/stats/tracker.php +++ b/upload/stats/tracker.php @@ -4,6 +4,10 @@ define('IN_ADMIN', true); define('BB_ROOT', './../'); require(BB_ROOT .'common.php'); +$user->session_start(); + +if (!IS_ADMIN) die('Unauthorized'); + $peers_in_last_minutes = array(30, 15, 5, 1); $peers_in_last_sec_limit = 300; diff --git a/upload/templates/admin/index.tpl b/upload/templates/admin/index.tpl index bf07ee500..14641d9ae 100644 --- a/upload/templates/admin/index.tpl +++ b/upload/templates/admin/index.tpl @@ -70,10 +70,28 @@ ajax.callback.manage_admin = function(data) { $('#update_user_level').html(data.update_user_level_html); $('#sync_topics').html(data.sync_topics_html); $('#sync_user_posts').html(data.sync_user_posts_html); + $('#unlock_cron').html(data.unlock_cron_html); } +
+ +
+

{L_ADMIN_DISABLE_CRON_TITLE}


+ {L_ADMIN_UNLOCK_CRON} + ({L_ADMIN_DISABLE_CRON}) +
+ + + +
+

{L_ADMIN_DISABLE_TITLE}


+ {L_ADMIN_UNLOCK} + ({L_ADMIN_DISABLE}) +
+ + diff --git a/upload/viewforum.php b/upload/viewforum.php index 87f012a21..3cbee8594 100644 --- a/upload/viewforum.php +++ b/upload/viewforum.php @@ -69,7 +69,7 @@ if (!$is_auth['auth_view']) if (IS_GUEST) { $redirect = ($start) ? "&start=$start" : ''; - redirect(LOGIN_URL . "?redirect=". FORUM_URL . $forum_id ."&$redirect"); + redirect(LOGIN_URL . "?redirect=". FORUM_URL . $forum_id . $redirect); } // The user is not authed to read this forum ... $message = sprintf($lang['SORRY_AUTH_VIEW'], $is_auth['auth_view_type']); @@ -268,7 +268,7 @@ if (!empty($_REQUEST['topicdays'])) SELECT COUNT(*) AS forum_topics FROM ". BB_TOPICS ." WHERE forum_id = $forum_id - AND topic_last_post_time > ". (TIMENOW - 86400*$req_topic_days) ." + AND topic_last_post_time > ". (TIMENOW - 86400 * $req_topic_days) ." "; if ($row = DB()->fetch_row($sql)) @@ -492,7 +492,7 @@ foreach ($topic_rowset as $topic) 'VIEWS' => $topic['topic_views'], 'TOR_STALED' => ($forum_data['allow_reg_tracker'] && !($t_type == POST_ANNOUNCE || $t_type == POST_STICKY || $topic['tor_size'])), 'TOR_FROZEN' => isset($topic['tor_status']) ? ((!IS_AM) ? isset($bb_cfg['tor_frozen'][$topic['tor_status']]) : '') : '', - 'TOR_TYPE' => is_gold($topic['tor_type']), + 'TOR_TYPE' => isset($topic['tor_type']) ? is_gold($topic['tor_type']) : '', 'TOR_STATUS_ICON' => isset($topic['tor_status']) ? $bb_cfg['tor_icons'][$topic['tor_status']] : '', 'TOR_STATUS_TEXT' => isset($topic['tor_status']) ? $lang['TOR_STATUS_NAME'][$topic['tor_status']] : '', diff --git a/upload/viewtopic.php b/upload/viewtopic.php index 3e85082ef..7f884761d 100644 --- a/upload/viewtopic.php +++ b/upload/viewtopic.php @@ -313,7 +313,7 @@ if ($bb_cfg['topic_notify_enabled']) { if ($_GET['unwatch'] == 'topic') { - redirect(LOGIN_URL . "?redirect=". TOPIC_URL . "$topic_id&unwatch=topic"); + redirect(LOGIN_URL . "?redirect=" . TOPIC_URL . "$topic_id&unwatch=topic"); } } } @@ -432,11 +432,11 @@ if ( count($orig_word) ) // Post, reply and other URL generation for // templating vars // -$new_topic_url = POSTING_URL . "?mode=newtopic&f=$forum_id"; -$reply_topic_url = POSTING_URL . "?mode=reply&t=$topic_id"; +$new_topic_url = POSTING_URL . "?mode=newtopic&f=" . $forum_id; +$reply_topic_url = POSTING_URL . "?mode=reply&t=" . $topic_id; $view_forum_url = FORUM_URL . $forum_id; -$view_prev_topic_url = TOPIC_URL ."$topic_id&view=previous#newest"; -$view_next_topic_url = TOPIC_URL ."$topic_id&view=next#newest"; +$view_prev_topic_url = TOPIC_URL . $topic_id . "&view=previous#newest"; +$view_next_topic_url = TOPIC_URL . $topic_id . "&view=next#newest"; $reply_img = ( $t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED) ? $images['reply_locked'] : $images['reply_new']; $reply_alt = ( $t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED) ? $lang['TOPIC_LOCKED_SHORT'] : $lang['REPLY_TO_TOPIC']; @@ -447,17 +447,17 @@ $template->set_filenames(array('body' => 'viewtopic.tpl')); // // User authorisation levels output // -$s_auth_can = ( ( $is_auth['auth_post'] ) ? $lang['RULES_POST_CAN'] : $lang['RULES_POST_CANNOT'] ) . '
'; -$s_auth_can .= ( ( $is_auth['auth_reply'] ) ? $lang['RULES_REPLY_CAN'] : $lang['RULES_REPLY_CANNOT'] ) . '
'; -$s_auth_can .= ( ( $is_auth['auth_edit'] ) ? $lang['RULES_EDIT_CAN'] : $lang['RULES_EDIT_CANNOT'] ) . '
'; -$s_auth_can .= ( ( $is_auth['auth_delete'] ) ? $lang['RULES_DELETE_CAN'] : $lang['RULES_DELETE_CANNOT'] ) . '
'; -$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['RULES_VOTE_CAN'] : $lang['RULES_VOTE_CANNOT'] ) . '
'; -$s_auth_can .= ( ($is_auth['auth_attachments'] ) ? $lang['RULES_ATTACH_CAN'] : $lang['RULES_ATTACH_CANNOT'] ) . '
'; -$s_auth_can .= ( ($is_auth['auth_download'] ) ? $lang['RULES_DOWNLOAD_CAN'] : $lang['RULES_DOWNLOAD_CANNOT'] ) . '
'; +$s_auth_can = (($is_auth['auth_post']) ? $lang['RULES_POST_CAN'] : $lang['RULES_POST_CANNOT']) . '
'; +$s_auth_can .= (($is_auth['auth_reply']) ? $lang['RULES_REPLY_CAN'] : $lang['RULES_REPLY_CANNOT']) . '
'; +$s_auth_can .= (($is_auth['auth_edit']) ? $lang['RULES_EDIT_CAN'] : $lang['RULES_EDIT_CANNOT']) . '
'; +$s_auth_can .= (($is_auth['auth_delete']) ? $lang['RULES_DELETE_CAN'] : $lang['RULES_DELETE_CANNOT']) . '
'; +$s_auth_can .= (($is_auth['auth_vote']) ? $lang['RULES_VOTE_CAN'] : $lang['RULES_VOTE_CANNOT']) . '
'; +$s_auth_can .= (($is_auth['auth_attachments']) ? $lang['RULES_ATTACH_CAN'] : $lang['RULES_ATTACH_CANNOT']) . '
'; +$s_auth_can .= (($is_auth['auth_download']) ? $lang['RULES_DOWNLOAD_CAN'] : $lang['RULES_DOWNLOAD_CANNOT']) . '
'; $topic_mod = ''; -if ( $is_auth['auth_mod'] ) +if ($is_auth['auth_mod']) { $s_auth_can .= $lang['RULES_MODERATE']; $topic_mod .= "' . $lang['DELETE_TOPIC'] . ' '; @@ -514,17 +514,17 @@ if ($report_topic && $report_topic->auth_check('auth_write')) // Topic watch information // $s_watching_topic = $s_watching_topic_img = ''; -if ( $can_watch_topic ) +if ($can_watch_topic) { - if ( $is_watching_topic ) + if ($is_watching_topic) { - $s_watching_topic = "' . $lang['STOP_WATCHING_TOPIC'] . ''; - $s_watching_topic_img = ( isset($images['topic_un_watch']) ) ? "' . $lang['STOP_WATCHING_TOPIC'] . '' : ''; + $s_watching_topic = "' . $lang['STOP_WATCHING_TOPIC'] . ''; + $s_watching_topic_img = (isset($images['topic_un_watch'])) ? "' . $lang['STOP_WATCHING_TOPIC'] . '' : ''; } else { - $s_watching_topic = "' . $lang['START_WATCHING_TOPIC'] . ''; - $s_watching_topic_img = ( isset($images['Topic_watch']) ) ? "' . $lang['START_WATCHING_TOPIC'] . '' : ''; + $s_watching_topic = "' . $lang['START_WATCHING_TOPIC'] . ''; + $s_watching_topic_img = (isset($images['Topic_watch'])) ? "' . $lang['START_WATCHING_TOPIC'] . '' : ''; } } @@ -601,7 +601,7 @@ $template->assign_vars(array( 'S_SELECT_POST_DAYS' => build_select('postdays', array_flip($sel_previous_days), $post_days), 'S_SELECT_POST_ORDER' => build_select('postorder', $sel_post_order_ary, $post_order), - 'S_POST_DAYS_ACTION' => TOPIC_URL ."$topic_id&start=$start", + 'S_POST_DAYS_ACTION' => TOPIC_URL . $topic_id . "&start=$start", 'S_AUTH_LIST' => $s_auth_can, 'S_TOPIC_ADMIN' => $topic_mod, 'S_WATCH_TOPIC' => $s_watching_topic, From 01933955e157a0e5a4609f4355bda594de556180 Mon Sep 17 00:00:00 2001 From: Exile Date: Mon, 11 Aug 2014 22:01:47 +0400 Subject: [PATCH 08/24] Less fonts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Уменьшаем базовое число доступных шрифтов. --- upload/includes/bbcode.php | 2 +- upload/templates/default/posting_editor.tpl | 40 +++++++++------------ 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/upload/includes/bbcode.php b/upload/includes/bbcode.php index b693ab78c..73c0ff20a 100644 --- a/upload/includes/bbcode.php +++ b/upload/includes/bbcode.php @@ -498,7 +498,7 @@ class bbcode function init_replacements () { $tpl = $this->tpl; - $img_url_exp = '(https?:)?//[^\s\?&;=\#\"<>]+?\.(jpg|jpeg|gif|png)([a-z0-9/?&%;][^\[\]]*)?'; + $img_url_exp = '(https?:)?//[^\s\?&;=\#\"<>]+?\.(jpg|jpeg|gif|png)([a-z0-9/?&%;][^\[\]]*)?'; $email_exp = '[a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+'; $url_exp = '[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+?'; diff --git a/upload/templates/default/posting_editor.tpl b/upload/templates/default/posting_editor.tpl index 2b2eeabef..7d5d8838b 100644 --- a/upload/templates/default/posting_editor.tpl +++ b/upload/templates/default/posting_editor.tpl @@ -1,31 +1,25 @@
      From 5470d8a289bca4d192ce2a3faf7418d030b4898a Mon Sep 17 00:00:00 2001 From: Exile Date: Tue, 12 Aug 2014 13:16:02 +0400 Subject: [PATCH 09/24] Forums' map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлена карта форумов. --- upload/index.php | 4 ++ upload/language/en/main.php | 4 +- upload/language/ru/main.php | 4 +- upload/language/ua/main.php | 4 +- upload/templates/default/index.tpl | 20 +++++-- upload/templates/default/index_map.tpl | 77 ++++++++++++++++++++++++++ 6 files changed, 104 insertions(+), 9 deletions(-) create mode 100644 upload/templates/default/index_map.tpl diff --git a/upload/index.php b/upload/index.php index 4358fb7ec..d09d198f8 100644 --- a/upload/index.php +++ b/upload/index.php @@ -280,6 +280,7 @@ foreach ($cat_forums as $cid => $c) $template->assign_vars(array( 'SHOW_FORUMS' => $forums_count, + 'SHOW_MAP' => isset($_GET['map']) ? true : false, 'PAGE_TITLE' => ($viewcat) ? $cat_title_html[$viewcat] : $lang['HOME'], 'NO_FORUMS_MSG' => ($only_new) ? $lang['NO_NEW_POSTS'] : $lang['NO_FORUMS'], @@ -427,4 +428,7 @@ if (IS_AM) // Display page define('SHOW_ONLINE', $show_online_users); + +if (isset($_GET['map'])) $template->assign_vars(array('PAGE_TITLE' => $lang['FORUM_MAP'])); + print_page('index.tpl'); \ No newline at end of file diff --git a/upload/language/en/main.php b/upload/language/en/main.php index 11c470b06..463c9f3be 100644 --- a/upload/language/en/main.php +++ b/upload/language/en/main.php @@ -2995,4 +2995,6 @@ $lang['SITEMAP_BING_2'] = 'Add sitemap of site you registered in its settings.'; $lang['SITEMAP_ADD_TITLE'] = 'Additional pages for sitemap'; $lang['SITEMAP_ADD_PAGE'] = 'Additional pages'; $lang['SITEMAP_ADD_EXP_1'] = 'You can specify additional pages on your site (for example, http://torrentpier.me/memberlist.php) which should be included in your sitemap file that you creating.'; -$lang['SITEMAP_ADD_EXP_2'] = 'Each reference must begin with http(s):// and a new line!'; \ No newline at end of file +$lang['SITEMAP_ADD_EXP_2'] = 'Each reference must begin with http(s):// and a new line!'; + +$lang['FORUM_MAP'] = 'Forums\' map'; \ No newline at end of file diff --git a/upload/language/ru/main.php b/upload/language/ru/main.php index 1a1828a55..505c9b50b 100644 --- a/upload/language/ru/main.php +++ b/upload/language/ru/main.php @@ -2995,4 +2995,6 @@ $lang['SITEMAP_BING_2'] = 'Добавьте файл sitemap зарегистр $lang['SITEMAP_ADD_TITLE'] = 'Дополнительные страницы для sitemap'; $lang['SITEMAP_ADD_PAGE'] = 'Дополнительные страницы'; $lang['SITEMAP_ADD_EXP_1'] = 'Здесь вы можете указать дополнительные страницы сайта (например http://torrentpier.me/memberlist.php), которые должны быть включены в создаваемый файл вами файл sitemap.'; -$lang['SITEMAP_ADD_EXP_2'] = 'Каждая ссылка должна начинаться с http(s):// и новой строки!'; \ No newline at end of file +$lang['SITEMAP_ADD_EXP_2'] = 'Каждая ссылка должна начинаться с http(s):// и новой строки!'; + +$lang['FORUM_MAP'] = 'Карта форумов'; \ No newline at end of file diff --git a/upload/language/ua/main.php b/upload/language/ua/main.php index 4a011ed2b..d13dc3799 100644 --- a/upload/language/ua/main.php +++ b/upload/language/ua/main.php @@ -2995,4 +2995,6 @@ $lang['SITEMAP_BING_2'] = 'Додайте файл sitemap зареєстров $lang['SITEMAP_ADD_TITLE'] = 'Додаткові сторінки для sitemap'; $lang['SITEMAP_ADD_PAGE'] = 'Додаткові сторінки'; $lang['SITEMAP_ADD_EXP_1'] = 'Тут ви можете вказати додаткові сторінки сайту (наприклад http://torrentpier.me/memberlist.php), які повинні бути включені в створюваний файл вами файл sitemap.'; -$lang['SITEMAP_ADD_EXP_2'] = 'Кожне посилання має починатись з http(s):// і нової рядки!'; \ No newline at end of file +$lang['SITEMAP_ADD_EXP_2'] = 'Кожне посилання має починатись з http(s):// і нової рядки!'; + +$lang['FORUM_MAP'] = 'Карта форумів'; \ No newline at end of file diff --git a/upload/templates/default/index.tpl b/upload/templates/default/index.tpl index c7f718a49..8449842fe 100644 --- a/upload/templates/default/index.tpl +++ b/upload/templates/default/index.tpl @@ -12,9 +12,10 @@
{L_CLEAR_CACHE}:
@@ -179,11 +187,11 @@ };
-

{WHOSBIRTHDAY_TODAY}

-

{WHOSBIRTHDAY_WEEK}

+

{WHOSBIRTHDAY_TODAY}

+

{WHOSBIRTHDAY_WEEK}

-
+

{TOTAL_USERS_ONLINE}  {USERS_ONLINE_COUNTS}

{RECORD_USERS}

diff --git a/upload/templates/default/index_map.tpl b/upload/templates/default/index_map.tpl new file mode 100644 index 000000000..b5fdd5a19 --- /dev/null +++ b/upload/templates/default/index_map.tpl @@ -0,0 +1,77 @@ + + + + +
+
+
+
+ {L_FILTER_BY_NAME}:   + + +
+
{L_LOADING}
+ +
+
+
\ No newline at end of file From 49393a24582c7f02f3077e784bdc912bf5cb926d Mon Sep 17 00:00:00 2001 From: Exile Date: Tue, 12 Aug 2014 13:31:25 +0400 Subject: [PATCH 10/24] Forums' map fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Небольшой фикс. --- upload/index.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/upload/index.php b/upload/index.php index d09d198f8..ce02d3415 100644 --- a/upload/index.php +++ b/upload/index.php @@ -280,7 +280,7 @@ foreach ($cat_forums as $cid => $c) $template->assign_vars(array( 'SHOW_FORUMS' => $forums_count, - 'SHOW_MAP' => isset($_GET['map']) ? true : false, + 'SHOW_MAP' => isset($_GET['map']), 'PAGE_TITLE' => ($viewcat) ? $cat_title_html[$viewcat] : $lang['HOME'], 'NO_FORUMS_MSG' => ($only_new) ? $lang['NO_NEW_POSTS'] : $lang['NO_FORUMS'], @@ -428,7 +428,6 @@ if (IS_AM) // Display page define('SHOW_ONLINE', $show_online_users); - if (isset($_GET['map'])) $template->assign_vars(array('PAGE_TITLE' => $lang['FORUM_MAP'])); print_page('index.tpl'); \ No newline at end of file From 683b86bf5c41ba82734a1a097e1f5d97e6724da3 Mon Sep 17 00:00:00 2001 From: Exile Date: Tue, 12 Aug 2014 14:07:38 +0400 Subject: [PATCH 11/24] Atom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Начинаем добавлять поддержку генерации atom-лент. --- install/sql/mysql.sql | 1 + upload/atom/.keep | 0 upload/config.php | 17 +- upload/feed.php | 68 +++++++ .../includes/cron/jobs/update_forums_atom.php | 29 +++ upload/includes/functions_atom.php | 186 ++++++++++++++++++ 6 files changed, 296 insertions(+), 5 deletions(-) create mode 100644 upload/atom/.keep create mode 100644 upload/feed.php create mode 100644 upload/includes/cron/jobs/update_forums_atom.php create mode 100644 upload/includes/functions_atom.php diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index 66c0e5ab7..13427eb50 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -645,6 +645,7 @@ INSERT INTO `bb_cron` VALUES (19, 1, 'Captcha', 'captcha_gen_gc.php', 'daily', N INSERT INTO `bb_cron` VALUES (20, 1, 'Tracker dl-complete count', 'tr_complete_count.php', 'interval', NULL, NULL, 255, '', '', '06:00:00', 0, '', 0, 0, 0); INSERT INTO `bb_cron` VALUES (21, 1, 'Cache garbage collector', 'cache_gc.php', 'interval', NULL, NULL, 255, '', '', '00:05:00', 0, '', 0, 0, 0); INSERT INTO `bb_cron` VALUES (22, 1, 'Sitemap update', 'sitemap.php', 'daily', NULL, '06:00:00', 30, '', '', NULL, 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (23, 1, 'Update forums atom', 'update_forums_atom.php', 'interval', NULL, NULL, 255, '', '', '00:20:00', 0, '', 0, 0, 0); -- -------------------------------------------------------- diff --git a/upload/atom/.keep b/upload/atom/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/upload/config.php b/upload/config.php index 9371b61bd..0137e0ddf 100644 --- a/upload/config.php +++ b/upload/config.php @@ -56,6 +56,7 @@ * Avatars * Misc * Captcha + * Atom feed **/ if (!defined('BB_ROOT')) die(basename(__FILE__)); @@ -68,8 +69,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Version info $bb_cfg['tp_version'] = '2.0.9 (RC)'; -$bb_cfg['tp_release_date'] = '07-08-2014'; -$bb_cfg['tp_release_state'] = 'R594b'; +$bb_cfg['tp_release_date'] = '12-08-2014'; +$bb_cfg['tp_release_state'] = 'R595'; // Database $charset = 'utf8'; @@ -590,10 +591,16 @@ $bb_cfg['advert_url'] = 'misc.php?do=info&show=advert'; // Captcha $bb_cfg['captcha'] = array( - 'disabled' => false, + 'disabled' => false, 'secret_key' => 'secret_key', - 'img_url' => './images/captcha/', # without '/' - 'img_path' => BB_PATH .'/images/captcha/', # without '/' + 'img_url' => './images/captcha/', + 'img_path' => BB_PATH .'/images/captcha/', +); + +// Atom feed +$bb_cfg['atom'] = array( + 'path' => BB_PATH .'/atom/', + 'url' => "http://{$domain_name}/atom", ); define('BB_CFG_LOADED', true); \ No newline at end of file diff --git a/upload/feed.php b/upload/feed.php new file mode 100644 index 000000000..4dad7657b --- /dev/null +++ b/upload/feed.php @@ -0,0 +1,68 @@ +session_start(array('req_login' => true)); + +$mode = (string) @$_REQUEST['mode']; +$type = (string) @$_POST['type']; +$id = (int) @$_POST['id']; +$timecheck = TIMENOW - 600; + +if (!$mode) bb_simple_die('Not specified mode'); + +if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) +{ + if ($type == 'f') + { + // Check if the user has actually sent a forum ID + $sql = "SELECT allow_reg_tracker, forum_name FROM ". BB_FORUMS ." WHERE forum_id = $id LIMIT 1"; + if (!$forum_data = DB()->fetch_row($sql)) + { + if ($id == 0) + { + $forum_data = array(); + } + else bb_simple_die('Invalid type of query #1'); + } + if (file_exists($bb_cfg['atom']['path'] .'/f/'. $id .'.atom') && filemtime($bb_cfg['atom']['path'] .'/f/'. $id .'.atom') > $timecheck) + { + redirect($bb_cfg['atom']['url'] .'/f/'. $id .'.atom'); + } + else + { + require_once(INC_DIR .'functions_atom.php'); + if (update_forum_feed($id, $forum_data)) redirect($bb_cfg['atom']['url'] .'/f/'. $id .'.atom'); + else bb_simple_die('No feed for this forum (no topics)'); + } + } + if ($type == 'u') + { + // Check if the user has actually sent a user ID + if ($id < 1) + { + bb_simple_die('Invalid type of query #2'); + } + if (!$username = get_username($id)) + { + bb_simple_die('Invalid type of query #3'); + } + if (file_exists($bb_cfg['atom']['path'] .'/u/'. floor($id/5000000) .'/'. ($id % 100) .'/'. $id .'.atom') && filemtime($bb_cfg['atom']['path'] .'/u/'. floor($id/5000000) .'/'. ($id % 100) .'/'. $id .'.atom') > $timecheck) + { + redirect($bb_cfg['atom']['url'] .'/u/'. floor($id/5000000) .'/'. ($id % 100) .'/'. $id .'.atom'); + } + else + { + require_once(INC_DIR .'functions_atom.php'); + if (update_user_feed($id, $username)) redirect($bb_cfg['atom']['url'] .'/u/'. floor($id/5000000) .'/'. ($id % 100) .'/'. $id .'.atom'); + else bb_simple_die('No feed for this user (no topics)'); + } + } +} +else +{ + bb_simple_die('Invalid type of query #4'); +} \ No newline at end of file diff --git a/upload/includes/cron/jobs/update_forums_atom.php b/upload/includes/cron/jobs/update_forums_atom.php new file mode 100644 index 000000000..3c8384acc --- /dev/null +++ b/upload/includes/cron/jobs/update_forums_atom.php @@ -0,0 +1,29 @@ +fetch_rowset("SELECT forum_id, allow_reg_tracker, forum_name FROM ". BB_FORUMS); + +if (file_exists($bb_cfg['atom']['path'] .'/f/0.atom') && filemtime($bb_cfg['atom']['path'] .'/f/0.atom') > $timecheck) +{ +} +else +{ + update_forum_feed(0, $forums_data); +} + +foreach ($forums_data as $forum_data) +{ + if (file_exists($bb_cfg['atom']['path'] .'/f/'. $forum_data['forum_id'] .'.atom') && filemtime($bb_cfg['atom']['path'] .'/f/'. $forum_data['forum_id'] .'.atom') > $timecheck) + { + } + else + { + update_forum_feed($forum_data['forum_id'], $forum_data); + } +} diff --git a/upload/includes/functions_atom.php b/upload/includes/functions_atom.php new file mode 100644 index 000000000..2df190b7c --- /dev/null +++ b/upload/includes/functions_atom.php @@ -0,0 +1,186 @@ + 0 && $forum_data['allow_reg_tracker']) + { + $select_tor_sql = ', tor.size AS tor_size, tor.tor_status'; + $join_tor_sql = "LEFT JOIN ". BB_BT_TORRENTS ." tor ON(t.topic_id = tor.topic_id)"; + } + if ($forum_id == 0) + { + $sql = " + SELECT + t.topic_id, t.topic_title, t.topic_status, + u1.username AS first_username, + p1.post_time AS topic_first_post_time, p1.post_edit_time AS topic_first_post_edit_time, + p2.post_time AS topic_last_post_time, p2.post_edit_time AS topic_last_post_edit_time, + tor.size AS tor_size, tor.tor_status + FROM ". BB_BT_TORRENTS ." tor + LEFT JOIN ". BB_TOPICS ." t ON(tor.topic_id = t.topic_id) + LEFT JOIN ". BB_USERS ." u1 ON(t.topic_poster = u1.user_id) + LEFT JOIN ". BB_POSTS ." p1 ON(t.topic_first_post_id = p1.post_id) + LEFT JOIN ". BB_POSTS ." p2 ON(t.topic_last_post_id = p2.post_id) + ORDER BY t.topic_last_post_time DESC + LIMIT 100 + "; + } + else if ($forum_id > 0) + { + $sql = " + SELECT + t.topic_id, t.topic_title, t.topic_status, + u1.username AS first_username, + p1.post_time AS topic_first_post_time, p1.post_edit_time AS topic_first_post_edit_time, + p2.post_time AS topic_last_post_time, p2.post_edit_time AS topic_last_post_edit_time + $select_tor_sql + FROM ". BB_TOPICS ." t + LEFT JOIN ". BB_USERS ." u1 ON(t.topic_poster = u1.user_id) + LEFT JOIN ". BB_POSTS ." p1 ON(t.topic_first_post_id = p1.post_id) + LEFT JOIN ". BB_POSTS ." p2 ON(t.topic_last_post_id = p2.post_id) + $join_tor_sql + WHERE t.forum_id = $forum_id + ORDER BY t.topic_last_post_time DESC + LIMIT 50 + "; + } + $topics_tmp = DB()->fetch_rowset($sql); + $topics = array(); + foreach ($topics_tmp as $topic) + { + if (isset($topic['topic_status'])) + { + if ($topic['topic_status'] == TOPIC_MOVED) continue; + } + if (isset($topic['tor_status'])) + { + if (isset($bb_cfg['tor_frozen'][$topic['tor_status']])) continue; + } + $topics[] = $topic; + } + if (!count($topics)) + { + @unlink($file_path); + return false; + } + if (create_atom($file_path, 'f', $forum_id, htmlCHR($forum_data['forum_name']), $topics)) return true; + else return false; +} + +function update_user_feed ($user_id, $username) +{ + global $bb_cfg; + $file_path = $bb_cfg['atom']['path'] .'/u/'. floor($user_id/5000000) .'/'. ($user_id % 100) .'/'. $user_id .'.atom'; + $sql = " + SELECT + t.topic_id, t.topic_title, t.topic_status, + u1.username AS first_username, + p1.post_time AS topic_first_post_time, p1.post_edit_time AS topic_first_post_edit_time, + p2.post_time AS topic_last_post_time, p2.post_edit_time AS topic_last_post_edit_time, + tor.size AS tor_size, tor.tor_status + FROM ". BB_TOPICS ." t + LEFT JOIN ". BB_USERS ." u1 ON(t.topic_poster = u1.user_id) + LEFT JOIN ". BB_POSTS ." p1 ON(t.topic_first_post_id = p1.post_id) + LEFT JOIN ". BB_POSTS ." p2 ON(t.topic_last_post_id = p2.post_id) + LEFT JOIN ". BB_BT_TORRENTS ." tor ON(t.topic_id = tor.topic_id) + WHERE t.topic_poster = $user_id + ORDER BY t.topic_last_post_time DESC + LIMIT 50 + "; + $topics_tmp = DB()->fetch_rowset($sql); + $topics = array(); + foreach ($topics_tmp as $topic) + { + if (isset($topic['topic_status'])) + { + if ($topic['topic_status'] == TOPIC_MOVED) continue; + } + if (isset($topic['tor_status'])) + { + if (isset($bb_cfg['tor_frozen'][$topic['tor_status']])) continue; + } + $topics[] = $topic; + } + if (!count($topics)) + { + @unlink($file_path); + return false; + } + if (create_atom($file_path, 'u', $user_id, wbr($username), $topics)) return true; + else return false; +} + +function create_atom ($file_path, $mode, $id, $title, $topics) +{ + global $bb_cfg; + $dir = dirname($file_path); + if (!file_exists($dir)) + { + if (!bb_mkdir($dir)) return false; + } + foreach ($topics as $topic) + { + $last_time = $topic['topic_last_post_time']; + if ($topic['topic_last_post_edit_time']) $last_time = $topic['topic_last_post_edit_time']; + $date = bb_date($last_time, 'Y-m-d', 0); + $time = bb_date($last_time, 'H:i:s', 0); + break; + } + $atom = ""; + $atom .= "\n"; + $atom .= "\n"; + $atom .= "$title\n"; + $atom .= "". $date ."T$time+00:00\n"; + $atom .= "tag:rto.feed,2000:/$mode/$id\n"; + $atom .= "\n"; + foreach ($topics as $topic) + { + $topic_id = $topic['topic_id']; + $tor_size = ''; + if (isset($topic['tor_size'])) + { + $tor_size = str_replace(' ', ' ', ' ['. humn_size($topic['tor_size']) .']'); + } + $topic_title = $topic['topic_title']; + $orig_word = array(); + $replacement_word = array(); + obtain_word_list($orig_word, $replacement_word); + if ( count($orig_word) ) + { + $topic_title = preg_replace($orig_word, $replacement_word, $topic_title); + } + $topic_title = wbr($topic_title); + $author_name = ($topic['first_username']) ? wbr($topic['first_username']) : 'Гость'; + $last_time = $topic['topic_last_post_time']; + if ($topic['topic_last_post_edit_time']) $last_time = $topic['topic_last_post_edit_time']; + $date = bb_date($last_time, 'Y-m-d', 0); + $time = bb_date($last_time, 'H:i:s', 0); + $updated = ''; + $checktime = TIMENOW - 604800; // неделя + if ($topic['topic_first_post_edit_time'] && $topic['topic_first_post_edit_time'] > $checktime) $updated = '[Обновлено] '; + $atom .= "\n"; + $atom .= " <![CDATA[$updated$topic_title$tor_size]]>\n"; + $atom .= " \n"; + $atom .= " $author_name\n"; + $atom .= " \n"; + $atom .= " ". $date ."T$time+00:00\n"; + $atom .= " tag:rto.feed,". $date .":/t/$topic_id\n"; + $atom .= " \n"; + $atom .= "\n"; + } + $atom .= ""; + @unlink($file_path); + $fp = fopen($file_path, "w"); + fwrite($fp, $atom); + fclose ($fp); + return true; +} \ No newline at end of file From 63835dbe76f83bd8f900443db83e1ea69eaf4493 Mon Sep 17 00:00:00 2001 From: Exile Date: Tue, 12 Aug 2014 16:24:38 +0400 Subject: [PATCH 12/24] Atom picture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавляем картинку для ленты, вносим ее в переменные. --- README.md | 1 + .../includes/cron/jobs/update_forums_atom.php | 12 +++------ upload/templates/default/images/feed.png | Bin 0 -> 520 bytes upload/templates/default/index.tpl | 4 +-- upload/templates/default/tpl_config.php | 24 ++++++++---------- upload/templates/default/viewtopic_attach.tpl | 6 ++--- 6 files changed, 19 insertions(+), 28 deletions(-) create mode 100644 upload/templates/default/images/feed.png diff --git a/README.md b/README.md index d4978f077..d20c97984 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ TorrentPier II - движок торрент-трекера, написанны Исходя из настроек вашего сервера, устанавливаем рекомендуемые права доступа (chmod) на указанные папки **777**, а на файлы внутри этих папок (кроме файлов **.htaccess** и **.keep**) **666**: - ajax/html +- atom - cache - cache/filecache - files diff --git a/upload/includes/cron/jobs/update_forums_atom.php b/upload/includes/cron/jobs/update_forums_atom.php index 3c8384acc..eaf6bc73e 100644 --- a/upload/includes/cron/jobs/update_forums_atom.php +++ b/upload/includes/cron/jobs/update_forums_atom.php @@ -9,21 +9,15 @@ require_once(INC_DIR .'functions_atom.php'); $timecheck = TIMENOW - 600; $forums_data = DB()->fetch_rowset("SELECT forum_id, allow_reg_tracker, forum_name FROM ". BB_FORUMS); -if (file_exists($bb_cfg['atom']['path'] .'/f/0.atom') && filemtime($bb_cfg['atom']['path'] .'/f/0.atom') > $timecheck) -{ -} -else +if (!file_exists($bb_cfg['atom']['path'] .'/f/0.atom') && filemtime($bb_cfg['atom']['path'] .'/f/0.atom') <= $timecheck) { update_forum_feed(0, $forums_data); } foreach ($forums_data as $forum_data) { - if (file_exists($bb_cfg['atom']['path'] .'/f/'. $forum_data['forum_id'] .'.atom') && filemtime($bb_cfg['atom']['path'] .'/f/'. $forum_data['forum_id'] .'.atom') > $timecheck) - { - } - else + if (!file_exists($bb_cfg['atom']['path'] .'/f/'. $forum_data['forum_id'] .'.atom') && filemtime($bb_cfg['atom']['path'] .'/f/'. $forum_data['forum_id'] .'.atom') <= $timecheck) { update_forum_feed($forum_data['forum_id'], $forum_data); } -} +} \ No newline at end of file diff --git a/upload/templates/default/images/feed.png b/upload/templates/default/images/feed.png new file mode 100644 index 0000000000000000000000000000000000000000..917dd18c9f3563555d71a96ba768065fa27a7817 GIT binary patch literal 520 zcmV+j0{8uiP)TI}{|xUwfB*30%_m1DkYWY~1_1*l2?jP+W`-ZX{xJOd{g>g_ zpT7)${{90i25Ax#;1-Y)=H1T%R3re@z_6|+97HhyO<~w@{075{LsuBS{rnA946+Gi zhzK8-0JEf-PXox5)3=^6Jb(9vK}M91!OK*Y!NWv_;oP0)4DY}GfZGTHOkj5d-D{;O z%W&rQGlsDC)eJ?mcQWvCvNO!e^<_|!5CkiRIgttML7=7_Uo(aUMF9*unq$CD$e6kX zY+_Hc8v_R$3qk|PbdUy{(s>LGOAo*miSctYR4v@gAS1%Z;AgH5cNW|R4H*%z;+XDr z4A0(uW+)1@WY~7*HaHMMY_yP^#0b$aA%Ag}J zh6rMCL;*G3diIv#)3=`t$F4sHV-Qf27G}8j;yswHB_|3FW=8ph{`a6rfw>Wmks=R_ z|NUd&VrTup0*Y>+Rq&(%4r@k8k^u2R&H!luYX0!$`!7d;00RKE7SNRFRLx)j0000< KMNUMnLSTZwwBJww literal 0 HcmV?d00001 diff --git a/upload/templates/default/index.tpl b/upload/templates/default/index.tpl index 8449842fe..de6de384c 100644 --- a/upload/templates/default/index.tpl +++ b/upload/templates/default/index.tpl @@ -13,9 +13,9 @@ From 5874e3383e0e4144f43e2aa7223c7f294ddfb2d0 Mon Sep 17 00:00:00 2001 From: Exile Date: Wed, 13 Aug 2014 22:24:57 +0400 Subject: [PATCH 18/24] Atom path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Фикс косяка с путями к атомам. --- upload/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload/config.php b/upload/config.php index e631a7ef9..30f62d246 100644 --- a/upload/config.php +++ b/upload/config.php @@ -599,7 +599,7 @@ $bb_cfg['captcha'] = array( // Atom feed $bb_cfg['atom'] = array( - 'path' => BB_PATH .'/atom/', + 'path' => BB_PATH .'/atom', 'url' => './atom', ); From 1969c6c57e58422be626c0ea34c6249bdfd76795 Mon Sep 17 00:00:00 2001 From: Exile Date: Wed, 13 Aug 2014 23:15:19 +0400 Subject: [PATCH 19/24] Function update_atom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Переходим на использование функции для минимизации кода. --- upload/ajax/posts.php | 15 +++------------ upload/includes/functions.php | 9 +++++++++ upload/posting.php | 4 +--- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/upload/ajax/posts.php b/upload/ajax/posts.php index 84c837bfa..67d72417f 100644 --- a/upload/ajax/posts.php +++ b/upload/ajax/posts.php @@ -59,10 +59,7 @@ switch($this->request['type']) post_delete($post_id); // Update user atom feed - require_once(INC_DIR .'functions_atom.php'); - $topic_id = (int) $this->request['topic_id']; - $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster'); - update_user_feed($topic_poster, get_username($topic_poster)); + update_atom((int) $this->request['topic_id']); $this->response['hide'] = true; $this->response['post_id'] = $post_id; @@ -166,10 +163,7 @@ switch($this->request['type']) else $this->ajax_die($lang['EMPTY_MESSAGE']); // Update user atom feed - require_once(INC_DIR .'functions_atom.php'); - $topic_id = (int) $this->request['topic_id']; - $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster'); - update_user_feed($topic_poster, get_username($topic_poster)); + update_atom((int) $this->request['topic_id']); $this->response['html'] = bbcode2html($text); } @@ -323,10 +317,7 @@ switch($this->request['type']) } // Update user atom feed - require_once(INC_DIR .'functions_atom.php'); - $topic_id = (int) $this->request['topic_id']; - $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster'); - update_user_feed($topic_poster, get_username($topic_poster)); + update_atom((int) $this->request['topic_id']); $this->response['redirect'] = make_url(POST_URL . "$post_id#$post_id"); break; diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 6e39e3a55..c83a7fb0f 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -2836,4 +2836,13 @@ function is_gold ($type) } return $is_gold; +} + +function update_atom ($topic_id) +{ + require_once(INC_DIR .'functions_atom.php'); + + // Update user atom feed + $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster'); + update_user_feed($topic_poster, get_username($topic_poster)); } \ No newline at end of file diff --git a/upload/posting.php b/upload/posting.php index 69f277abd..a67293946 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -445,9 +445,7 @@ elseif ( ($submit || $confirm) && !$topic_has_new_posts ) } // Update user atom feed - require_once(INC_DIR .'functions_atom.php'); - $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster'); - update_user_feed($topic_poster, get_username($topic_poster)); + update_atom($topic_id); if ($mode == 'reply' && $post_info['topic_status'] == TOPIC_LOCKED) { From 773dcb5bafc6670424ccdf4348f93e59238a16b5 Mon Sep 17 00:00:00 2001 From: Exile Date: Thu, 14 Aug 2014 00:25:21 +0400 Subject: [PATCH 20/24] Lang cleaning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Удаление избыточных языковых переменных на часовые пояса. --- upload/includes/page_header.php | 2 +- upload/language/en/main.php | 35 +-------------------------------- upload/language/ru/main.php | 33 ------------------------------- upload/language/ua/main.php | 33 ------------------------------- 4 files changed, 2 insertions(+), 101 deletions(-) diff --git a/upload/includes/page_header.php b/upload/includes/page_header.php index fb30f8cf8..77183659c 100644 --- a/upload/includes/page_header.php +++ b/upload/includes/page_header.php @@ -190,7 +190,7 @@ $template->assign_vars(array( 'FULL_URL' => FULL_URL, 'CURRENT_TIME' => sprintf($lang['CURRENT_TIME'], bb_date(TIMENOW, $bb_cfg['last_visit_date_format'], false)), - 'S_TIMEZONE' => sprintf($lang['ALL_TIMES'], $lang[''.str_replace(',', '.', floatval($bb_cfg['board_timezone'])).'']), + 'S_TIMEZONE' => preg_replace('/\(.*?\)/', '', sprintf($lang['ALL_TIMES'], $lang['TZ'][str_replace(',', '.', floatval($bb_cfg['board_timezone']))])), 'PM_INFO' => $pm_info, 'PRIVMSG_IMG' => $icon_pm, diff --git a/upload/language/en/main.php b/upload/language/en/main.php index 5d1cb75db..e4601652f 100644 --- a/upload/language/en/main.php +++ b/upload/language/en/main.php @@ -902,40 +902,7 @@ $lang['LOOKUP_IP'] = 'Look up IP address'; // // Timezones ... for display on each page // -$lang['ALL_TIMES'] = 'All times are %s'; // eg. All times are UTC - 12 Hours (times from next block) - -$lang['-12'] = 'UTC - 12'; -$lang['-11'] = 'UTC - 11'; -$lang['-10'] = 'UTC - 10'; -$lang['-9'] = 'UTC - 9'; -$lang['-8'] = 'UTC - 8'; -$lang['-7'] = 'UTC - 7'; -$lang['-6'] = 'UTC - 6'; -$lang['-5'] = 'UTC - 5'; -$lang['-4'] = 'UTC - 4'; -$lang['-3.5'] = 'UTC - 3.5'; -$lang['-3'] = 'UTC - 3'; -$lang['-2'] = 'UTC - 2'; -$lang['-1'] = 'UTC - 1'; -$lang['0'] = 'UTC ± 0'; -$lang['1'] = 'UTC + 1'; -$lang['2'] = 'UTC + 2'; -$lang['3'] = 'UTC + 3'; -$lang['3.5'] = 'UTC + 3.5'; -$lang['4'] = 'UTC + 4'; -$lang['4.5'] = 'UTC + 4.5'; -$lang['5'] = 'UTC + 5'; -$lang['5.5'] = 'UTC + 5.5'; -$lang['6'] = 'UTC + 6'; -$lang['6.5'] = 'UTC + 6.5'; -$lang['7'] = 'UTC + 7'; -$lang['8'] = 'UTC + 8'; -$lang['9'] = 'UTC + 9'; -$lang['9.5'] = 'UTC + 9.5'; -$lang['10'] = 'UTC + 10'; -$lang['11'] = 'UTC + 11'; -$lang['12'] = 'UTC + 12'; -$lang['13'] = 'UTC + 13'; +$lang['ALL_TIMES'] = 'All times are %s'; // This is followed by UTC and the timezone offset // These are displayed in the timezone select box $lang['TZ']['-12'] = 'UTC - 12'; diff --git a/upload/language/ru/main.php b/upload/language/ru/main.php index 0a19d4f7f..6c72b05c4 100644 --- a/upload/language/ru/main.php +++ b/upload/language/ru/main.php @@ -904,39 +904,6 @@ $lang['LOOKUP_IP'] = 'Посмотреть хост для IP'; // $lang['ALL_TIMES'] = 'Часовой пояс: %s'; // This is followed by UTC and the timezone offset -$lang['-12'] = 'UTC - 12'; -$lang['-11'] = 'UTC - 11'; -$lang['-10'] = 'UTC - 10'; -$lang['-9'] = 'UTC - 9'; -$lang['-8'] = 'UTC - 8'; -$lang['-7'] = 'UTC - 7'; -$lang['-6'] = 'UTC - 6'; -$lang['-5'] = 'UTC - 5'; -$lang['-4'] = 'UTC - 4'; -$lang['-3.5'] = 'UTC - 3:30'; -$lang['-3'] = 'UTC - 3'; -$lang['-2'] = 'UTC - 2'; -$lang['-1'] = 'UTC - 1'; -$lang['0'] = 'UTC ± 0'; -$lang['1'] = 'UTC + 1'; -$lang['2'] = 'UTC + 2'; -$lang['3'] = 'UTC + 3'; -$lang['3.5'] = 'UTC + 3:30'; -$lang['4'] = 'UTC + 4'; -$lang['4.5'] = 'UTC + 4:30'; -$lang['5'] = 'UTC + 5'; -$lang['5.5'] = 'UTC + 5:30'; -$lang['6'] = 'UTC + 6'; -$lang['6.5'] = 'UTC + 6:30'; -$lang['7'] = 'UTC + 7'; -$lang['8'] = 'UTC + 8'; -$lang['9'] = 'UTC + 9'; -$lang['9.5'] = 'UTC + 9:30'; -$lang['10'] = 'UTC + 10'; -$lang['11'] = 'UTC + 11'; -$lang['12'] = 'UTC + 12'; -$lang['13'] = 'UTC + 13'; - // это для выпадающего меню, раньше тут еще были города $lang['TZ']['-12'] = 'UTC - 12'; $lang['TZ']['-11'] = 'UTC - 11'; diff --git a/upload/language/ua/main.php b/upload/language/ua/main.php index 966e2cfcb..cb36b1801 100644 --- a/upload/language/ua/main.php +++ b/upload/language/ua/main.php @@ -904,39 +904,6 @@ $lang['LOOKUP_IP'] = 'Показати хост для IP'; // $lang['ALL_TIMES'] = 'Часовий пояс: %s'; // This is followed by UTC and the timezone offset -$lang['-12'] = 'UTC - 12'; -$lang['-11'] = 'UTC - 11'; -$lang['-10'] = 'UTC - 10'; -$lang['-9'] = 'UTC - 9'; -$lang['-8'] = 'UTC - 8'; -$lang['-7'] = 'UTC - 7'; -$lang['-6'] = 'UTC - 6'; -$lang['-5'] = 'UTC - 5'; -$lang['-4'] = 'UTC - 4'; -$lang['-3.5'] = 'UTC - 3:30'; -$lang['-3'] = 'UTC - 3'; -$lang['-2'] = 'UTC - 2'; -$lang['-1'] = 'UTC - 1'; -$lang['0'] = 'UTC ± 0'; -$lang['1'] = 'UTC + 1'; -$lang['2'] = 'UTC + 2'; -$lang['3'] = 'UTC + 3'; -$lang['3.5'] = 'UTC + 3:30'; -$lang['4'] = 'UTC + 4'; -$lang['4.5'] = 'UTC + 4:30'; -$lang['5'] = 'UTC + 5'; -$lang['5.5'] = 'UTC + 5:30'; -$lang['6'] = 'UTC + 6'; -$lang['6.5'] = 'UTC + 6:30'; -$lang['7'] = 'UTC + 7'; -$lang['8'] = 'UTC + 8'; -$lang['9'] = 'UTC + 9'; -$lang['9.5'] = 'UTC + 9:30'; -$lang['10'] = 'UTC + 10'; -$lang['11'] = 'UTC + 11'; -$lang['12'] = 'UTC + 12'; -$lang['13'] = 'UTC + 13'; - // це для випадного меню, раніше тут ще були міста $lang['TZ']['-12'] = 'UTC - 12'; $lang['TZ']['-11'] = 'UTC - 11'; From 469d038784c9ce5057c66c30168fcfbf82d597c0 Mon Sep 17 00:00:00 2001 From: Exile Date: Thu, 14 Aug 2014 22:21:55 +0400 Subject: [PATCH 21/24] Atom updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Обновления лент при удалении тем (одиночном, массовом). При удалении сообщений (одиночном, массовом). --- upload/ajax/posts.php | 12 ++++++------ upload/includes/functions.php | 16 ++++++++++++---- upload/includes/functions_admin.php | 23 +++++++++++++++++++++++ upload/posting.php | 4 ++-- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/upload/ajax/posts.php b/upload/ajax/posts.php index 67d72417f..7c6397144 100644 --- a/upload/ajax/posts.php +++ b/upload/ajax/posts.php @@ -58,8 +58,8 @@ switch($this->request['type']) } post_delete($post_id); - // Update user atom feed - update_atom((int) $this->request['topic_id']); + // Update atom feed + update_atom('topic', (int) $this->request['topic_id']); $this->response['hide'] = true; $this->response['post_id'] = $post_id; @@ -162,8 +162,8 @@ switch($this->request['type']) } else $this->ajax_die($lang['EMPTY_MESSAGE']); - // Update user atom feed - update_atom((int) $this->request['topic_id']); + // Update atom feed + update_atom('topic', (int) $this->request['topic_id']); $this->response['html'] = bbcode2html($text); } @@ -316,8 +316,8 @@ switch($this->request['type']) user_notification('reply', $post, $post['topic_title'], $post['forum_id'], $topic_id, $notify); } - // Update user atom feed - update_atom((int) $this->request['topic_id']); + // Update atom feed + update_atom('topic', (int) $this->request['topic_id']); $this->response['redirect'] = make_url(POST_URL . "$post_id#$post_id"); break; diff --git a/upload/includes/functions.php b/upload/includes/functions.php index c83a7fb0f..b92c29b34 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -2838,11 +2838,19 @@ function is_gold ($type) return $is_gold; } -function update_atom ($topic_id) +function update_atom ($type, $id) { require_once(INC_DIR .'functions_atom.php'); - // Update user atom feed - $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster'); - update_user_feed($topic_poster, get_username($topic_poster)); + switch ($type) + { + case 'user': + update_user_feed($id, get_username($id)); + break; + + case 'topic': + $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $id LIMIT 1", 'topic_poster'); + update_user_feed($topic_poster, get_username($topic_poster)); + break; + } } \ No newline at end of file diff --git a/upload/includes/functions_admin.php b/upload/includes/functions_admin.php index 6a4b0a793..1c4319d32 100644 --- a/upload/includes/functions_admin.php +++ b/upload/includes/functions_admin.php @@ -277,6 +277,13 @@ function topic_delete ($mode_or_topic_id, $forum_id = null, $prune_time = 0, $pr GROUP BY p.poster_id "); + // Get array for atom update + $atom_csv = array(); + foreach (DB()->fetch_rowset('SELECT user_id FROM '.$tmp_user_posts) as $at) + { + $atom_csv[] = $at['user_id']; + } + DB()->query(" UPDATE $tmp_user_posts tmp, ". BB_USERS ." u @@ -384,6 +391,12 @@ function topic_delete ($mode_or_topic_id, $forum_id = null, $prune_time = 0, $pr // Sync sync('forum', array_keys($sync_forums)); + // Update atom feed + foreach ($atom_csv as $atom) + { + update_atom('user', $atom); + } + DB()->query("DROP TEMPORARY TABLE $tmp_delete_topics"); return $deleted_topics_count; @@ -663,6 +676,16 @@ function post_delete ($mode_or_post_id, $user_id = null, $exclude_first = true) sync('forum', array_keys($sync_forums)); sync('user_posts', $sync_users); + // Update atom feed + foreach ($sync_topics as $atom_topic) + { + update_atom('topic', $atom_topic); + } + foreach ($sync_users as $atom_user) + { + update_atom('user', $atom_user); + } + DB()->query("DROP TEMPORARY TABLE $tmp_delete_posts"); return $deleted_posts_count; diff --git a/upload/posting.php b/upload/posting.php index a67293946..62956849f 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -444,8 +444,8 @@ elseif ( ($submit || $confirm) && !$topic_has_new_posts ) } } - // Update user atom feed - update_atom($topic_id); + // Update atom feed + update_atom('topic', $topic_id); if ($mode == 'reply' && $post_info['topic_status'] == TOPIC_LOCKED) { From 54d0c387b2d75c7adbb3d5c1a53284fa23ab8876 Mon Sep 17 00:00:00 2001 From: Exile Date: Thu, 14 Aug 2014 22:44:15 +0400 Subject: [PATCH 22/24] Atom ajax post MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Фиксы при удалении поста на аяксе. --- upload/config.php | 6 +++--- upload/templates/default/viewtopic.tpl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/upload/config.php b/upload/config.php index 30f62d246..254f3b42b 100644 --- a/upload/config.php +++ b/upload/config.php @@ -69,7 +69,7 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Version info $bb_cfg['tp_version'] = '2.0.9 (RC)'; -$bb_cfg['tp_release_date'] = '12-08-2014'; +$bb_cfg['tp_release_date'] = '14-08-2014'; $bb_cfg['tp_release_state'] = 'R595'; // Database @@ -141,8 +141,8 @@ if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) } // Increase number after changing js or css -$bb_cfg['js_ver'] = 2; -$bb_cfg['css_ver'] = 2; +$bb_cfg['js_ver'] = 1; +$bb_cfg['css_ver'] = 1; // Backup $bb_cfg['db_backup_shell_cmd'] = ''; // '/path/to/db_backup.sh 2>&1' diff --git a/upload/templates/default/viewtopic.tpl b/upload/templates/default/viewtopic.tpl index 59f46fdac..60dfa8cfb 100644 --- a/upload/templates/default/viewtopic.tpl +++ b/upload/templates/default/viewtopic.tpl @@ -390,7 +390,7 @@ function build_poll_add_form (src_el) {POLL_IMG} {QUOTE_IMG}{POST_BTN_SPACER} {EDIT_POST_IMG}{POST_BTN_SPACER} - {DELETE_POST_IMG}{POST_BTN_SPACER} + {DELETE_POST_IMG}{POST_BTN_SPACER} {IP_POST_IMG}{POST_BTN_SPACER} {postrow.REPORT}{POST_BTN_SPACER} From 306418955ed4d16f33488ac3b914758579ee8f89 Mon Sep 17 00:00:00 2001 From: Exile Date: Thu, 14 Aug 2014 22:54:34 +0400 Subject: [PATCH 23/24] Config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Пояснения к путям у капчи и атомов. Уменьшенный интервал генерации общих атомов. --- install/sql/mysql.sql | 2 +- upload/config.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index 3a168aefa..a34ee47bb 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -645,7 +645,7 @@ INSERT INTO `bb_cron` VALUES (19, 1, 'Captcha', 'captcha_gen_gc.php', 'daily', N INSERT INTO `bb_cron` VALUES (20, 1, 'Tracker dl-complete count', 'tr_complete_count.php', 'interval', NULL, NULL, 255, '', '', '06:00:00', 0, '', 0, 0, 0); INSERT INTO `bb_cron` VALUES (21, 1, 'Cache garbage collector', 'cache_gc.php', 'interval', NULL, NULL, 255, '', '', '00:05:00', 0, '', 0, 0, 0); INSERT INTO `bb_cron` VALUES (22, 1, 'Sitemap update', 'sitemap.php', 'daily', NULL, '06:00:00', 30, '', '', NULL, 0, '', 0, 0, 0); -INSERT INTO `bb_cron` VALUES (23, 1, 'Update forums atom', 'update_forums_atom.php', 'interval', NULL, NULL, 255, '', '', '00:20:00', 0, '', 0, 0, 0); +INSERT INTO `bb_cron` VALUES (23, 1, 'Update forums atom', 'update_forums_atom.php', 'interval', NULL, NULL, 255, '', '', '00:15:00', 0, '', 0, 0, 0); -- -------------------------------------------------------- diff --git a/upload/config.php b/upload/config.php index 254f3b42b..43b6483ad 100644 --- a/upload/config.php +++ b/upload/config.php @@ -593,14 +593,14 @@ $bb_cfg['advert_url'] = 'misc.php?do=info&show=advert'; $bb_cfg['captcha'] = array( 'disabled' => false, 'secret_key' => 'secret_key', - 'img_url' => './images/captcha/', - 'img_path' => BB_PATH .'/images/captcha/', + 'img_url' => './images/captcha/', # with '/' + 'img_path' => BB_PATH .'/images/captcha/', # with '/' ); // Atom feed $bb_cfg['atom'] = array( - 'path' => BB_PATH .'/atom', - 'url' => './atom', + 'path' => BB_PATH .'/atom', # without '/' + 'url' => './atom', # without '/' ); define('BB_CFG_LOADED', true); \ No newline at end of file From 02ac67bb5033ae692f1b20f0e13204c13e22db31 Mon Sep 17 00:00:00 2001 From: Exile Date: Thu, 14 Aug 2014 23:09:46 +0400 Subject: [PATCH 24/24] Ajax access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Исправление ошибки с недоступностью списка форума для вывода. --- upload/ajax/.htaccess | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 upload/ajax/.htaccess diff --git a/upload/ajax/.htaccess b/upload/ajax/.htaccess deleted file mode 100644 index baa56e5a3..000000000 --- a/upload/ajax/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -order allow,deny -deny from all \ No newline at end of file
{NO_FORUMS_MSG}
- - - - + + + + diff --git a/upload/templates/default/viewtopic_torrent.tpl b/upload/templates/default/viewtopic_torrent.tpl index b13db21af..a0723d1a1 100644 --- a/upload/templates/default/viewtopic_torrent.tpl +++ b/upload/templates/default/viewtopic_torrent.tpl @@ -232,10 +232,10 @@ $(document).ready(function(){  
{DL_HIDDEN_FIELDS} -   -   -   - +   +   +   +
 
From a7f0d2148c7f7ebeff1fa668761985df7df9e5af Mon Sep 17 00:00:00 2001 From: Exile Date: Tue, 12 Aug 2014 22:11:47 +0400 Subject: [PATCH 15/24] Atom for users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Создание лент пользователей: в аяксе, создание при обычном постинге, удаление при удалении юзера, фиксы папок для аттачей, аватарок и атомов. Осталось сделать пересоздание лент пользователей при удалении постов из тем и удалении тем (functions_admin). --- upload/ajax/posts.php | 19 +++++++++++++++++++ upload/feed.php | 6 +++--- upload/includes/captcha/captcha.php | 8 ++------ upload/includes/functions.php | 4 ++-- upload/includes/functions_admin.php | 9 ++++++++- upload/includes/functions_atom.php | 4 ++-- upload/posting.php | 7 ++++++- upload/templates/default/viewtopic.tpl | 15 ++++++--------- 8 files changed, 48 insertions(+), 24 deletions(-) diff --git a/upload/ajax/posts.php b/upload/ajax/posts.php index 86ad38dbe..84c837bfa 100644 --- a/upload/ajax/posts.php +++ b/upload/ajax/posts.php @@ -57,6 +57,13 @@ switch($this->request['type']) $this->prompt_for_confirm($lang['CONFIRM_DELETE']); } post_delete($post_id); + + // Update user atom feed + require_once(INC_DIR .'functions_atom.php'); + $topic_id = (int) $this->request['topic_id']; + $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster'); + update_user_feed($topic_poster, get_username($topic_poster)); + $this->response['hide'] = true; $this->response['post_id'] = $post_id; } @@ -158,6 +165,12 @@ switch($this->request['type']) } else $this->ajax_die($lang['EMPTY_MESSAGE']); + // Update user atom feed + require_once(INC_DIR .'functions_atom.php'); + $topic_id = (int) $this->request['topic_id']; + $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster'); + update_user_feed($topic_poster, get_username($topic_poster)); + $this->response['html'] = bbcode2html($text); } else @@ -309,6 +322,12 @@ switch($this->request['type']) user_notification('reply', $post, $post['topic_title'], $post['forum_id'], $topic_id, $notify); } + // Update user atom feed + require_once(INC_DIR .'functions_atom.php'); + $topic_id = (int) $this->request['topic_id']; + $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster'); + update_user_feed($topic_poster, get_username($topic_poster)); + $this->response['redirect'] = make_url(POST_URL . "$post_id#$post_id"); break; diff --git a/upload/feed.php b/upload/feed.php index 4dad7657b..85c9336b1 100644 --- a/upload/feed.php +++ b/upload/feed.php @@ -50,14 +50,14 @@ if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) { bb_simple_die('Invalid type of query #3'); } - if (file_exists($bb_cfg['atom']['path'] .'/u/'. floor($id/5000000) .'/'. ($id % 100) .'/'. $id .'.atom') && filemtime($bb_cfg['atom']['path'] .'/u/'. floor($id/5000000) .'/'. ($id % 100) .'/'. $id .'.atom') > $timecheck) + if (file_exists($bb_cfg['atom']['path'] .'/u/'. floor($id/5000) .'/'. ($id % 100) .'/'. $id .'.atom') && filemtime($bb_cfg['atom']['path'] .'/u/'. floor($id/5000) .'/'. ($id % 100) .'/'. $id .'.atom') > $timecheck) { - redirect($bb_cfg['atom']['url'] .'/u/'. floor($id/5000000) .'/'. ($id % 100) .'/'. $id .'.atom'); + redirect($bb_cfg['atom']['url'] .'/u/'. floor($id/5000) .'/'. ($id % 100) .'/'. $id .'.atom'); } else { require_once(INC_DIR .'functions_atom.php'); - if (update_user_feed($id, $username)) redirect($bb_cfg['atom']['url'] .'/u/'. floor($id/5000000) .'/'. ($id % 100) .'/'. $id .'.atom'); + if (update_user_feed($id, $username)) redirect($bb_cfg['atom']['url'] .'/u/'. floor($id/5000) .'/'. ($id % 100) .'/'. $id .'.atom'); else bb_simple_die('No feed for this user (no topics)'); } } diff --git a/upload/includes/captcha/captcha.php b/upload/includes/captcha/captcha.php index 61fe023d3..4ecfcdc34 100644 --- a/upload/includes/captcha/captcha.php +++ b/upload/includes/captcha/captcha.php @@ -131,7 +131,7 @@ class captcha_common CACHE('bb_cap_sid')->set('c_sid_'. $this->new_cap_sid, $this->new_cap_code, $this->key_ttl*2); } - function get_img_url ($id) + function get_img_url ($id) { return $this->get_path($id, $this->cfg['img_url']); } @@ -215,8 +215,6 @@ class captcha_kcaptcha extends captcha_common $credits = $bb_cfg['server_name']; # if empty, HTTP_HOST will be shown # CAPTCHA image colors (RGB, 0-255) - //$foreground_color = array(0, 0, 0); - //$background_color = array(220, 230, 255); $foreground_color = array(mt_rand(0,100), mt_rand(0,100), mt_rand(0,100)); $background_color = array(mt_rand(200,255), mt_rand(200,255), mt_rand(200,255)); @@ -316,7 +314,7 @@ class captcha_kcaptcha extends captcha_common $center=$x/2; - // credits. To remove, see configuration file + // credits $img2=imagecreatetruecolor($width, $height+($show_credits?12:0)); $foreground=imagecolorallocate($img2, $foreground_color[0], $foreground_color[1], $foreground_color[2]); $background=imagecolorallocate($img2, $background_color[0], $background_color[1], $background_color[2]); @@ -390,8 +388,6 @@ class captcha_kcaptcha extends captcha_common file_write('', $img_path, null, true, true); imagejpeg($img2, $img_path, $jpeg_quality); -# imagegif($img2, $img_path); -# imagepng($img2, $img_path); imagedestroy($img2); diff --git a/upload/includes/functions.php b/upload/includes/functions.php index c8c7db0a6..6e39e3a55 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -11,7 +11,7 @@ function get_path_from_id ($id, $ext_id, $base_path, $first_div, $sec_div) function get_avatar_path ($id, $ext_id, $base_path = '') { - return get_path_from_id($id, $ext_id, $base_path, 5000000, 100); + return get_path_from_id($id, $ext_id, $base_path, 5000, 100); } function delete_avatar ($user_id, $avatar_ext_id) @@ -24,7 +24,7 @@ function delete_avatar ($user_id, $avatar_ext_id) function get_attach_path ($id) { global $bb_cfg; - return get_path_from_id($id, '', $bb_cfg['attach']['upload_path'], 1000000, 100); + return get_path_from_id($id, '', $bb_cfg['attach']['upload_path'], 1000, 100); } function get_tracks ($type) diff --git a/upload/includes/functions_admin.php b/upload/includes/functions_admin.php index 32ce428f8..6a4b0a793 100644 --- a/upload/includes/functions_admin.php +++ b/upload/includes/functions_admin.php @@ -670,7 +670,7 @@ function post_delete ($mode_or_post_id, $user_id = null, $exclude_first = true) function user_delete ($user_id, $delete_posts = false) { - global $log_action; + global $bb_cfg, $log_action; if (!$user_csv = get_id_csv($user_id)) { @@ -755,6 +755,13 @@ function user_delete ($user_id, $delete_posts = false) DB()->query("UPDATE ". BB_PRIVMSGS ." SET privmsgs_from_userid = ". DELETED ." WHERE privmsgs_from_userid IN($user_csv)"); DB()->query("UPDATE ". BB_PRIVMSGS ." SET privmsgs_to_userid = ". DELETED ." WHERE privmsgs_to_userid IN($user_csv)"); + + // Delete user feed + foreach (explode(',', $user_csv) as $user_id) + { + $file_path = $bb_cfg['atom']['path'] .'/u/'. floor($user_id/5000) .'/'. ($user_id % 100) .'/'. $user_id .'.atom'; + @unlink($file_path); + } } function get_usernames_for_log ($user_id) diff --git a/upload/includes/functions_atom.php b/upload/includes/functions_atom.php index 2df190b7c..d4b05bf87 100644 --- a/upload/includes/functions_atom.php +++ b/upload/includes/functions_atom.php @@ -79,7 +79,7 @@ function update_forum_feed ($forum_id, $forum_data) function update_user_feed ($user_id, $username) { global $bb_cfg; - $file_path = $bb_cfg['atom']['path'] .'/u/'. floor($user_id/5000000) .'/'. ($user_id % 100) .'/'. $user_id .'.atom'; + $file_path = $bb_cfg['atom']['path'] .'/u/'. floor($user_id/5000) .'/'. ($user_id % 100) .'/'. $user_id .'.atom'; $sql = " SELECT t.topic_id, t.topic_title, t.topic_status, @@ -154,7 +154,7 @@ function create_atom ($file_path, $mode, $id, $title, $topics) $orig_word = array(); $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); - if ( count($orig_word) ) + if (count($orig_word)) { $topic_title = preg_replace($orig_word, $replacement_word, $topic_title); } diff --git a/upload/posting.php b/upload/posting.php index 1eee18c3e..69f277abd 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -353,7 +353,7 @@ elseif ( ($submit || $confirm) && !$topic_has_new_posts ) $return_message = ''; $return_meta = ''; - switch ( $mode ) + switch ($mode) { case 'editpost': case 'newtopic': @@ -444,6 +444,11 @@ elseif ( ($submit || $confirm) && !$topic_has_new_posts ) } } + // Update user atom feed + require_once(INC_DIR .'functions_atom.php'); + $topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster'); + update_user_feed($topic_poster, get_username($topic_poster)); + if ($mode == 'reply' && $post_info['topic_status'] == TOPIC_LOCKED) { $locked_warn = ' diff --git a/upload/templates/default/viewtopic.tpl b/upload/templates/default/viewtopic.tpl index 27c5cf571..59f46fdac 100644 --- a/upload/templates/default/viewtopic.tpl +++ b/upload/templates/default/viewtopic.tpl @@ -5,7 +5,6 @@ img.postImg, div.postImg-wrap { display: none; } .smile { display: none; } .signature { display: none; } - -
+ + +
@@ -55,20 +71,29 @@ $(function(){ diff --git a/upload/templates/default/tpl_config.php b/upload/templates/default/tpl_config.php index 4788f60a8..96b4f72ec 100644 --- a/upload/templates/default/tpl_config.php +++ b/upload/templates/default/tpl_config.php @@ -123,13 +123,13 @@ $template->assign_vars(array( 'IMG' => $_main, 'TEXT_BUTTONS' => $bb_cfg['text_buttons'], 'POST_BTN_SPACER' => ($bb_cfg['text_buttons']) ? ' ' : '', - 'FEED_IMG_ALT' => 'a', 'TOPIC_ATTACH_ICON' => '', 'OPEN_MENU_IMG_ALT' => '', 'TOPIC_LEFT_COL_SPACER_WITDH' => $bb_cfg['topic_left_column_witdh'] - 8, // 8px padding 'POST_IMG_WIDTH_DECR_JS' => $bb_cfg['topic_left_column_witdh'] + $bb_cfg['post_img_width_decr'], 'ATTACH_IMG_WIDTH_DECR_JS' => $bb_cfg['topic_left_column_witdh'] + $bb_cfg['attach_img_width_decr'], 'MAGNET_LINKS' => $bb_cfg['magnet_links_enabled'], + 'FEED_IMG' => 'feed', )); // post_buttons From 5b79642a1fda1eb15be0a589a1617596c83959db Mon Sep 17 00:00:00 2001 From: Exile Date: Wed, 13 Aug 2014 00:26:22 +0400 Subject: [PATCH 17/24] Atom links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ссылки в профиле пользователя + локализация. Осталась перегенерация лент при удалении тем и сообщений. --- upload/feed.php | 14 +++++++------- upload/includes/functions_atom.php | 2 +- upload/language/en/main.php | 10 ++++++++-- upload/language/ru/main.php | 10 ++++++++-- upload/language/ua/main.php | 10 ++++++++-- upload/templates/default/tpl_config.php | 2 +- upload/templates/default/usercp_viewprofile.tpl | 5 +++-- 7 files changed, 36 insertions(+), 17 deletions(-) diff --git a/upload/feed.php b/upload/feed.php index 85c9336b1..87b981957 100644 --- a/upload/feed.php +++ b/upload/feed.php @@ -12,7 +12,7 @@ $type = (string) @$_POST['type']; $id = (int) @$_POST['id']; $timecheck = TIMENOW - 600; -if (!$mode) bb_simple_die('Not specified mode'); +if (!$mode) bb_simple_die($lang['ATOM_NO_MODE']); if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) { @@ -26,7 +26,7 @@ if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) { $forum_data = array(); } - else bb_simple_die('Invalid type of query #1'); + else bb_simple_die($lang['ATOM_ERROR'].' #1'); } if (file_exists($bb_cfg['atom']['path'] .'/f/'. $id .'.atom') && filemtime($bb_cfg['atom']['path'] .'/f/'. $id .'.atom') > $timecheck) { @@ -36,7 +36,7 @@ if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) { require_once(INC_DIR .'functions_atom.php'); if (update_forum_feed($id, $forum_data)) redirect($bb_cfg['atom']['url'] .'/f/'. $id .'.atom'); - else bb_simple_die('No feed for this forum (no topics)'); + else bb_simple_die($lang['ATOM_NO_FORUM']); } } if ($type == 'u') @@ -44,11 +44,11 @@ if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) // Check if the user has actually sent a user ID if ($id < 1) { - bb_simple_die('Invalid type of query #2'); + bb_simple_die($lang['ATOM_ERROR'].' #2'); } if (!$username = get_username($id)) { - bb_simple_die('Invalid type of query #3'); + bb_simple_die($lang['ATOM_ERROR'].' #3'); } if (file_exists($bb_cfg['atom']['path'] .'/u/'. floor($id/5000) .'/'. ($id % 100) .'/'. $id .'.atom') && filemtime($bb_cfg['atom']['path'] .'/u/'. floor($id/5000) .'/'. ($id % 100) .'/'. $id .'.atom') > $timecheck) { @@ -58,11 +58,11 @@ if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) { require_once(INC_DIR .'functions_atom.php'); if (update_user_feed($id, $username)) redirect($bb_cfg['atom']['url'] .'/u/'. floor($id/5000) .'/'. ($id % 100) .'/'. $id .'.atom'); - else bb_simple_die('No feed for this user (no topics)'); + else bb_simple_die($lang['ATOM_NO_USER']); } } } else { - bb_simple_die('Invalid type of query #4'); + bb_simple_die($lang['ATOM_ERROR'].' #4'); } \ No newline at end of file diff --git a/upload/includes/functions_atom.php b/upload/includes/functions_atom.php index d4b05bf87..0c3c4f2e2 100644 --- a/upload/includes/functions_atom.php +++ b/upload/includes/functions_atom.php @@ -165,7 +165,7 @@ function create_atom ($file_path, $mode, $id, $title, $topics) $date = bb_date($last_time, 'Y-m-d', 0); $time = bb_date($last_time, 'H:i:s', 0); $updated = ''; - $checktime = TIMENOW - 604800; // неделя + $checktime = TIMENOW - 604800; // неделя (week) if ($topic['topic_first_post_edit_time'] && $topic['topic_first_post_edit_time'] > $checktime) $updated = '[Обновлено] '; $atom .= "\n"; $atom .= " <![CDATA[$updated$topic_title$tor_size]]>\n"; diff --git a/upload/language/en/main.php b/upload/language/en/main.php index 13b9af5ad..fb65c606e 100644 --- a/upload/language/en/main.php +++ b/upload/language/en/main.php @@ -1282,7 +1282,7 @@ $lang['SEARCH_DL_COMPLETE_DOWNLOADS'] = 'Completed Downloads'; $lang['SEARCH_DL_CANCEL'] = 'Canceled'; $lang['CUR_DOWNLOADS'] = 'Current Downloads'; $lang['CUR_UPLOADS'] = 'Current Uploads'; -$lang['SEARCH_RELEASES'] = 'Find releases'; +$lang['SEARCH_RELEASES'] = 'Releases'; $lang['TOR_SEARCH_TITLE'] = 'Torrent search options'; $lang['OPEN_TOPIC'] = 'Open topic'; @@ -2998,4 +2998,10 @@ $lang['SITEMAP_ADD_PAGE'] = 'Additional pages'; $lang['SITEMAP_ADD_EXP_1'] = 'You can specify additional pages on your site (for example, http://torrentpier.me/memberlist.php) which should be included in your sitemap file that you creating.'; $lang['SITEMAP_ADD_EXP_2'] = 'Each reference must begin with http(s):// and a new line!'; -$lang['FORUM_MAP'] = 'Forums\' map'; \ No newline at end of file +$lang['FORUM_MAP'] = 'Forums\' map'; +$lang['ATOM_FEED'] = 'Feed'; +$lang['ATOM_ERROR'] = 'Error generating feed'; +$lang['ATOM_SUBSCRIBE'] = 'Subscribe to the feed'; +$lang['ATOM_NO_MODE'] = 'Do not specify a mode for the feed'; +$lang['ATOM_NO_FORUM'] = 'This forum does not have a feed (no ongoing topics)'; +$lang['ATOM_NO_USER'] = 'This user does not have a feed (no ongoing topics)'; \ No newline at end of file diff --git a/upload/language/ru/main.php b/upload/language/ru/main.php index 0799e78f0..9494c5135 100644 --- a/upload/language/ru/main.php +++ b/upload/language/ru/main.php @@ -1282,7 +1282,7 @@ $lang['SEARCH_DL_COMPLETE_DOWNLOADS'] = 'Прошлые закачки'; $lang['SEARCH_DL_CANCEL'] = 'Отмененные'; $lang['CUR_DOWNLOADS'] = 'Текущие закачки'; $lang['CUR_UPLOADS'] = 'Текущие раздачи'; -$lang['SEARCH_RELEASES'] = 'Найти раздачи'; +$lang['SEARCH_RELEASES'] = 'Раздачи'; $lang['TOR_SEARCH_TITLE'] = 'Опции показа торрентов'; $lang['OPEN_TOPIC'] = 'Открыть топик'; @@ -2998,4 +2998,10 @@ $lang['SITEMAP_ADD_PAGE'] = 'Дополнительные страницы'; $lang['SITEMAP_ADD_EXP_1'] = 'Здесь вы можете указать дополнительные страницы сайта (например http://torrentpier.me/memberlist.php), которые должны быть включены в создаваемый файл вами файл sitemap.'; $lang['SITEMAP_ADD_EXP_2'] = 'Каждая ссылка должна начинаться с http(s):// и новой строки!'; -$lang['FORUM_MAP'] = 'Карта форумов'; \ No newline at end of file +$lang['FORUM_MAP'] = 'Карта форумов'; +$lang['ATOM_FEED'] = 'Лента'; +$lang['ATOM_ERROR'] = 'Ошибка генерации ленты'; +$lang['ATOM_SUBSCRIBE'] = 'Подписка на ленту'; +$lang['ATOM_NO_MODE'] = 'Не указан режим для ленты'; +$lang['ATOM_NO_FORUM'] = 'Для этого форума нет ленты (нет начатых тем)'; +$lang['ATOM_NO_USER'] = 'Для этого пользователя нет ленты (нет начатых тем)'; \ No newline at end of file diff --git a/upload/language/ua/main.php b/upload/language/ua/main.php index 57370431b..e954323f6 100644 --- a/upload/language/ua/main.php +++ b/upload/language/ua/main.php @@ -1282,7 +1282,7 @@ $lang['SEARCH_DL_COMPLETE_DOWNLOADS'] = 'Минулі закачування'; $lang['SEARCH_DL_CANCEL'] = 'Скасовані'; $lang['CUR_DOWNLOADS'] = 'Поточні закачування'; $lang['CUR_UPLOADS'] = 'Поточні роздачі'; -$lang['SEARCH_RELEASES'] = 'Знайти роздачі'; +$lang['SEARCH_RELEASES'] = 'Роздачі'; $lang['TOR_SEARCH_TITLE'] = 'Опції показу торрентів'; $lang['OPEN_TOPIC'] = 'Відкрити топік'; @@ -2998,4 +2998,10 @@ $lang['SITEMAP_ADD_PAGE'] = 'Додаткові сторінки'; $lang['SITEMAP_ADD_EXP_1'] = 'Тут ви можете вказати додаткові сторінки сайту (наприклад http://torrentpier.me/memberlist.php), які повинні бути включені в створюваний файл вами файл sitemap.'; $lang['SITEMAP_ADD_EXP_2'] = 'Кожне посилання має починатись з http(s):// і нової рядки!'; -$lang['FORUM_MAP'] = 'Карта форумів'; \ No newline at end of file +$lang['FORUM_MAP'] = 'Карта форумів'; +$lang['ATOM_FEED'] = 'Стрічка'; +$lang['ATOM_ERROR'] = 'Помилка створення стрічки'; +$lang['ATOM_SUBSCRIBE'] = 'Підписка на стрічку'; +$lang['ATOM_NO_MODE'] = 'Не вказано режим для стрічки'; +$lang['ATOM_NO_FORUM'] = 'Для цього форуму немає стрічки (немає початих тем)'; +$lang['ATOM_NO_USER'] = 'Для цього користувача немає стрічки (немає початих тем)'; \ No newline at end of file diff --git a/upload/templates/default/tpl_config.php b/upload/templates/default/tpl_config.php index 96b4f72ec..31773f5bf 100644 --- a/upload/templates/default/tpl_config.php +++ b/upload/templates/default/tpl_config.php @@ -129,7 +129,7 @@ $template->assign_vars(array( 'POST_IMG_WIDTH_DECR_JS' => $bb_cfg['topic_left_column_witdh'] + $bb_cfg['post_img_width_decr'], 'ATTACH_IMG_WIDTH_DECR_JS' => $bb_cfg['topic_left_column_witdh'] + $bb_cfg['attach_img_width_decr'], 'MAGNET_LINKS' => $bb_cfg['magnet_links_enabled'], - 'FEED_IMG' => 'feed', + 'FEED_IMG' => ''. $lang['ATOM_FEED'] .'', )); // post_buttons diff --git a/upload/templates/default/usercp_viewprofile.tpl b/upload/templates/default/usercp_viewprofile.tpl index 7281ef627..8f1938ca3 100644 --- a/upload/templates/default/usercp_viewprofile.tpl +++ b/upload/templates/default/usercp_viewprofile.tpl @@ -365,8 +365,9 @@ ajax.callback.gen_passkey = function(data){ {POSTS} [ {L_SEARCH_USER_POSTS} ] [ {L_SEARCH_USER_TOPICS} ] - [ {L_SEARCH_RELEASES} ] - [ {L_WATCHED_TOPICS} ] + [ {L_SEARCH_RELEASES} ] + [ {L_WATCHED_TOPICS} ] + [ {FEED_IMG} ]