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

colin_bb
Registered User
Posts: 104
Joined: Tue Feb 14, 2006 8:40 pm

Post by colin_bb »

Those changes worked perfectly. Apart from some simple template changes, it installed fine and works brilliantly.

5 stars for the mod, 5 stars for the support.

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

Post by asinshesq »

colin_bb wrote: Those changes worked perfectly. Apart from some simple template changes, it installed fine and works brilliantly.

5 stars for the mod, 5 stars for the support.

Thanks 8)


Great...so you didn't need any more tweaking to accomodate save posts as drafts? Were those two places the only places where the mods conflict?
colin_bb
Registered User
Posts: 104
Joined: Tue Feb 14, 2006 8:40 pm

Post by colin_bb »

yes, just those two queries. The rest were changes to non-subsilver templates.
krisbfunk
Registered User
Posts: 150
Joined: Mon Jul 10, 2006 1:47 am

Post by krisbfunk »

I have the 'instant post redirect' mod installed which has modified this part in posting.php:

Code: Select all

		if ( $mode == 'newtopic' || $mode == 'reply' )
		{
			$tracking_topics = ( !empty($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
			$tracking_forums = ( !empty($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();

			if ( count($tracking_topics) + count($tracking_forums) == 100 && empty($tracking_topics[$topic_id]) )
			{
				asort($tracking_topics);
				unset($tracking_topics[key($tracking_topics)]);
			}

			$tracking_topics[$topic_id] = time();

			setcookie($board_config['cookie_name'] . '_t', serialize($tracking_topics), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
            // MOD: Instant Post Redirect
            redirect(append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id", true) . '#' . $post_id);

		}
where do I place the instant post redirect code in the 'keep unread' mod replacement for this?

Code: Select all

		//START MOD Keep_unread_2
		if ( $mode == 'newtopic' || $mode == 'reply' || $mode == 'quote' || ($mode == 'editpost' && $post_data['last_post']) )
		{
			$board_config['tracking_unreads'][$topic_id] = time();
			write_cookies($userdata);
		}
		//END MOD Keep_unread_2
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

krisbfunk wrote: I have the 'instant post redirect' mod installed which has modified this part in posting.php...where do I place the instant post redirect code in the 'keep unread' mod replacement for this?


Give this ia try...it should work, but note that it will now instantly redirect not just for newtopics and replies but also for quotes and edits of last posts in a topic (perhaps the instant redirect mod already did this later on...I've never seen that mod)

Code: Select all

		//START MOD Keep_unread_2
		if ( $mode == 'newtopic' || $mode == 'reply' || $mode == 'quote' || ($mode == 'editpost' && $post_data['last_post']) )
		{
			$board_config['tracking_unreads'][$topic_id] = time();
			write_cookies($userdata);
			// MOD: Instant Post Redirect
			redirect(append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id", true) . '#' . $post_id);
		}
		//END MOD Keep_unread_2
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

Looks like the correct way to handle this, even though technically it should remain separate like this:

Code: Select all

		//START MOD Keep_unread_2
		if ( $mode == 'newtopic' || $mode == 'reply' || $mode == 'quote' || ($mode == 'editpost' && $post_data['last_post']) )
		{
			$board_config['tracking_unreads'][$topic_id] = time();
			write_cookies($userdata);
			// MOD: Instant Post Redirect
		}
		//END MOD Keep_unread_2

		if ( $mode == 'newtopic' || $mode == 'reply' || $mode == 'quote' || ($mode == 'editpost' && $post_data['last_post']) )
		{

         // MOD: Instant Post Redirect 
         redirect(append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id", true) . '#' . $post_id); 
		}
         // Continue with processing deleting of messages or polls etc.
Need custom work done? Pimp My Forum!
User avatar
BrotherTank
Registered User
Posts: 73
Joined: Sun Jan 11, 2004 1:39 pm
Location: Hamilton, Ontario, Canada
Name: Greg
Contact:

Simple Fix for Function: list_new_unreads

Post by BrotherTank »

I ran into a little problem with the logic in your modification. The problem stems from say installing some type of modification like Yellow Cards or Report Post, where the user must have read/write privilages to actually post the report, but not necessarily the view privilage.

By that I mean, on my forums, I don't want users seeing which posts have been reported and by whom, other than by the moderators and the admin of the forum. What I did was create a hidden area (visible only to Admins and Mods), where the reports could be posted. The users are granted Read/Write privilages, but not the "view". When they log in the area is hidden completely, and yet when they report a post with a problem, the Yellow Card software will allow them to report the post and read their report. So, I had to modify your routine only slightly to fix this problem as it was listing posts as "not being read" when they shouldn't have been visible in the first place.

Anyhow,... in the list_new_unreads function in the functions.php, I changed the code:

Code: Select all

		$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
		if ( count($is_auth_ary) )
		{
			foreach ( $is_auth_ary as $forum_id => $auths )
			{
				if ($auths['auth_read'])
				{
					$forum_ids[] = $forum_id;
				}
			}
		}
and replaced it with this code:

Code: Select all

		$is_auth_view = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);
		if (count($is_auth_view))
		{
			foreach ( $is_auth_view as $forum_id => $auths )
			{
				if ( $auths['auth_view'] )
				{
					if (auth(AUTH_READ, $forum_id , $userdata) )
					{
						$forum_ids[] = $forum_id;
					}
				}
			}
		}
It's only a small change, but it does make it search first to make sure the user can see the area, and then check to make sure they can read that forum. This now also repairs the search listing these hidden areas threads as well.

Greg
BrotherTank

PS: Love the mod, and my users love it as well. It really makes a difference when for whatever reason, you accidently get logged out of the forums without reading all the new or latest messages. I've only had the mod installed for 8 days now, but other than the problem I fixed with the above code, it's been a real blessing.
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: Simple Fix for Function: list_new_unreads

Post by Merlin Sythove »

If it works like this, fine :D

There probably is a faster way to get all permissions for all forums and check auth_view and auth_read both in a single if statement.

There also exists a mod that allows just the author permission to see his own threads. That way the moderators can have numerous discussions with members in one section, but each member can only see their own threads. It works by adding an auth option, SELF. This setup can be used for help forums (individual help) or course forums (individual tuition) etc.
If you were to use this mod, you would avoid the klutz with auth_view because it is logical for read and write authorisation to include view as well. Anyway, just a few suggestions.

(Possibly old version: http://216.239.59.104/search?q=cache:12 ... =clnk&cd=1)
Need custom work done? Pimp My Forum!
User avatar
BrotherTank
Registered User
Posts: 73
Joined: Sun Jan 11, 2004 1:39 pm
Location: Hamilton, Ontario, Canada
Name: Greg
Contact:

Re: Simple Fix for Function: list_new_unreads

Post by BrotherTank »

Merlin Sythove wrote: If it works like this, fine :D

There probably is a faster way to get all permissions for all forums and check auth_view and auth_read both in a single if statement.


It actually works just fine. I'm not an avid php programmer. I understand enough to get by, but didn't really understand the foreach loop structure you used. So by all means, if there is a faster way or more efficient way, I'd love for you to post it as a fix to your program. Or, feel free to use my change in your code so that it closes a hole in the logic.

Logically, if someone can't see an area, they shouldn't be able to read things they can't see and it shouldn't be reporting those posts as un-read when they click on the "view unread posts".
Merlin Sythove wrote: There also exists a mod that allows just the author permission to see his own threads. That way the moderators can have numerous discussions with members in one section, but each member can only see their own threads. It works by adding an auth option, SELF. This setup can be used for help forums (individual help) or course forums (individual tuition) etc.
If you were to use this mod, you would avoid the klutz with auth_view because it is logical for read and write authorisation to include view as well. Anyway, just a few suggestions.


Oh... so they took the time to create a fix to your mod so that it would work with theirs? Ok... I'll give it a look see. I still prefer that users didn't get to see the area, so that they can't see that "X" person has reported such and such post... but for the reporting system, the user "X" must have read and post authorizations to actually post the message.

Anyhow... I just thought that I would point out that there was a bug in your code - as your code assumes that everyone with read authorization automatically has view authorization. This may not always be the case, especially if someone is using something like Yellow Card Mod or Report a Post.

Greg
BrotherTank
colin_bb
Registered User
Posts: 104
Joined: Tue Feb 14, 2006 8:40 pm

Post by colin_bb »

Hello again,

I just tried installing the List Topic Title on Index mod, but it will not install with easymod as this mod changes the index.php.

Is there any way that this mod can accomodate such a feature, that the title (and a link to) the most recent topic is displayed in the same way the above mod would do it?

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

Post by asinshesq »

colin_bb wrote: Is there any way that this mod can accomodate such a feature, that the title (and a link to) the most recent topic is displayed in the same way the above mod would do it?

The author's notes to this mod include the following sentence:
If you want to run this mod with the latest topics on index mod, see the string of posts starting here: http://www.phpbb.com/phpBB/viewtopic.ph ... 76#2117576

Is that the mod you are talking about?
colin_bb
Registered User
Posts: 104
Joined: Tue Feb 14, 2006 8:40 pm

Post by colin_bb »

thanks for replying.

I had a read of those posts but he seems to be going on about the image for the unread icon not appearing. What i'm after is simply the title of the topic to be shown underneath the 'last post' column for each forum, above the date and the person who posted there.

I'm sure it's just an extra field in a query, a join at the most, but i don't know the mod well enough to attempt it. :(
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: Simple Fix for Function: list_new_unreads

Post by Merlin Sythove »

BrotherTank wrote: Oh... so they took the time to create a fix to your mod so that it would work with theirs?


I don't think so, I mentioned that mod as an alternative to your setup, where people can see only their own threads in a particular forum. But that mod I mentioned may suffer from the same problem, I have no idea.
Anyhow... I just thought that I would point out that there was a bug in your code


"Bug" is a matter of opinion. I think that if you have read permission, you will automatically have view permission. How else can you view your own posts? If another mod changes that assumption and detaches read and view so you can read topics but not view them (where's the logic in that?) then I would hardly call that a bug in my mod :lol:

Anyway, glad you have solved it. If other people have similar problems I may have a look into it to see if there is a more elegant way of solving the "interference" :D Fornow, your solution seems to work just fine.
Need custom work done? Pimp My Forum!
Rednarb
Registered User
Posts: 7
Joined: Wed Mar 26, 2003 1:58 pm

Error during install

Post by Rednarb »

Please disregard this post.. heck, please delete it if you have the ability to do so.
Last edited by Rednarb on Tue Jan 09, 2007 7:15 pm, edited 2 times in total.
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

colin_bb wrote: Hello again,

I just tried installing the List Topic Title on Index mod, but it will not install with easymod as this mod changes the index.php.

Is there any way that this mod can accomodate such a feature, that the title (and a link to) the most recent topic is displayed in the same way the above mod would do it?

Thanks.


I had a look at it and offhand it looks like you should be able to install it. Try it by hand and see if the bits you can't find are really absent even if you look for smaller sections etc.

Technically there is no interference with this mod - there is nothing in the keep_unread mod that would prevent showing the topic title for all last posts on the index page.
Need custom work done? Pimp My Forum!
Post Reply

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