1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-21 07:51:33 +02:00

[ticket/9684] Remove code for global announcement in root-files

PHPBB3-9684
This commit is contained in:
Joas Schilling
2010-03-11 00:38:56 +01:00
parent 7074d19c40
commit 3352141264
10 changed files with 55 additions and 432 deletions

View File

@@ -87,8 +87,7 @@ switch ($mode)
$sql = 'SELECT f.*, t.*
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
WHERE t.topic_id = $topic_id
AND (f.forum_id = t.forum_id
OR f.forum_id = $forum_id)" .
AND f.forum_id = t.forum_id" .
(($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1');
break;
@@ -116,8 +115,7 @@ switch ($mode)
WHERE p.post_id = $post_id
AND t.topic_id = p.topic_id
AND u.user_id = p.poster_id
AND (f.forum_id = t.forum_id
OR f.forum_id = $forum_id)" .
AND f.forum_id = t.forum_id" .
(($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1');
break;
@@ -1005,60 +1003,6 @@ if ($submit || $preview || $refresh)
// Store message, sync counters
if (!sizeof($error) && $submit)
{
// Check if we want to de-globalize the topic... and ask for new forum
if ($post_data['topic_type'] != POST_GLOBAL)
{
$sql = 'SELECT topic_type, forum_id
FROM ' . TOPICS_TABLE . "
WHERE topic_id = $topic_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row && !$row['forum_id'] && $row['topic_type'] == POST_GLOBAL)
{
$to_forum_id = request_var('to_forum_id', 0);
if ($to_forum_id)
{
$sql = 'SELECT forum_type
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $to_forum_id;
$result = $db->sql_query($sql);
$forum_type = (int) $db->sql_fetchfield('forum_type');
$db->sql_freeresult($result);
if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id) || (!$auth->acl_get('m_approve', $to_forum_id) && !$auth->acl_get('f_noapprove', $to_forum_id)))
{
$to_forum_id = 0;
}
}
if (!$to_forum_id)
{
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
$template->assign_vars(array(
'S_FORUM_SELECT' => make_forum_select(false, false, false, true, true, true),
'S_UNGLOBALISE' => true)
);
$submit = false;
$refresh = true;
}
else
{
if (!$auth->acl_get('f_post', $to_forum_id))
{
// This will only be triggered if the user tried to trick the forum.
trigger_error('NOT_AUTHORISED');
}
$forum_id = $to_forum_id;
}
}
}
if ($submit)
{
// Lock/Unlock Topic