mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/9684] Fix Forum/Topic-Tracking for global announcements
Should be ready for intensive testing now. PHPBB3-9684
This commit is contained in:
@@ -1323,35 +1323,6 @@ function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $
|
||||
{
|
||||
$mark_time = array();
|
||||
|
||||
// Get global announcement info
|
||||
if ($global_announce_list && sizeof($global_announce_list))
|
||||
{
|
||||
if (!isset($forum_mark_time[0]))
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = 'SELECT mark_time
|
||||
FROM ' . FORUMS_TRACK_TABLE . "
|
||||
WHERE user_id = {$user->data['user_id']}
|
||||
AND forum_id = 0";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($row)
|
||||
{
|
||||
$mark_time[0] = $row['mark_time'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($forum_mark_time[0] !== false)
|
||||
{
|
||||
$mark_time[0] = $forum_mark_time[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($forum_mark_time[$forum_id]) && $forum_mark_time[$forum_id] !== false)
|
||||
{
|
||||
$mark_time[$forum_id] = $forum_mark_time[$forum_id];
|
||||
@@ -1361,14 +1332,7 @@ function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $
|
||||
|
||||
foreach ($topic_ids as $topic_id)
|
||||
{
|
||||
if ($global_announce_list && isset($global_announce_list[$topic_id]))
|
||||
{
|
||||
$last_read[$topic_id] = (isset($mark_time[0])) ? $mark_time[0] : $user_lastmark;
|
||||
}
|
||||
else
|
||||
{
|
||||
$last_read[$topic_id] = $user_lastmark;
|
||||
}
|
||||
$last_read[$topic_id] = $user_lastmark;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1412,8 +1376,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
|
||||
$sql = 'SELECT forum_id, mark_time
|
||||
FROM ' . FORUMS_TRACK_TABLE . "
|
||||
WHERE user_id = {$user->data['user_id']}
|
||||
AND forum_id " .
|
||||
(($global_announce_list && sizeof($global_announce_list)) ? "IN (0, $forum_id)" : "= $forum_id");
|
||||
AND forum_id = $forum_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$mark_time = array();
|
||||
@@ -1427,14 +1390,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
|
||||
|
||||
foreach ($topic_ids as $topic_id)
|
||||
{
|
||||
if ($global_announce_list && isset($global_announce_list[$topic_id]))
|
||||
{
|
||||
$last_read[$topic_id] = (isset($mark_time[0])) ? $mark_time[0] : $user_lastmark;
|
||||
}
|
||||
else
|
||||
{
|
||||
$last_read[$topic_id] = $user_lastmark;
|
||||
}
|
||||
$last_read[$topic_id] = $user_lastmark;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1472,13 +1428,6 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
|
||||
if (sizeof($topic_ids))
|
||||
{
|
||||
$mark_time = array();
|
||||
if ($global_announce_list && sizeof($global_announce_list))
|
||||
{
|
||||
if (isset($tracking_topics['f'][0]))
|
||||
{
|
||||
$mark_time[0] = base_convert($tracking_topics['f'][0], 36, 10) + $config['board_startdate'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($tracking_topics['f'][$forum_id]))
|
||||
{
|
||||
@@ -1489,14 +1438,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
|
||||
|
||||
foreach ($topic_ids as $topic_id)
|
||||
{
|
||||
if ($global_announce_list && isset($global_announce_list[$topic_id]))
|
||||
{
|
||||
$last_read[$topic_id] = (isset($mark_time[0])) ? $mark_time[0] : $user_lastmark;
|
||||
}
|
||||
else
|
||||
{
|
||||
$last_read[$topic_id] = $user_lastmark;
|
||||
}
|
||||
$last_read[$topic_id] = $user_lastmark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user