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 » Thu Nov 01, 2007 7:09 am

neox3 wrote: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.
Per user it stores less than your message above, that is now (because of my quote) twice in this database... :D
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 Nov 09, 2007 12:17 am

asinshesq wrote: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 = '';
							$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 = '';
					$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : '';
				}
When I do that change, this is the result:
Image
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 Nov 09, 2007 2:15 am

computersOC wrote:When I do that change, this is the result:
Image
So assign a blank gif to that area instead of assigning an image of ''. I've gone ahead and edited my original post above to pick up that change. You can find that post here: http://www.phpbb.com/community/viewtopi ... 7#p3237267

User avatar
TheInquistor
Registered User
Posts: 304
Joined: Tue Jun 19, 2007 11:36 pm

Re: keep unread flags

Post by TheInquistor » Sat Nov 10, 2007 3:45 am

over 1800 post...ummm...i will jsut ask.

What does the "add guest posting" thing mean? Does this allow for guests to post? This is not soemthing i would want guests doing for reasons of spam if i understand this correctly. Tho i am interested in the flags not being removed
[noob]ME[/noob]

User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: keep unread flags

Post by dellsystem » Sat Nov 10, 2007 4:21 am

TheInquistor wrote:over 1800 post...ummm...i will jsut ask.

What does the "add guest posting" thing mean? Does this allow for guests to post? This is not soemthing i would want guests doing for reasons of spam if i understand this correctly. Tho i am interested in the flags not being removed
It just allows guests to click "View New Posts" and be able to search by new posts.
Former moderator and website team member | My MODs, and more (GitHub)

symphonie
Registered User
Posts: 10
Joined: Thu Nov 15, 2007 11:36 am

Re: keep unread flags

Post by symphonie » Thu Nov 15, 2007 11:44 am

Hello,

Excuse me for my awful english, I'm french...
I looked for a solution for me, but as I don't speak english very well, it's difficult to find what i'm looking for...
So excuse me by advance if I ask you something you have already answered.

I have the 2-0-7 version, and I'd like to have a possibility to mark all subjects as read on the unread list... That way, when we are connected, we can chose which of the unread subjects we want to read, and mark all the others as read.

:oops: well, I'm not sure my explication is clear...

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

Re: keep unread flags

Post by Merlin Sythove » Thu Nov 15, 2007 11:56 am

You can already do that: when you have read everything you want to read, go to the index page and click the link to mark the whole forum as read.
Need custom work done? Pimp My Forum!

symphonie
Registered User
Posts: 10
Joined: Thu Nov 15, 2007 11:36 am

Re: keep unread flags

Post by symphonie » Thu Nov 15, 2007 12:05 pm

Well in fact, that option is only on the forums, not on the index page... (phpBB2.0.22)

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

Re: keep unread flags

Post by asinshesq » Thu Nov 15, 2007 12:29 pm

symphonie wrote:Well in fact, that option is only on the forums, not on the index page... (phpBB2.0.22)
You are right that there is a link in viewforum which marks topics in that forum read. But there is another link on the index page to mark all forums on the board read (which marks every topic anywhere on the board read).

If you are using subSilver, look at the bottom left side of the index page (right above the WHO IS ONLINE part). You should see a link called "Mark all forums read". Clicking that link marks everything on the board read.

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 » Thu Nov 15, 2007 12:36 pm

Would it be possible to make a checkbox after each topictitle in the list of unread topics, so you can mark a selection of the topics as read?
Or am I asking too much now? :oops:
Last edited by marian0810 on Thu Nov 15, 2007 12:38 pm, edited 2 times in total.
You and me, time and space. You watch us run!

symphonie
Registered User
Posts: 10
Joined: Thu Nov 15, 2007 11:36 am

Re: keep unread flags

Post by symphonie » Thu Nov 15, 2007 12:37 pm

Wow Incredible! I'm using this forum since more than one year and half, and i've never seen that!
How stupid I am!
I've juste to modify my templates to put that at the top of the forums ;
Thanks a lot!

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

Re: keep unread flags

Post by Merlin Sythove » Thu Nov 15, 2007 1:40 pm

marian0810 wrote:Would it be possible to make a checkbox after each topictitle in the list of unread topics, so you can mark a selection of the topics as read?
Or am I asking too much now? :oops:
Haha this is computerzzz, anything is possible... :D
I wasn't planning on making it although I can see the advantage.

A quick solution is to right-click on the last page number that is show with the topic that has unread posts, and select "open in new window" (or "open in new tab" in FF), and simply ignore the opened topic, close the windows / tabs unseen.

Another solution for some forums might be a facility where complete forums can be marked as "please ignore" on a per user basis.

As for the check boxes that you mention, maybe Asinshesq is interested in adding them?
An alternative could be a single link to mark all topics that are shown on that page alone as "read". This would be a search page addition, separate from this mod, I think. Anyway, just theorising.
Need custom work done? Pimp My Forum!

kodgetts
Registered User
Posts: 10
Joined: Sat Nov 10, 2007 5:12 pm

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

Post by kodgetts » Sat Nov 17, 2007 7:11 pm

asinshesq wrote: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, 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_newposts_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>
I tried this on my (quite heavily modded) 2.0.22 board and it worked for members who were already registered, but when new members attempted to submit their registration form they received a debug message stating that the user data could not be added to the database. It seems that the value for the user_show_classic_new_post_link field was blank rather than '1' or '0'. Here's the full error message (with user's information censored in italics). Note the blank space between two commas near the end:
Could not insert data into users table

DEBUG MODE

INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_blog, user_google_talk, user_attachsig, user_allowsmile, user_smart_dates, user_show_classic_newpost_link, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) VALUES (4, 'username', 1195176360, 'encrypted password', 'email address', '', '', '', '', '', '', '', '', 0, 1, '', '', '', 'blog address', '', 1, 1, 1, , 1, 1, 1, 0, 1, 1, -5, 'd M Y, G:i', 'english', 1, 0, 1, 0, 'activation key[/]')

Line : 791
File : usercp_register.php


I retried the install, making sure that all the edits to usercp_register were correct but people were still experiencing the same issue. I have uninstalled the mod add-on for now but if anyone can suggest what might have been wrong then I'll try it again.

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

Re: keep unread flags

Post by asinshesq » Sat Nov 17, 2007 10:33 pm

Kodgets, when you report something like that, it's always a good idea to also show the code the error message is complaining of (in this case the $sql definition that has line 791 of usercp_register in it.

Anyway, looks like the code I gave you has a typo in it. so change

Code: Select all

$show_classic_newposts_link
to instead be

Code: Select all

$show_classic_newpost_link
and let me know if that works. If it does, I'll go back and edit my original post.

You probably also noticed the other typo where I said

Code: Select all

    #
    #-----[ IN-LINE AFTER, FIND ]------------------------------------------------
    #
when I meant

Code: Select all

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

kodgetts
Registered User
Posts: 10
Joined: Sat Nov 10, 2007 5:12 pm

Re: keep unread flags

Post by kodgetts » Sun Nov 18, 2007 3:13 am

Thanks, I'll try that tomorrow and let you know. ;)

Post Reply

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