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

Post by Merlin Sythove »

Hi Eddy,

OK, it is clear, this has nothing to do with the MOD itself.
You are trying to add more code of your own design and it does not work, and you wonder what you are doing wrong.

First: there is absolutely nothing wrong with the bold section in your code. However, if you search for the variable $unread_topics that you have chosen to use in your IF statement, you will see that it does not exist. Hence the code will never be executed.

The variable $view_topic_url that you are making, is the URL to the top (1st post) of the topic. that is where you go if you click on the topic title in the forum page. That is how phpBB is designed.

If you want the title of the topic in the list of topics in one forum, to link to the NEWEST post instead of to the 1ST POST, you must change that variable:

Find:
$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");

and change it to
$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest");

That is all - do not make it more complicated. I'm fairly confident this will work fine if there is no "newest" post in the topic too.
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

Just tested the view=newest option to a topic I have completely read and it will simply jump to the last post in the topic. If that is not the case with you you may need to adjust viewtopic.php.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

»»EDDY«« wrote: We did not it understand....

Correct ;)

Are you saying you have version 2 installed and it works fine? What are you trying to do with that change? Is Merlin right that you are simply trying to get it to jump to newest rather than the top of the topic? I assume you only want it to do that when there are unread topics and that's why you were using that if statement structure, correct?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

asinshesq wrote: ...Is Merlin right that you are simply trying to get it to jump to newest rather than the top of the topic? I assume you only want it to do that when there are unread topics and that's why you were using that if statement structure, correct?

If that's what you are trying to do, try this (I am not at my server now so I haven't yet tried it):

Code: Select all

OPEN
viewforum.php

FIND
		$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");


REPLACE WITH
		if( $topic_rowset[$i]['post_time'] > topic_last_read($forum_id, $topic_id) )
		{
			$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest");
		}
		else
		{
			$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
		}
»»EDDY««
Registered User
Posts: 220
Joined: Mon Jun 02, 2003 10:14 am
Location: Poland/Slupsk
Contact:

Post by »»EDDY«« »

asinshesq wrote:

Code: Select all

OPEN
viewforum.php

FIND
		$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");


REPLACE WITH
		if( $topic_rowset[$i]['post_time'] > topic_last_read($forum_id, $topic_id) )
		{
			$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest");
		}
		else
		{
			$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
		}

This is this, I about what asked.
Grand merci!
:mrgreen:
Make a Tiny URL in excellent domain heh.pl


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

Post by Merlin Sythove »

Please note that the above solution will lead you to one of the last posts in a topic if there are unread posts, but to the first post of a topic if you have read everything.

My own solution above will lead you to the very last post of a topic if you have read everything.

The question is what your users will find most "logical" in behaviour.

The other question is whether your users also use other phpBB forums that work in a normal standard way, and if they like it if you change the standard behaviour.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

Merlin Sythove wrote: Please note that the above solution will lead you to one of the last posts in a topic if there are unread posts, but to the first post of a topic if you have read everything....

I only showed that code since the code eddy originally quoted (apparantly a tweak he had on his board to the original keep unread 1.0.0) was set up to do exactly that.
Merlin Sythove wrote: ...The other question is whether your users also use other phpBB forums that work in a normal standard way, and if they like it if you change the standard behaviour.

I'm with Merlin on this! I think people used to other forums will find the change confusing (though I think the version I did that takes you to the first unread post if there is one or the first post if there are no unread posts is a bit less confusing for people used to other forums).
»»EDDY««
Registered User
Posts: 220
Joined: Mon Jun 02, 2003 10:14 am
Location: Poland/Slupsk
Contact:

Post by »»EDDY«« »

Merlin, I read everything, but your solution is not exactly same.
For users: =$topic_id and =$topic_id&view=newest
For google: =$topic_id
I needed seo friendly links:)

The other question is whether your users also use other phpBB forums that work in a normal standard way, and if they like it if you change the standard behaviour.

Keep Unread Flags MOD is not in a standard phpbb... :)


Sorry for my english...
Make a Tiny URL in excellent domain heh.pl


cooling system & water cooling
joshcryer
Registered User
Posts: 15
Joined: Wed Jul 20, 2005 3:46 am

Post by joshcryer »

Any news on if this works on PCP or Calander mods? I don't understand what the functions*.php does or why it would break this. I'm considering applying it, but I don't want my users freaking out if anything goes wrong. Someone let me know if they tried it. ^_^;

It would be nice if the mod creators had a rationale for why it "doesn't work," since apparently some have had successes.
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

»»EDDY«« wrote: Merlin, I read everything, but your solution is not exactly same.
For users: =$topic_id and =$topic_id&view=newest
For google: =$topic_id
I needed seo friendly links:)


I'm assuming that google will also use a cookie like any other visitor and will therefore also have a list of unread topics. The distinction you make between users and google may not apply. Also, the "view=newest" addition will work even if there is no new post - it will show the last post.
The other question is whether your users also use other phpBB forums that work in a normal standard way, and if they like it if you change the standard behaviour.

Keep Unread Flags MOD is not in a standard phpbb... :)


Well, no. But there is a difference between improving something along lines that are logical and expected by everyone, like "if I don't read it today, it should still be marked as unread tomorrow", and changing certain behaviour when there is no particular logical reason to select one type of behaviour over the other, or when both behaviours happen at different times.
joshcryer
Registered User
Posts: 15
Joined: Wed Jul 20, 2005 3:46 am

Post by joshcryer »

Yes, keep unread is behavior that would be expected on any forum software, and I hope that its behavior is added to newer version of phpBB. Not sure why they had the design decision to have session lengths determine whether or not a post was read.

I applied this mod to a a phpBB version 2.0.17 forum with PCP, Calendar,Topic Descriptions, and Extended PM Notification mods. I did not use EasyMod (though from what it looks, it may well work, someone please shoot any progress this way), but did it by hand (yeah, I know, crazy, but I have a sharp eye for copy/find/replace).

The only bug I think I have found so far is that daylight savings time, which is part of PCP and Calendar, is no longer functional. If anyone knows where the daylight savings time variable is stored and how I can remedy this, let me know (primarily because PCP has a nice little "time zone" image that corresponds to ones time zone and such).

Thanks for this mod, I will rate it excellent, since it introduces behavior that is fully expected and desired on any forum software.
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

joshcryer wrote: The only bug I think I have found so far is that daylight savings time, which is part of PCP and Calendar, is no longer functional. If anyone knows where the daylight savings time variable is stored and how I can remedy this, let me know (primarily because PCP has a nice little "time zone" image that corresponds to ones time zone and such).


I doubt very much whether that has anything to do with this mod. But in the config table you will find the board_timezone record, and each user has a user_timezone field. I'd start by checking the ACP to see if the time zone of the whole board has not been reset by some accident.
joshcryer
Registered User
Posts: 15
Joined: Wed Jul 20, 2005 3:46 am

Post by joshcryer »

Merlin, ahah, it was my own profile that had either been reset, or I was just silly and reset it and forgot. What a silly error to have made... thanks for the reply.

Did some heavy test casing, and it seems the mod works perfectly fine with my configuration. Thank so you much, mod creators, this is a well needed feature of phpBB.

edit: btw, I just remembered, there was a lot of white space differences in certain files (I'm thinking search.php most notably), and I don't know if it really affects an easymod install or not. But those differences threw me off at first, until I realized that the spacing was just different, the code itself was identical.
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

Glad to hear everything works fine now!

White space problem: might be an editor that does not correctly load files and sees the windows CR LF combination as 2 white lines or something.
bitter-peace
Registered User
Posts: 15
Joined: Thu Jul 28, 2005 11:24 am

Post by bitter-peace »

Post Reply

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