From ebad74456a0e5eb267b694b59954c1440b6cc5f4 Mon Sep 17 00:00:00 2001 From: "gemini_13@torba.su" Date: Sat, 13 Apr 2013 22:11:47 +0000 Subject: [PATCH] r499 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Черновики до конца не доделаны, есть пара нюансов. За правки в шаблоне админки спасибо T-John. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@499 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- upload/ajax.php | 7 +- upload/ajax/view_profile.php | 119 +++++++++++------- upload/config.php | 4 +- upload/includes/emailer.class.php | 1 - upload/includes/page_header.php | 13 -- upload/includes/sessions.php | 6 +- upload/includes/sphinxapi.php | 2 +- upload/includes/ucp/usercp_viewprofile.php | 17 ++- upload/language/lang_english/lang_main.php | 2 + upload/language/lang_russian/lang_main.php | 2 + upload/posting.php | 24 +++- upload/search.php | 4 - upload/templates/admin/admin_attach_cp.tpl | 12 +- .../templates/admin/admin_bt_tracker_cfg.tpl | 2 +- upload/templates/admin/admin_extensions.tpl | 2 +- upload/templates/admin/admin_mass_email.tpl | 4 +- upload/templates/admin/admin_ranks.tpl | 1 + .../templates/admin/admin_rebuild_search.tpl | 4 +- upload/templates/admin/admin_user_search.tpl | 2 +- .../templates/default/usercp_viewprofile.tpl | 20 +-- upload/viewforum.php | 11 +- 21 files changed, 151 insertions(+), 108 deletions(-) diff --git a/upload/ajax.php b/upload/ajax.php index f94d8f55c..a8bc15a1a 100644 --- a/upload/ajax.php +++ b/upload/ajax.php @@ -45,6 +45,7 @@ switch ($ajax->action) break; case 'manage_user': + case 'modify_draft': require(INC_DIR .'functions_admin.php'); break; @@ -535,13 +536,13 @@ class ajax_common $mode = (int)$this->request['mode']; $sql = "SELECT * FROM ". BB_TOPICS ." WHERE topic_id = {$tid}"; - if (!$row = DB()->fetch_row($sql)) $this->ajax_die('Нет такого черновика'); + if (!$row = DB()->fetch_row($sql)) $this->ajax_die($lang['TOPIC_POST_NOT_EXIST']); - if ($row['topic_poster'] != $userdata['user_id'] && !IS_ADMIN) $this->ajax_die('Нельзя удалять чужие черновики'); + if ($row['topic_poster'] != $userdata['user_id'] && !IS_ADMIN) $this->ajax_die($lang['CANNOT_DELETE_DRAFT']); if (!$mode) { - DB()->query("DELETE FROM ". BB_TOPICS ." WHERE topic_id = {$tid} LIMIT 1"); + topic_delete($tid); } else { diff --git a/upload/ajax/view_profile.php b/upload/ajax/view_profile.php index d0c725533..3be0c05e4 100644 --- a/upload/ajax/view_profile.php +++ b/upload/ajax/view_profile.php @@ -11,6 +11,8 @@ switch ($mode) case 'active_torrents': $user_id = (int) $this->request['user_id']; if(!$user_id) $this->ajax_die($lang['NO_USER_ID_SPECIFIED']); + $user_info = get_userdata($user_id); + if(bf($user_info['user_opt'], 'user_opt', 'allow_dls') && !IS_AM && $user_id != $userdata['user_id']) $this->ajax_die($lang['CUR_ACTIVE_DLS_DISALLOWED']); $excluded_forums_csv = $user->get_excluded_forums(AUTH_VIEW); $not_auth_forums_sql = ($excluded_forums_csv) ? " @@ -18,6 +20,21 @@ switch ($mode) AND f.forum_parent NOT IN($excluded_forums_csv) " : ''; + $dl = ' '; + if(IS_AM || $user_id == $userdata['user_id']) + { + $dl_link = "search.php?dlu=$user_id&"; + $dl = ' + '. $lang['SEARCH_DL_WILL_DOWNLOADS'] .' + :: + '. $lang['SEARCH_DL_DOWN'] .' + :: + '. $lang['SEARCH_DL_COMPLETE'] .' + :: + '. $lang['SEARCH_DL_CANCEL'] .' + '; + } + $sql = " SELECT f.forum_id, f.forum_name, @@ -40,10 +57,11 @@ switch ($mode) $this->ajax_die('Could not query users torrent profile information', '', __LINE__, __FILE__, $sql); } + $r = $s = $l = $releasing_count = $seeding_count = $leeching_count = 0; + if ($rowset = DB()->sql_fetchrowset($result)) { $html = ''; - $r = $s = $l = $releasing_count = $seeding_count = $leeching_count = 0; for ($i=0; $i'. $lang['SEARCH_DL_WILL_DOWNLOADS'] .' - :: - '. $lang['SEARCH_DL_DOWN'] .' - :: - '. $lang['SEARCH_DL_COMPLETE'] .' - :: - '. $lang['SEARCH_DL_CANCEL'] .' - '; - } - - $this->response['active_torrents'] = ' - - -
-
'. $lang['CUR_ACTIVE_DLS'] .'
-
'. $lang['RELEASING'] .': '. $releasing_count .' :: '. $lang['SEEDING'] .': ' . $seeding_count .' :: '. $lang['LEECHING'] .': ' . $leeching_count .'
-
- -
- - - - - - - - '. $html .' - - - -
'. $lang['TYPE'] .''. $lang['FORUM'] .''. $lang['TOPICS'] .''. $lang['TORRENT'] .'
- '. $dl .' -
-
+ } + else + { + $html = ' + + '. $lang['NONE'] .' + '; } - else $this->ajax_die($lang['CUR_ACTIVE_DLS_ERROR']); + + $this->response['active_torrents'] = ' + + + + + + + + + + + + + + + + +
+

'. $lang['CUR_ACTIVE_DLS'] .'

+
'. $lang['RELEASING'] .': '. $releasing_count .' :: '. $lang['SEEDING'] .': ' . $seeding_count .' :: '. $lang['LEECHING'] .': ' . $leeching_count .'
+
+ + + +
+ + + + + + + + + + + + + + '. $html .' + + + +
'. $lang['TYPE'] .''. $lang['FORUM'] .''. $lang['TOPICS'] .''. $lang['TORRENT'] .'
+ '. $dl .' +
+
+ '; + + + break; } \ No newline at end of file diff --git a/upload/config.php b/upload/config.php index 2d56e4d9e..b318f95bc 100644 --- a/upload/config.php +++ b/upload/config.php @@ -56,8 +56,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Increase number of revision after update $bb_cfg['tp_version'] = '2.5 pre-stable'; -$bb_cfg['tp_release_date'] = '11-03-2013'; -$bb_cfg['tp_release_state'] = 'R497'; +$bb_cfg['tp_release_date'] = '14-04-2013'; +$bb_cfg['tp_release_state'] = 'R499'; // Database $charset = 'utf8'; diff --git a/upload/includes/emailer.class.php b/upload/includes/emailer.class.php index ef0d180af..e9eb68b0d 100644 --- a/upload/includes/emailer.class.php +++ b/upload/includes/emailer.class.php @@ -176,7 +176,6 @@ class emailer $bcc = (@count($this->addresses['bcc'])) ? implode(', ', $this->addresses['bcc']) : ''; // Build header - //$this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $bb_cfg['board_email'] . "\n") . "Return-Path: " . $bb_cfg['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $bb_cfg['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '') . (($bcc != '') ? "Bcc: $bcc\n" : ''); $this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $bb_cfg['board_email'] . "\n") . "Return-Path: " . $bb_cfg['board_email'] . "\nMessage-ID: <" . md5(uniqid(TIMENOW)) . "@" . $bb_cfg['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', TIMENOW) . "\nX-Priority: 0\nX-MSMail-Priority: Normal\nX-Mailer: Microsoft Office Outlook, Build 11.0.5510\nX-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441\nX-Sender: " . $bb_cfg['board_email'] . "\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '') . (($bcc != '') ? "Bcc: $bcc\n" : ''); // Send message ... removed $this->encode() from subject for time being diff --git a/upload/includes/page_header.php b/upload/includes/page_header.php index 88c01b6de..7712ee5c7 100644 --- a/upload/includes/page_header.php +++ b/upload/includes/page_header.php @@ -278,19 +278,6 @@ $template->assign_vars(array( 'U_SEARCH_SELF_BY_LAST' => "search.php?uid={$userdata['user_id']}&o=5", )); -if (!empty($page_cfg['dl_links_user_id'])) -{ - $dl_link = "search.php?dlu={$page_cfg['dl_links_user_id']}&"; - - $template->assign_vars(array( - 'SHOW_SEARCH_DL' => true, - 'U_SEARCH_DL_WILL' => $dl_link .'dlw=1', - 'U_SEARCH_DL_DOWN' => $dl_link .'dld=1', - 'U_SEARCH_DL_COMPLETE' => $dl_link .'dlc=1', - 'U_SEARCH_DL_CANCEL' => $dl_link .'dla=1', - )); -} - if (!empty($page_cfg['show_torhelp'][BB_SCRIPT]) && !empty($userdata['torhelp'])) { $ignore_time = !empty($_COOKIE['torhelp']) ? (int) $_COOKIE['torhelp'] : 0; diff --git a/upload/includes/sessions.php b/upload/includes/sessions.php index 73c41a47e..ad0d24787 100644 --- a/upload/includes/sessions.php +++ b/upload/includes/sessions.php @@ -89,7 +89,7 @@ class user_common if ($session_id) { - $SQL['WHERE'][] = "s.session_id = '$session_id'"; + $SQL['WHERE'][] = "s.session_id = '$session_id'"; if ($bb_cfg['torhelp_enabled']) { @@ -101,8 +101,8 @@ class user_common } else { - $SQL['WHERE'][] = "s.session_ip = '". USER_IP ."'"; - $SQL['WHERE'][] = "s.session_user_id = ". ANONYMOUS; + $SQL['WHERE'][] = "s.session_ip = '". USER_IP ."'"; + $SQL['WHERE'][] = "s.session_user_id = ". ANONYMOUS; $userdata_cache_id = USER_IP; } diff --git a/upload/includes/sphinxapi.php b/upload/includes/sphinxapi.php index 54d83a2b3..f5f4eab72 100644 --- a/upload/includes/sphinxapi.php +++ b/upload/includes/sphinxapi.php @@ -433,7 +433,7 @@ class SphinxClient extends cache_common // per-query settings $this->_offset = 0; - $this->_limit = 20; + $this->_limit = 2000; $this->_mode = SPH_MATCH_ALL; $this->_weights = array (); $this->_sort = SPH_SORT_RELEVANCE; diff --git a/upload/includes/ucp/usercp_viewprofile.php b/upload/includes/ucp/usercp_viewprofile.php index e62ec98a0..b5304df07 100644 --- a/upload/includes/ucp/usercp_viewprofile.php +++ b/upload/includes/ucp/usercp_viewprofile.php @@ -96,8 +96,16 @@ else if ($signature) $signature = bbcode2html($signature); } -$count_draft = DB()->fetch_row("SELECT COUNT(topic_id) as count FROM ". BB_TOPICS . " WHERE topic_poster = {$profiledata['user_id']} AND is_draft=1"); -$count_draft = $count_draft["count"]; +if($bb_cfg['status_of_draft']) +{ + $count_draft = DB()->fetch_row(" + SELECT COUNT(topic_id) as count + FROM ". BB_TOPICS . " + WHERE topic_poster = {$profiledata['user_id']} + AND is_draft = 1 + "); + $count_draft = $count_draft["count"]; +} $template->assign_vars(array( 'PAGE_TITLE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']), @@ -119,7 +127,7 @@ $template->assign_vars(array( 'LOCATION' => $profiledata['user_from'], 'USER_ACTIVE' => $profiledata['user_active'], - 'COUNT_DRAFT' => $count_draft, + 'COUNT_DRAFT' => ($bb_cfg['status_of_draft']) ? $count_draft : '', 'OCCUPATION' => $profiledata['user_occ'], 'INTERESTS' => $profiledata['user_interests'], 'SKYPE' => $profiledata['user_skype'], @@ -143,6 +151,7 @@ $template->assign_vars(array( 'SHOW_ROLE' => (IS_AM || $profile_user_id || $profiledata['user_active']), 'GROUP_MEMBERSHIP' => false, 'TRAF_STATS' => !(IS_AM || $profile_user_id), + 'U_MANAGE' => (IS_ADMIN) ? "profile.php?mode=editprofile&u={$profiledata['user_id']}" : 'profile.php?mode=editprofile', )); if (IS_ADMIN) @@ -214,8 +223,6 @@ if (IS_ADMIN) { $template->assign_vars(array( 'EDITABLE_TPLS' => true, - - 'U_MANAGE' => "profile.php?mode=editprofile&u={$profiledata['user_id']}", 'U_PERMISSIONS' => "admin/admin_ug_auth.php?mode=user&u={$profiledata['user_id']}", )); diff --git a/upload/language/lang_english/lang_main.php b/upload/language/lang_english/lang_main.php index fd68ca80b..e6b99a435 100644 --- a/upload/language/lang_english/lang_main.php +++ b/upload/language/lang_english/lang_main.php @@ -225,6 +225,7 @@ $lang['TOPIC_ANNOUNCEMENT'] = 'Announcement:'; $lang['TOPIC_STICKY'] = 'Sticky:'; $lang['TOPIC_MOVED'] = 'Moved:'; $lang['TOPIC_POLL'] = '[ Poll ]'; +$lang['TOPIC_DRAFT'] = '[ Draft ]'; $lang['MARK_TOPICS_READ'] = 'Mark all topics read'; $lang['TOPICS_MARKED_READ'] = 'The topics for this forum have now been marked read'; @@ -383,6 +384,7 @@ $lang['ATTACH_SIGNATURE'] = 'Attach signature (signatures can be changed in prof $lang['NOTIFY'] = 'Notify me when a reply is posted'; $lang['TO_DRAFT'] = 'Save as Draft'; $lang['DRAFTS'] = 'Drafts'; +$lang['CANNOT_DELETE_DRAFT'] = 'Sorry, but you may not delete other user\'s drafts'; $lang['STORED'] = 'Your message has been entered successfully.'; $lang['DELETED'] = 'Your message has been deleted successfully.'; diff --git a/upload/language/lang_russian/lang_main.php b/upload/language/lang_russian/lang_main.php index 89ebb1e6a..a0d379e43 100644 --- a/upload/language/lang_russian/lang_main.php +++ b/upload/language/lang_russian/lang_main.php @@ -223,6 +223,7 @@ $lang['TOPIC_ANNOUNCEMENT'] = 'Объявление:'; $lang['TOPIC_STICKY'] = 'Прилеплена:'; $lang['TOPIC_MOVED'] = 'Перемещена:'; $lang['TOPIC_POLL'] = '[ Опрос ]'; +$lang['TOPIC_DRAFT'] = '[ Черновик ]'; $lang['MARK_TOPICS_READ'] = 'Отметить все темы как прочтённые'; $lang['TOPICS_MARKED_READ'] = 'Все темы в этом форуме были отмечены как прочтённые'; @@ -385,6 +386,7 @@ $lang['ATTACH_SIGNATURE'] = 'Присоединить подпись (можно $lang['NOTIFY'] = 'Сообщать мне о получении ответа'; $lang['TO_DRAFT'] = 'Сохранить как черновик'; $lang['DRAFTS'] = 'Черновиков'; +$lang['CANNOT_DELETE_DRAFT'] = 'Извините, вы не можете удалять чужие черновики'; $lang['STORED'] = 'Ваше сообщение было успешно добавлено'; $lang['DELETED'] = 'Ваше сообщение было успешно удалено'; diff --git a/upload/posting.php b/upload/posting.php index 6bc8ba5ff..c1d44528b 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -525,10 +525,28 @@ else if ( ($submit || $confirm) && !$topic_has_new_posts ) if (!in_array($mode, array('editpost', 'delete', 'poll_delete'))) { $user_id = ( $mode == 'reply' || $mode == 'newtopic' ) ? $userdata['user_id'] : $post_data['poster_id']; - if (!isset($_POST['to_draft'])) + if (!$to_draft) { - update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $user_id); - } + update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $user_id); + } + else + { + update_post_stats('delete', $post_data, $forum_id, $topic_id, $post_id, $user_id); + } + } + if ($mode == 'editpost') + { + if ($post_info['is_draft'] != $to_draft) + { + if ($to_draft) + { + update_post_stats('delete', $post_data, $forum_id, $topic_id, $post_id, $post_data['poster_id']); + } + else + { + update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $post_data['poster_id']); + } + } } $attachment_mod['posting']->insert_attachment($post_id); diff --git a/upload/search.php b/upload/search.php index 71e45eb9a..ce5b2ec83 100644 --- a/upload/search.php +++ b/upload/search.php @@ -25,10 +25,6 @@ if (isset($_POST['del_my_post'])) '. $lang['INDEX_RETURN'] .' '); - if (IS_GUEST) - { - redirect('index.php'); - } if (empty($_POST['topic_id_list']) OR !$topic_csv = get_id_csv($_POST['topic_id_list'])) { bb_die($lang['NONE_SELECTED']); diff --git a/upload/templates/admin/admin_attach_cp.tpl b/upload/templates/admin/admin_attach_cp.tpl index 34036dd28..cbd5f2919 100644 --- a/upload/templates/admin/admin_attach_cp.tpl +++ b/upload/templates/admin/admin_attach_cp.tpl @@ -108,14 +108,14 @@ {L_FORUM}: - + {L_SORT_BY}:  - {S_SORT_OPTIONS} + {S_SORT_OPTIONS} {L_SORT}:  - {S_SORT_ORDER} + {S_SORT_ORDER} {S_HIDDEN_FIELDS} @@ -133,8 +133,10 @@
-
{L_VIEW}: {S_VIEW_SELECT}  {L_SORT_BY}: {S_MODE_SELECT}  {L_ORDER} {S_ORDER_SELECT}   + + {L_VIEW}: {S_VIEW_SELECT}  {L_SORT_BY}: {S_MODE_SELECT}  {L_ORDER} {S_ORDER_SELECT}   +
@@ -196,7 +198,7 @@ - + diff --git a/upload/templates/admin/admin_bt_tracker_cfg.tpl b/upload/templates/admin/admin_bt_tracker_cfg.tpl index 73f92bc0e..4437318e1 100644 --- a/upload/templates/admin/admin_bt_tracker_cfg.tpl +++ b/upload/templates/admin/admin_bt_tracker_cfg.tpl @@ -52,7 +52,7 @@ - + diff --git a/upload/templates/admin/admin_extensions.tpl b/upload/templates/admin/admin_extensions.tpl index 3d056273f..1d269595e 100644 --- a/upload/templates/admin/admin_extensions.tpl +++ b/upload/templates/admin/admin_extensions.tpl @@ -140,7 +140,7 @@ - + diff --git a/upload/templates/admin/admin_mass_email.tpl b/upload/templates/admin/admin_mass_email.tpl index ebfd50ddf..f6efa6264 100644 --- a/upload/templates/admin/admin_mass_email.tpl +++ b/upload/templates/admin/admin_mass_email.tpl @@ -19,8 +19,8 @@ - + diff --git a/upload/templates/admin/admin_ranks.tpl b/upload/templates/admin/admin_ranks.tpl index b2999bfd3..fac828828 100644 --- a/upload/templates/admin/admin_ranks.tpl +++ b/upload/templates/admin/admin_ranks.tpl @@ -25,6 +25,7 @@ diff --git a/upload/templates/admin/admin_rebuild_search.tpl b/upload/templates/admin/admin_rebuild_search.tpl index dc1261acc..accafd44f 100644 --- a/upload/templates/admin/admin_rebuild_search.tpl +++ b/upload/templates/admin/admin_rebuild_search.tpl @@ -173,7 +173,7 @@ function updateButton()
-
+
@@ -185,7 +185,7 @@ function updateButton()
-
+
diff --git a/upload/templates/admin/admin_user_search.tpl b/upload/templates/admin/admin_user_search.tpl index 4475515a3..e4a436219 100644 --- a/upload/templates/admin/admin_user_search.tpl +++ b/upload/templates/admin/admin_user_search.tpl @@ -180,7 +180,7 @@
- + diff --git a/upload/templates/default/usercp_viewprofile.tpl b/upload/templates/default/usercp_viewprofile.tpl index 6e03d8bcb..3fa70d4e8 100644 --- a/upload/templates/default/usercp_viewprofile.tpl +++ b/upload/templates/default/usercp_viewprofile.tpl @@ -179,11 +179,9 @@ ajax.callback.view_profile = function(data) { @@ -417,7 +415,7 @@ ajax.callback.view_profile = function(data) { - + @@ -463,7 +461,7 @@ ajax.callback.view_profile = function(data) { - +
# {L_FILENAME} {L_FILE_COMMENT}

{L_ALLOW_GUEST_DL}

{L_ALLOW_GUEST_DL_EXPL}
  {L_NO}{L_YES}  {L_NO}{L_YES}
     
{L_MESSAGE} - + {L_MESSAGE}

{L_STYLE_COLOR}


{L_STYLE_COLOR_FAQ}
+
 {userrow.USER}   {userrow.EMAIL}   {userrow.JOINDATE}  {userrow.POSTS}  {userrow.POSTS}   {userrow.LASTVISIT}   {L_MANAGE}   {L_PERMISSIONS} {L_ACCESS_SRV_LOAD}: {IGNORE_SRV_LOAD}
{L_DRAFTS}: {COUNT_DRAFT}{L_MAX_SPEED} {L_DL_DL_SPEED}: {SPEED_DOWN} {L_DL_UL_SPEED}: {SPEED_UP}{L_EXCHANGE}{L_EXCHANGE}
@@ -497,16 +495,6 @@ ajax.callback.view_profile = function(data) {
- - -

- -

- - -
- -
diff --git a/upload/viewforum.php b/upload/viewforum.php index e3aece9bd..351357e81 100644 --- a/upload/viewforum.php +++ b/upload/viewforum.php @@ -49,7 +49,6 @@ if (!$forum_id OR !$forum_data = @$forums['forum'][$forum_id]) // Only new $only_new = $user->opt_js['only_new']; $only_new_sql = ''; -$no_draft = "AND `t`.`is_draft` = 0"; if ($only_new == ONLY_NEW_POSTS) { $only_new_sql = "AND t.topic_last_post_time > $lastvisit"; @@ -279,6 +278,7 @@ if (!empty($_REQUEST['topicdays'])) SELECT COUNT(*) AS forum_topics FROM ". BB_TOPICS ." WHERE forum_id = $forum_id + AND is_draft != 1 AND topic_last_post_time > ". (TIMENOW - 86400*$req_topic_days) ." "; @@ -363,7 +363,6 @@ $sql = " $only_new_sql $title_match_sql $limit_topics_time_sql - $no_draft $order_sql LIMIT $start, $topics_per_page "; @@ -465,12 +464,18 @@ $template->assign_vars(array( // Okay, lets dump out the page ... foreach ($topic_rowset as $topic) { + if ($topic['is_draft'] && $topic['first_user_id'] != $userdata['user_id']) + { + continue; + } + $topic_id = $topic['topic_id']; $moved = ($topic['topic_status'] == TOPIC_MOVED); $replies = $topic['topic_replies']; $t_hot = ($replies >= $bb_cfg['hot_threshold']); $t_type = $topic['topic_type']; $separator = ''; + $topic_draft = ($topic['is_draft']) ? $lang['TOPIC_DRAFT'] .' ' : ''; $is_unread = is_unread($topic['topic_last_post_time'], $topic_id, $forum_id); if ($t_type == POST_ANNOUNCE && !defined('ANNOUNCE_SEP')) @@ -511,7 +516,7 @@ foreach ($topic_rowset as $topic) 'FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, 'HREF_TOPIC_ID' => ($moved) ? $topic['topic_moved_id'] : $topic['topic_id'], - 'TOPIC_TITLE' => wbr($topic['topic_title']), + 'TOPIC_TITLE' => $topic_draft . wbr($topic['topic_title']), 'TOPICS_SEPARATOR' => $separator, 'IS_UNREAD' => $is_unread, 'TOPIC_ICON' => get_topic_icon($topic, $is_unread),