Post by questonerruber on Jun 28, 2022 16:26:55 GMT -8
I want guests when they click on a thread for it to automatically go to the latest post in the thread
For clarification, I know there is a 'last post' button - but it simply doesnt work. It still goes to the first post in the thread when you click it. (as guest)
Currently it only halfworks if you're logged in
For example: when logged in it also doesnt go to the latest post, it only goes to the last post you've seen.
Any ideas?
Last Edit: Jun 28, 2022 16:31:01 GMT -8 by questonerruber
Here's some helpful tips regarding new posts in a thread:
A. Clicking on the new icon will take you to your first unread post of that thread. B. Clicking on the thread title will take you to the first post of that thread. C. Clicking in the Last Post cell will take you to the last post of that thread (which is the most recent post made in that thread).
Clicking in the last post column takes you to the last post in the thread (even as a guest) regardless if you have not yet read the other posts created prior to that last one.
Every day, coders are looking for new ways to kill bugs. Think you've got what it takes?
"To fight the bug, we must first understand the bug. "
Post by questonerruber on Jun 30, 2022 18:05:34 GMT -8
Thanks for the demonstration, the problem is that unlike your animation, clicking 'last post' column actually doesn't work as guest. It still just goes to the first page and beginning of thread. any clues why this could be?
Thanks for the demonstration, the problem is that unlike your animation, clicking 'last post' column actually doesn't work as guest. It still just goes to the first page and beginning of thread. any clues why this could be?
The animation is from an incognito session showing that it works for guests.
It could be some code interfering with your forum or a browser issue among other things. Only generalities can be given here since the question was not posed with a specific forum in mind
Every day, coders are looking for new ways to kill bugs. Think you've got what it takes?
"To fight the bug, we must first understand the bug. "
Post by questonerruber on Jul 2, 2022 11:28:39 GMT -8
Here is a forum where it doesnt work. heres a gif I took as incognito. As you can see it still goes to the first post in the thread. I am using latest version of firefox with all plugins disabled. This same behaviour happens on MULTIPLE different forums.
I have no idea why it works for you but not me
Last Edit: Jul 2, 2022 11:29:17 GMT -8 by questonerruber
Post by questonerruber on Jul 2, 2022 17:46:16 GMT -8
ah yeah, it works on this here support forum! so where precisely in the theme code does that feature reside? and even still, its so obscure and precise I doubt many people will even notice it in the first place (like me)
is there a way to take the code from that and make it the default action for clicking 'last post' links?
The last post column on the forum's homepage would not exhibit this behavior (as your demonstration shows), it is on a list of threads such as inside a board or recent topics that the last post column becomes clickable. You can mimic this empty-space-click-takes-you-to-last-post for the main page by adding the following code to the forum's main footer
<!-- Last Post Cell Click on Homepage Takes You to Newest Post --> <script> (()=>{ document.querySelectorAll('.board.item .latest') .forEach(lp=>{ let thread = $('.js-thread__link',lp); thread.length && (lp.style.cursor='pointer') && lp.addEventListener('click',ev=>{ ev.currentTarget === ev.target && (window.location = proboards.route("thread_last_post", { thread_id: +thread.idFromClass('thread') })) }) ; }) })() </script>
Post by questonerruber on Jul 4, 2022 12:50:04 GMT -8
Great, that seems like it would probably work. However, If I am using this code to make it so a forum only has one thread in a category:
Then I think that this code is interferring with yours, because when I use your code, I can then click on the blank spots to load the recent thread - but it gives me an error that "The thread cannot be found"
Any clues how to get around that?
Is there something I can put on the end of the URL to force a thread to go to the latest post even as guest?
Post by questonerruber on Jul 4, 2022 23:01:06 GMT -8
hmm, ok that works. but if I use a redirect URL like that in the Structure > Categories & Boards > click board > Settings > Redict url
then it gets rid of the post counts, timestamps, and # of viewers if I use that redirect section to force it to go to newest post with your above method.
This is the code i'm working with to make a board have one main thread
How could I use that last URL idea you just mentioned, in this section? so it keeps the front page information, and also goes to latest post as guest. Currently, using that code, when I click a thread the URL it takes me to is like: