The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Redirect to the lastest post?

View previous topic View next topic Go down

Solved Redirect to the lastest post?

Post by Yuushishio on Mon Feb 29, 2016 12:12 pm

My forum: http://1000sunny.forumvi.com/
ver: Phpbb3
-----------------------

Is there any script to help me solve a problem of the link of a topic will lead to its latest post/page but not the #1post/page
I don't want to just use the small icon lead to the latest post. But just click to the link of topic title and redirect right to the latest.


Last edited by Yuushishio on Fri Mar 04, 2016 7:52 am; edited 1 time in total

Yuushishio
Forumember

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Solved Re: Redirect to the lastest post?

Post by Yuushishio on Thu Mar 03, 2016 1:21 am

bumb

Yuushishio
Forumember

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Solved Re: Redirect to the lastest post?

Post by Ange Tuteur on Thu Mar 03, 2016 8:53 am

It depends on which area of the topic links you want to modify. Generally speaking you can add the following query to the end of a topic URL to go directly to the most recent post.
Code:
?view=newest

and a quick example of modifying the topic links.
Code:
$(function() {
  for (var a = $('a[href^="/t"]'), i = 0, j = a.length; i < j; i++) a[i].href += (/\?/.test(a[i].href) ? '&' : '?' ) + 'view=newest';
});
The above script should go in Modules > JS codes management, with a placement of your choosing.
avatar
Ange Tuteur
Forumaster

Male Posts : 13172
Reputation : 2868
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Redirect to the lastest post?

Post by Yuushishio on Fri Mar 04, 2016 1:05 am

@Ange Tuteur it worked but it caused another big problem.
Now when I click to a topic, it link to the latest (newest post) but the pagination becomes not working. I can't click the number to go back to the previous page. When I click it still lead me to the latest Shocked

Yuushishio
Forumember

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Solved Re: Redirect to the lastest post?

Post by Ange Tuteur on Fri Mar 04, 2016 7:15 am

That's because the script needs to be isolated to a specific area. Allow me to reiterate :
It depends on which area of the topic links you want to modify.
That is ; where do you want this script to work, specifically. ( e.g. topiclist, last post, etc.. )
avatar
Ange Tuteur
Forumaster

Male Posts : 13172
Reputation : 2868
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Redirect to the lastest post?

Post by Yuushishio on Fri Mar 04, 2016 7:34 am

I want it to apply in home page and in every forum.
Just click to a title of a topic link, and it lead to the latest post of that topic.
Actually your last code worked well but as I say, it also made the pagination bar lost control.
So please help me fix it.

Ahh sorry ! I get it now. I just have to choose where to apply it in the Java script module.
Thank you very much.
Problem solved.

Yuushishio
Forumember

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Solved Re: Redirect to the lastest post?

Post by SLGray on Fri Mar 04, 2016 1:51 pm

Topic solved and archived


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 39139
Reputation : 2626
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum