1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 15:16:16 +02:00
git-svn-id: file:///svn/phpbb/trunk@8228 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Henry Sudhof 2007-11-06 00:05:53 +00:00
parent 35f205ea61
commit 5abe1ea4fe
2 changed files with 27 additions and 17 deletions

View File

@ -95,6 +95,7 @@
<li>[Sec] Fix bbcode helpline display for custom bbcodes - this requires style changes for any custom style (Bug #14850)</li>
<li>[Fix] Correctly count announcements when filtering forums by date (Bug #14877)</li>
<li>[Fix] Allow charset names containing underscores or spaces</li>
<li>[Fix] Don't allow previous/next links for non-existing topics (Bug #15039)</li>
<li>[Change] Do not assign converted votes to the first option in a vote.</li>
</ul>

View File

@ -116,34 +116,43 @@ if ($view && !$post_id)
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$sql = 'SELECT topic_id, forum_id
FROM ' . TOPICS_TABLE . '
WHERE forum_id = ' . $row['forum_id'] . "
AND topic_moved_id = 0
AND topic_last_post_time $sql_condition {$row['topic_last_post_time']}
" . (($auth->acl_get('m_approve', $row['forum_id'])) ? '' : 'AND topic_approved = 1') . "
ORDER BY topic_last_post_time $sql_ordering";
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$row)
{
$user->setup('viewtopic');
// OK, the topic doesn't exist. This error message is not helpful, but technically correct.
trigger_error(($view == 'next') ? 'NO_NEWER_TOPICS' : 'NO_OLDER_TOPICS');
}
else
{
$topic_id = $row['topic_id'];
$sql = 'SELECT topic_id, forum_id
FROM ' . TOPICS_TABLE . '
WHERE forum_id = ' . $row['forum_id'] . "
AND topic_moved_id = 0
AND topic_last_post_time $sql_condition {$row['topic_last_post_time']}
" . (($auth->acl_get('m_approve', $row['forum_id'])) ? '' : 'AND topic_approved = 1') . "
ORDER BY topic_last_post_time $sql_ordering";
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Check for global announcement correctness?
if (!$row['forum_id'] && !$forum_id)
if (!$row)
{
trigger_error('NO_TOPIC');
$user->setup('viewtopic');
trigger_error(($view == 'next') ? 'NO_NEWER_TOPICS' : 'NO_OLDER_TOPICS');
}
else if ($row['forum_id'])
else
{
$forum_id = $row['forum_id'];
$topic_id = $row['topic_id'];
// Check for global announcement correctness?
if (!$row['forum_id'] && !$forum_id)
{
trigger_error('NO_TOPIC');
}
else if ($row['forum_id'])
{
$forum_id = $row['forum_id'];
}
}
}
}