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: 8
Joined: Wed Aug 15, 2018 9:02 pm

U_NEWEST_POST not generating correct link

Post by Tengo_1 »

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: 6108
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: U_NEWEST_POST not generating correct link

Post by AmigoJack »

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 problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
Tengo_1
Registered User
Posts: 8
Joined: Wed Aug 15, 2018 9:02 pm

Re: U_NEWEST_POST not generating correct link

Post by Tengo_1 »

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: 53400
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: U_NEWEST_POST not generating correct link

Post by Brf »

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: 8
Joined: Wed Aug 15, 2018 9:02 pm

Re: U_NEWEST_POST not generating correct link

Post by Tengo_1 »

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: 53400
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: U_NEWEST_POST not generating correct link

Post by Brf »

Are you logged in after you click the link?
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: U_NEWEST_POST not generating correct link

Post by 3Di »

🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Tengo_1
Registered User
Posts: 8
Joined: Wed Aug 15, 2018 9:02 pm

Re: U_NEWEST_POST not generating correct link

Post by Tengo_1 »

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: 53400
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: U_NEWEST_POST not generating correct link

Post by Brf »

That link is the same as your link. The point was that it only works if you are logged in.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: U_NEWEST_POST not generating correct link

Post by 3Di »

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
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Tengo_1
Registered User
Posts: 8
Joined: Wed Aug 15, 2018 9:02 pm

Re: U_NEWEST_POST not generating correct link

Post by Tengo_1 »

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
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: U_NEWEST_POST not generating correct link

Post by 3Di »

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?
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Tengo_1
Registered User
Posts: 8
Joined: Wed Aug 15, 2018 9:02 pm

Re: U_NEWEST_POST not generating correct link

Post by Tengo_1 »

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: 53400
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: U_NEWEST_POST not generating correct link

Post by Brf »

The purpose of that "e" parameter is to redirect to login if the user is not logged in.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: U_NEWEST_POST not generating correct link

Post by 3Di »

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.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Post Reply

Return to “[3.2.x] Support Forum”