From: Andreas F. <ba...@ph...> - 2009-09-07 00:40:06
|
Author: bantu Date: Mon Sep 7 01:38:20 2009 New Revision: 10113 Log: Adjustments to r10005: Use request_var() to get cookie data. Some more adjustments to get_unread_topics_list() Related to report: #46765 Modified: branches/phpBB-3_0_0/phpBB/includes/functions.php Modified: branches/phpBB-3_0_0/phpBB/includes/functions.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions.php Mon Sep 7 01:38:20 2009 *************** *** 1671,1680 **** { global $config, $db, $user; ! if ($user_id === false) ! { ! $user_id = (int) $user->data['user_id']; ! } if (empty($sql_sort)) { --- 1671,1677 ---- { global $config, $db, $user; ! $user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id; if (empty($sql_sort)) { *************** *** 1697,1710 **** while ($row = $db->sql_fetchrow($result)) { if ($row['topic_last_post_time'] <= $row['mark_time']) { // Check if there're read topics for the forums having unread ones ! $read_topics_list[$row['topic_id']] = (int) $row['mark_time']; } else { ! $unread_topics_list[$row['topic_id']] = (int) $row['mark_time']; } } $db->sql_freeresult($result); --- 1694,1709 ---- while ($row = $db->sql_fetchrow($result)) { + $topic_id = (int) $row['topic_id']; + if ($row['topic_last_post_time'] <= $row['mark_time']) { // Check if there're read topics for the forums having unread ones ! $read_topics_list[$topic_id] = (int) $row['mark_time']; } else { ! $unread_topics_list[$topic_id] = (int) $row['mark_time']; } } $db->sql_freeresult($result); *************** *** 1729,1735 **** while ($row = $db->sql_fetchrow($result)) { ! $unread_topics_list[$row['topic_id']] = (int) $row['mark_time']; } $db->sql_freeresult($result); --- 1728,1734 ---- while ($row = $db->sql_fetchrow($result)) { ! $unread_topics_list[(int) $row['topic_id']] = (int) $row['mark_time']; } $db->sql_freeresult($result); *************** *** 1765,1771 **** while ($row = $db->sql_fetchrow($result)) { ! $unread_topics_list[$row['topic_id']] = (int) $user->data['user_lastmark']; } $db->sql_freeresult($result); } --- 1764,1770 ---- while ($row = $db->sql_fetchrow($result)) { ! $unread_topics_list[(int) $row['topic_id']] = (int) $user->data['user_lastmark']; } $db->sql_freeresult($result); } *************** *** 1775,1783 **** { global $tracking_topics; ! if (!isset($tracking_topics) || !sizeof($tracking_topics)) { ! $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : ''; $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array(); } --- 1774,1782 ---- { global $tracking_topics; ! if (empty($tracking_topics)) { ! $tracking_topics = request_var($config['cookie_name'] . '_track', '', false, true); $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array(); } *************** *** 1787,1793 **** } else { ! $user_lastmark = $user->data['user_lastmark']; } $sql = 'SELECT t.topic_id, t.forum_id, t.topic_last_post_time --- 1786,1792 ---- } else { ! $user_lastmark = (int) $user->data['user_lastmark']; } $sql = 'SELECT t.topic_id, t.forum_id, t.topic_last_post_time *************** *** 1795,1801 **** WHERE t.topic_last_post_time > ' . $user_lastmark . " $sql_extra $sql_sort"; - $result = $db->sql_query_limit($sql, $sql_limit); while ($row = $db->sql_fetchrow($result)) --- 1794,1799 ---- *************** *** 1824,1830 **** { $unread_topics_list[$topic_id] = $user_lastmark; } - } $db->sql_freeresult($result); } --- 1822,1827 ---- |