aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-07-11 15:20:35 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-07-11 15:20:35 +0000
commit59767029a969b4cea2eacb38cb27fd784937f72e (patch)
tree3b2a8024048201998ce61d58a3df876258d8b9ad /phpBB/viewtopic.php
parent6a6910650103980c5741e9958c6067b0de772d24 (diff)
downloadforums-59767029a969b4cea2eacb38cb27fd784937f72e.tar
forums-59767029a969b4cea2eacb38cb27fd784937f72e.tar.gz
forums-59767029a969b4cea2eacb38cb27fd784937f72e.tar.bz2
forums-59767029a969b4cea2eacb38cb27fd784937f72e.tar.xz
forums-59767029a969b4cea2eacb38cb27fd784937f72e.zip
- fixed permissions for mcp (global permission settings are false if user is only able to moderate one to x forums)
- determine permission settings for submodules - further approve/disapprove work (approve_details added) git-svn-id: file:///svn/phpbb/trunk@4925 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index a8b9f04ad8..baef239f19 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -160,11 +160,11 @@ if ($user->data['user_id'] != ANONYMOUS)
break;
default:
- $extra_fields .= ', tw.notify_status, bm.order_id as bookmarked';
+ $extra_fields .= ', tw.notify_status' . (($config['allow_bookmarks']) ? ', bm.order_id as bookmarked' : '');
$join_sql_table .= ' LEFT JOIN ' . TOPICS_WATCH_TABLE . ' tw ON (tw.user_id = ' . $user->data['user_id'] . '
AND t.topic_id = tw.topic_id)';
- $join_sql_table .= ' LEFT JOIN ' . BOOKMARKS_TABLE . ' bm ON (bm.user_id = ' . $user->data['user_id'] . '
- AND t.topic_id = bm.topic_id)';
+ $join_sql_table .= ($config['allow_bookmarks']) ? ' LEFT JOIN ' . BOOKMARKS_TABLE . ' bm ON (bm.user_id = ' . $user->data['user_id'] . '
+ AND t.topic_id = bm.topic_id)' : '';
}
}
@@ -172,7 +172,7 @@ if ($user->data['user_id'] != ANONYMOUS)
// whereupon we join on the forum_id passed as a parameter ... this
// is done so navigation, forum name, etc. remain consistent with where
// user clicked to view a global topic
-$sql = 'SELECT t.topic_id, t.forum_id, t.topic_title, t.topic_attachment, t.topic_status, t.topic_approved, ' . (($auth->acl_get('m_approve')) ? 't.topic_replies_real AS topic_replies' : 't.topic_replies') . ', t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_poster, t.topic_time, t.topic_time_limit, t.topic_type, t.topic_bumped, t.topic_bumper, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_type, f.forum_id, f.forum_style, f.forum_password, f.forum_rules, f.forum_rules_link, f.forum_rules_flags' . $extra_fields . '
+$sql = 'SELECT t.topic_id, t.forum_id, t.topic_title, t.topic_attachment, t.topic_status, t.topic_approved, t.topic_replies_real, t.topic_replies, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_poster, t.topic_time, t.topic_time_limit, t.topic_type, t.topic_bumped, t.topic_bumper, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_type, f.forum_id, f.forum_style, f.forum_password, f.forum_rules, f.forum_rules_link, f.forum_rules_flags' . $extra_fields . '
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f' . $join_sql_table . "
WHERE $join_sql
AND (f.forum_id = t.forum_id
@@ -194,6 +194,10 @@ if (!($topic_data = $db->sql_fetchrow($result)))
// Extract the data
extract($topic_data);
+// We make this check here because the correct forum_id is determined
+$topic_replies = ($auth->acl_get('m_approve', $forum_id) ? $topic_replies_real : $topic_replies;
+unset($topic_replies_real);
+
if ($user->data['user_id'] != ANONYMOUS)
{
if ($config['load_db_lastread'])
@@ -497,7 +501,7 @@ $template->assign_vars(array(
'L_WATCH_TOPIC' => $s_watching_topic['title'],
'U_BOOKMARK_TOPIC' => ($user->data['user_id'] != ANONYMOUS && $config['allow_bookmarks']) ? $viewtopic_url . '&amp;bookmark=1' : '',
- 'L_BOOKMARK_TOPIC' => ($user->data['user_id'] != ANONYMOUS && $bookmarked) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'],
+ 'L_BOOKMARK_TOPIC' => ($user->data['user_id'] != ANONYMOUS && $config['allow_bookmarks'] && $bookmarked) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'],
'U_POST_NEW_TOPIC' => "posting.$phpEx$SID&amp;mode=post&amp;f=$forum_id",
'U_POST_REPLY_TOPIC' => "posting.$phpEx$SID&amp;mode=reply&amp;f=$forum_id&amp;t=$topic_id",
@@ -1259,7 +1263,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'U_REPORT' => "report.$phpEx$SID&amp;p=" . $row['post_id'],
'U_MCP_REPORT' => ($auth->acl_gets('m_', 'a_', 'f_report', $forum_id)) ? "mcp.$phpEx$SID&amp;mode=post_details&amp;p=" . $row['post_id'] : '',
'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? "mcp.$phpEx$SID&amp;i=queue&amp;mode=approve&amp;p=" . $row['post_id'] : '',
- 'U_MCP_DETAILS' => ($auth->acl_gets('a_', 'm_', $forum_id)) ? "mcp.$phpEx$SID&amp;mode=post_details&amp;p=" . $row['post_id'] : '',
+ 'U_MCP_DETAILS' => ($auth->acl_get('m_', $forum_id)) ? "mcp.$phpEx$SID&amp;mode=post_details&amp;p=" . $row['post_id'] : '',
'U_MINI_POST' => "viewtopic.$phpEx$SID&amp;p=" . $row['post_id'] . '#' . $row['post_id'],
'U_POST_ID' => ($unread_post_id == $row['post_id']) ? 'unread' : $row['post_id'],
'POST_ID' => $row['post_id'],