Unread posts - Civinfo
Reply
 
LinkBack Thread Tools
post #1 of 21 (permalink) Old 27th August 2006, 17:52 Thread Starter
Administrator
 
Pottsy's Avatar
 
Car: Jag XF 3.0
Join Date: 10th April 2006
Location: Leics ENGLAND
Posts: 12,496
Thanks: 127
Thanked 2,774 Times in 824 Posts
iTrader: (0)
Eco display
Send a message via Skype™ to Pottsy
Unread posts

Just a little change to the way the forum works (I've been wanting to do this for ages) - now if you log off or change browsers, the forum will remember all your unread posts. The unread posts info is stored in the database, so it will remember them even if you change computers.

Furthermore, you can mark a read post as unread (to kind of bookmark it, if you like) by clicking on the "mark" button (near the quote button), or the little yellow mark icon for those of you using subsilver.

If you want to make the forum work as it used to, where everything appears "read" between visits, then click on "Mark all forums as read" on the index page before you go:

read1.gif

read2.gif

Hope this makes things easier, especially when we're busy!

Pottsy
Pottsy is offline  
Sponsored Links
Advertisement
 
post #2 of 21 (permalink) Old 27th August 2006, 19:57
 
Ancient Nerd's Avatar
 
Join Date: 5th May 2006
Location: Norfolk
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
iTrader: (0)
Sounds good. Many thanks.
Ancient Nerd is offline  
post #3 of 21 (permalink) Old 27th August 2006, 21:01
Administrator
 
basegreen's Avatar
 
Join Date: 15th April 2006
Location: noitacoL
Posts: 3,005
Thanks: 3
Thanked 178 Times in 24 Posts
iTrader: (2)
Send a message via MSN to basegreen
Brilliant, didnt know you could enable this change on the software!

This will really help me out
basegreen is offline  
 
post #4 of 21 (permalink) Old 27th August 2006, 21:34 Thread Starter
Administrator
** Thread starter **
 
Pottsy's Avatar
 
Car: Jag XF 3.0
Join Date: 10th April 2006
Location: Leics ENGLAND
Posts: 12,496
Thanks: 127
Thanked 2,774 Times in 824 Posts
iTrader: (0)
Eco display
Send a message via Skype™ to Pottsy
bg, it's easy. To enable it, you just have to do this:

[code:1:1be0c87364]
#
#-----[ COPY ]------------------------------------------
#
copy icon_keep_unread.gif to templates/subSilver/images/icon_keep_unread.gif

#
#-----[ SQL ]-------------------------------------------------
#
ALTER TABLE phpbb_users ADD user_unread_topics TEXT;

#
#-----[ OPEN ]------------------------------------------------
#
index.php

#
#-----[ FIND ]------------------------------------------------
#
// End session management
//

#
#-----[ AFTER, ADD ]------------------------------------------------
#
//START MOD Keep_unread_2 * set $toggle_unreads_link so that later on the script knows wheter to run the extra queries to toggle view unread link text depending on whether or not there are unread posts
$toggle_unreads_link = true;
//END MOD Keep_unread

#
#-----[ FIND ]------------------------------------------------
#
if( $mark_read == 'forums' )
{
if( $userdata['session_logged_in'] )
{
setcookie($board_config['cookie_name'] . '_f_all', time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
}

$template->assign_vars(array(

#
#-----[ REPLACE WITH ]----------------------------------------
#
if( $mark_read == 'forums' )
{
//START MOD Keep_unread_2 * Mark everything as read
$board_config['tracking_time'] = time(); //at this moment
$board_config['tracking_forums'] = array(); //clean
$board_config['tracking_unreads'] = array(); //clean
write_cookies($userdata);
//END MOD Keep_unread_2

$template->assign_vars(array(

#
#-----[ FIND ]------------------------------------------------
#
$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config[ 'cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_confi g['cookie_name'] . "_t"]) : array();
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config[ 'cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_confi g['cookie_name'] . "_f"]) : array();

#
#-----[ REPLACE WITH ]----------------------------------------
#
//MOD Keep_unread * deleted
// $tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config[ 'cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_confi g['cookie_name'] . "_t"]) : array();
// $tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config[ 'cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_confi g['cookie_name'] . "_f"]) : array();
//END MOD Keep_unread

#
#-----[ FIND ]------------------------------------------------
#
//
// Obtain a list of topic ids which contain
// posts made since user last visited
//
if ($userdata['session_logged_in']&#41 ;
{
// 60 days limit
if &#40;$userdata&#91;'user_lastvisit'&#93; < &#40;time&#40;&#41; - 5184000&#41;&#41;
&#123;
$userdata&#91;'user_lastvisit'&#93; = time&#40;&#41; - 5184000;
&#125;

$sql = "SELECT t.forum_id, t.topic_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE p.post_id = t.topic_last_post_id
AND p.post_time > " . $userdata&#91;'user_lastvisit'&#93; . "
AND t.topic_moved_id = 0";
if &#40; !&#40;$result = $db->sql_query&#40;$sql&#41;&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql&#41;;
&#125;

$new_topic_data = array&#40;&#41;;
while&#40; $topic_data = $db->sql_fetchrow&#40;$result&#41; &#41;
&#123;
$new_topic_data&#91;$topic_data&#91;'forum_id'&#93 ;&#93;&#91;$topic_data&#91;'topic_id'&#93;&#93; = $topic_data&#91;'post_time'&#93;;
&#125;
$db->sql_freeresult&#40;$result&#41;;
&#125;

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#
//MOD Keep_unread_2 * Get new_unreads list and forum_unread flags, save cookies etc.
$new_unreads = list_new_unreads&#40;$forum_unreads, $toggle_unreads_link&#41;;
//END MOD Keep_unread_2

#
#-----&#91; FIND &#93;------------------------------------------------
#
else
&#123;
$unread_topics = false;
if &#40; $userdata&#91;'session_logged_in'&#93; &#41;
&#123;
if &#40; !empty&#40;$new_topic_data&#91;$forum_id&#93;&#41; &#41;
&#123;
$forum_last_post_time = 0;

while&#40; list&#40;$check_topic_id, $check_post_time&#41; = @each&#40;$new_topic_data&#91;$forum_id&#93;&#41; &#41;
&#123;
if &#40; empty&#40;$tracking_topics&#91;$check_topic_id&#93 ;&#41; &#41;
&#123;
$unread_topics = true;
$forum_last_post_time = max&#40;$check_post_time, $forum_last_post_time&#41;;

&#125;
else
&#123;
if &#40; $tracking_topics&#91;$check_topic_id&#93; < $check_post_time &#41;
&#123;
$unread_topics = true;
$forum_last_post_time = max&#40;$check_post_time, $forum_last_post_time&#41;;
&#125;
&#125;
&#125;

if &#40; !empty&#40;$tracking_forums&#91;$forum_id&#93;&#41 ; &#41;
&#123;
if &#40; $tracking_forums&#91;$forum_id&#93; > $forum_last_post_time &#41;
&#123;
$unread_topics = false;
&#125;
&#125;

if &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_f_all'&#93;&#41; &#41;
&#123;
if &#40; $HTTP_COOKIE_VARS&#91;$board_config&#91;'cookie_na me'&#93; . '_f_all'&#93; > $forum_last_post_time &#41;
&#123;
$unread_topics = false;
&#125;
&#125;

&#125;
&#125;

$folder_image = &#40; $unread_topics &#41; ? $images&#91;'forum_new'&#93; &#58; $images&#91;'forum'&#93;;
$folder_alt = &#40; $unread_topics &#41; ? $lang&#91;'New_posts'&#93; &#58; $lang&#91;'No_new_posts'&#93;;
&#125;

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#
else
&#123;
//MOD Keep_Unread_2 * Forum_unread flags set earlier
$unread_topic = $forum_unreads&#91;$forum_id&#93;;
$folder_image = &#40; $unread_topic &#41; ? $images&#91;'forum_new'&#93; &#58; $images&#91;'forum'&#93;;
$folder_alt = &#40; $unread_topic &#41; ? $lang&#91;'New_posts'&#93; &#58; $lang&#91;'No_new_posts'&#93;;
&#125;

#
#-----&#91; OPEN &#93;------------------------------------------------
#
posting.php

#
#-----&#91; FIND &#93;------------------------------------------------
#
if &#40; $mode == 'newtopic' || $mode == 'reply' &#41;
&#123;
$tracking_topics = &#40; !empty&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91 ;'cookie_name'&#93; . '_t'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_t'&#93;&#41; &#58; array&#40;&#41;;
$tracking_forums = &#40; !empty&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91 ;'cookie_name'&#93; . '_f'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_f'&#93;&#41; &#58; array&#40;&#41;;

if &#40; count&#40;$tracking_topics&#41; + count&#40;$tracking_forums&#41; == 100 && empty&#40;$tracking_topics&#91;$topic_id&#93;&#41; &#41;
&#123;
asort&#40;$tracking_topics&#41;;
unset&#40;$tracking_topics&#91;key&#40;$tracking_t opics&#41;&#93;&#41;;
&#125;

$tracking_topics&#91;$topic_id&#93; = time&#40;&#41;;

setcookie&#40;$board_config&#91;'cookie_name'&#93; . '_t', serialize&#40;$tracking_topics&#41;, 0, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
&#125;

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#
//START MOD Keep_unread_2
if &#40; $mode == 'newtopic' || $mode == 'reply' || $mode == 'quote' || &#40;$mode == 'editpost' && $post_data&#91;'last_post'&#93;&#41; &#41;
&#123;
$board_config&#91;'tracking_unreads'&#93;&#91;$top ic_id&#93; = time&#40;&#41;;
write_cookies&#40;$userdata&#41;;
&#125;
//END MOD Keep_unread_2

#
#-----&#91; OPEN &#93;------------------------------------------------
#
search.php

#
#-----&#91; FIND &#93;------------------------------------------------
#
if &#40; $search_id == 'newposts' &#41;
&#123;
if &#40; $userdata&#91;'session_logged_in'&#93; &#41;
&#123;
$sql = "SELECT post_id
FROM " . POSTS_TABLE . "
WHERE post_time >= " . $userdata&#91;'user_lastvisit'&#93;;
&#125;
else
&#123;
redirect&#40;append_sid&#40;"login.$phpEx?redirect =search.$phpEx&search_id=newposts", true&#41;&#41;;
&#125;

$show_results = 'topics';
$sort_by = 0;
$sort_dir = 'DESC';
&#125;

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#
if &#40; $search_id == 'newposts' &#41;
&#123;
//START MOD Keep_unread_2
$list_unreads = implode&#40;',', array_keys&#40;list_new_unreads&#40;$dummy, $toggle_unreads_link&#41;&#41;&#41;;
$sql = "SELECT post_id, topic_id, forum_id, post_time
FROM " . POSTS_TABLE . "
WHERE ";//post_time >= " . $userdata&#91;'user_lastvisit'&#93; ;
$sql .= &#40;$list_unreads != ''&#41; ? " topic_id IN &#40;" . $list_unreads . "&#41;" &#58; " topic_id=-1";
//END MOD Keep_unread_2
$show_results = 'topics';
$sort_by = 0;
$sort_dir = 'DESC';
&#125;

#
#-----&#91; FIND &#93;------------------------------------------------
#
if &#40; !&#40;$result = $db->sql_query&#40;$sql&#41;&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql&#41;;
&#125;

$search_ids = array&#40;&#41;;
while&#40; $row = $db->sql_fetchrow&#40;$result&#41; &#41;
&#123;
$search_ids&#91;&#93; = $row&#91;'post_id'&#93;;
&#125;
$db->sql_freeresult&#40;$result&#41;;

$total_match_count = count&#40;$search_ids&#41;;

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#
if &#40; !&#40;$result = $db->sql_query&#40;$sql&#41;&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not obtain posts list', '', __LINE__, __FILE__, $sql&#41;;
&#125;

// Add posts to list of id's
while&#40; $row = $db->sql_fetchrow&#40;$result&#41; &#41;
&#123;
//START MOD Keep_unread_2
$topic_id = $row&#91;'topic_id'&#93;;
$forum_id = $row&#91;'forum_id'&#93;;
$unread_topic = true;
//Don't add post if you've read it and you want new posts only
if &#40; &#40;$search_id == 'newposts'&#41; &#41;
&#123;
$unread_topic = &#40; $row&#91;'post_time'&#93; > topic_last_read&#40;$forum_id, $topic_id&#41; &#41;;
&#125;
if &#40; $unread_topic &#41; $search_ids&#91;&#93; = $row&#91;'post_id'&#93;;
//END MOD Keep_unread_2
&#125;
$db->sql_freeresult&#40;$result&#41;;

$total_match_count = count&#40;$search_ids&#41;;

#
#-----&#91; FIND &#93;------------------------------------------------
#
$highlight_active = urlencode&#40;trim&#40;$highlight_active&#41;&#41; ;

$tracking_topics = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_t'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_t'&#93;&#41; &#58; array&#40;&#41;;
$tracking_forums = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_f'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_f'&#93;&#41; &#58; array&#40;&#41;;

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#
$highlight_active = urlencode&#40;trim&#40;$highlight_active&#41;&#41; ;

//MOD Keep_unread_2
//$tracking_topics = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_t'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_t'&#93;&#41; &#58; array&#40;&#41;;
//$tracking_forums = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_f'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_f'&#93;&#41; &#58; array&#40;&#41;;
//END MOD Keep_unread_2

#
#-----&#91; FIND &#93;------------------------------------------------
#
if &#40; $userdata&#91;'session_logged_in'&#93; && $searchset&#91;$i&#93;&#91;'post_time'&#93; > $userdata&#91;'user_lastvisit'&#93; &#41;
&#123;
if &#40; !empty&#40;$tracking_topics&#91;$topic_id&#93;&#41 ; && !empty&#40;$tracking_forums&#91;$forum_id&#93;&#41 ; &#41;
&#123;
$topic_last_read = &#40; $tracking_topics&#91;$topic_id&#93; > $tracking_forums&#91;$forum_id&#93; &#41; ? $tracking_topics&#91;$topic_id&#93; &#58; $tracking_forums&#91;$forum_id&#93;;
&#125;
else if &#40; !empty&#40;$tracking_topics&#91;$topic_id&#93;&#41 ; || !empty&#40;$tracking_forums&#91;$forum_id&#93;&#41 ; &#41;
&#123;
$topic_last_read = &#40; !empty&#40;$tracking_topics&#91;$topic_id&#93;&#41 ; &#41; ? $tracking_topics&#91;$topic_id&#93; &#58; $tracking_forums&#91;$forum_id&#93;;
&#125;

if &#40; $searchset&#91;$i&#93;&#91;'post_time'&#93; > $topic_last_read &#41;
&#123;
$mini_post_img = $images&#91;'icon_minipost_new'&#93;;
$mini_post_alt = $lang&#91;'New_post'&#93;;
&#125;
else
&#123;
$mini_post_img = $images&#91;'icon_minipost'&#93;;
$mini_post_alt = $lang&#91;'Post'&#93;;
&#125;
&#125;
else
&#123;
$mini_post_img = $images&#91;'icon_minipost'&#93;;
$mini_post_alt = $lang&#91;'Post'&#93;;
&#125;

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#
//START MOD Keep_unread_2
$topic_id = $searchset&#91;$i&#93;&#91;'topic_id'&#93;;
$forum_id = $searchset&#91;$i&#93;&#91;'forum_id'&#93;;
$topic_last_read = topic_last_read&#40;$forum_id, $topic_id&#41;;
if &#40; $searchset&#91;$i&#93;&#91;'post_time'&#93; > $topic_last_read &#41; // unread status ?
&#123;
$mini_post_img = $images&#91;'icon_minipost_new'&#93;;
$mini_post_alt = $lang&#91;'New_post'&#93;;
&#125;
else
&#123;
$mini_post_img = $images&#91;'icon_minipost'&#93;;
$mini_post_alt = $lang&#91;'Post'&#93;;
&#125;
//END MOD Keep_unread_2

#
#-----&#91; FIND &#93;------------------------------------------------
#
if &#40; $userdata&#91;'session_logged_in'&#93; &#41;
&#123;
if &#40; $searchset&#91;$i&#93;&#91;'post_time'&#93; > $userdata&#91;'user_lastvisit'&#93; &#41;
&#123;
if &#40; !empty&#40;$tracking_topics&#41; || !empty&#40;$tracking_forums&#41; || isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_f_all'&#93;&#41; &#41;
&#123;

$unread_topics = true;

if &#40; !empty&#40;$tracking_topics&#91;$topic_id&#93;&#41 ; &#41;
&#123;
if &#40; $tracking_topics&#91;$topic_id&#93; > $searchset&#91;$i&#93;&#91;'post_time'&#93; &#41;
&#123;
$unread_topics = false;
&#125;
&#125;

if &#40; !empty&#40;$tracking_forums&#91;$forum_id&#93;&#41 ; &#41;
&#123;
if &#40; $tracking_forums&#91;$forum_id&#93; > $searchset&#91;$i&#93;&#91;'post_time'&#93; &#41;
&#123;
$unread_topics = false;
&#125;
&#125;

if &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_f_all'&#93;&#41; &#41;
&#123;
if &#40; $HTTP_COOKIE_VARS&#91;$board_config&#91;'cookie_na me'&#93; . '_f_all'&#93; > $searchset&#91;$i&#93;&#91;'post_time'&#93; &#41;
&#123;
$unread_topics = false;
&#125;
&#125;

if &#40; $unread_topics &#41;
&#123;
$folder_image = $folder_new;
$folder_alt = $lang&#91;'New_posts'&#93;;

$newest_post_img = '[img]' . $images&#91;'icon_newest_reply'&#93; . '[/img] ';
&#125;
else
&#123;
$folder_alt = &#40; $searchset&#91;$i&#93;&#91;'topic_status'&#93; == TOPIC_LOCKED &#41; ? $lang&#91;'Topic_locked'&#93; &#58; $lang&#91;'No_new_posts'&#93;;

$folder_image = $folder;
$folder_alt = $folder_alt;
$newest_post_img = '';
&#125;

&#125;
else if &#40; $searchset&#91;$i&#93;&#91;'post_time'&#93; > $userdata&#91;'user_lastvisit'&#93; &#41;
&#123;
$folder_image = $folder_new;
$folder_alt = $lang&#91;'New_posts'&#93;;

$newest_post_img = '[img]' . $images&#91;'icon_newest_reply'&#93; . '[/img] ';
&#125;
else
&#123;
$folder_image = $folder;
$folder_alt = &#40; $searchset&#91;$i&#93;&#91;'topic_status'&#93; == TOPIC_LOCKED &#41; ? $lang&#91;'Topic_locked'&#93; &#58; $lang&#91;'No_new_posts'&#93;;
$newest_post_img = '';
&#125;
&#125;
else
&#123;
$folder_image = $folder;
$folder_alt = &#40; $searchset&#91;$i&#93;&#91;'topic_status'&#93; == TOPIC_LOCKED &#41; ? $lang&#91;'Topic_locked'&#93; &#58; $lang&#91;'No_new_posts'&#93;;
$newest_post_img = '';
&#125;
&#125;
else
&#123;
$folder_image = $folder;
$folder_alt = &#40; $searchset&#91;$i&#93;&#91;'topic_status'&#93; == TOPIC_LOCKED &#41; ? $lang&#91;'Topic_locked'&#93; &#58; $lang&#91;'No_new_posts'&#93;;
$newest_post_img = '';
&#125;
&#125;

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#
//START MOD Keep_unread_2
$topic_id = $searchset&#91;$i&#93;&#91;'topic_id'&#93;;
$forum_id = $searchset&#91;$i&#93;&#91;'forum_id'&#93;;
if &#40; $searchset&#91;$i&#93;&#91;'post_time'&#93; > topic_last_read&#40;$forum_id, $topic_id&#41; &#41;
&#123;
$folder_image = $folder_new;
$folder_alt = $lang&#91;'New_posts'&#93;;
$newest_post_img = '[img]' . $images&#91;'icon_newest_reply'&#93; . '[/img] ';
&#125;
else
&#123;
$folder_alt = &#40; $searchset&#91;$i&#93;&#91;'topic_status'&#93; == TOPIC_LOCKED &#41; ? $lang&#91;'Topic_locked'&#93; &#58; $lang&#91;'No_new_posts'&#93;;
$folder_image = $folder;
$folder_alt = $folder_alt;
$newest_post_img = '';
&#125;
//END MOD Keep_unread_2
&#125;

#
#-----&#91; OPEN &#93;------------------------------------------------
#
viewforum.php

#
#-----&#91; FIND &#93;------------------------------------------------
#
//
// Handle marking posts
//
if &#40; $mark_read == 'topics' &#41;
&#123;
if &#40; $userdata&#91;'session_logged_in'&#93; &#41;
&#123;
$sql = "SELECT MAX&#40;post_time&#41; AS last_post
FROM " . POSTS_TABLE . "
WHERE forum_id = $forum_id";
if &#40; !&#40;$result = $db->sql_query&#40;$sql&#41;&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql&#41;;
&#125;

if &#40; $row = $db->sql_fetchrow&#40;$result&#41; &#41;
&#123;
$tracking_forums = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_f'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_f'&#93;&#41; &#58; array&#40;&#41;;
$tracking_topics = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_t'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_t'&#93;&#41; &#58; array&#40;&#41;;

if &#40; &#40; count&#40;$tracking_forums&#41; + count&#40;$tracking_topics&#41; &#41; >= 150 && empty&#40;$tracking_forums&#91;$forum_id&#93;&#41; &#41;
&#123;
asort&#40;$tracking_forums&#41;;
unset&#40;$tracking_forums&#91;key&#40;$tracking_f orums&#41;&#93;&#41;;
&#125;

if &#40; $row&#91;'last_post'&#93; > $userdata&#91;'user_lastvisit'&#93; &#41;
&#123;
$tracking_forums&#91;$forum_id&#93; = time&#40;&#41;;

setcookie&#40;$board_config&#91;'cookie_name'&#93; . '_f', serialize&#40;$tracking_forums&#41;, 0, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
&#125;
&#125;

$template->assign_vars&#40;array&#40;
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid&#40;"viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"&#41; . '">'&#41;
&#41;;
&#125;

$message = $lang&#91;'Topics_marked_read'&#93; . '

' . sprintf&#40;$lang&#91;'Click_return_forum'&#93;, '', ' '&#41;;
message_die&#40;GENERAL_MESSAGE, $message&#41;;
&#125;
//
// End handle marking posts
//

$tracking_topics = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_t'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_t'&#93;&#41; &#58; '';
$tracking_forums = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_f'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_f'&#93;&#41; &#58; '';

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#

if &#40; $mark_read == 'topics' &#41;
&#123;
//START MOD Keep_unread_2
//
//Mark this forum as read
$board_config&#91;'tracking_forums'&#93;&#91;$foru m_id&#93; = time&#40;&#41;; //right now
$list_topics = implode&#40;',', array_keys&#40;$board_config&#91;'tracking_unreads '&#93;&#41;&#41;; //all tracking topic_id's
if &#40;$list_topics&#41;
&#123; //Get all the topics that are in this forum
$sql = "SELECT topic_id
FROM " . TOPICS_TABLE . "
WHERE topic_id IN &#40;$list_topics&#41;
AND forum_id = $forum_id AND topic_moved_id = 0";
if &#40; !$result = $db->sql_query&#40;$sql&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not access topics', '', __LINE__, __FILE__, $sql&#41;;
&#125;
while &#40; $row = $db->sql_fetchrow&#40;$result&#41; &#41; //Clean them
&#123;
$id = $row&#91;'topic_id'&#93;;
if &#40; isset&#40;$board_config&#91;'tracking_unreads'&#93 ;&#91;$id&#93;&#41; &#41; unset&#40;$board_config&#91;'tracking_unreads'&#93 ;&#91;$id&#93;&#41;;
&#125;
&#125;
write_cookies&#40;$userdata&#41;; //Save
//END MOD Keep_unread_2

//Message
$template->assign_vars&#40;array&#40;
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid&#40;"index.$phpEx"&#41; . '">'&#41;
&#41;;
$message = $lang&#91;'Topics_marked_read'&#93; . '

' . sprintf&#40;$lang&#91;'Click_return_forum'&#93;, '', ' '&#41;;
$message .= '

' . sprintf&#40;$lang&#91;'Click_return_index'&#93;, '', ' '&#41;;
message_die&#40;GENERAL_MESSAGE, $message&#41;;
&#125;
//
// End handle marking posts
//

//START MOD Keep_unread_2
//$tracking_topics = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_t'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_t'&#93;&#41; &#58; '';
//$tracking_forums = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_f'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_f'&#93;&#41; &#58; '';
//END MOD Keep_unread_2

#
#-----&#91; FIND &#93;------------------------------------------------
#
$newest_post_img = '';
if&#40; $userdata&#91;'session_logged_in'&#93; &#41;
&#123;
if&#40; $topic_rowset&#91;$i&#93;&#91;'post_time'&#93; > $userdata&#91;'user_lastvisit'&#93; &#41;
&#123;
if&#40; !empty&#40;$tracking_topics&#41; || !empty&#40;$tracking_forums&#41; || isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_f_all'&#93;&#41; &#41;
&#123;
$unread_topics = true;

if&#40; !empty&#40;$tracking_topics&#91;$topic_id&#93;&#41 ; &#41;
&#123;
if&#40; $tracking_topics&#91;$topic_id&#93; >= $topic_rowset&#91;$i&#93;&#91;'post_time'&#93; &#41;
&#123;
$unread_topics = false;
&#125;
&#125;

if&#40; !empty&#40;$tracking_forums&#91;$forum_id&#93;&#41 ; &#41;
&#123;
if&#40; $tracking_forums&#91;$forum_id&#93; >= $topic_rowset&#91;$i&#93;&#91;'post_time'&#93; &#41;
&#123;
$unread_topics = false;
&#125;
&#125;

if&#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_f_all'&#93;&#41; &#41;
&#123;
if&#40; $HTTP_COOKIE_VARS&#91;$board_config&#91;'cookie_na me'&#93; . '_f_all'&#93; >= $topic_rowset&#91;$i&#93;&#91;'post_time'&#93; &#41;
&#123;
$unread_topics = false;
&#125;
&#125;

if&#40; $unread_topics &#41;
&#123;
$folder_image = $folder_new;
$folder_alt = $lang&#91;'New_posts'&#93;;

$newest_post_img = '[img]' . $images&#91;'icon_newest_reply'&#93; . '[/img] ';
&#125;
else
&#123;
$folder_image = $folder;
$folder_alt = &#40; $topic_rowset&#91;$i&#93;&#91;'topic_status'&#93; == TOPIC_LOCKED &#41; ? $lang&#91;'Topic_locked'&#93; &#58; $lang&#91;'No_new_posts'&#93;;

$newest_post_img = '';
&#125;
&#125;
else
&#123;
$folder_image = $folder_new;
$folder_alt = &#40; $topic_rowset&#91;$i&#93;&#91;'topic_status'&#93; == TOPIC_LOCKED &#41; ? $lang&#91;'Topic_locked'&#93; &#58; $lang&#91;'New_posts'&#93;;

$newest_post_img = '[img]' . $images&#91;'icon_newest_reply'&#93; . '[/img] ';
&#125;
&#125;
else
&#123;
$folder_image = $folder;
$folder_alt = &#40; $topic_rowset&#91;$i&#93;&#91;'topic_status'&#93; == TOPIC_LOCKED &#41; ? $lang&#91;'Topic_locked'&#93; &#58; $lang&#91;'No_new_posts'&#93;;

$newest_post_img = '';
&#125;
&#125;
else
&#123;
$folder_image = $folder;
$folder_alt = &#40; $topic_rowset&#91;$i&#93;&#91;'topic_status'&#93; == TOPIC_LOCKED &#41; ? $lang&#91;'Topic_locked'&#93; &#58; $lang&#91;'No_new_posts'&#93;;

$newest_post_img = '';
&#125;

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#
//START MOD Keep_unread_2
if&#40; $topic_rowset&#91;$i&#93;&#91;'post_time'&#93; > topic_last_read&#40;$forum_id, $topic_id&#41; &#41;
&#123;
$folder_image = $folder_new;
$folder_alt = $lang&#91;'New_posts'&#93;;
$newest_post_img = '[img]' . $images&#91;'icon_newest_reply'&#93; . '[/img] ';
&#125;
else
&#123;
$folder_image = $folder;
$folder_alt = &#40; $topic_rowset&#91;$i&#93;&#91;'topic_status'&#93; == TOPIC_LOCKED &#41; ? $lang&#91;'Topic_locked'&#93; &#58; $lang&#91;'No_new_posts'&#93;;
$newest_post_img = '';
&#125;
//END MOD Keep_unread_2

#
#-----&#91; OPEN &#93;------------------------------------------------
#
viewtopic.php

#
#-----&#91; FIND &#93;------------------------------------------------
#
if &#40;!$topic_id && !$post_id&#41;
&#123;
message_die&#40;GENERAL_MESSAGE, 'Topic_post_not_exist'&#41;;
&#125;

//
// Find topic id if user requested a newer
// or older topic
//
if &#40; isset&#40;$HTTP_GET_VARS&#91;'view'&#93;&#41; && empty&#40;$HTTP_GET_VARS&#91;POST_POST_URL&#93;&#4 1; &#41;
&#123;
if &#40; $HTTP_GET_VARS&#91;'view'&#93; == 'newest' &#41;
&#123;
if &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_sid'&#93;&#41; || isset&#40;$HTTP_GET_VARS&#91;'sid'&#93;&#41; &#41;
&#123;
$session_id = isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_sid'&#93;&#41; ? $HTTP_COOKIE_VARS&#91;$board_config&#91;'cookie_na me'&#93; . '_sid'&#93; &#58; $HTTP_GET_VARS&#91;'sid'&#93;;

if &#40;!preg_match&#40;'/^&#91;A-Za-z0-9&#93;*$/', $session_id&#41;&#41;
&#123;
$session_id = '';
&#125;

if &#40; $session_id &#41;
&#123;
$sql = "SELECT p.post_id
FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_id = '$session_id'
AND u.user_id = s.session_user_id
AND p.topic_id = $topic_id
AND p.post_time >= u.user_lastvisit
ORDER BY p.post_time ASC
LIMIT 1";
if &#40; !&#40;$result = $db->sql_query&#40;$sql&#41;&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql&#41;;
&#125;

if &#40; !&#40;$row = $db->sql_fetchrow&#40;$result&#41;&#41; &#41;
&#123;
message_die&#40;GENERAL_MESSAGE, 'No_new_posts_last_visit'&#41;;
&#125;

$post_id = $row&#91;'post_id'&#93;;

if &#40;isset&#40;$HTTP_GET_VARS&#91;'sid'&#93;&#41;& #41;
&#123;
redirect&#40;"viewtopic.$phpEx?sid=$session_id&" . POST_POST_URL . "=$post_id#$post_id"&#41;;
&#125;
else
&#123;
redirect&#40;"viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id"&#41;;
&#125;
&#125;
&#125;

redirect&#40;append_sid&#40;"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true&#41;&#41;;
&#125;

#
#-----&#91; REPLACE WITH &#93;------------------------------------------
#
//START MOD Keep_unread_2
$mode = &#40; isset&#40;$HTTP_GET_VARS&#91;'mode'&#93;&#41; &#41; ? htmlspecialchars&#40; $HTTP_GET_VARS&#91;'mode'&#93; &#41; &#58; '';

if &#40; !empty&#40;$post_id&#41; &#41;
&#123; //added topic_last_post_id, p.post_time to sql
$sql = "SELECT t.forum_id, t.topic_id, t.topic_last_post_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.topic_id = p.topic_id
AND t.topic_moved_id = 0
AND p.post_id = $post_id";
&#125;
else if &#40; !empty&#40;$topic_id&#41; &#41;
&#123;
$sql = "SELECT t.forum_id, t.topic_id, t.topic_last_post_id
FROM " . TOPICS_TABLE . " t
WHERE t.topic_moved_id = 0
AND t.topic_id = $topic_id";
&#125;
else
&#123;
message_die&#40;GENERAL_MESSAGE, 'Topic_post_not_exist'&#41;;
&#125;
if &#40; !$result = $db->sql_query&#40;$sql&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql&#41;;
&#125;
if &#40; !$row = $db->sql_fetchrow&#40;$result&#41; &#41;
&#123;
message_die&#40;GENERAL_MESSAGE, 'Topic_post_not_exist'&#41;;
&#125;
$forum_id = $row&#91;'forum_id'&#93;;
$topic_id = $row&#91;'topic_id'&#93;;
$post_time = $row&#91;'post_time'&#93;;
$topic_last_post_id = $row&#91;'topic_last_post_id'&#93;;
//END MOD Keep_unread_2

//
// Start session management
//
$userdata = session_pagestart&#40;$user_ip, $forum_id&#41;;
init_userprefs&#40;$userdata&#41;;
//
// End session management
//

//START MOD Keep_unread_2 * Keep topic unread from given post onwards
if &#40;$mode == 'unread'&#41;
&#123;
$board_config&#91;'tracking_unreads'&#93;&#91;$top ic_id&#93; = $post_time-1; //testing for ">" only later on
write_cookies&#40;$userdata&#41;;
$message = $lang&#91;'keep_unread_done'&#93; . '

' .
sprintf&#40;$lang&#91;'Click_return_forum'&#93;, '', ' '&#41; . '

' .
sprintf&#40;$lang&#91;'Click_return_index'&#93;, '', ' '&#41;;
message_die&#40;GENERAL_MESSAGE, $message&#41;;
&#125;
$topic_last_read = topic_last_read&#40;$forum_id, $topic_id&#41;;
//END MOD Keep_unread_2

//
// Find topic id if user requested a newer
// or older topic
//
if &#40; isset&#40;$HTTP_GET_VARS&#91;'view'&#93;&#41; && empty&#40;$HTTP_GET_VARS&#91;POST_POST_URL&#93;&#4 1; &#41;
&#123;
if &#40; $HTTP_GET_VARS&#91;'view'&#93; == 'newest' &#41;
&#123; // read the first unread post in this topic
$sql = "SELECT p.post_id, t.topic_last_post_id
FROM &#40;" . TOPICS_TABLE . " t
LEFT JOIN " . POSTS_TABLE . " p ON p.topic_id = t.topic_id AND p.post_time > $topic_last_read&#41;
WHERE t.topic_id = $topic_id
AND t.topic_moved_id = 0
ORDER BY p.post_time";
if &#40; !$result = $db->sql_query&#40;$sql&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql&#41;;
&#125;

if &#40; !&#40;$row = $db->sql_fetchrow&#40;$result&#41;&#41; &#41;
&#123;
message_die&#40;GENERAL_MESSAGE, 'No_new_posts_last_visit'&#41;;
&#125;
$post_id = empty&#40;$row&#91;'post_id'&#93;&#41; ? $row&#91;'topic_last_post_id'&#93; &#58; $row&#91;'post_id'&#93;;
redirect&#40;append_sid&#40;"./viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true&#41;&#41;;
&#125;

#
#-----&#91; FIND &#93;------------------------------------------------
#
if &#40; !&#40;$result = $db->sql_query&#40;$sql&#41;&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql&#41;;
&#125;

if &#40; $row = $db->sql_fetchrow&#40;$result&#41; &#41;
&#123;
$topic_id = intval&#40;$row&#91;'topic_id'&#93;&#41;;

#
#-----&#91; AFTER, ADD &#93;----------------------------------------
#
//MOD Keep_unread_2
redirect&#40;append_sid&#40;"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true&#41;&#41;;

#
#-----&#91; FIND &#93;------------------------------------------------
#
$forum_id = intval&#40;$forum_topic_data&#91;'forum_id'&#93;&# 41;;

//
// Start session management
//
$userdata = session_pagestart&#40;$user_ip, $forum_id&#41;;
init_userprefs&#40;$userdata&#41;;
//
// End session management
//

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#

$forum_id = intval&#40;$forum_topic_data&#91;'forum_id'&#93;&# 41;;

//MOD Keep_unread_2&#58; session management already done above

#
#-----&#91; FIND &#93;------------------------------------------------
#
//
// Set a cookie for this topic
//
if &#40; $userdata&#91;'session_logged_in'&#93; &#41;
&#123;
$tracking_topics = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_t'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_t'&#93;&#41; &#58; array&#40;&#41;;
$tracking_forums = &#40; isset&#40;$HTTP_COOKIE_VARS&#91;$board_config&#91; 'cookie_name'&#93; . '_f'&#93;&#41; &#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$board_confi g&#91;'cookie_name'&#93; . '_f'&#93;&#41; &#58; array&#40;&#41;;

if &#40; !empty&#40;$tracking_topics&#91;$topic_id&#93;&#41 ; && !empty&#40;$tracking_forums&#91;$forum_id&#93;&#41 ; &#41;
&#123;
$topic_last_read = &#40; $tracking_topics&#91;$topic_id&#93; > $tracking_forums&#91;$forum_id&#93; &#41; ? $tracking_topics&#91;$topic_id&#93; &#58; $tracking_forums&#91;$forum_id&#93;;
&#125;
else if &#40; !empty&#40;$tracking_topics&#91;$topic_id&#93;&#41 ; || !empty&#40;$tracking_forums&#91;$forum_id&#93;&#41 ; &#41;
&#123;
$topic_last_read = &#40; !empty&#40;$tracking_topics&#91;$topic_id&#93;&#41 ; &#41; ? $tracking_topics&#91;$topic_id&#93; &#58; $tracking_forums&#91;$forum_id&#93;;
&#125;
else
&#123;
$topic_last_read = $userdata&#91;'user_lastvisit'&#93;;
&#125;

if &#40; count&#40;$tracking_topics&#41; >= 150 && empty&#40;$tracking_topics&#91;$topic_id&#93;&#41; &#41;
&#123;
asort&#40;$tracking_topics&#41;;
unset&#40;$tracking_topics&#91;key&#40;$tracking_t opics&#41;&#93;&#41;;
&#125;

$tracking_topics&#91;$topic_id&#93; = time&#40;&#41;;

setcookie&#40;$board_config&#91;'cookie_name'&#93; . '_t', serialize&#40;$tracking_topics&#41;, 0, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
&#125;

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#
//
// Set a cookie for this topic
//
//START MOD Keep_unread_2 * $topic_last_read is known
//Reached the last post in a topic with unread posts
// &#40;note&#58; the definition in the next line makes sure things work right regardless of whether viewtopic is set to display from oldest to newest or newest to oldest&#41;
$lastpost = $postrow&#91;0&#93;&#91;'post_time'&#93; < $postrow&#91;&#40;$total_posts-1&#41;&#93;&#91;'post_time'&#93; ? $total_posts-1 &#58; 0;
if &#40;$topic_last_post_id == $postrow&#91;$lastpost&#93;&#91;'post_id'&#93;&#41 ;
&#123;
//Read up to time of retrieval of this topic
$board_config&#91;'tracking_unreads'&#93;&#91;$top ic_id&#93; = time&#40;&#41;;
&#125;
//Reading a page, but not the last one, in a topic with new posts
elseif &#40;isset&#40;$board_config&#91;'tracking_unreads '&#93;&#91;$topic_id&#93;&#41;&#41;
&#123;
//Set the highest of current topic_last_read and time of last post on page
$board_config&#91;'tracking_unreads'&#93;&#91;$top ic_id&#93; = max&#40;$topic_last_read, $postrow&#91;$lastpost&#93;&#91;'post_time'&#93;&# 41;;
&#125;
write_cookies&#40;$userdata&#41;; //Save
//END MOD Keep_unread_2

#
#-----&#91; FIND &#93;------------------------------------------------
#
//
// Define the little post icon
//
if &#40; $userdata&#91;'session_logged_in'&#93; && $postrow&#91;$i&#93;&#91;'post_time'&#93; > $userdata&#91;'user_lastvisit'&#93; && $postrow&#91;$i&#93;&#91;'post_time'&#93; > $topic_last_read &#41;
&#123;
$mini_post_img = $images&#91;'icon_minipost_new'&#93;;
$mini_post_alt = $lang&#91;'New_post'&#93;;
&#125;
else
&#123;
$mini_post_img = $images&#91;'icon_minipost'&#93;;
$mini_post_alt = $lang&#91;'Post'&#93;;
&#125;

#
#-----&#91; REPLACE WITH &#93;------------------------------------------------
#
//
//START MOD Keep_Unread_2 * Define the little post icon
//
if &#40; $postrow&#91;$i&#93;&#91;'post_time'&#93; > $topic_last_read &#41;
&#123;
$mini_post_img = $images&#91;'icon_minipost_new'&#93;;
$mini_post_alt = $lang&#91;'New_post'&#93;;
&#125;
else
&#123;
$mini_post_img = $images&#91;'icon_minipost'&#93;;
$mini_post_alt = $lang&#91;'Post'&#93;;
&#125;
//END MOD Keep_unread_2

#
#-----&#91; FIND &#93;------------------------------------------------
#

$search = '' . sprintf&#40;$lang&#91;'Search_user_posts'&#93;, $postrow&#91;$i&#93;&#91;'username'&#93;&#41; . '';

#
#-----&#91; AFTER, ADD &#93;------------------------------------------
#
//START MOD Keep_Unread_2
$temp_url = append_sid&#40;"viewtopic.$phpEx?mode=unread&amp;" . POST_POST_URL . '=' . $postrow&#91;$i&#93;&#91;'post_id'&#93;&#41;;
//$keep_unread_img_ms = '' . $lang&#91;'keep_post_unread'&#93; . '';
$keep_unread_img = '[img]' . $images&#91;'icon_keep_unread'&#93; . '[/img]';

#
#-----&#91; FIND &#93;------------------------------------------------
#
'L_MINI_POST_ALT' => $mini_post_alt,

#
#-----&#91; AFTER, ADD &#93;------------------------------------------
#
//MOD Keep_Unread_2
'KEEP_UNREAD_IMG' => $keep_unread_img,
//'KEEP_UNREAD_IMG_MS' => $keep_unread_img_ms,

#
#-----&#91; OPEN &#93;------------------------------------------------
#
includes/functions.php

#
#-----&#91; FIND &#93;------------------------------------------------
# in function init_userprefs

include&#40;$phpbb_root_path . 'language/lang_' . $board_config&#91;'default_lang'&#93; . '/lang_admin.' . $phpEx&#41;;
&#125;

#
#-----&#91; AFTER, ADD &#93;------------------------------------------
#
//MOD Keep_unread_2
read_cookies&#40;$userdata&#41;;

#
#-----------&#91; FIND &#93;-----------
#
//
// Load the Page Header
//
if &#40; !defined&#40;'IN_ADMIN'&#41; &#41;
&#123;
include&#40;$phpbb_root_path . 'includes/page_header.'.$phpEx&#41;;

#
#-----------&#91; BEFORE, ADD &#93;-----------
#
$toggle_unreads_link = false;

#
#-----&#91; FIND &#93;------------------------------------------------
#
?>

#
#-----&#91; BEFORE, ADD &#93;------------------------------------------
#
//START MOD Keep_Unread_2
// maximum number of items &#40;topic_id&#41; per cookie
define&#40;'MAX_COOKIE_ITEM', 300&#41;;
//Default if no board setting
define&#40;'KEEP_UNREAD_DB', TRUE&#41;;

function read_cookies&#40;$userdata&#41;
&#123;
global $board_config, $HTTP_COOKIE_VARS;

// do we use the tracking ?
if &#40; !isset&#40;$board_config&#91;'keep_unreads'&#93;&# 41; &#41;
&#123;
$board_config&#91;'keep_unreads'&#93; = true;
&#125;
if &#40; !isset&#40;$board_config&#91;'keep_unreads_db'&#93 ;&#41; &#41;
&#123;
$board_config&#91;'keep_unreads_db'&#93; = KEEP_UNREAD_DB;
&#125;
// do we use database to store data ?
if &#40; !$userdata&#91;'session_logged_in'&#93; || !$board_config&#91;'keep_unreads'&#93; &#41;
&#123;
$board_config&#91;'keep_unreads_db'&#93; = false;
&#125;
// cookies name
$user_id = &#40; $userdata&#91;'user_id'&#93; == ANONYMOUS ? '_' &#58; $userdata&#91;'user_id'&#93;&#41;;
$base_name = $board_config&#91;'cookie_name'&#93; . '_' . $user_id;

// get the anonymous last visit date
if &#40; !$userdata&#91;'session_logged_in'&#93; &#41;
&#123;
$board_config&#91;'guest_lastvisit'&#93; = intval&#40;$HTTP_COOKIE_VARS&#91;$base_name . '_lastvisit'&#93;&#41;;
if &#40; $board_config&#91;'guest_lastvisit'&#93; < &#40;time&#40;&#41;-300&#41; &#41;
&#123;
$board_config&#91;'guest_lastvisit'&#93; = time&#40;&#41;;
setcookie&#40;$base_name . '_lastvisit', intval&#40;$board_config&#91;'guest_lastvisit'&#93 ;&#41;, $current_time + 31536000, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
&#125;
$userdata&#91;'user_lastvisit'&#93; = $board_config&#91;'guest_lastvisit'&#93;;
&#125;

//Assume old system&#58; data in cookie
$board_config&#91;'tracking_time'&#93; = isset&#40;$HTTP_COOKIE_VARS&#91;$base_name . '_tt'&#93;&#41; ? intval&#40;$HTTP_COOKIE_VARS&#91;$base_name . '_tt'&#93;&#41; &#58; $userdata&#91;'user_lastvisit'&#93;;
$board_config&#91;'tracking_forums'&#93; = isset&#40;$HTTP_COOKIE_VARS&#91;$base_name . '_f'&#93;&#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$base_name . '_f'&#93;&#41; &#58; array&#40;&#41;;
$board_config&#91;'tracking_unreads'&#93; = array&#40;&#41;;
if &#40; $board_config&#91;'keep_unreads'&#93; &#41;
&#123;
if &#40; $userdata&#91;'session_logged_in'&#93; && $board_config&#91;'keep_unreads_db'&#93; &#41;
&#123;
$temp = explode&#40;'//', $userdata&#91;'user_unread_topics'&#93;&#41;;
if &#40;$temp&#91;1&#93;&#41;
&#123;
$board_config&#91;'tracking_time'&#93; = $temp&#91;1&#93;;
$w_forums = &#40;$temp&#91;2&#93; ? explode&#40;';', $temp&#91;2&#93;&#41; &#58; array&#40;&#41;&#41;;
for &#40; $i = 0; $i < count&#40;$w_forums&#41;; $i++ &#41;
&#123;
$forum_data = explode&#40;'&#58;', $w_forums&#91;$i&#93;&#41;;
$board_config&#91;'tracking_forums'&#93;&#91; intval&#40;$forum_data&#91;0&#93;&#41; &#93; = intval&#40;$forum_data&#91;1&#93;&#41;;
&#125;
&#125;
$w_unreads = $temp&#91;0&#93; ? explode&#40;';', $temp&#91;0&#93;&#41; &#58; array&#40;&#41;;
$tracking_floor = intval&#40;$w_unreads&#91;0&#93;&#41;; // we don't use serialized data to gain some digits
for &#40; $i = 1; $i < count&#40;$w_unreads&#41;; $i++ &#41;
&#123;
$topic_data = explode&#40;'&#58;', $w_unreads&#91;$i&#93;&#41;;
$board_config&#91;'tracking_unreads'&#93;&#91; intval&#40;$topic_data&#91;0&#93;&#41; &#93; = intval&#40;$topic_data&#91;1&#93;&#41; + $tracking_floor;
&#125;
&#125;
else //not logged in or not database&#58; cookie. If you delete this block then guests have no unread functionality
&#123;
//the tracking floor &#40;min time value&#41; allows to reduce the size of the time data, so the size of the cookie is smaller
$tracking_floor = intval&#40;$HTTP_COOKIE_VARS&#91;$base_name . '_uf'&#93;&#41;;
$board_config&#91;'tracking_unreads'&#93; = isset&#40;$HTTP_COOKIE_VARS&#91;$base_name . '_u'&#93;&#41; ? unserialize&#40;$HTTP_COOKIE_VARS&#91;$base_name . '_u'&#93;&#41; &#58; array&#40;&#41;;
@reset&#40; $board_config&#91;'tracking_unreads'&#93; &#41;;
while &#40; list&#40;$id, $time&#41; = @each&#40;$board_config&#91;'tracking_unreads'&#93 ;&#41; &#41;
&#123;
if &#40; intval&#40;$id&#41; > 0 &#41;
&#123;
$board_config&#91;'tracking_unreads'&#93;&#91;intv al&#40;$id&#41;&#93; = intval&#40;$time&#41; + $tracking_floor;
&#125;
else
&#123;
unset&#40;$board_config&#91;'tracking_unreads'&#93 ;&#91;$id&#93;&#41;;
&#125;
&#125;
&#125;
&#125;
define&#40;'COOKIE_READ', true&#41;;
&#125;

function write_cookies&#40;$userdata&#41;
&#123;
global $board_config, $HTTP_COOKIE_VARS, $db;

// do we use the tracking ?
if &#40; !isset&#40;$board_config&#91;'keep_unreads'&#93;&# 41; &#41;
&#123;
$board_config&#91;'keep_unreads'&#93; = true;
&#125;
if &#40; !isset&#40;$board_config&#91;'keep_unreads_db'&#93 ;&#41; &#41;
&#123;
$board_config&#91;'keep_unreads_db'&#93; = KEEP_UNREAD_DB;
&#125;

// do we use database to store data ?
if &#40; !$userdata&#91;'session_logged_in'&#93; || !$board_config&#91;'keep_unreads'&#93; &#41;
&#123;
$board_config&#91;'keep_unreads_db'&#93; = false;
&#125;

// check if the cookie has been read &#40;prevent any erase&#41;
if &#40; !defined&#40;'COOKIE_READ'&#41; &#41;
&#123;
return;
&#125;

// cookies name
$user_id = &#40; $userdata&#91;'user_id'&#93; == ANONYMOUS ? '_' &#58; $userdata&#91;'user_id'&#93;&#41;;
$base_name = $board_config&#91;'cookie_name'&#93; . '_' . $user_id;

if &#40; $board_config&#91;'keep_unreads'&#93; &#41;
&#123;
// sort the unread array
if &#40; !empty&#40;$board_config&#91;'tracking_unreads'&#9 3;&#41; &#41;
&#123;
asort&#40;$board_config&#91;'tracking_unreads'&#93 ;&#41;;
&#125;
if &#40; count&#40;$board_config&#91;'tracking_unreads'&#93 ;&#41; > MAX_COOKIE_ITEM &#41;
&#123;
$nb = count&#40;$board_config&#91;'tracking_unreads'&#93 ;&#41; - MAX_COOKIE_ITEM;
while &#40; &#40;$nb > 0&#41; && &#40; list&#40;$id, $time&#41; = @each&#40;$board_config&#91;'tracking_unreads'&#93 ;&#41; &#41; &#41;
&#123;
unset&#40;$board_config&#91;'tracking_unreads'&#93 ;&#91;$id&#93;&#41;;
$nb--;
&#125;
&#125;
&#125;

// store the unread topics
$sql = '';
if &#40; $board_config&#91;'keep_unreads'&#93; &#41;
&#123;
// the array is already sorted
$tracking_floor = 0;
$tracking_forums = $board_config&#91;'tracking_forums'&#93;;
$tracking_unreads = $board_config&#91;'tracking_unreads'&#93;;

//Change all times to offset from lowest time.
if &#40; !empty&#40;$tracking_unreads&#41; &#41;
&#123;
$first_found = false;
$tracking_floor = 0;
@reset&#40;$tracking_unreads&#41;;
while &#40; list&#40;$id, $time&#41; = @each&#40;$tracking_unreads&#41; &#41;
&#123;
if &#40; !$first_found &#41;
&#123;
$tracking_floor = intval&#40;$time&#41;;
$first_found = true;
&#125;
$tracking_unreads&#91;$id&#93; -= $tracking_floor;
&#125;
&#125;

if &#40; $board_config&#91;'keep_unreads_db'&#93; && $userdata&#91;'session_logged_in'&#93; &#41;
&#123;
$data = intval&#40;$tracking_floor&#41;;
@reset&#40;$tracking_unreads&#41;;
while &#40; list&#40;$id, $time&#41; = @each&#40;$tracking_unreads&#41; &#41;
&#123;
if &#40;$id&#41; $data .= ';' . intval&#40;$id&#41; . '&#58;' . intval&#40;$time&#41;;
&#125;
$data .= '//' . intval&#40;$board_config&#91;'tracking_time'&#93;& #41; . '//';
@reset&#40;$tracking_forums&#41;;//board_config&#91;'tracking_forums'&#93;&#41;;
while &#40; list&#40;$id, $time&#41; = @each&#40;$tracking_forums&#41;&#41; //$board_config&#91;'tracking_forums'&#93;&#41; &#41;
&#123;
if &#40;$id&#41; $data .= ';' . intval&#40;$id&#41; . '&#58;' . intval&#40;$time&#41;;
&#125;
//Erase old cookies
@setcookie&#40;$base_name . '_tt', '', 0, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
@setcookie&#40;$base_name . '_f', '', 0, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
@setcookie&#40;$base_name . '_uf', '', 0, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
@setcookie&#40;$base_name . '_u', '', 0, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
$sql = "UPDATE " . USERS_TABLE . "
SET user_unread_topics = '$data'
WHERE user_id = " . intval&#40;$userdata&#91;'user_id'&#93;&#41;;
&#125;
else
&#123;
@setcookie&#40;$base_name . '_tt', intval&#40;$board_config&#91;'tracking_time'&#93;& #41;, time&#40;&#41; + 31536000, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
@setcookie&#40;$base_name . '_f', serialize&#40;$board_config&#91;'tracking_forums'& #93;&#41;, time&#40;&#41; + 31536000, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
@setcookie&#40;$base_name . '_uf', intval&#40;$tracking_floor&#41;, time&#40;&#41; + 31536000, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
@setcookie&#40;$base_name . '_u', serialize&#40;$tracking_unreads&#41;, time&#40;&#41; + 31536000, $board_config&#91;'cookie_path'&#93;, $board_config&#91;'cookie_domain'&#93;, $board_config&#91;'cookie_secure'&#93;&#41;;
// erase the users table to prevent a timewrap if the user reactivate the unreads database storage
if &#40; !empty&#40;$userdata&#91;'user_unread_topics'&#93; &#41; && $userdata&#91;'session_logged_in'&#93; &#41;
&#123;
$sql = "UPDATE " . USERS_TABLE . "
SET user_unread_topics = NULL
WHERE user_id = " . intval&#40;$userdata&#91;'user_id'&#93;&#41;;
&#125;
&#125;
&#125;
if &#40; !empty&#40;$sql&#41; &#41;
&#123;
if &#40; !$db->sql_query&#40;$sql&#41; &#41;
&#123;
message_die&#40;CRITICAL_ERROR, 'Failed to update users table for unread topics', '', __LINE__, __FILE__, $sql&#41;;
&#125;
&#125;
&#125;

//Return an array with all true unreads and array with topics with new posts
//Will check everything and write new arrays to database / cookie
function list_new_unreads&#40;&$forum_unread, $check_auth = 0&#41;
&#123;
global $board_config, $userdata, $db;

//Clean tracking_forums
$tracking_time = &#40; $board_config&#91;'tracking_time'&#93; != 0 &#41; ? $board_config&#91;'tracking_time'&#93; &#58; $userdata&#91;'user_lastvisit'&#93;;
if &#40; !empty&#40;$board_config&#91;'tracking_forums'&#93 ;&#41; &#41;
&#123;
@reset&#40;$board_config&#91;'tracking_forums'&#93 ;&#41;; //Mark whole forum as read records
while &#40; list&#40;$id, $time&#41; = @each&#40;$board_config&#91;'tracking_forums'&#93; &#41; &#41;
&#123; //obsolete if forum was marked read before current visit time
if &#40; $time <= $tracking_time &#41; unset&#40;$board_config&#91;'tracking_forums'&#93; &#91;$id&#93;&#41;;
&#125;
&#125;

//get list of remembered topic id's
@reset&#40;$board_config&#91;'tracking_unreads'&#9 3;&#41;; //Mark whole forum as read records
while &#40; list&#40;$id, $time&#41; = @each&#40;$board_config&#91;'tracking_unreads'&#93 ;&#41; &#41;
&#123;
if &#40;$id&#41; $list_unreads .= &#40;$list_unreads ? ','&#58;''&#41; . $id;
&#125;

$new_unreads = array&#40;&#41;;
$forum_unread = array&#40;&#41;;
$sql_and = array&#40;&#41;;
$sql_and&#91;0&#93; = " AND p.post_time > $tracking_time";
if &#40;$list_unreads&#41;
&#123;
$sql_and&#91;1&#93; = " AND t.topic_id IN &#40;$list_unreads&#41; AND &#40;p.post_time <= $tracking_time&#41;";
&#125;
$check_auth_sql = '';

// the next line of code artificially sets $auth_list to true so that when it is used later on
// in an if statement the if statement will resolve to true if either &#40;a&#41; $check_auth is false &#40;since in
// that case $auth_list never gets reset&#41; or &#40;b&#41; $check_auth is true and the user is authorized
// to view some forums
$auth_list = TRUE;

if &#40;$check_auth&#41;
&#123;
// get a list of all forums the user is allowed to read
$is_auth_ary = array&#40;&#41;;
$forum_ids = array&#40;&#41;;
$is_auth_ary = auth&#40;AUTH_READ, AUTH_LIST_ALL, $userdata&#41;;
if &#40; count&#40;$is_auth_ary&#41; &#41;
&#123;
foreach &#40; $is_auth_ary as $forum_id => $auths &#41;
&#123;
if &#40; $auths&#91;'auth_read'&#93; &#41;
&#123;
$forum_ids&#91;&#93; = $forum_id;
&#125;
&#125;
&#125;
$auth_list = implode&#40;"," , $forum_ids&#41;;
$check_auth_sql = "AND t.forum_id IN &#40;" . $auth_list . "&#41;";
&#125;

//Get all topics
// note that $auth_list may resolve to true if $check_auth is false &#40;i.e. we are not checking authorizations on this board&#41;
// or alternatively if we are checking authorizations and there are in fact forums the user is authorized to view;
// however, if we are checking authorizations and there are no forums the user is authorized to view we can skip the rest of this
// since the user will not be shown any unreads, and that's what the next if statement is for
if &#40;$auth_list&#41;
&#123;
for &#40; $i = 0; $i < count&#40;$sql_and&#41;; $i++&#41;
&#123;
$sql = "SELECT t.forum_id, t.topic_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE p.post_id = t.topic_last_post_id
$sql_and&#91;$i&#93;
$check_auth_sql
AND t.topic_moved_id = 0";

if &#40; !&#40;$result = $db->sql_query&#40;$sql&#41;&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql&#41;;
&#125;

while&#40; $topic_data = $db->sql_fetchrow&#40;$result&#41; &#41; //Keep the valid unread topics
&#123;
$id = $topic_data&#91;'topic_id'&#93;;
$topic_last_read = topic_last_read&#40;$topic_data&#91;'forum_id'&#93 ;, $id&#41;;
if &#40; $topic_data&#91;'post_time'&#93; > $topic_last_read&#41;
&#123;
$new_unreads&#91;$id&#93; = $topic_last_read;
$forum_unread&#91;$topic_data&#91;'forum_id'&#93;& #93;=true;
&#125;
&#125;
&#125;
$db->sql_freeresult&#40;$result&#41;;
&#125;
$board_config&#91;'tracking_time'&#93; = time&#40;&#41;;
$board_config&#91;'tracking_unreads'&#93; = $new_unreads;
write_cookies&#40;$userdata&#41;; //save

return $new_unreads;
&#125;

function topic_last_read&#40;$forum_id, $topic_id&#41; //Returns a time stamp
&#123;
global $userdata, $board_config;
$t = intval&#40;$board_config&#91;'tracking_unreads'&#9 3;&#91;$topic_id&#93;&#41;;
//No tracking data at all, then last read when last logged in.
if &#40;$t == 0&#41; $t = &#40;&#40;$board_config&#91;'tracking_time'&#93 ; != 0&#41; ? intval&#40;$board_config&#91;'tracking_time'&#93;& #41; &#58; $userdata&#91;'user_lastvisit'&#93;&#41;;
return $t;
&#125;
//END MOD Keep_unread_2

#
#-----&#91; OPEN &#93;------------------------------------------------
#
includes/page_header.php

#
#-----&#91; FIND &#93;------------------------------------------------
#
$s_last_visit = &#40; $userdata&#91;'session_logged_in'&#93; &#41; ? create_date&#40;$board_config&#91;'default_datefor mat'&#93;, $userdata&#91;'user_lastvisit'&#93;, $board_config&#91;'board_timezone'&#93;&#41; &#58; '';

#
#-----&#91; REPLACE WITH &#93;----------------------------------------
#
//MOD Keep_unread
$t = $userdata&#91;'session_logged_in'&#93; ? $userdata&#91;'user_lastvisit'&#93; &#58; $board_config&#91;'guest_lastvisit'&#93;;
$s_last_visit = create_date&#40;$board_config&#91;'default_datefor mat'&#93;, $t, $board_config&#91;'board_timezone'&#93;&#41;;
//END MOD Keep_unread

#
#-----&#91; FIND &#93;------------------------------------------
#
//
// The following assigns all _common_ variables that may be used at any point
// in a template.
//

#
#-----&#91; AFTER, ADD &#93;------------------------------------------
#
//START MOD Keep_unread_2
// check to see if we are supposed to toggle unread link from "View your unread posts" to "You have no unread posts" depending on whether
// there are unread posts &#40;on large boards people may want to skip that toggle by defining $toggle_unreads_link as false
// in index.php to save query time&#41;
if &#40;$toggle_unreads_link&#41;
&#123;
// only run a new list_new_unreads check if we haven't already done that by the time we get here &#40;if we're coming from index.php this will already have been done in index.php&#41;
if &#40; !isset&#40;$new_unreads&#41; &#41;
&#123;
$new_unreads = &#40;list_new_unreads&#40;$forum_unreads, $toggle_unreads_link&#41;&#41; ? true &#58; false;
&#125;
&#125;
else
&#123;
// if we get here, we are not supposed to toggle the unread link so we'll just set the link to read "View your unread posts" in all cases
$new_unreads = true;
&#125;
//END MOD Keep_unread_2

#
#-----&#91; FIND &#93;------------------------------------------
#
'L_SEARCH_NEW' => $lang&#91;'Search_new'&#93;,

#
#-----&#91; REPLACE WITH &#93;------------------------------------------
#
'L_SEARCH_NEW' => &#40;$new_unreads&#41; ? $lang&#91;'View_unread_posts'&#93; &#58; $lang&#91;'No_unread_posts'&#93;,

#
#-----&#91; OPEN &#93;------------------------------------------------
#
language/lang_english/lang_main.php

#
#-----&#91; FIND &#93;------------------------------------------------
#
$lang&#91;'Search_new'&#93; = 'View posts since last visit';

#
#-----&#91; REPLACE WITH &#93;------------------------------------------------
#
$lang&#91;'Search_new'&#93; = 'View unread posts';

#
#-----&#91; FIND &#93;------------------------------------------------
#
?>

#
#-----&#91; BEFORE, ADD &#93;------------------------------------------------
#
//MOD Keep_unread
$lang&#91;'keep_post_unread_explain'&#93; = 'Mark post as unread';
$lang&#91;'keep_unread_done'&#93; = 'The post has been marked as unread.';
$lang&#91;'View_unread_posts'&#93; = 'View unread posts';
$lang&#91;'No_unread_posts'&#93; = 'You have no unread posts';

#
#-----&#91; OPEN &#93;------------------------------------------------
#
templates/subSilver/index_body.tpl

#
#-----&#91; FIND &#93;------------------------------------------------
#
# at top of the file
#
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">

#
#-----&#91; BEFORE, ADD &#93;-----------------------------------------
#


#
#-----&#91; FIND &#93;------------------------------------------------
#

&#123;LAST_VISIT_DATE&#125;



#
#-----&#91; REPLACE WITH &#93;------------------------------------------
#
&#123;LAST_VISIT_DATE&#125;


#
#-----&#91; FIND &#93;------------------------------------------------
#

&#123;L_SEARCH_NEW&#125;
&#123;L_SEARCH_SELF&#125;



#
#-----&#91; REPLACE WITH &#93;-----------------------------------------
#
&#123;L_SEARCH_NEW&#125;
&#123;L_SEARCH_SELF&#125;


#
#-----&#91; FIND &#93;------------------------------------------------
#

<span class="gensmall">&#123;L_MARK_FORUMS_READ&#125;</span>


#
#-----&#91; REPLACE WITH &#93;-----------------------------------------
#
<span class="gensmall">&#123;L_MARK_FORUMS_READ&#125;</span>

#
#-----&#91; OPEN &#93;------------------------------------------------
#
templates/subSilver/subSilver.cfg

#
#-----&#91; FIND &#93;------------------------------------------------
#
?>

#
[/code:1:1be0c87
Pottsy is offline  
post #5 of 21 (permalink) Old 27th August 2006, 21:39
12th June 2006 1.8EX
 
WoolyCiv's Avatar
 
Join Date: 28th May 2006
Location: Lancashire
Posts: 1,119
Thanks: 0
Thanked 4 Times in 4 Posts
iTrader: (0)
It ws a quick mod then
WoolyCiv is offline  
post #6 of 21 (permalink) Old 27th August 2006, 21:45 Thread Starter
Administrator
** Thread starter **
 
Pottsy's Avatar
 
Car: Jag XF 3.0
Join Date: 10th April 2006
Location: Leics ENGLAND
Posts: 12,496
Thanks: 127
Thanked 2,774 Times in 824 Posts
iTrader: (0)
Eco display
Send a message via Skype™ to Pottsy


I have done about 20 mods to the forum to get it the way I want it - nearly all done by hand - with the exception of this one and the attachment mod, where easymod has taken the strain (after plenty of testing on my own server).
Pottsy is offline  
post #7 of 21 (permalink) Old 27th August 2006, 22:06
 
Unguided's Avatar
 
Join Date: 4th June 2006
Location: London
Posts: 63
Thanks: 0
Thanked 1 Time in 1 Post
iTrader: (0)
Forum modding, can be just as tricky as modding a car
Unguided is offline  
post #8 of 21 (permalink) Old 27th August 2006, 22:16
12th June 2006 1.8EX
 
WoolyCiv's Avatar
 
Join Date: 28th May 2006
Location: Lancashire
Posts: 1,119
Thanks: 0
Thanked 4 Times in 4 Posts
iTrader: (0)
Quote:
Originally Posted by Pottsy


I have done about 20 mods to the forum to get it the way I want it - nearly all done by hand - with the exception of this one and the attachment mod, where easymod has taken the strain (after plenty of testing on my own server).
Pottsy - I bow to your knowledge
WoolyCiv is offline  
post #9 of 21 (permalink) Old 27th August 2006, 22:46
Supporter
 
Fedorov's Avatar
 
Car: 2016 1.6 Diesel, Sporty Blue
Join Date: 15th April 2006
Posts: 785
Thanks: 0
Thanked 3 Times in 3 Posts
iTrader: (0)
With that amount of code I'm still looking for the hidden forum easter egg game of Manic Miner!
Fedorov is offline  
post #10 of 21 (permalink) Old 27th August 2006, 23:03
 
Ancient Nerd's Avatar
 
Join Date: 5th May 2006
Location: Norfolk
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
iTrader: (0)
Quote:
Originally Posted by Fedorov
With that amount of code I'm still looking for the hidden forum easter egg game of Manic Miner!
I was thinking more Colossal Cave (I'm even more ancient than that. )
Ancient Nerd is offline  
post #11 of 21 (permalink) Old 27th August 2006, 23:10
12th June 2006 1.8EX
 
WoolyCiv's Avatar
 
Join Date: 28th May 2006
Location: Lancashire
Posts: 1,119
Thanks: 0
Thanked 4 Times in 4 Posts
iTrader: (0)
Quote:
Originally Posted by Ancient Nerd
Quote:
Originally Posted by Fedorov
With that amount of code I'm still looking for the hidden forum easter egg game of Manic Miner!
I was thinking more Colossal Cave (I'm even more ancient than that. )
Was that the original 'Dungeons & Dragons', if so used to play that on a Data General Nova which at the time was refered to as a mini computer although it needed a full 19 inch rack to mount it and a fully stabilised supply
WoolyCiv is offline  
post #12 of 21 (permalink) Old 27th August 2006, 23:28
 
Ancient Nerd's Avatar
 
Join Date: 5th May 2006
Location: Norfolk
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
iTrader: (0)
Quote:
Originally Posted by WoolyCiv
Quote:
Originally Posted by Ancient Nerd
Quote:
Originally Posted by Fedorov
With that amount of code I'm still looking for the hidden forum easter egg game of Manic Miner!
I was thinking more Colossal Cave (I'm even more ancient than that. )
Was that the original 'Dungeons & Dragons', if so used to play that on a Data General Nova which at the time was refered to as a mini computer although it needed a full 19 inch rack to mount it and a fully stabilised supply
Yes, but that was in the days when Dungeons and Dragons was non-computer and role playing. In my case, an IBM 360 mainframe. Had to be the most expensive game system of all time (unless you know better). All in pure text.

Mind you, I had used Spacewar on a PDP-11 in the early 1970's, roughly equivalent to the DG machine. Graphics that would bring tears to the eyes of any modern gamer.
Ancient Nerd is offline  
post #13 of 21 (permalink) Old 27th August 2006, 23:58
12th June 2006 1.8EX
 
WoolyCiv's Avatar
 
Join Date: 28th May 2006
Location: Lancashire
Posts: 1,119
Thanks: 0
Thanked 4 Times in 4 Posts
iTrader: (0)
Quote:
Originally Posted by Ancient Nerd
Quote:
Originally Posted by WoolyCiv
Quote:
Originally Posted by Ancient Nerd
Quote:
Originally Posted by Fedorov
With that amount of code I'm still looking for the hidden forum easter egg game of Manic Miner!
I was thinking more Colossal Cave (I'm even more ancient than that. )
Was that the original 'Dungeons & Dragons', if so used to play that on a Data General Nova which at the time was refered to as a mini computer although it needed a full 19 inch rack to mount it and a fully stabilised supply
Yes, but that was in the days when Dungeons and Dragons was non-computer and role playing. In my case, an IBM 360 mainframe. Had to be the most expensive game system of all time (unless you know better). All in pure text.

Mind you, I had used Spacewar on a PDP-11 in the early 1970's, roughly equivalent to the DG machine. Graphics that would bring tears to the eyes of any modern gamer.
All so true - Oh nostalgia
WoolyCiv is offline  
post #14 of 21 (permalink) Old 28th August 2006, 00:07
 
Ancient Nerd's Avatar
 
Join Date: 5th May 2006
Location: Norfolk
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
iTrader: (0)
And sadly off-topic. I guess we'd better stop now. Besides, nostalgia isn't what it used to be.
Ancient Nerd is offline  
post #15 of 21 (permalink) Old 28th August 2006, 01:15
Supporter
 
Fedorov's Avatar
 
Car: 2016 1.6 Diesel, Sporty Blue
Join Date: 15th April 2006
Posts: 785
Thanks: 0
Thanked 3 Times in 3 Posts
iTrader: (0)
Manic Miner anyone?
http://www.darnkitty.com/manic/

Once you've played it remember to mark your posts READ on these forums - erm, trying to keep it slightly back on topic Pottsy
Fedorov is offline  
post #16 of 21 (permalink) Old 28th August 2006, 02:04
Super Moderator
 
TTDegs's Avatar
 
Car: '08 2.2 NHB CRV
Join Date: 4th August 2006
Location: Cardiff WALES
Posts: 7,762
Thanks: 97
Thanked 106 Times in 97 Posts
iTrader: (3)
Pottsy - many thanks for doing this one, it's one of my favourite gripes about most forums (specially when browsing after a few days away and they all mark themselves as read )


So cheers, nice one!




(PS - you're missing a semi colon on line 289....)*




















PPS - please don't look, I'm just joshing :P
TTDegs is offline  
post #17 of 21 (permalink) Old 28th August 2006, 08:02
 
elfa7's Avatar
 
Join Date: 8th May 2006
Location: Cheshire ENGLAND
Posts: 1,712
Thanks: 0
Thanked 1 Time in 1 Post
iTrader: (0)
Seems pretty straightforward to me
elfa7 is offline  
post #18 of 21 (permalink) Old 28th August 2006, 11:38
Supporter
 
Hartside's Avatar
 
Join Date: 4th May 2006
Location: Northumberland SCOTLAND
Posts: 645
Thanks: 1
Thanked 8 Times in 8 Posts
iTrader: (0)
Me too, just wondered if the comma was in the right place on line 234 though...........................
Hartside is offline  
post #19 of 21 (permalink) Old 28th August 2006, 21:31
Supporter
 
generationgav's Avatar
 
Join Date: 29th May 2006
Location: Manchester, UK ENGLAND
Posts: 833
Thanks: 0
Thanked 10 Times in 8 Posts
iTrader: (0)
Send a message via MSN to generationgav
Quote:
Originally Posted by Unguided
Forum modding, can be just as tricky as modding a car
If someone would like me to mod their forum in exchange for them modding my car then go ahead!

The great thing about modding a forum is that if it goes wrong you can either roll back or easily fix the changes, if the car goes wrong and you drill a hole in the wrong place. That could be one expensive fix!
generationgav is offline  
post #20 of 21 (permalink) Old 28th August 2006, 22:38
 
Unguided's Avatar
 
Join Date: 4th June 2006
Location: London
Posts: 63
Thanks: 0
Thanked 1 Time in 1 Post
iTrader: (0)
Quote:
Originally Posted by generationgav
Quote:
Originally Posted by Unguided
Forum modding, can be just as tricky as modding a car
If someone would like me to mod their forum in exchange for them modding my car then go ahead!

The great thing about modding a forum is that if it goes wrong you can either roll back or easily fix the changes, if the car goes wrong and you drill a hole in the wrong place. That could be one expensive fix!
I've done my fair share of forum modding when I ran a CS clan, thankfully being a bit of a programmer I pretty much understand what it is all doing. Now modding a car, the most I've ever done is change the radio, even then I do it the hard way. Took the standard radio out of 206 and got my Kenwood mp3 radio in. However when I bought a new one so I could get the iPod adapter too, bought the Haynes 206 modding book and learnt that the whole centre console plastic came away
Unguided is offline  
Reply

  Civinfo > Welcome > Site suggestions, feedback and rules

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the Civinfo forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
Your User Name is the name that appears by all your posts on the forum, and so should not be your email address.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is new posts missing some????? grey99 Site suggestions, feedback and rules 2 9th November 2006 13:02
News feed posts filling your new posts list? Pottsy Site suggestions, feedback and rules 0 3rd November 2006 08:30
1000 posts! richierich Any non Civic chat here please! 26 29th September 2006 00:43
View your Posts civic-babe Site suggestions, feedback and rules 7 14th September 2006 09:53
Read new posts Andrea Site suggestions, feedback and rules 11 4th September 2006 18:02

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome