diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-05-17 13:01:17 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-05-17 13:01:17 +0000 |
commit | a2c81d763fa2e591bf3aa8f48ffeed4beb363975 (patch) | |
tree | 45b7c11ec918b0d9b98cf3a6671d0c606d15a12a /phpBB | |
parent | 94a91530da9f952a8b6e729ff187932706282f5a (diff) | |
download | forums-a2c81d763fa2e591bf3aa8f48ffeed4beb363975.tar forums-a2c81d763fa2e591bf3aa8f48ffeed4beb363975.tar.gz forums-a2c81d763fa2e591bf3aa8f48ffeed4beb363975.tar.bz2 forums-a2c81d763fa2e591bf3aa8f48ffeed4beb363975.tar.xz forums-a2c81d763fa2e591bf3aa8f48ffeed4beb363975.zip |
#11046 - properly show load button.
git-svn-id: file:///svn/phpbb/trunk@7615 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions_posting.php | 13 | ||||
-rw-r--r-- | phpBB/posting.php | 6 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/posting_editor.html | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/posting_layout.html | 1 | ||||
-rw-r--r-- | phpBB/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 @@ <!-- IF $EXTRA_POSTING_OPTIONS eq 1 --> + <!-- IF not S_SHOW_DRAFTS --> <span class="corners-bottom"><span></span></span></div> </div> + <!-- ENDIF --> <!-- IF S_HAS_ATTACHMENTS --> <div class="panel bg2"> 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 @@ <!-- ENDIF --> <form id="postform" method="post" action="{S_POST_ACTION}" onsubmit="return checkForm(this);"{S_FORM_ENCTYPE}> + <!-- IF S_DRAFT_LOADED --> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> 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 @@ <!-- ELSEIF S_PRIVMSGS --> <!-- ELSE -->{L_NO_TOPIC_FORUM}<!-- ENDIF --> </dt> - <dd class="info"><span>{draftrow.DATE}<br /><!-- IF draftrow.U_INSERT and not S_PRIVMSGS --><a href="{draftrow.U_INSERT}">{L_LOAD_DRAFT}</a> • <!-- ENDIF --><a href="{draftrow.U_VIEW_EDIT}">{L_VIEW_EDIT}</a></span></dd> + <dd class="info"><span>{draftrow.DATE}<br /><!-- IF draftrow.U_INSERT --><a href="{draftrow.U_INSERT}">{L_LOAD_DRAFT}</a> • <!-- ENDIF --><a href="{draftrow.U_VIEW_EDIT}">{L_VIEW_EDIT}</a></span></dd> <dd class="mark"><input type="checkbox" name="d[{draftrow.DRAFT_ID}]" id="d{draftrow.DRAFT_ID}" /></dd> </dl> </li> |