From a2c81d763fa2e591bf3aa8f48ffeed4beb363975 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 17 May 2007 13:01:17 +0000 Subject: [PATCH] #11046 - properly show load button. git-svn-id: file:///svn/phpbb/trunk@7615 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_posting.php | 13 ++++++++++--- phpBB/posting.php | 6 +++--- phpBB/styles/prosilver/template/posting_editor.html | 2 ++ phpBB/styles/prosilver/template/posting_layout.html | 1 + .../styles/prosilver/template/ucp_main_drafts.html | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index bea1c7397b..9fe27fdd1a 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -844,13 +844,20 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) $link_topic = $link_forum = $link_pm = false; $insert_url = $view_url = $title = ''; - if (isset($topic_rows[$draft['topic_id']]) && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) + if (isset($topic_rows[$draft['topic_id']]) + && ( + ($topic_rows[$draft['topic_id']]['forum_id'] && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) + || + (!$topic_rows[$draft['topic_id']]['forum_id'] && $auth->acl_getf_global('f_read')) + )) { + $topic_forum_id = ($topic_rows[$draft['topic_id']]['forum_id']) ? $topic_rows[$draft['topic_id']]['forum_id'] : $forum_id; + $link_topic = true; - $view_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id']); + $view_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_forum_id . '&t=' . $draft['topic_id']); $title = $topic_rows[$draft['topic_id']]['topic_title']; - $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']); + $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $topic_forum_id . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']); } else if ($draft['forum_id'] && $auth->acl_get('f_read', $draft['forum_id'])) { diff --git a/phpBB/posting.php b/phpBB/posting.php index c14cde21d4..77f8aa720d 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -412,9 +412,9 @@ if ($user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ($mode == { $sql = 'SELECT draft_id FROM ' . DRAFTS_TABLE . ' - WHERE (forum_id IN (' . $forum_id . ', 0)' . (($topic_id) ? " OR topic_id = $topic_id" : '') . ') - AND (forum_id <> 0 AND topic_id <> 0) - AND user_id = ' . $user->data['user_id'] . + WHERE user_id = ' . $user->data['user_id'] . + (($forum_id) ? ' AND forum_id = ' . (int) $forum_id : '') . + (($topic_id) ? ' AND topic_id = ' . (int) $topic_id : '') . (($draft_id) ? " AND draft_id <> $draft_id" : ''); $result = $db->sql_query_limit($sql, 1); diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index e13941003c..578f80c892 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -141,8 +141,10 @@ + +
diff --git a/phpBB/styles/prosilver/template/posting_layout.html b/phpBB/styles/prosilver/template/posting_layout.html index ed7733852a..b5c5e7dcfd 100644 --- a/phpBB/styles/prosilver/template/posting_layout.html +++ b/phpBB/styles/prosilver/template/posting_layout.html @@ -22,6 +22,7 @@
+
diff --git a/phpBB/styles/prosilver/template/ucp_main_drafts.html b/phpBB/styles/prosilver/template/ucp_main_drafts.html index 80805b69f0..b60e478ce3 100644 --- a/phpBB/styles/prosilver/template/ucp_main_drafts.html +++ b/phpBB/styles/prosilver/template/ucp_main_drafts.html @@ -44,7 +44,7 @@ {L_NO_TOPIC_FORUM} -
{draftrow.DATE}
{L_LOAD_DRAFT}{L_VIEW_EDIT}
+
{draftrow.DATE}
{L_LOAD_DRAFT}{L_VIEW_EDIT}