diff --git a/upload/ajax/change_tor_status.php b/upload/ajax/change_tor_status.php index e0d5f9057..7940c71c5 100644 --- a/upload/ajax/change_tor_status.php +++ b/upload/ajax/change_tor_status.php @@ -18,7 +18,7 @@ $attach_id = (int) $this->request['attach_id']; $new_status = (int) $this->request['status']; // Валидность статуса -if (!isset($lang['tor_status'][$new_status])) +if (!isset($lang['TOR_STATUS_NAME'][$new_status])) { $this->ajax_die("Такого статуса не существует: $new_status"); } @@ -64,7 +64,7 @@ if ($tor['tor_status'] != TOR_NOT_APPROVED && $tor['checked_user_id'] != $userda { if (empty($this->request['confirmed'])) { - $msg = "Раздача имеет статус: {$lang['tor_status'][$tor['tor_status']]}\n\n"; + $msg = "Раздача имеет статус: {$lang['TOR_STATUS_NAME'][$tor['tor_status']]}\n\n"; $msg .= ($username = get_username($tor['checked_user_id'])) ? "Статус изменен: ". html_entity_decode($username) .", ". delta_time($tor['checked_time']) ." назад\n\n" : ""; $msg .= "Продолжить?"; $this->prompt_for_confirm($msg); @@ -74,4 +74,4 @@ if ($tor['tor_status'] != TOR_NOT_APPROVED && $tor['checked_user_id'] != $userda change_tor_status($attach_id, $new_status); $this->response['attach_id'] = $attach_id; -$this->response['status'] = $bb_cfg['tor_icons'][$new_status] .' '. $lang['tor_status'][$new_status]; \ No newline at end of file +$this->response['status'] = $bb_cfg['tor_icons'][$new_status] .' '. $lang['TOR_STATUS_NAME'][$new_status]; \ No newline at end of file diff --git a/upload/ajax/mod_action.php b/upload/ajax/mod_action.php index 0c8ac3dc8..6a7d8645c 100644 --- a/upload/ajax/mod_action.php +++ b/upload/ajax/mod_action.php @@ -15,7 +15,7 @@ switch ($mode) $status = (int) $this->request['status']; // Валидность статуса - if (!isset($lang['tor_status'][$status])) + if (!isset($lang['TOR_STATUS_NAME'][$status])) { $this->ajax_die("Такого статуса не существует: $new_status"); } @@ -48,6 +48,14 @@ switch ($mode) DB()->query("UPDATE ". BB_TOPICS ." SET topic_title = '$topic_title_sql' WHERE topic_id = $topic_id LIMIT 1"); + //Обновление кеша новостей на главной + $news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id'])); + if(isset($news_forums[$t_data['forum_id']]) && $bb_cfg['show_latest_news']) + { global $datastore; + + $datastore->enqueue('latest_news'); + $datastore->update('latest_news'); } + $this->response['topic_id'] = $topic_id; $this->response['topic_title'] = $new_title; break; diff --git a/upload/attach_mod/displaying_torrent.php b/upload/attach_mod/displaying_torrent.php index 73753a5f1..9f39cedb7 100644 --- a/upload/attach_mod/displaying_torrent.php +++ b/upload/attach_mod/displaying_torrent.php @@ -222,10 +222,10 @@ if ($tor_reged && $tor_info) 'TOR_SILVER_GOLD' => $tor_type, // torrent status mod - 'TOR_STATUS_TEXT' => $lang['tor_status'][$tor_info['tor_status']], + 'TOR_STATUS_TEXT' => $lang['TOR_STATUS_NAME'][$tor_info['tor_status']], 'TOR_STATUS_ICON' => $bb_cfg['tor_icons'][$tor_info['tor_status']], 'TOR_STATUS_BY' => ($cuid && $is_auth['auth_mod']) ? (' ·  ' . get_username($cuid) . '  ·  '. delta_time($tor_info['checked_time']) .' назад') : '', - 'TOR_STATUS_SELECT' => build_select('', array_flip($bb_cfg['change_tor_status_select']), TOR_APPROVED), + 'TOR_STATUS_SELECT' => build_select('', array_flip($bb_cfg['tor_status_name']), TOR_APPROVED), //end torrent status mod 'S_UPLOAD_IMAGE' => $upload_image, diff --git a/upload/config.php b/upload/config.php index 43217e58f..270364eee 100644 --- a/upload/config.php +++ b/upload/config.php @@ -57,7 +57,7 @@ $bb_cfg['css_ver'] = 1; // Increase number of revision after update $bb_cfg['tp_version'] = '2.0.2'; -$bb_cfg['tp_release_state'] = 'TP II r80'; +$bb_cfg['tp_release_state'] = 'TP II r81'; $bb_cfg['tp_release_date'] = '05-07-2011'; $bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger diff --git a/upload/includes/datastore/build_cat_forums.php b/upload/includes/datastore/build_cat_forums.php index ff4cb7964..53eec0366 100644 --- a/upload/includes/datastore/build_cat_forums.php +++ b/upload/includes/datastore/build_cat_forums.php @@ -131,7 +131,7 @@ if ($bb_cfg['show_latest_news'] AND $news_forum_ids = $bb_cfg['latest_news_forum $news_count = max($bb_cfg['latest_news_count'], 1); $data = DB()->fetch_rowset(" - SELECT topic_id, topic_time, topic_title + SELECT topic_id, topic_time, topic_title, forum_id FROM ". BB_TOPICS ." WHERE forum_id IN ($news_forum_ids) ORDER BY topic_time DESC diff --git a/upload/includes/functions_post.php b/upload/includes/functions_post.php index 7a2cf63a6..7bd82b486 100644 --- a/upload/includes/functions_post.php +++ b/upload/includes/functions_post.php @@ -240,6 +240,16 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_ 'post_text' => $post_message, )); + // + $news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id'])); + if(isset($news_forums[$forum_id]) && $bb_cfg['show_latest_news'] && $mode == 'newtopic') + { + global $datastore; + + $datastore->enqueue('latest_news'); + $datastore->update('latest_news'); + } + // // Add poll // diff --git a/upload/includes/init_bb.php b/upload/includes/init_bb.php index 088c76715..96d9f22bb 100644 --- a/upload/includes/init_bb.php +++ b/upload/includes/init_bb.php @@ -284,47 +284,18 @@ define('TOR_DOUBTFUL', 8); // сомнительно define('TOR_CHECKING', 9); // проверяется define('TOR_TMP', 10); // временная -// Названия -$lang['tor_status'] = array( - TOR_TMP => 'временная', - TOR_CLOSED_CPHOLD => 'закрыто правообладателем', - TOR_CLOSED => 'закрыто', - TOR_NOT_APPROVED => 'не проверено', - TOR_NEED_EDIT => 'недооформлено', - TOR_NO_DESC => 'неоформлено', - TOR_DUP => 'повтор', - TOR_CONSUMED => 'поглощено', - TOR_APPROVED => 'проверено', - TOR_CHECKING => 'проверяется', - TOR_DOUBTFUL => 'сомнительно', -); - -// Список доступных модераторам статусов -$bb_cfg['change_tor_status_select'] = array( - TOR_CLOSED => 'закрыто', - TOR_NOT_APPROVED => 'не проверено', - TOR_NEED_EDIT => 'недооформлено', - TOR_NO_DESC => 'неоформлено', - TOR_DUP => 'повтор', - TOR_CONSUMED => 'поглощено', - TOR_TMP => 'временная', - TOR_APPROVED => 'проверено', - TOR_CHECKING => 'проверяется', - TOR_DOUBTFUL => 'сомнительно', -); - $bb_cfg['tor_icons'] = array( - TOR_APPROVED => '', - TOR_CHECKING => '%', - TOR_CLOSED => 'x', - TOR_CLOSED_CPHOLD => '©', - TOR_CONSUMED => '', - TOR_DOUBTFUL => '#', - TOR_DUP => 'D', - TOR_NEED_EDIT => '?', - TOR_NO_DESC => '!', - TOR_NOT_APPROVED => '*', - TOR_TMP => 'T', + TOR_NOT_APPROVED => '*', + TOR_CLOSED => 'x', + TOR_APPROVED => '', + TOR_NEED_EDIT => '?', + TOR_NO_DESC => '!', + TOR_DUP => 'D', + TOR_CLOSED_CPHOLD => '©', + TOR_CONSUMED => '', + TOR_DOUBTFUL => '#', + TOR_CHECKING => '%', + TOR_TMP => 'T', ); // Запрет на скачивание diff --git a/upload/includes/page_footer_dev.php b/upload/includes/page_footer_dev.php index 9182d7f99..d23d54fd2 100644 --- a/upload/includes/page_footer_dev.php +++ b/upload/includes/page_footer_dev.php @@ -71,6 +71,22 @@ if (!empty($_COOKIE['explain'])) $sql_log = !empty($_COOKIE['sql_log']) ? get_sql_log() : ''; echo ' +
'; if (PROFILER) { @@ -103,25 +119,6 @@ echo ' '. (UA_IE ? '
' : '') .'
- -
'; } diff --git a/upload/index.php b/upload/index.php index c66ec43c3..8b6caa461 100644 --- a/upload/index.php +++ b/upload/index.php @@ -312,14 +312,15 @@ if ($bb_cfg['show_latest_news']) 'NEWS_TOPIC_ID' => $news['topic_id'], 'NEWS_TITLE' => $news['topic_title'], 'NEWS_TIME' => bb_date($news['topic_time'], 'd-M'), - 'NEWS_IS_NEW' => $news['topic_time'] > $lastvisit, + 'NEWS_IS_NEW' => is_unread($news['topic_time'], $news['topic_id'], $news['forum_id']), )); } } // Allow cron -if (IS_ADMIN || IS_MOD) +if (IS_AM) { - if (@file_exists(CRON_RUNNING)) { + if (@file_exists(CRON_RUNNING)) + { if (@file_exists(CRON_ALLOWED)) { unlink (CRON_ALLOWED); diff --git a/upload/language/lang_english/lang_main.php b/upload/language/lang_english/lang_main.php index b1d917c21..fbe3f3a29 100644 --- a/upload/language/lang_english/lang_main.php +++ b/upload/language/lang_english/lang_main.php @@ -1157,14 +1157,19 @@ $lang['MAGNET'] = 'Magnet'; //torrent status mod $lang['TOR_STATUS'] = 'Status'; $lang['TOR_STATUS_SELECT_ACTION'] = 'Select status'; -$lang['TOR_STATUS_CHECKED'] = 'checked';//2 -$lang['TOR_STATUS_NOT_CHECKED'] = 'not checked';//0 -$lang['TOR_STATUS_CLOSED'] = 'closed';//1 -$lang['TOR_STATUS_D'] = 'repeat';//3 -$lang['TOR_STATUS_NOT_PERFECT'] = 'neoformleno';//4 -$lang['TOR_STATUS_PART_PERFECT'] = 'nedooformleno';//5 -$lang['TOR_STATUS_FISHILY'] = 'doubtful';//6 -$lang['TOR_STATUS_COPY'] = 'closed right';//7 +$lang['TOR_STATUS_NAME'] = array( + TOR_NOT_APPROVED => 'not checked', + TOR_CLOSED => 'closed', + TOR_APPROVED => 'checked', + TOR_NEED_EDIT => 'not formalized until', + TOR_NO_DESC => 'not formalized', + TOR_DUP => 'repeat', + TOR_CLOSED_CPHOLD => 'closed right', + TOR_CONSUMED => 'absorbed', + TOR_DOUBTFUL => 'doubtful', + TOR_CHECKING => 'verified', + TOR_TMP => 'temporary', +); //end torrent status mod $lang['BT_TOPIC_TITLE'] = 'Topic title'; diff --git a/upload/language/lang_russian/lang_main.php b/upload/language/lang_russian/lang_main.php index 9d8cd25b1..0fc3f6776 100644 --- a/upload/language/lang_russian/lang_main.php +++ b/upload/language/lang_russian/lang_main.php @@ -1163,14 +1163,19 @@ $lang['MAGNET'] = 'Magnet'; //torrent status mod $lang['TOR_STATUS'] = 'Статус'; $lang['TOR_STATUS_SELECT_ACTION'] = 'Выберите статус'; -$lang['TOR_STATUS_CHECKED'] = 'проверено'; // 2 -$lang['TOR_STATUS_NOT_CHECKED'] = 'не проверено';//0 -$lang['TOR_STATUS_CLOSED'] = 'закрыто';//1 -$lang['TOR_STATUS_D'] = 'повтор';//3 -$lang['TOR_STATUS_NOT_PERFECT'] = 'неоформлено';//4 -$lang['TOR_STATUS_PART_PERFECT'] = 'недооформлено';//5 -$lang['TOR_STATUS_FISHILY'] = 'сомнительно';//6 -$lang['TOR_STATUS_COPY'] = 'закрыто правообладателем';//7 +$lang['TOR_STATUS_NAME'] = array( + TOR_NOT_APPROVED => 'не проверено', + TOR_CLOSED => 'закрыто', + TOR_APPROVED => 'проверено', + TOR_NEED_EDIT => 'недооформлено', + TOR_NO_DESC => 'неоформлено', + TOR_DUP => 'повтор', + TOR_CLOSED_CPHOLD => 'закрыто правообладателем', + TOR_CONSUMED => 'поглощено', + TOR_DOUBTFUL => 'сомнительно', + TOR_CHECKING => 'проверяется', + TOR_TMP => 'временная', +); //end torrent status mod $lang['BT_TOPIC_TITLE'] = 'Название темы'; diff --git a/upload/templates/default/viewforum.tpl b/upload/templates/default/viewforum.tpl index 17937f73e..87f34d5f0 100644 --- a/upload/templates/default/viewforum.tpl +++ b/upload/templates/default/viewforum.tpl @@ -2,10 +2,10 @@