Ik heb wel de Keep Unread mod geinstalleerd
Code: Selecteer alles
//
// Handle marking posts
//
if ( $mark_read == 'topics' )
{
//-- mod : keep unread -----------------------------------------------------------------------------
//-- delete
// if ( $userdata['session_logged_in'] )
// {
// $sql = "SELECT MAX(post_time) AS last_post
// FROM " . POSTS_TABLE . "
// WHERE forum_id = $forum_id";
// if ( !($result = $db->sql_query($sql)) )
// {
// message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
// }
//
// if ( $row = $db->sql_fetchrow($result) )
// {
// $tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();
// $tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
//
// if ( ( count($tracking_forums) + count($tracking_topics) ) >= 150 && empty($tracking_forums[$forum_id]) )
// {
// asort($tracking_forums);
// unset($tracking_forums[key($tracking_forums)]);
// }
//
// if ( $row['last_post'] > $userdata['user_lastvisit'] )
// {
// $tracking_forums[$forum_id] = time();
//
// setcookie($board_config['cookie_name'] . '_f', serialize($tracking_forums), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
// }
// }
//-- add
$board_config['tracking_forums'][$forum_id] = time();
// clean cookies
$s_topics = '';
// unreads
@reset($board_config['tracking_unreads']);
while ( list($id, $time) = @each($board_config['tracking_unreads']) )
{
$s_topics .= ( empty($s_topics) ? '' : ', ' ) . $id;
}
// reads
@reset($board_config['tracking_topics']);
while ( list($id, $time) = @each($board_config['tracking_topics']) )
{
$s_topics .= ( empty($s_topics) ? '' : ', ' ) . $id;
}
// read the relevant topic ids
$sql = "SELECT topic_id
FROM " . TOPICS_TABLE . "
WHERE topic_id IN ($s_topics)
AND forum_id = $forum_id
AND topic_moved_id = 0";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not access topics', '', __LINE__, __FILE__, $sql);
}
// clean them
while ( $row = $db->sql_fetchrow($result) )
{
if ( isset($board_config['tracking_unreads'][ $row['topic_id'] ]) )
{
unset($board_config['tracking_unreads'][ $row['topic_id'] ]);
}
if ( isset($board_config['tracking_topics'][ $row['topic_id'] ]) )
{
unset($board_config['tracking_topics'][ $row['topic_id'] ]);
}
}
// except the cookies
write_cookies($userdata);
//-- fin mod : keep unread -------------------------------------------------------------------------
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">')
);
//-- mod : keep unread -----------------------------------------------------------------------------
//-- delete
// }
//-- fin mod : keep unread -------------------------------------------------------------------------
$message = $lang['Topics_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a> ');
message_die(GENERAL_MESSAGE, $message);
}
//
// End handle marking posts
//
Voor de rest volgens mij geen verandering. Dat zou dus betekenen dat de Keep Unread niet goed werkt.
Dan is de volgende vraag, hoe dit te verbeteren???