keep unread flags

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
72
75%
Very Good
16
17%
Good
4
4%
Fair
0
No votes
Poor
4
4%
 
Total votes: 96

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: keep unread flags

Post by Merlin Sythove » Fri Oct 26, 2007 2:21 pm

asinshesq wrote:
Merlin Sythove wrote:...It is not too difficult to change the function list_new_unreads into a version that uses a flag to get proper unread topics, or just the newest ones "old style"...
How well defined is the 'newest ones "old style"'? Unmodded phpbb is buggy on this; are you clear on when it should in theory measure from if implemented correctly?
In the given function you replace the tracking time with the last login time (that is default phpBB so if that last login time is buggy, so be it :D) and you don't merge in the list of unread topics that was kept. You DO keep everything the same so if the user uses both types interchangeably, the full list of unread topics is always correct and up to date.

I would have to have a good look on how to implement it. And in general I advise against it, if one's users don't want this mod, you shouldn't install it, and if a few users are confused, teach them where the "mark everything as read" button is :D
Need custom work done? Pimp My Forum!

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: keep unread flags

Post by asinshesq » Fri Oct 26, 2007 2:28 pm

Merlin Sythove wrote:
asinshesq wrote:How well defined is the 'newest ones "old style"'? Unmodded phpbb is buggy on this; are you clear on when it should in theory measure from if implemented correctly?
In the given function you replace the tracking time with the last login time (that is default phpBB so if that last login time is buggy, so be it :D) ...
I haven't studied the original code, so I may be way offbase, but my sense from the way things worked on phpbb.com before phpbb3 is that it is not tied to last login. If it were tied to last login that would mean that anyone who checks the box to be permanently logged in would never get any flags.

Perhaps it is last session start?

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: keep unread flags

Post by Merlin Sythove » Fri Oct 26, 2007 4:34 pm

asinshesq wrote:Perhaps it is last session start?
Could be, whatever it is, it is the same as what phpBB used originally :D That needs checking, of course.
Need custom work done? Pimp My Forum!

computersOC
Registered User
Posts: 2528
Joined: Thu Dec 04, 2003 6:21 am
Location: New York
Contact:

Re: keep unread flags

Post by computersOC » Fri Oct 26, 2007 8:21 pm

asinshesq wrote:
computersOC wrote:Yeah, that's what I'm talking about. I can't edit the .tpl because there is something already there surrounding the image, so I can't use the code for saying somebody is logged in/logged out to make it show/not show.
If you're just trying to get rid of the alt text that comes up when a guest moves the mouse over the circle with a folder inside, you can try this (I haven't tried it but it should work):

Code: Select all

OPEN
index.php

FIND
$folder_alt = ( $unread_topic ) ? $lang['New_posts'] : $lang['No_new_posts'];

REPLACE WITH
$folder_alt = '';
if ( $userdata['session_logged_in'] )
{
	$folder_alt = ( $unread_topic ) ? $lang['New_posts'] : $lang['No_new_posts'];
}

OPEN
viewforum.php

FIND
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

REPLACE WITH
$no_new_posts_text = ( $userdata['session_logged_in'] ) $lang['No_new_posts'] : '';
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $no_new_posts_text;
Will that take away the alt text showing, but still keep the image there? I don't want the image there either, this way it saves on bandwidth. Thanks.
http://www.computersOC.com - overclocking, P2P, broadband tweaks, ISP forums, more... Computer Building Help -- Overclocking Guide

Want us to install you a phpBB board or update your current one? Want mods/anti-spam mods installed? Moving to a new host? Check us out here.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: keep unread flags

Post by asinshesq » Fri Oct 26, 2007 9:10 pm

Let's reviiw the bidding here. After you asked a confusing question, I said:
asinshesq wrote:It is true that phpbb without the mod shows the text 'no new posts' to a guest when a guest hovers the mouse over that image...is that what you are complaining about? If so, that has nothing to do with this mod but it should be easy for you to figure out how to get rid of it if you really care.
You then said:
computersOC wrote:Yeah, that's what I'm talking about...
I then went ahead and gave you some code for that even though it has nothing at all to do with this mod and you then said:
computersOC wrote:Will that take away the alt text showing, but still keep the image there? I don't want the image there either, this way it saves on bandwidth. Thanks.
The answer is yes, it will keep the image there because you didn't ask for the image to be removed (and I am skeptical that you are going to save any noticeable bandwidth by getting rid of that image anyway).

My point: when you ask someone for help here you should try hard to be clear about what you are asking so that the mod author doesn't end up wasting his time. I have noticed in the past that you tend not to be terribly careful, and that's why I am mentioning it here.

Anyway, I think this will work for what you are now asking about:

Code: Select all

OPEN
index.php

FIND
							$unread_topic = $forum_unreads[$forum_id];
							$folder_image = ( $unread_topic ) ? $images['forum_new'] : $images['forum'];
							$folder_alt = ( $unread_topic ) ? $lang['New_posts'] : $lang['No_new_posts'];

REPLACE WITH
							$folder_image = $images['spacer'];
							$folder_alt = '';
							if ( $userdata['session_logged_in'] )
							{
								$unread_topic = $forum_unreads[$forum_id];
								$folder_image = ( $unread_topic ) ? $images['forum_new'] : $images['forum'];
								$folder_alt = ( $unread_topic ) ? $lang['New_posts'] : $lang['No_new_posts'];
							}


OPEN
viewforum.php

FIND
				$folder_image = $folder;
				$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

REPLACE WITH
				if ( $userdata['session_logged_in'] )
				{
					$folder_image = $folder;
					$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
				}
				else
				{
					$folder_image = $images['spacer'];
					$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : '';
				}



OPEN
templates/subSilver/subsilver.cfg

FIND
$images['icon_keep_unread'] = "$current_template_images/icon_keep_unread.gif";

AFTER, ADD
$images['spacer'] = "$current_template_images/spacer.gif";
Last edited by asinshesq on Fri Nov 09, 2007 2:16 am, edited 1 time in total.

computersOC
Registered User
Posts: 2528
Joined: Thu Dec 04, 2003 6:21 am
Location: New York
Contact:

Re: keep unread flags

Post by computersOC » Sat Oct 27, 2007 1:16 am

Sorry I wasn't clear, I tried explaining it to the best of my ability. I will give that a try, thanks.

BTW, by getting rid of the images, I will be saving about 11KB on each viewforum.php page, and I will save about 5KB on my main index.php forums page. It might not equal to that because of caching, but not totally sure. I know some pages take too long on mobile devices, but without images, it's faster.
http://www.computersOC.com - overclocking, P2P, broadband tweaks, ISP forums, more... Computer Building Help -- Overclocking Guide

Want us to install you a phpBB board or update your current one? Want mods/anti-spam mods installed? Moving to a new host? Check us out here.

marian0810
Former Team Member
Posts: 3011
Joined: Mon May 21, 2007 9:17 pm
Location: The Netherlands
Name: Marian
Contact:

Re: keep unread flags

Post by marian0810 » Sat Oct 27, 2007 9:29 am

asinshesq wrote:
computersOC wrote:Can someone tell me what code to change if I don't want the read/unread flag image to show to guests? Thanks.
This is from the author's notes on the mod:
## NOTE: this mod stores keep unread info for guests in their cookies; some people want to
## disable this mod for guests altogether (I guess as an incentive to register); in order
## to turn off this mod for guests, install the mod in the usual way and then do this:
##
## OPEN
## includes/functions.php
##
## FIND
## return $new_unreads;
##
## REPLACE WITH
## return ($userdata['session_logged_in'] ? $new_unreads : array());
##
## FIND
## return $t;
##
## REPLACE WITH
## return ($userdata['session_logged_in'] ? $t: time());
##
## OPEN viewtopic.php
##
## FIND
## 'KEEP_UNREAD_IMG' => $keep_unread_img,
##
## REPLACE WITH
## 'KEEP_UNREAD_IMG' => ($userdata['session_logged_in'] ? $keep_unread_img : ''),
Thank you! I found that very useful :D
You and me, time and space. You watch us run!

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: keep unread flags

Post by Merlin Sythove » Sat Oct 27, 2007 11:04 am

FYI, since I'm a sucker for challenges, I've sent a test version of what I will call "classic new posts" to Asinsesq to try out. We must make sure the code works since my forum may not be exactly what he has. If we get it to work, we'll post it here of course.

I do agree that for SOME forums that I only follow "on the fly" I don't want to be bothered with all unread topics, if I don't read it now, it means I don't WANT to read it anymore, and the classic new posts feature would be preferable. So provided your users know what is what, you may want to offer the feature. I have offered it on my own forum a long time ago, but it is only listed as a manual link that people may create a favourite out of, so as to avoid any possible confusion.
Need custom work done? Pimp My Forum!

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Sat Oct 27, 2007 2:41 pm

[deleted as off-topic]
Last edited by asinshesq on Sun Oct 28, 2007 2:19 am, edited 2 times in total.

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: somehwat off-topic: phpbb's new posts function

Post by Merlin Sythove » Sat Oct 27, 2007 3:12 pm

Hmmm, the reason to post it via PM was to keep these discussions off list since they are not relevant to the real mod here. But I used what the original phpBB used to track new posts in search.php, which is this code:

Code: Select all

			if ( $search_id == 'newposts' )
			{
				if ( $userdata['session_logged_in'] )
				{
					$sql = "SELECT post_id 
						FROM " . POSTS_TABLE . " 
						WHERE post_time >= " . $userdata['user_lastvisit'];
				}
I'm not attempting to provide an "original" new posts functionality without whatever bugs the original had. If you have a better idea, lets hear it :D (because it would make sense to solve whatever bugs there were, if that is not too difficult).
Need custom work done? Pimp My Forum!

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: keep unread flags

Post by Merlin Sythove » Sat Oct 27, 2007 3:14 pm

PS: Check autologin - it is an automated login option, not an option to stay logged in with the date of three years ago, if I understand it correctly.
Need custom work done? Pimp My Forum!

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Sat Oct 27, 2007 3:56 pm

Merlin and I are close to agreeing on an approach to add back phpbb's original function allowing a user to get a list of posts since the last visit (although both he and I think that having both functions available on a board may confuse users). I expect to be able to post some code some time in the next few days.
Last edited by asinshesq on Sun Oct 28, 2007 2:23 am, edited 1 time in total.

ace2ace
Registered User
Posts: 364
Joined: Sat Aug 14, 2004 3:48 pm

Re: Performance

Post by ace2ace » Sat Oct 27, 2007 5:26 pm

scottflory wrote:Well... ODBC was it.
If you're so inclined, take a look at the mssql-odbc.php code in the base phpbb installation (under the db directory). Compare it to the mssql.php code. The ODBC code not only gets the query result, but parses EVERY ROW AND COLUMN into an array before moving on. The mssql version does not do this, presumably because the mssql php functions allow you to keep a handle to the query and get the rows and columns at a later time (as in, when you need it).
So, I switched to using mssql instead of mssql-odbc and now our forums are flying!!!

Scott
Hi Scoott,
How do we switch from mssql_odbc to mssql?
thanks

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

off-topic: adding back "view posts since last visit" functio

Post by asinshesq » Tue Oct 30, 2007 8:40 pm

Warning: this is a long, detailed and off-topic post. If you are not curious about the pros and cons of adding back the original "view posts since last visit" function to a board that has keep unread installed, or about the code to add that function back, skip this post!

Merlin and I have spent a fair bit of time reverse engineering exactly how an unmodded phpbb's "View posts since last visit" function works and writing code to add that function back to a board that has keep unread installed. (Actually, writing the code to re-install the function itself took no time at all since we just need to replace a small bit of code that keep unread takes out, but reverse engineering how the old function actually works took some doing.)

Anyway, Merlin and I both remain convinced that adding this function back to a board that has keep unread installed will confuse users, that this function (in a clean phpbb board) works erratically, and that there are better ways than this function for users to get what they think they want. Specifically:

- If people don't like the list of unread posts that the keep unread mod supplies because it includes unread posts that the user has already decided he will never read, those users should be told that they can get rid of those old unread posts in the list by clicking the mark all forums read link that appears at the bottom left side of the index page

- If people want a list of posts in the last ___ hours or days or weeks (a time specified by the user), consider adding the following mod that is based on a mod Niels Chr. (at http://mods.db9.dk) did a while back. The mod adds a dropdown menu at the bottom of the index page that allows the user to ask for a list of all posts in the last 15 minutes, 30 minutes, 45 minutes, 1 hour, 2 hours, 6 hours, 12 hours, 1 day. 7 days or one month. The code for that mod (as modified slightly by me to streamline it and change it to match a subsequent change to phpbb) is as follows:

Code: Select all

mod based on Niels Chr mod that adds a dropdown menu at the bottom of the index page allowing users to ask for a list of all posts in the last ___ hours or days:

# 
#-----[ OPEN ]------------------------------------------------ 
# 
search.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
$search_id = ( isset($HTTP_GET_VARS['search_id']) ) ? $HTTP_GET_VARS['search_id'] : '';

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#  

// Start replacement - Search back MOD
$search_id = ( isset($HTTP_GET_VARS['search_id']) ) ? $HTTP_GET_VARS['search_id'] : (($HTTP_POST_VARS['search_id'])? $HTTP_POST_VARS['search_id']:'');
// End replacement - Search back MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$search_time = time() - ( ( ( !empty($HTTP_POST_VARS['search_time']) ) ? intval($HTTP_POST_VARS['search_time']) : intval($HTTP_GET_VARS['search_time']) ) * 86400 );

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#  

// Start replacement - Search back MOD
$search_time = time() - ( ( ( !empty($HTTP_POST_VARS['search_time']) ) ? intval($HTTP_POST_VARS['search_time']) : intval($HTTP_GET_VARS['search_time']) ) * 60 );
// End replacement - Search back MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
WHERE post_time >= " . $userdata['user_lastvisit'];

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#
WHERE post_time >= " . (($search_time)? $search_time." AND post_time >= ":'' ).$userdata['user_lastvisit'];

# 
#-----[ FIND ]------------------------------------------------ 
# 
				if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )

				{
					$search_author = '';
				}

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#
/* mod for search back ... comment out the next three lines so that they don't mess up the search back in time mod
				if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )

				{
					$search_author = '';
				}
*/

# 
#-----[ FIND ]------------------------------------------------ 
# 
				if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )

				{
					$search_author = '';
				}

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#
/* mod for search back ... comment out the next three lines so that they don't mess up the search back in time mod
				if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )

				{
					$search_author = '';
				}
*/

# 
#-----[ FIND ]------------------------------------------------ 
# 
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Posts'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']);

# 
#-----[ REPLACE WITH ]---------------------------------------- 
# 

// Start replacement - Search back MOD
$previous_days = array(0,15,30,60,120,360,720,1440,10080,20160,43200,129600,259200,524160);

$previous_days_text = array($lang['All_Posts'], 
$lang['15_min'],$lang['30_min'],$lang['1_Hour'],$lang['2_Hour'],$lang['6_Hour'],$lang['12_Hour'],
$lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']);
// End replacement - Search back MOD

# 
#-----[ OPEN ]------------------------------------------------ 
# 
includes/page_header.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
//
// The following assigns all _common_ variables that may be used at any point

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 
// Start add - Search back MOD
$Select_time='<select name="search_time" size="1" onchange="SetLastVisit();" class="gensmall">
	<option value="1" SELECTED>&nbsp;'.$lang['Select_time'].'&nbsp;</option>
	<option value="15">&nbsp;'.$lang['15_min'].'</option>
	<option value="30">&nbsp;'.$lang['30_min'].'</option>
	<option value="45">&nbsp;'.$lang['45_min'].'</option>
	<option value="60">&nbsp;'.$lang['1_Hour'].'</option>
	<option value="120">&nbsp;'.$lang['2_Hour'].'</option>
	<option value="360">&nbsp;'.$lang['6_Hour'].'</option>
	<option value="720">&nbsp;'.$lang['12_Hour'].'</option>
	<option value="1440">&nbsp;'.$lang['1_Day'].'</option>
	<option value="10080">&nbsp;'.$lang['7_Days'].'</option>
	<option value="43200">&nbsp;'.$lang['1_Month'].'</option>
  	</select>
	<input type="hidden" name="search_author" value="*">
	<input type="hidden" name="show_results" value="posts">';
// End add - Search back MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
'PAGE_TITLE' => $page_title,

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// Start add - Search back MOD
'SELECT_TIME' => $Select_time,
// End add - Search back MOD

# 
#-----[ OPEN ]------------------------------------------------ 
# 
language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
?>

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 
// Start add - Search back MOD
$lang['Select_time'] = 'View posts from last (select time)';
$lang['15_min'] = '15 min';
$lang['30_min'] = '30 min';
$lang['45_min'] = '45 min';
$lang['1_Hour'] = '1 Hour';
$lang['2_Hour'] = '2 Hours';
$lang['6_Hour'] = '6 Hours';
$lang['12_Hour'] = '12 Hours';
// End add - Search back MOD

# 
#-----[ OPEN ]------------------------------------------------ 
# 
templates/subSilver/index_body.tpl

# 
#-----[ FIND ]------------------------------------------------ 
# 
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 
<!-- Start add - Search back MOD -->
<script language="javascript">
<!-- 
function SetLastVisit() 
{ 
	if (!document.LastVisitFrm.search_time.options[0].selected) 
{ 
document.LastVisitFrm.submit(); 
} 
	return true; 
} 
//-->
</script>
<!-- End add - Search back MOD -->

# 
#-----[ FIND ]------------------------------------------------ 
# 
	<td align="right"><span class="gensmall">{S_TIMEZONE}</span></td>

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
#
	<!-- Start add - Search back MOD -->
	<td align="center" class="gensmall">
	<form name="LastVisitFrm" action="search.php" method="post">
	{SELECT_TIME}
	</td>
	</form>
	<!-- End add - Search back MOD -->
# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------------- 
# 
# EoM
However, for people who still insist on adding back the 'view posts since last visit' function, I spell out the code changes below. But before spelling out those changes, I'll try to explain what happens in an unmodded phpbb board when a user clicks the "View posts since last visit" link. Obviously, the user sees a list of all topics that have been posted to since the user's 'last visit'. But the problem is in how 'last visit' is defined.

Here's a simple explanation of the problem: when a user navigates to the forum for a new visit, the list can be both over- and under-inclusive. It can in some cases:

- include posts that the user actually already read in his last visit

- not include some posts made towards the end of the prior visit that the user has never seen.

And here's a fuller explanation:

'Last visit' is supposed to mean the last time the user was active on the forum before the current session. But the way phpbb keeps track of 'last visit' and current session results in behavior that many users will not expect:

- The session generally only closes out if a user physically closes his browser (navigating away does NOT close out the session). So, suppose a user goes to the site in the evening, views 10 posts, navigates away (to google.com or some other site), leaves the browser open and goes to bed, and then in the morning goes back to the site with the same open browser. 'Last visit' will be stale and the list the user sees when he clicks the "view posts since last visit" link will inappropriately include the posts he already saw the night before. And if the user is in the habit of leaving on his computer and leaving the browser open perpetually, the list will grow longer and longer, including more and more posts he has already seen days or weeks ago. So for this feature to be even a little bit useful the user would have to be careful to close his browser when done with a session.

- When a session restarts, last visit gets updated to the last time the user navigated to or refreshed a phpbb page before the restart. That means if posts get made during a session and the user doesn't check the list at the very end of his session, the user may not see those posts during that session and they will not appear in the list the next time he goes to the forum. Instead, those posts will fall through the cracks.

- There is a lag of up to 60 seconds built into phpbb before session times get updated. So, suppose someone makes a post 59 seconds before a user signs off and the user reads that post and at the very end refreshes his browser to assure that everything is 'up to date'. That post may still show up in the list the next time he signs on since depending on the exact timing the 'last visit' time may pre-date the post.

- In some browsers (e.g. IE), a new session commences when a new occurance of the browser opens even if the old occurrance of the browser is still open. This can result in 'last visit' getting updated to a time close to the current time, and as a result the uesr suddenly loses everything in the list for no apparant reason. For example, suppose a user goes to the site with IE, is faced with a long list of posts since the last visit and reads the first post. Now suppose he opens a second occurance of IE and goes to the site. That resets 'last visit' to the last time he clicked on the forum with the first browser. And that means that the entire list of posts since real 'last visit' gets unexpectedly wiped out before he has a chance to read the other posts.

FInally, for completeness before setting forth the code for how to add back the "view posts since last visit" function, here is a technical explanation of exactly how phpbb keeps track of 'user_lastvisit':

1. The function session_begin() (in includes/sessions.php) gets called every time a user logs in anew or closes his browser and some time later navigates to the site. Session_begin():

- changes the user's user_lastvisit field in the db to become his old db user_session_time (which is generally the last time he went to or refreshed a phpbb page or within 60 seconds before that last time)

- updates the user's user_session_time field in the db to equal current_time()

- sets a cookie for the session that expires whenever the browser is closed.

2. The function session_pagestart() (also in includes/sessions.php) gets called every time a user goes to or refreshes a regular phpbb page, Session_pagestart() checks cookies to see if the user is part of an active session.

- If, according to the cookies, the user is part of an active session, and if the existing user_session_time is more than 60 seconds old, the user_session_time in the db gets updated (but nothing happens to the user_lastvisit).

- If, according to the cookies, the user is part of an active session, but the existing user_session_time is no more than 60 seconds old, nothing happens to user_lastvisit or user_session_time fields in the db (raising the possibility that a user could see posts in the last 60 seconds before he closes his browser that are inappropriately coutned as made since the last visit when the uesr next goes back to the site).

- If, according to the cookies, the user is not part of an active session, session_pagestart() (described above) gets called, and as a result the user_lastvisit in the db is reset to the last user_session_time in the db (i.e. the last time the user went to or refreshed a phpbb page or within 60 seconds before that last time) and user_session_time is reset to current time().

This should generally work as expected except:

- a user who never closes his browser will have an ever growing list of posts since his user_last_visit never gets reset (there is a 60 day limit on this in the code somewhere but 60 days is a lot of posts since the 'last visit'!)

- the lag of up to 60 seconds in updating user_session_time creates the possibility that a user who closes his browser and then goes back to the site will, when he clicks to 'view posts since last visit', see posts in the list that he has already read (i.e. posts that were posted within 60 seconds of the last time the user_session_time was updated)

- a user who opens multiple occurances of certain browsers like IE (without closing any occurances) triggers an updating of user_lastvisit (as though each occurance has its own cookies) and that can result in the posts since last visit list being unexpectedly wiped out (I think this happens because a second occurance of IE apparantly does not share cookies with the first and thus when a user opens up a second occurance of IE that occurance has no _sid cookie indicating an active session already going).

Below, I set forth three alternative sets of code changes, to give you three different options for adding back this function. If you decide to install one of these alternatives on your board, we suggest you come up with a standard disclaimer that will explain to users that this function is erratic and nonintuitive and that it may not be a good idea to use it.


FIRST ALTERNATIVE
This adds back the view posts since last visit function but no link.
To get to the list of posts since last visit, users navigate their
browsers to http://[domain]/search.php?search_id=newposts&classic=1
They can save that link as a browser favorite to make it easier to use.
Here's the code:

Code: Select all

#
#-----[ OPEN ]------------------------------------------------
#
search.php

#
#-----[ FIND ]------------------------------------------------
#
			if ( $search_id == 'newposts' )

#
#-----[ REPLACE WITH ]---------------------------------------- 
#
			//START MOD Keep_unread_2
			if ( $search_id == 'newposts' && isset($HTTP_GET_VARS['classic']) )
			{
				if ( $userdata['session_logged_in'] )
				{
					$sql = "SELECT post_id
						FROM " . POSTS_TABLE . "
						WHERE post_time >= " . $userdata['user_lastvisit'];
				}
				else
				{
					redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=newposts", true));
				}

				$show_results = 'topics';
				$sort_by = 0;
				$sort_dir = 'DESC';
			}
			else if ( $search_id == 'newposts' )

#
#-----[ FIND ]------------------------------------------------
#
				//Don't add post if you've read it and you want new posts only
				if ( ($search_id == 'newposts') )

#
#-----[ REPLACE WITH ]---------------------------------------- 
#
				//Don't add post if you've read it and you want unread posts only
				if ( ($search_id == 'newposts') && !isset($HTTP_GET_VARS['classic']) )
SECOND ALTERNATIVE
This adds back the view posts since last visit function,
and also adds a link on the index page
(right under the view unread posts link) for any user who chooses
that option in his profile. Here's the code:

Code: Select all

#
#-----[ SQL ]-------------------------------------------------
#
ALTER TABLE phpbb_users ADD user_show_classic_newpost_link TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL;

#
#-----[ OPEN ]------------------------------------------------
#
search.php

#
#-----[ FIND ]------------------------------------------------
#
			if ( $search_id == 'newposts' )

#
#-----[ REPLACE WITH ]---------------------------------------- 
#
			//START MOD Keep_unread_2
			if ( $search_id == 'newposts' && isset($HTTP_GET_VARS['classic']) )
			{
				if ( $userdata['session_logged_in'] )
				{
					$sql = "SELECT post_id
						FROM " . POSTS_TABLE . "
						WHERE post_time >= " . $userdata['user_lastvisit'];
				}
				else
				{
					redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=newposts", true));
				}

				$show_results = 'topics';
				$sort_by = 0;
				$sort_dir = 'DESC';
			}
			else if ( $search_id == 'newposts' )

#
#-----[ FIND ]------------------------------------------------
#
				//Don't add post if you've read it and you want new posts only
				if ( ($search_id == 'newposts') )

#
#-----[ REPLACE WITH ]---------------------------------------- 
#
				//Don't add post if you've read it and you want unread posts only
				if ( ($search_id == 'newposts') && !isset($HTTP_GET_VARS['classic']) )

#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_users.php

#
#-----[ FIND ]------------------------------------------------
#
		$allowsmilies = ( isset( $HTTP_POST_VARS['allowsmilies']) ) ? intval( $HTTP_POST_VARS['allowsmilies'] ) : $board_config['allow_smilies'];

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$show_classic_newpost_link = ( isset($HTTP_POST_VARS['show_classic_newpost_link']) ) ? intval( $HTTP_POST_VARS['show_classic_newpost_link'] ) : 0;

#
#-----[ FIND ]------------------------------------------------
# note: actual line is longer
				SET " . $username_sql . 

#
#-----[ IN-LINE FIND ]------------------------------------------------
#
user_allowsmile = $allowsmilies, 

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------------
#
user_show_classic_newpost_link = $show_classic_newpost_link,

#
#-----[ FIND ]------------------------------------------------
#
		$allowsmilies = $this_userdata['user_allowsmile'];

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$show_classic_newpost_link = $this_userdata['user_show_classic_newpost_link'];

#
#-----[ FIND ]------------------------------------------------
#
			$s_hidden_fields .= '<input type="hidden" name="allowsmilies" value="' . $allowsmilies . '" />';

#
#-----[ AFTER, ADD ]------------------------------------------------
#
			$s_hidden_fields .= '<input type="hidden" name="show_classic_newpost_link" value="' . $show_classic_newpost_link . '" />';

#
#-----[ FIND ]------------------------------------------------
#
			'ALWAYS_ALLOW_SMILIES_NO' => (!$allowsmilies) ? 'checked="checked"' : '',

#
#-----[ AFTER, ADD ]------------------------------------------------
#
			'SHOW_CLASSIC_NEWPOST_LINK_YES' => ( $show_classic_newpost_link ) ? 'checked="checked"' : '',
			'SHOW_CLASSIC_NEWPOST_LINK_NO' => ( !$show_classic_newpost_link ) ? 'checked="checked"' : '',

#
#-----[ FIND ]------------------------------------------------
#
			'L_ALWAYS_ALLOW_SMILIES' => $lang['Always_smile'],

#
#-----[ AFTER, ADD ]------------------------------------------------
#
			'L_SHOW_CLASSIC_NEWPOST_LINK' => $lang['Show_classic_newpost_link'],

#
#-----[ OPEN ]------------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------------
#
//START MOD Keep_unread_2

#
#-----[ AFTER, ADD ]------------------------------------------------
#
// check to see if the user has opted to include a link for posts since last visit and if so, set flag
if ($userdata['user_show_classic_newpost_link'])
{
	$template->assign_block_vars('switch_show_classic_newpost_link', array());
}

#
#-----[ FIND ]------------------------------------------------
#
	'L_SEARCH_NEW' => ($new_unreads) ? $lang['View_unread_posts'] : $lang['No_unread_posts'],

#
#-----[ AFTER, ADD ]---------------------------------------- 
#
	'L_SEARCH_CLASSIC_NEW' => $lang['Search_classic_new'],

#
#-----[ FIND ]------------------------------------------------
#
	'U_SEARCH_NEW' => append_sid('search.'.$phpEx.'?search_id=newposts'),

#
#-----[ AFTER, ADD ]------------------------------------------------
#

	'U_SEARCH_CLASSIC_NEW' => append_sid('search.'.$phpEx.'?search_id=newposts&classic=1'),

#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------------
#
		$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : 0$board_config['allow_smilies'];

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$show_classic_newpost_link = ( isset($HTTP_POST_VARS['show_classic_newpost_link']) ) ? ( ($HTTP_POST_VARS['show_classic_newpost_link']) ? TRUE : 0 ) : 0;

#
#-----[ FIND ]------------------------------------------------
#
		$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $userdata['user_allowsmile'];

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$show_classic_newpost_link = ( isset($HTTP_POST_VARS['show_classic_newpost_link']) ) ? ( ($HTTP_POST_VARS['show_classic_newpost_link']) ? TRUE : 0 ) : $userdata['user_show_classic_newpost_link'];

#
#-----[ FIND ]------------------------------------------------
# note: actual line is longer
				SET " . $username_sql . $

#
#-----[ IN-LINE FIND ]------------------------------------------------
#
user_allowsmile = $allowsmilies, 

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------------
#
user_show_classic_newpost_link = $show_classic_newpost_link, 

#
#-----[ FIND ]------------------------------------------------
# note: actual line is longer
			$sql = "INSERT INTO " . USERS_TABLE 

#
#-----[ IN-LINE FIND ]------------------------------------------------
#
user_allowsmile, 

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------------
#
user_show_classic_newpost_link, 

#
#-----[ FIND ]------------------------------------------------
# note: actual line is longer
				VALUES ($user_id, '"

#
#-----[ IN-LINE FIND ]------------------------------------------------
#
$allowsmilies, 

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------------
#
$show_classic_newpost_link, 

#
#-----[ FIND ]------------------------------------------------
#
	$allowsmilies = $userdata['user_allowsmile'];

#
#-----[ AFTER, ADD ]------------------------------------------------
#
	$show_classic_newpost_link = $userdata['user_show_classic_newpost_link'];

#
#-----[ FIND ]------------------------------------------------
#
		'ALWAYS_ALLOW_SMILIES_NO' => ( !$allowsmilies ) ? 'checked="checked"' : '',

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		'SHOW_CLASSIC_NEWPOST_LINK_YES' => ( $show_classic_newpost_link ) ? 'checked="checked"' : '',
		'SHOW_CLASSIC_NEWPOST_LINK_NO' => ( !$show_classic_newpost_link ) ? 'checked="checked"' : '',

#
#-----[ FIND ]------------------------------------------------
#
		'L_ALWAYS_ALLOW_SMILIES' => $lang['Always_smile'],

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		'L_SHOW_CLASSIC_NEWPOST_LINK' => $lang['Show_classic_newpost_link'],

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#
$lang['Search_new'] = 'View unread posts';

#
#-----[ AFTER, ADD ]------------------------------------------------
#
$lang['Search_classic_new'] = 'View posts since last visit';
$lang['Show_classic_newpost_link'] = 'Add link for posts since last visit (not recommended)';

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/index_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
		<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />

#
#-----[ REPLACE WITH ]-----------------------------------------
#
		<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br />
		<!-- BEGIN switch_show_classic_newpost_link -->
		<a href="{U_SEARCH_CLASSIC_NEW}" class="gensmall">{L_SEARCH_CLASSIC_NEW}</a><br />
		<!-- END switch_show_classic_newpost_link -->
		<a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_BOARD_LANGUAGE}:</span></td>

#
#-----[ BEFORE, ADD ]------------------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_SHOW_CLASSIC_NEWPOST_LINK}:</span></td>
	  <td class="row2"> 
		<input type="radio" name="show_classic_newpost_link" value="1" {SHOW_CLASSIC_NEWPOST_LINK_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="show_classic_newpost_link" value="0" {SHOW_CLASSIC_NEWPOST_LINK_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_BOARD_LANGUAGE}</span></td>

#
#-----[ BEFORE, ADD]------------------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_SHOW_CLASSIC_NEWPOST_LINK}</span></td>
	  <td class="row2"> 
		<input type="radio" name="show_classic_newpost_link" value="1" {SHOW_CLASSIC_NEWPOST_LINK_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="show_classic_newpost_link" value="0" {SHOW_CLASSIC_NEWPOST_LINK_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

THIRD ALTERNATIVE
This adds back the view posts since last visit function,
and also adds a link on the index page
(right under the view unread posts link) for any user who chooses
that option in his profile. However, it only allows users to select
that option if the admin has choosen to activate the feature
in the config page of the ACP. Here's the code:

Code: Select all

#
#-----[ SQL ]-------------------------------------------------
#
INSERT INTO phpbb_config (config_name,config_value) VALUES ('allow_classic_newpost_link',0);
ALTER TABLE phpbb_users ADD user_show_classic_newpost_link TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL;

#
#-----[ OPEN ]------------------------------------------------
#
search.php

#
#-----[ FIND ]------------------------------------------------
#
			if ( $search_id == 'newposts' )

#
#-----[ REPLACE WITH ]---------------------------------------- 
#
			//START MOD Keep_unread_2
			if ( $search_id == 'newposts' && isset($HTTP_GET_VARS['classic']) )
			{
				if ( $userdata['session_logged_in'] )
				{
					$sql = "SELECT post_id
						FROM " . POSTS_TABLE . "
						WHERE post_time >= " . $userdata['user_lastvisit'];
				}
				else
				{
					redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=newposts", true));
				}

				$show_results = 'topics';
				$sort_by = 0;
				$sort_dir = 'DESC';
			}
			else if ( $search_id == 'newposts' )

#
#-----[ FIND ]------------------------------------------------
#
				//Don't add post if you've read it and you want new posts only
				if ( ($search_id == 'newposts') )

#
#-----[ REPLACE WITH ]---------------------------------------- 
#
				//Don't add post if you've read it and you want unread posts only
				if ( ($search_id == 'newposts') && !isset($HTTP_GET_VARS['classic']) )

#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_board.php

#
#-----[ FIND ]------------------------------------------------
#
$smile_no = ( !$new['allow_smilies'] ) ? "checked=\"checked\"" : "";

#
#-----[ AFTER, ADD ]------------------------------------------------
#
$allow_classic_newpost_link_yes = ( $new['allow_classic_newpost_link'] ) ? "checked=\"checked\"" : "";
$allow_classic_newpost_link_no = ( !$new['allow_classic_newpost_link'] ) ? "checked=\"checked\"" : "";

#
#-----[ FIND ]------------------------------------------------
#
	"L_ALLOW_SMILIES" => $lang['Allow_smilies'],

#
#-----[ AFTER, ADD ]------------------------------------------------
#
	"L_ALLOW_CLASSIC_NEWPOST_LINK" => $lang['Allow_classic_newpost_link'],

#
#-----[ FIND ]------------------------------------------------
#
	"SMILE_NO" => $smile_no,

#
#-----[ AFTER, ADD ]------------------------------------------------
#
	"ALLOW_CLASSIC_NEWPOST_LINK_YES" => $allow_classic_newpost_link_yes,
	"ALLOW_CLASSIC_NEWPOST_LINK_NO" => $allow_classic_newpost_link_no,

#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_users.php

#
#-----[ FIND ]------------------------------------------------
#
		$allowsmilies = ( isset( $HTTP_POST_VARS['allowsmilies']) ) ? intval( $HTTP_POST_VARS['allowsmilies'] ) : $board_config['allow_smilies'];

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$show_classic_newpost_link = ( isset($HTTP_POST_VARS['show_classic_newpost_link']) ) ? intval( $HTTP_POST_VARS['show_classic_newpost_link'] ) : $board_config['allow_classic_newpost_link'];

#
#-----[ FIND ]------------------------------------------------
# note: actual line is longer
				SET " . $username_sql . 

#
#-----[ IN-LINE FIND ]------------------------------------------------
#
user_allowsmile = $allowsmilies, 

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------------
#
user_show_classic_newpost_link = $show_classic_newpost_link,

#
#-----[ FIND ]------------------------------------------------
#
		$allowsmilies = $this_userdata['user_allowsmile'];

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$show_classic_newpost_link = $this_userdata['user_show_classic_newpost_link'];

#
#-----[ FIND ]------------------------------------------------
#
			$s_hidden_fields .= '<input type="hidden" name="allowsmilies" value="' . $allowsmilies . '" />';

#
#-----[ AFTER, ADD ]------------------------------------------------
#
			$s_hidden_fields .= '<input type="hidden" name="show_classic_newpost_link" value="' . $show_classic_newpost_link . '" />';

#
#-----[ FIND ]------------------------------------------------
#
		$template->set_filenames(array(
			"body" => "admin/user_edit_body.tpl")
		);

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		if ( $board_config['allow_classic_newpost_link'] )
		{
			$template->assign_block_vars('switch_show_classic_newpost_option', array());
		}

#
#-----[ FIND ]------------------------------------------------
#
			'ALWAYS_ALLOW_SMILIES_NO' => (!$allowsmilies) ? 'checked="checked"' : '',

#
#-----[ AFTER, ADD ]------------------------------------------------
#
			'SHOW_CLASSIC_NEWPOST_LINK_YES' => ( $show_classic_newpost_link ) ? 'checked="checked"' : '',
			'SHOW_CLASSIC_NEWPOST_LINK_NO' => ( !$show_classic_newpost_link ) ? 'checked="checked"' : '',

#
#-----[ FIND ]------------------------------------------------
#
			'L_ALWAYS_ALLOW_SMILIES' => $lang['Always_smile'],

#
#-----[ AFTER, ADD ]------------------------------------------------
#
			'L_SHOW_CLASSIC_NEWPOST_LINK' => $lang['Show_classic_newpost_link'],

#
#-----[ OPEN ]------------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------------
#
//START MOD Keep_unread_2

#
#-----[ AFTER, ADD ]------------------------------------------------
#
// check to see if the user has opted to include a link for posts since last visit and if so, set flag
if ($userdata['user_show_classic_newpost_link'] && $board_config['allow_classic_newpost_link'])
{
	$template->assign_block_vars('switch_show_classic_newpost_link', array());
}

#
#-----[ FIND ]------------------------------------------------
#
	'L_SEARCH_NEW' => ($new_unreads) ? $lang['View_unread_posts'] : $lang['No_unread_posts'],

#
#-----[ AFTER, ADD ]---------------------------------------- 
#
	'L_SEARCH_CLASSIC_NEW' => $lang['Search_classic_new'],

#
#-----[ FIND ]------------------------------------------------
#
	'U_SEARCH_NEW' => append_sid('search.'.$phpEx.'?search_id=newposts'),

#
#-----[ AFTER, ADD ]------------------------------------------------
#

	'U_SEARCH_CLASSIC_NEW' => append_sid('search.'.$phpEx.'?search_id=newposts&classic=1'),

#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------------
#
		$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $board_config['allow_smilies'];

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$show_classic_newpost_link = ( isset($HTTP_POST_VARS['show_classic_newpost_link']) ) ? ( ($HTTP_POST_VARS['show_classic_newpost_link']) ? TRUE : 0 ) : $board_config['allow_classic_newpost_link'];

#
#-----[ FIND ]------------------------------------------------
#
		$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $userdata['user_allowsmile'];

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$show_classic_newpost_link = ( isset($HTTP_POST_VARS['show_classic_newpost_link']) ) ? ( ($HTTP_POST_VARS['show_classic_newpost_link']) ? TRUE : 0 ) : $userdata['user_show_classic_newpost_link'];

#
#-----[ FIND ]------------------------------------------------
# note: actual line is longer
				SET " . $username_sql . $

#
#-----[ IN-LINE FIND ]------------------------------------------------
#
user_allowsmile = $allowsmilies, 

#
#-----[ IN-LINE AFTER, FIND ]------------------------------------------------
#
user_show_classic_newpost_link = $show_classic_newpost_link, 

#
#-----[ FIND ]------------------------------------------------
# note: actual line is longer
			$sql = "INSERT INTO " . USERS_TABLE 

#
#-----[ IN-LINE FIND ]------------------------------------------------
#
user_allowsmile, 

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------------
#
user_show_classic_newpost_link, 

#
#-----[ FIND ]------------------------------------------------
# note: actual line is longer
				VALUES ($user_id, '"

#
#-----[ IN-LINE FIND ]------------------------------------------------
#
$allowsmilies, 

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------------
#
$show_classic_newpost_link, 

#
#-----[ FIND ]------------------------------------------------
#
	$allowsmilies = $userdata['user_allowsmile'];

#
#-----[ AFTER, ADD ]------------------------------------------------
#
	$show_classic_newpost_link = $userdata['user_show_classic_newpost_link'];

#
#-----[ FIND ]------------------------------------------------
#
	$template->set_filenames(array(
		'body' => 'profile_add_body.tpl')
	);

#
#-----[ AFTER, ADD ]------------------------------------------------
#
	if ( $board_config['allow_classic_newpost_link'] )
	{
		$template->assign_block_vars('switch_show_classic_newpost_option', array());
	}

#
#-----[ FIND ]------------------------------------------------
#
		'ALWAYS_ALLOW_SMILIES_NO' => ( !$allowsmilies ) ? 'checked="checked"' : '',

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		'SHOW_CLASSIC_NEWPOST_LINK_YES' => ( $show_classic_newpost_link ) ? 'checked="checked"' : '',
		'SHOW_CLASSIC_NEWPOST_LINK_NO' => ( !$show_classic_newpost_link ) ? 'checked="checked"' : '',

#
#-----[ FIND ]------------------------------------------------
#
		'L_ALWAYS_ALLOW_SMILIES' => $lang['Always_smile'],

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		'L_SHOW_CLASSIC_NEWPOST_LINK' => $lang['Show_classic_newpost_link'],

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------------
#
$lang['Allow_smilies'] = 'Allow Smilies';

#
#-----[ AFTER, ADD ]------------------------------------------------
#
$lang['Allow_classic_newpost_link'] = 'Allow users to add link for posts since last visit (not recommended)';

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#
$lang['Search_new'] = 'View unread posts';

#
#-----[ AFTER, ADD ]------------------------------------------------
#
$lang['Search_classic_new'] = 'View posts since last visit';
$lang['Show_classic_newpost_link'] = 'Add link for posts since last visit (not recommended)';

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/index_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
		<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />

#
#-----[ REPLACE WITH ]-----------------------------------------
#
		<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br />
		<!-- BEGIN switch_show_classic_newpost_link -->
		<a href="{U_SEARCH_CLASSIC_NEW}" class="gensmall">{L_SEARCH_CLASSIC_NEW}</a><br />
		<!-- END switch_show_classic_newpost_link -->
		<a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_BOARD_LANGUAGE}:</span></td>

#
#-----[ BEFORE, ADD ]------------------------------------------------
#
	<!-- BEGIN switch_show_classic_newpost_option -->
	<tr> 
	  <td class="row1"><span class="gen">{L_SHOW_CLASSIC_NEWPOST_LINK}:</span></td>
	  <td class="row2"> 
		<input type="radio" name="show_classic_newpost_link" value="1" {SHOW_CLASSIC_NEWPOST_LINK_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="show_classic_newpost_link" value="0" {SHOW_CLASSIC_NEWPOST_LINK_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>
	<!-- END switch_show_classic_newpost_option -->

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
	<tr>
		<td class="row1">{L_ALLOW_SMILIES}</td>
		<td class="row2"><input type="radio" name="allow_smilies" value="1" {SMILE_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="allow_smilies" value="0" {SMILE_NO} /> {L_NO}</td>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------------
#
	<tr>
		<td class="row1">{L_ALLOW_CLASSIC_NEWPOST_LINK}</td>
		<td class="row2"><input type="radio" name="allow_classic_newpost_link" value="1" {ALLOW_CLASSIC_NEWPOST_LINK_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="allow_classic_newpost_link" value="0" {ALLOW_CLASSIC_NEWPOST_LINK_NO} /> {L_NO}</td>
	</tr>

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_BOARD_LANGUAGE}</span></td>

#
#-----[ BEFORE, ADD]------------------------------------------------
#
	<!-- BEGIN switch_show_classic_newpost_option -->
	<tr> 
	  <td class="row1"><span class="gen">{L_SHOW_CLASSIC_NEWPOST_LINK}</span></td>
	  <td class="row2"> 
		<input type="radio" name="show_classic_newpost_link" value="1" {SHOW_CLASSIC_NEWPOST_LINK_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="show_classic_newpost_link" value="0" {SHOW_CLASSIC_NEWPOST_LINK_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>
	<!-- END switch_show_classic_newpost_option -->
Last edited by asinshesq on Tue Dec 04, 2007 8:01 pm, edited 1 time in total.

User avatar
NeoID
Registered User
Posts: 406
Joined: Mon Jun 06, 2005 10:12 pm
Location: Norway
Contact:

Re: keep unread flags

Post by NeoID » Wed Oct 31, 2007 10:37 pm

I have a couple of question regarding this mod..
As the mod is storing all the unread topics for each member on a forum.. what's going to happen to the servers resources? Does this mod consume much space for storing unread topics for larges forums? How about speed issues?
As far as I understand this mod stores quite a lot information to the database, so I'm very anxious on your answer, thanks.
Norsk Anime Forum
http://www.AnimeNord.com

Post Reply

Return to “[2.0.x] MOD Database Releases”