U_NEWEST_POST not generating correct link

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Tengo_1
Registered User
Posts: 6
Joined: Wed Aug 15, 2018 9:02 pm

U_NEWEST_POST not generating correct link

Post by Tengo_1 » Wed Aug 15, 2018 9:18 pm

Support Request Template
What version of phpBB are you using? phpBB 3.2.2
What is your board's URL? www.gamersarms.com/forum
Who do you host your board with? TSO
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board? Fresh Install
Is registration required to reproduce this issue? Yes
Do you have any MODs installed? No
Do you have any extensions installed? Yes
What extensions do you have installed? Board announcements, Feed post bot, header banner, magic OGP, media embed, profile side switcher, quick reply toggle.
What styles do you currently have installed? Clean-Boardz, Revolution, Pycode
What language(s) is your board currently using? English
Which database type/version are you using? MySQL 5
What is your level of experience? New to PHP and phpBB
What username can be used to view this issue? TestUser
What password can be used to view this issue? testuserpassword
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? All extensions installed over a fresh phpbb installation prior to a user noticing this issue.
Please describe your problem. Email subscriptions for notifications to new posts in topics are not functioning correctly. Rather than provide a link to the last post that a user has read up to, the link takes the user directly to the top of the topic. The link generated within the email looks as follows:

"If you want to view the newest post made since your last visit, click the
following link:

http://www.gamersarms.com/forum/viewtop ... ead#unread"
Generated by SRT Generator

User avatar
AmigoJack
Registered User
Posts: 5317
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: U_NEWEST_POST not generating correct link

Post by AmigoJack » Thu Aug 16, 2018 6:48 am

As per /phpbb/notification/type/post.php public function get_email_template_variables() this is the expected behaviour.

Just like in a topic where you have the link "First unread post" the URI is made in the same style: the parameter view=unread ensures that viewing the topic will look up the user's last read post in that topic (and when none is found, the most recent post is used) will be presented.

"the top of the topic" does not collide with that: you still seem to be on the correct page of a topic. the #unread part in the URI is an anchor, your internet browser should automatically scroll that positition once the page has loaded completely. If it doesn't, then try the default style (proSilver) and/or a different internet browser.
The worst thing about censorship is ███████████

Tengo_1
Registered User
Posts: 6
Joined: Wed Aug 15, 2018 9:02 pm

Re: U_NEWEST_POST not generating correct link

Post by Tengo_1 » Thu Aug 16, 2018 7:42 pm

Thanks for your response. Am I mistaken in thinking that the link should take the user to a specific post ID then? The user in question was claiming that whenever they used to follow the notification link in the email on an older forum that it would take them to the last post in the thread that they had read. In this instance the link always takes me to the top of the latest page in a topic regardless of whether I've read any of the previous posts. It does this regardless of which style I am using too, I have tested it with proSilver.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51308
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: U_NEWEST_POST not generating correct link

Post by Brf » Thu Aug 16, 2018 9:24 pm

It should take you to the correct post, assuming you are logged in and the page is fully rendered before your web browser starts displaying it.
If there are a lot of large images, they might be rendered after the page is displayed, pushing the post down out of the viewport.

Tengo_1
Registered User
Posts: 6
Joined: Wed Aug 15, 2018 9:02 pm

Re: U_NEWEST_POST not generating correct link

Post by Tengo_1 » Thu Aug 16, 2018 9:42 pm

In which case it definitely isn't working properly because it is loading directly at the top of the page even in topics where there are no images posted.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51308
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: U_NEWEST_POST not generating correct link

Post by Brf » Thu Aug 16, 2018 11:25 pm

Are you logged in after you click the link?

User avatar
3Di
Registered User
Posts: 12893
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: U_NEWEST_POST not generating correct link

Post by 3Di » Thu Aug 16, 2018 11:35 pm

Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

Tengo_1
Registered User
Posts: 6
Joined: Wed Aug 15, 2018 9:02 pm

Re: U_NEWEST_POST not generating correct link

Post by Tengo_1 » Sun Aug 19, 2018 9:20 am

3Di wrote:
Thu Aug 16, 2018 11:35 pm
Try this link once logged in: http://www.gamersarms.com/forum/viewtop ... ead#unread
That worked! It took me to half way down the previous page as expected.

How can I replicate that in the email notifications in future?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51308
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: U_NEWEST_POST not generating correct link

Post by Brf » Sun Aug 19, 2018 7:31 pm

That link is the same as your link. The point was that it only works if you are logged in.

User avatar
3Di
Registered User
Posts: 12893
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: U_NEWEST_POST not generating correct link

Post by 3Di » Sun Aug 19, 2018 7:59 pm

Brf wrote:
Sun Aug 19, 2018 7:31 pm
That link is the same as your link. The point was that it only works if you are logged in.
Ern,

his link:
http://www.gamersarms.com/forum/viewtopic.php?f=2&t=329&e=1&view=unread#unread

mine
http://www.gamersarms.com/forum/viewtopic.php?f=2&t=329&view=unread#unread
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

Tengo_1
Registered User
Posts: 6
Joined: Wed Aug 15, 2018 9:02 pm

Re: U_NEWEST_POST not generating correct link

Post by Tengo_1 » Sun Aug 19, 2018 10:43 pm

Yes, I have been logged in every time I have tested it. So the '&e=1' lines appear to be causing the issue?

User avatar
3Di
Registered User
Posts: 12893
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: U_NEWEST_POST not generating correct link

Post by 3Di » Sun Aug 19, 2018 10:57 pm

I am not sure from where that bit comes from, didn't investigate.
Is it that link you provided a link someone else gave you?
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

Tengo_1
Registered User
Posts: 6
Joined: Wed Aug 15, 2018 9:02 pm

Re: U_NEWEST_POST not generating correct link

Post by Tengo_1 » Tue Aug 21, 2018 7:07 pm

The original one I posted here was provided to me by a member, but I've tested the notification system myself and it produces the same result.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51308
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: U_NEWEST_POST not generating correct link

Post by Brf » Tue Aug 21, 2018 8:20 pm

The purpose of that "e" parameter is to redirect to login if the user is not logged in.

User avatar
3Di
Registered User
Posts: 12893
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: U_NEWEST_POST not generating correct link

Post by 3Di » Tue Aug 21, 2018 10:07 pm

Brf wrote:
Tue Aug 21, 2018 8:20 pm
The purpose of that "e" parameter is to redirect to login if the user is not logged in.
Yeah, found it.

viewtopic.php

Code: Select all

// Redirect to login upon emailed notification links if user is not logged in.
if (isset($_GET['e']) && $user->data['user_id'] == ANONYMOUS)
{
	login_box(build_url('e') . '#unread', $user->lang['LOGIN_NOTIFY_TOPIC']);
}
not sure though exactly where that 'e' is generated.
Tengo_1 wrote:
Tue Aug 21, 2018 7:07 pm
The original one I posted here was provided to me by a member
In fact, that's why my question.
Tengo_1 wrote:
Tue Aug 21, 2018 7:07 pm
but I've tested the notification system myself and it produces the same result.
Expand once again this bit pls, each and every use case.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: janus_zonstraal, sakm, suewright, TritonZA, vader696 and 43 guests