Page 1 of 1

Mark Forums Read: Link now hashed?

Posted: Mon Jan 19, 2009 12:34 pm
by Radioguy

Code: Select all

http://forum.thinkpads.com/index.php?hash=********&mark=forums
If the login cookie problem is now fixed (is for me), is there a need for a hash? If the hash changes like a sid, it breaks my bookmark.

Re: Mark Forums Read: Link now hashed?

Posted: Mon Jan 19, 2009 1:35 pm
by basketb
Can you bookmark the URI without the hash? Does it still work then?

Re: Mark Forums Read: Link now hashed?

Posted: Mon Jan 19, 2009 6:58 pm
by RealBlackStuff
I have this bookmarked AND as my homepage:

Code: Select all

http://forum.thinkpads.com/index.php

Re: Mark Forums Read: Link now hashed?

Posted: Mon Jan 19, 2009 7:08 pm
by nikki605
I just have http://forum.thinkpads.com bookmarked and it works for me as well.

Re: Mark Forums Read: Link now hashed?

Posted: Mon Jan 19, 2009 7:11 pm
by Marin85
I can confirm this as well.

Re: Mark Forums Read: Link now hashed?

Posted: Mon Jan 19, 2009 9:41 pm
by Radioguy
Guys, I never said there was a problem with the index page. I'm talking about specific links in the forum like new posts or mark forums read.
basketb wrote:Can you bookmark the URI without the hash? Does it still work then?
I wouldn't have started the thread if it did. ;)

What's odd to me, is that mark forums read is hashed when new posts isn't. Not that either should be, but why hash mark read? There are some subforums that I don't read regularly, and once I go through new posts to see what interests me, I want to mark read those that I won't, just like I could before.

The hash makes no sense to me. :?

Re: Mark Forums Read: Link now hashed?

Posted: Thu Jan 22, 2009 1:17 am
by Radioguy
Checked again. It still won't work without the hash. :(

Re: Mark Forums Read: Link now hashed?

Posted: Thu Jan 22, 2009 12:11 pm
by Zender
I guess the hash is there so that new messages, which were posted while you were looking on the current page, aren't marked read - it remembers when you loaded that page.

Re: Mark Forums Read: Link now hashed?

Posted: Fri Jan 23, 2009 2:08 am
by Radioguy
Zender wrote:I guess the hash is there so that new messages, which were posted while you were looking on the current page, aren't marked read - it remembers when you loaded that page.
That doesn't make sense. phpBB cookies accomplish that (IIRC). Back on the previous version of phpBB here, any new threads or posts added while I was logged in would show as new when I reclicked the new posts link, or visited the forum they're in. There was no hash then. The hash isn't doing that, unless there has been some major change in phpBB code. As I feared, the hash changes, so any bookmark to mark read is broken shortly after it's created. :(

To the Admin or Mods: I suggest disabling the hash to see if it has any positive effect. So far, it has a crippling one.

EDIT: I found a topic on phpBB.com referencing this:

https://www.phpbb.com/community/viewtop ... &t=1411745

Re: Mark Forums Read: Link now hashed?

Posted: Fri Jan 23, 2009 7:44 am
by GomJabbar
I think Zender is on the right track in what he wrote above.

Bookmarking "Mark topics read" might be a convenience for you, but personally I see this as a quite minor quibble. I suspect very few people bookmark that link. I see no reason to do so.

Re: Mark Forums Read: Link now hashed?

Posted: Fri Jan 23, 2009 1:13 pm
by Radioguy
GomJabbar wrote:I think Zender is on the right track in what he wrote above.
Are you saying the phpBB code was changed in this new version to make the hash necessary? I know that new posts were flagged as new even without the hash in the previous build deployed here. :?
GomJabbar wrote:Bookmarking "Mark topics read" might be a convenience for you, but personally I see this as a quite minor quibble. I suspect very few people bookmark that link. I see no reason to do so.
I respectfully disagree. On such a highly trafficked forum, the new posts request spawns several pages. As a moderator, your duty is monitor even the forums that you might not normally visit as a member. Like many, I don't own every model, and as such will pass over subforums dedicated to them. For years I could browse through the new posts since my last visit, peruse the ones that were of interest to me, and mark the rest read with ease. I know this is far from being as critical as the cookie issue, but as a regular and experienced member here, it certainly is more time consuming to revisit the index page to scroll to the newly hashed link and click it.

I hate to think how much more time it would take with scrolling on a mobile device. (Luckily I usually visit via my widescreen TP) ;)

I know there are probably more serious issues to resolve since the upgrade, but I hope you eventually reconsider this. I can honestly say it lessens the thinkpads.com experience. Not by much, but some.

Thanks.

Re: Mark Forums Read: Link now hashed?

Posted: Fri Jan 23, 2009 1:34 pm
by JaneL
Radioguy wrote:Are you saying the phpBB code was changed in this new version to make the hash necessary? I know that new posts were flagged as new even without the hash in the previous build deployed here. :?
I've not seen any setting in the admin panel to change this feature. I suggest you learn to love it.
As a moderator, your duty is monitor even the forums that you might not normally visit as a member.
And FWIW, don't presume to know how Bill has assigned the moderator duties in his forum.

Re: Mark Forums Read: Link now hashed?

Posted: Fri Jan 23, 2009 1:52 pm
by GomJabbar
What you consider my duty and what I actually do are two different things. I have never had the time to read or moderate all forums and I have never attempted to nor claimed to. Some of the moderators and admins do read all posts, but I do not.

I do not browse this forum as some others do. To start with, I use the Opera browser which allows me to go back and forth in forums, theads, and even replies without the pages being refreshed. When I am done looking at the threads I decide to read in a particular forum, I click on "Mark topics read" (for that forum), then I go back to the index page and click on the next forum. Once I have looked at all the threads that draw my interest, I refresh the index page and see what new posts show up in the various forums. Then I follow the same process again. I never click on "View new posts".

At any rate, my opinion is my own. It is quite possible that other moderators and the admins here feel differently about this issue than I do.

Regarding changes in the phpBB code from version 2 to version 3; I know significant changes were made, but I do not know the specifics. Nevertheless, what Zender said makes sense. I am quite sure the hashes were not put in place by the admins here. It must have been part of the newer code. I don't believe the hashes were put there on a whim by the phpBB code writers - there must have been a reason. Whether they could be eliminated or not, I don't know.

Re: Mark Forums Read: Link now hashed?

Posted: Fri Jan 23, 2009 2:14 pm
by Radioguy
JaneL wrote:I've not seen any setting in the admin panel to change this feature. I suggest you learn to love it.

And FWIW, don't presume to know how Bill has assigned the moderator duties in his forum.
Live with it, I suppose. ;)

If it's something that really is unalterable, then I understand. I consider it a drawback, but there are many improvements with the new build as well.

As for my comment on moderation, I apologize for generalizing there. As a moderator myself, I had to deal with a lot of forums that I wasn't delegated to either.

Thanks for the consideration.
GomJabbar wrote:What you consider my duty and what I actually do are two different things. I have never had the time to read or moderate all forums and I have never attempted to nor claimed to. Some of the moderators and admins do read all posts, but I do not.

I do not browse this forum as some others do. To start with, I use the Opera browser which allows me to go back and forth in forums, theads, and even replies without the pages being refreshed. When I am done looking at the threads I decide to read in a particular forum, I click on "Mark topics read" (for that forum), then I go back to the index page and click on the next forum. Once I have looked at all the threads that draw my interest, I refresh the index page and see what new posts show up in the various forums. Then I follow the same process again. I never click on "View new posts".

At any rate, my opinion is my own. It is quite possible that other moderators and the admins here feel differently about this issue than I do.

Regarding changes in the phpBB code from version 2 to version 3; I know significant changes were made, but I do not know the specifics. Nevertheless, what Zender said makes sense. I am quite sure the hashes were not put in place by the admins here. It must have been part of the newer code. I don't believe the hashes were put there on a whim by the phpBB code writers - there must have been a reason. Whether they could be eliminated or not, I don't know.
If I came across as someone saying the hash was a intentional mod by the staff here, that certainly wasn't my intention. I was sure that it was part of the new build. I certainly don't fault anyone here for that. I was just noting it, and suggesting that it could be remedied since it does have a drawback.

Just for the record, I'm fully aware of how hard the job of moderating such an active forum is, and am extremely appreciative for all the work you guys have put in. :)

Re: Mark Forums Read: Link now hashed?

Posted: Sat Jan 24, 2009 11:36 pm
by pkiff
Radioguy wrote:Are you saying the phpBB code was changed in this new version to make the hash necessary?
It appears that this is the case. Various posts on the phpBB Forum suggest that this code change occurred between 3.02 and 3.03. The purpose of the code change is not entirely clear to me, but is related to security. According to a couple posters, this closes a security hole whereby a 3rd party could create a link to the forum that would cause all threads to be marked as read without a user being notified or given a chance to stop that happening. These two posters call it an "annoyance" as opposed to a true security issue:
Page 19 in View or mark unread posts thread on phpBB Forum

I am sure that this could be removed from the forum code base, but my inclination would be to encourage the board admins to leave it as it stands now.

Phil.

Re: Mark Forums Read: Link now hashed?

Posted: Sun Jan 25, 2009 3:34 pm
by Radioguy
Thanks for looking into this.

So...going by that thread, the hash was introduced in case someone posted a mark read link as an attack? That seems like overkill. At worst that would be an annoyance, but only as much as accidentally clicking on the hashed link on the index page (would happen either way).

Although, I could see kids tinyurl'ing such a link as some juvenile goof against another member of some teen board. In that context I supposed it could be considered an attack like rickrolling or worse, but I don't see members here stooping that low.

I hope Bill and the other staff here consider disabling this, but I appreciate the information on why it's happening to begin with.

Re: Mark Forums Read: Link now hashed?

Posted: Sun Jan 25, 2009 5:56 pm
by bill bolton
Radioguy wrote:I hope Bill and the other staff here consider disabling this
The Admin staff is aiming to keep the phpBB installation here as standardised as reasonably possible to ease any future upgrades...... so probably not.

Cheers,

Bill B.

Re: Mark Forums Read: Link now hashed?

Posted: Sun Jan 25, 2009 11:04 pm
by Zender

Code: Select all

javascript:(function(){var mrq=new XMLHttpRequest();mrq.open("GET","http://forum.thinkpads.com/index.php",true);mrq.onreadystatechange=function(){var lnk;if(lnk=mrq.responseText.match(/<a.*?href="([^"]+)".*?>Mark forums read<\/a>/)){location.href=lnk[1].replace(/&/,'&');};};mrq.send(null);})();
Bookmark this, it will work (Firefox, possibly also Opera; but only when you click the bookmark when on some page from forum.thinkpads.com domain, security restrictions).

Re: Mark Forums Read: Link now hashed?

Posted: Sun Jan 25, 2009 11:26 pm
by pkiff
Nice solution, Zender. Works great here in Opera 9.63 under XP.

Phil.

Re: Mark Forums Read: Link now hashed?

Posted: Mon Jan 26, 2009 12:56 am
by basketb
Zender wrote:

Code: Select all

javascript:(function(){var mrq=new XMLHttpRequest();mrq.open("GET","http://forum.thinkpads.com/index.php",true);mrq.onreadystatechange=function(){var lnk;if(lnk=mrq.responseText.match(/<a.*?href="([^"]+)".*?>Mark forums read<\/a>/)){location.href=lnk[1].replace(/&/,'&');};};mrq.send(null);})();
Bookmark this, it will work (Firefox, possibly also Opera; but only when you click the bookmark when on some page from forum.thinkpads.com domain, security restrictions).
Is it possible to have something like this for one/any/all of the subforums? (as this would be of more use to me than marking all forums read).
I don't know anything about javascript, so any help is appreciated.
For example, to mark the X200 forum read, I naively replaced a couple of strings in the above as follows:
javascript:(function(){var%20mrq=new%20XMLHttpRequest();mrq.open("GET","http://forum.thinkpads.com/viewforum.php?f=43",true);mrq.onreadystatechange=function(){if(lnk=mrq.responseText.match(/<a.*?href="([^"]+)".*?>Mark topics read<\/a>/)){location.href=lnk[1].replace(/&/,'&');};};mrq.send(null);})();
This resulted in the following URI being generated:
whereas the correct URI is:
I would have assumed that the
.replace(/&/,'&')
in the javascript should have replaced the "&" with just a "&".
So what do I have to do to correctly replace the "&" with "&"? thx.

Re: Mark Forums Read: Link now hashed?

Posted: Mon Jan 26, 2009 1:00 am
by Zender
Also modify /&/ to /&/g
The "g" means "match all", I didn't bother because there was only one occurence.
It might be also possible to make it auto-detect which sub-forum you're browsing at the moment.

Current subforum - should work from subforum index or from any topic inside.

Code: Select all

javascript:(function(){var cur=document.body.innerHTML;var trymark=function(s){var lnk;if(lnk=s.match(/<a.*?href="([^"]+)".*?>Mark topics read<\/a>/)){location.href=lnk[1].replace(/&/g,'&');return 1;};return 0;};if(!trymark(cur)){var sf;if(sf=cur.match(/<p class="breadcrumbs">.*?<a href="([^"]+)">[^<]+<\/a><\/p>/)) {var mrq=new XMLHttpRequest();mrq.open("GET","http://forum.thinkpads.com/"+sf[1],true);mrq.onreadystatechange=function(){if(mrq.readyState<4)return;trymark(mrq.responseText);};mrq.send(null);};};})();
Readable form.

Code: Select all

(
    function()
    {
        var cur = document.body.innerHTML;
        var trymark = function(s) {
            var lnk;
            if(lnk = s.match(/<a.*?href="([^"]+)".*?>Mark topics read<\/a>/)) { 
                location.href = lnk[1].replace(/&/g, '&');
                return 1;
            }
            return 0;
        }
        if(!trymark(cur)) {
            var sf;
            if(sf = cur.match(/<p class="breadcrumbs">.*?<a href="([^"]+)">[^<]+<\/a><\/p>/)) {
                var mrq = new XMLHttpRequest();
                mrq.open("GET", "http://forum.thinkpads.com/" + sf[1], true);
                mrq.onreadystatechange = function() {
                    if(mrq.readyState < 4) return;
                    
                    trymark(mrq.responseText);
                };
                mrq.send(null);
            }
        }
    }
) ();

Re: Mark Forums Read: Link now hashed?

Posted: Mon Jan 26, 2009 1:39 am
by basketb
Zender wrote:Also modify /&/ to /&/g
The "g" means "match all", I didn't bother because there was only one occurence....
Great, thanks, this does the trick.

Re: Mark Forums Read: Link now hashed?

Posted: Mon Jan 26, 2009 2:51 pm
by Radioguy
THANK YOU ZENDER!
:bow: :bow: :bow: :bow: :bow: :bow:

Just my 2 cents, but it might be worth stickying this, or creating a separate sticky post with these commands, if the staff do choose not to edit the new hash code out of the database. Apparently I am not the only one who will use this. :)

I also appreciate the subforum variations as well, although I tend to not ignore the other subforums entirely. Posts that are of interest to me may popup in them, but I don't browse them as a rule. That's why I browse the board via new posts to begin with. After having done so, I then mark read those threads/posts I don't intend to read, so the next new posts query will spawn fewer pages.

That's just how I roll. 8)