BH.org frontpage: view first unread post in topic ?

Discussions about the forum and contents
Post Reply
User avatar
triceratop
Moderator
Posts: 3754
Joined: Tue Aug 04, 2015 8:20 pm
Location: la la land

BH.org frontpage: view first unread post in topic ?

Post by triceratop » Mon Apr 18, 2016 1:54 pm

This feature is very useful for the individual board indices. It is nice to not have to remember the page number I have read up through of each topic I am interested in. Is it possible to have it on the front page next to the most recent topics as well? Has this been asked before? Obviously, this would only work for users who are currently logged in, so this might pre-empt such a feature. But if the link was persistent across all users then for those members not logged in it would simply point to the first post in topic (this is not how the #unread is currently set up -- currently it redirects to log-in)
"To play the stock market is to play musical chairs under the chord progression of a bid-ask spread."

aorin
Posts: 28
Joined: Tue Nov 20, 2012 2:11 pm

Re: BH.org frontpage: view first unread post in topic ?

Post by aorin » Mon Apr 18, 2016 2:12 pm

This has been asked for previously:
viewtopic.php?f=3&t=128444


As a workaround I use the GreaseMonkey addon for firefox with this script:


// ==UserScript==
// @name URL Replace
// @namespace https://www.bogleheads.org/
// @description replaces new post url tag with last unread post.

// @include https://www.bogleheads.org/
// @version 1
// @grant none
// ==/UserScript==

var links,thisLink;
links = document.evaluate("//a[@href]"

,

document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
for (var i=0;i<links.snapshotLength;i++) {
var thisLink = links.snapshotItem(i);


thisLink.href = thisLink.href.replace(/newpost=.*/,

'view=unread#unread');
}


It replaces the links locally with the unread tags at the end. It seems to work most of the time.

User avatar
triceratop
Moderator
Posts: 3754
Joined: Tue Aug 04, 2015 8:20 pm
Location: la la land

Re: BH.org frontpage: view first unread post in topic ?

Post by triceratop » Mon Apr 18, 2016 2:35 pm

Very nice. Works perfectly with Tampermonkey (for Chrome). :sharebeer
"To play the stock market is to play musical chairs under the chord progression of a bid-ask spread."

User avatar
LadyGeek
Site Admin
Posts: 41578
Joined: Sat Dec 20, 2008 5:34 pm
Location: Philadelphia
Contact:

Re: BH.org frontpage: view first unread post in topic ?

Post by LadyGeek » Mon Apr 18, 2016 6:36 pm

That hack will work fine.

To answer triceratop's question, the home page is designed to work without logging in. We won't be modifying it for this purpose.

Remember you can view unread posts from the Quick links drop-down (top-left menu): Unread posts

The home page has some additional sorting features. I highlighted links that will sort the by the column indicated, for a period of up to 3 days.

1036 new posts and replies over 189 topics in last day (sorted by Latest Reply). Days: 1 2 3
# Replies - Subforum (view list) - Topic Title First (time, by) Latest (time, by)
To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.

User avatar
triceratop
Moderator
Posts: 3754
Joined: Tue Aug 04, 2015 8:20 pm
Location: la la land

Re: BH.org frontpage: view first unread post in topic ?

Post by triceratop » Thu Mar 09, 2017 3:19 am

LadyGeek wrote:That hack will work fine.

To answer triceratop's question, the home page is designed to work without logging in. We won't be modifying it for this purpose.

Remember you can view unread posts from the Quick links drop-down (top-left menu): Unread posts

The home page has some additional sorting features. I highlighted links that will sort the by the column indicated, for a period of up to 3 days.

1036 new posts and replies over 189 topics in last day (sorted by Latest Reply). Days: 1 2 3
# Replies - Subforum (view list) - Topic Title First (time, by) Latest (time, by)


Interesting; I just tried appending "#unread" and "&view=unread" to links from the homepage in an incognito session and was not prompted to log in. I wonder if some change in the forum software occurred which changed this behavior. Anyway, now the homepage could be modified to include such code, and still work perfectly for logged-in and logged-out users alike. Whether that is desired is another question. Some people want this feature and don't even know it's possible to use this hack.
"To play the stock market is to play musical chairs under the chord progression of a bid-ask spread."

User avatar
LadyGeek
Site Admin
Posts: 41578
Joined: Sat Dec 20, 2008 5:34 pm
Location: Philadelphia
Contact:

Re: BH.org frontpage: view first unread post in topic ?

Post by LadyGeek » Thu Mar 09, 2017 4:29 pm

Nothing has changed in the home page. What's happening is that the forum software uses cookies to determine if you're logged in (or not).

Appending "#unread" is not correct format. If you want to do this right, use the topic (thread) ID as follows:

Code: Select all

https://www.bogleheads.org/forum/viewtopic.php?f=11&t=145914&view=unread#unread

If you're logged in, it goes to the last unread post. If you've already read the last post, it goes to the last page of the topic (thread).

If not logged in, it goes to the first post of the topic (thread).
To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.

User avatar
triceratop
Moderator
Posts: 3754
Joined: Tue Aug 04, 2015 8:20 pm
Location: la la land

Re: BH.org frontpage: view first unread post in topic ?

Post by triceratop » Thu Mar 09, 2017 5:03 pm

Right, that is my point I think. If the behavior is correct for logged in users AND those not logged in, then there's no downside to adding this to the front page URLs.

As I recall, such a link as you put in the code box used to prompt the user to log in. But not any longer. Of course, I could be wrong, but your previous message is consistent with that behavior.
"To play the stock market is to play musical chairs under the chord progression of a bid-ask spread."

aorin
Posts: 28
Joined: Tue Nov 20, 2012 2:11 pm

Re: BH.org frontpage: view first unread post in topic ?

Post by aorin » Sat Aug 12, 2017 11:24 am

hmm it appears I may have modified this at some point slightly for a different replace. It is working with the new forum and tamper monkey in chrome for me:

// ==UserScript==
// @name URL Replace
// @namespace https://www.bogleheads.org/
// @description replaces new post url tag with last unread post.

// @include http://www.bogleheads.org/
// @version 1
// @grant none
// ==/UserScript==

var links,thisLink;
links = document.evaluate("//a[@href]",

document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
for (var i=0;i<links.snapshotLength;i++) {
var thisLink = links.snapshotItem(i);
thisLink.href = thisLink.href.replace(/newpost=\d+/, 'view=unread#unread');
}

User avatar
LadyGeek
Site Admin
Posts: 41578
Joined: Sat Dec 20, 2008 5:34 pm
Location: Philadelphia
Contact:

Re: BH.org frontpage: view first unread post in topic ?

Post by LadyGeek » Fri Aug 18, 2017 10:44 pm

LadyGeek wrote:
Mon Apr 18, 2016 6:36 pm
...To answer triceratop's question, the home page is designed to work without logging in. We won't be modifying it for this purpose.
A year later, we have indeed modified the home page. See: Home Page Updated
To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.

User avatar
triceratop
Moderator
Posts: 3754
Joined: Tue Aug 04, 2015 8:20 pm
Location: la la land

Re: BH.org frontpage: view first unread post in topic ?

Post by triceratop » Sun Aug 20, 2017 8:31 am

triceratop wrote:
Thu Mar 09, 2017 5:03 pm
Right, that is my point I think. If the behavior is correct for logged in users AND those not logged in, then there's no downside to adding this to the front page URLs.

As I recall, such a link as you put in the code box used to prompt the user to log in. But not any longer. Of course, I could be wrong, but your previous message is consistent with that behavior.
I think this post was correct in calling out how a software change at some point in the last year enabled this feature to be plausible.
"To play the stock market is to play musical chairs under the chord progression of a bid-ask spread."

User avatar
LadyGeek
Site Admin
Posts: 41578
Joined: Sat Dec 20, 2008 5:34 pm
Location: Philadelphia
Contact:

Re: BH.org frontpage: view first unread post in topic ?

Post by LadyGeek » Sun Aug 20, 2017 8:53 am

If a reader clicks a link that requires a login, such as going to the last unread post (or member profile), the forum software requests a login. That has always been the case.
To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.

Post Reply