diff --git a/upload/includes/page_header.php b/upload/includes/page_header.php index 7712ee5c7..5fc1427c8 100644 --- a/upload/includes/page_header.php +++ b/upload/includes/page_header.php @@ -276,6 +276,8 @@ $template->assign_vars(array( 'SELECTED' => HTML_SELECTED, 'U_SEARCH_SELF_BY_LAST' => "search.php?uid={$userdata['user_id']}&o=5", + 'U_WATCHED_TOPICS' => "profile.php?mode=watch", + 'U_MY_DRAFTS' => "profile.php?mode=viewdraft&u={$userdata['user_id']}", )); if (!empty($page_cfg['show_torhelp'][BB_SCRIPT]) && !empty($userdata['torhelp'])) diff --git a/upload/includes/ucp/usercp_viewprofile.php b/upload/includes/ucp/usercp_viewprofile.php index cd560b72b..ec79fdf64 100644 --- a/upload/includes/ucp/usercp_viewprofile.php +++ b/upload/includes/ucp/usercp_viewprofile.php @@ -143,7 +143,7 @@ $template->assign_vars(array( 'U_SEARCH_USER' => "search.php?search_author=1&uid={$profiledata['user_id']}", 'U_SEARCH_TOPICS' => "search.php?uid={$profiledata['user_id']}&myt=1", 'U_SEARCH_RELEASES' => "tracker.php?rid={$profiledata['user_id']}#results", - 'U_WATCHED_TOPICS' => "profile.php?mode=watch", + 'U_DRAFTS' => "profile.php?mode=viewdraft&u={$profiledata['user_id']}", 'S_PROFILE_ACTION' => 'profile.php', diff --git a/upload/search.php b/upload/search.php index 68de9068f..48178a956 100644 --- a/upload/search.php +++ b/upload/search.php @@ -465,7 +465,7 @@ if ($post_mode) // Run initial search for post_ids if (!$items_found) { - $join_t = ($title_match || $my_topics || $new_topics || in_array($order_val, array($ord_last_p, $ord_created, $ord_name, $ord_repl))); + $join_t = ($title_match || $my_topics || $new_topics || in_array($order_val, array($ord_last_p, $ord_created, $ord_name, $ord_repl || $bb_cfg['status_of_draft']))); $join_s = ($text_match_sql && !$title_match); $join_p = ($my_posts || $join_s); @@ -476,7 +476,7 @@ if ($post_mode) $SQL['SELECT'][] = ($join_t && !$join_p) ? 't.topic_first_post_id AS item_id' : 'p.post_id AS item_id'; // FROM - if ($join_t || $bb_cfg['status_of_draft']) $SQL['FROM'][] = $topics_tbl; + if ($join_t) $SQL['FROM'][] = $topics_tbl; if ($join_p) $SQL['FROM'][] = $posts_tbl; if (!$SQL['FROM']) @@ -629,7 +629,7 @@ else // Run initial search for topic_ids if (!$items_found) { - $join_t = ($title_match || $my_topics || $new_topics || $dl_search || $new_posts || in_array($order_val, array($ord_last_p, $ord_created, $ord_name, $ord_repl))); + $join_t = ($title_match || $my_topics || $new_topics || $dl_search || $new_posts || in_array($order_val, array($ord_last_p, $ord_created, $ord_name, $ord_repl || $bb_cfg['status_of_draft']))); $join_s = ($text_match_sql && !$title_match); $join_p = ($my_posts || $join_s); $join_dl = ($dl_search); diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl index 18f3171d4..7278f711b 100644 --- a/upload/templates/default/page_header.tpl +++ b/upload/templates/default/page_header.tpl @@ -462,9 +462,10 @@ $(document).ready(function() { diff --git a/upload/templates/default/usercp_viewprofile.tpl b/upload/templates/default/usercp_viewprofile.tpl index b14f1ac1a..6fb6efb01 100644 --- a/upload/templates/default/usercp_viewprofile.tpl +++ b/upload/templates/default/usercp_viewprofile.tpl @@ -418,7 +418,7 @@ ajax.callback.view_profile = function(data) { {L_DRAFTS}: - {COUNT_DRAFT} + {COUNT_DRAFT}