Former Member
inherit
guest@proboards.com
253222
0
Dec 4, 2024 8:14:08 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jun 9, 2020 9:35:29 GMT -8
Hi. So, basically my forum has next and previous thread buttons, and the problem is that, previous thread appears even on the first thread (where there's no threads before it, and it leads to a sort of an error page), and next thread appears even on the last thread (where there's no threads after that thread). Thus, I was wondering if there was a way to make next thread not appear when you're on the last thread of the thread's list, and previous thread not to appear when you're on the first thread of the thread's list.
|
|
Former Member
inherit
guest@proboards.com
253222
0
Dec 4, 2024 8:14:08 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jun 10, 2020 9:37:57 GMT -8
Anyone?
|
|
Kami
Forum Cat
Posts: 40,203
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,203
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jun 10, 2020 13:06:26 GMT -8
is this a script/plugin or a template mod? it sounds like the former.
either way, forum URL and/or link to a guest-viewable thread so we can see the issue would be immensely helpful. can't pull answers out of thin air :P
|
|
Former Member
inherit
guest@proboards.com
253222
0
Dec 4, 2024 8:14:08 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jun 10, 2020 13:09:18 GMT -8
is this a script/plugin or a template mod? it sounds like the former. either way, forum URL and/or link to a guest-viewable thread so we can see the issue would be immensely helpful. can't pull answers out of thin air We're using the script and template change from this thread: support.proboards.com/thread/626921/pluginWould that suffice, or do you need the forum URL still?
|
|
Kami
Forum Cat
Posts: 40,203
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,203
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jun 10, 2020 13:12:25 GMT -8
is this a script/plugin or a template mod? it sounds like the former. either way, forum URL and/or link to a guest-viewable thread so we can see the issue would be immensely helpful. can't pull answers out of thin air We're using the script and template change from this thread: support.proboards.com/thread/626921/pluginWould that suffice, or do you need the forum URL still? I (and others) cannot diagnose a problem that can't be seen. While we can probably look at that plugin to see if there is a change that can be made, without knowing how your forum is set up, if it's modified template-wise, or what other plugins you're running, we can't give you a completely accurate answer. Depending on the issue, we may also need to see how the plugin works to get an idea of how the script is put together. At the end of the day, if you need assistance with stuff you've added to your forum, you'll need to provide a URL. If you're not comfortable providing one, that's fine, but then volunteer hands are limited to the kind of help they can give. I'm not saying it's impossible to fix without seeing your forum, but you do run the risk of having to wait a while at minimum. Case in pont: I'm not super great with javascript as a for instance, so I can't diagnose based on raw javascript. You'll have to wait to see if someone else chimes in. Good luck!
|
|
Former Member
inherit
guest@proboards.com
253222
0
Dec 4, 2024 8:14:08 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jun 10, 2020 13:21:27 GMT -8
I (and others) cannot diagnose a problem that can't be seen. While we can probably look at that plugin to see if there is a change that can be made, without knowing how your forum is set up, if it's modified template-wise, or what other plugins you're running, we can't give you a completely accurate answer. Depending on the issue, we may also need to see how the plugin works to get an idea of how the script is put together. At the end of the day, if you need assistance with stuff you've added to your forum, you'll need to provide a URL. If you're not comfortable providing one, that's fine, but then volunteer hands are limited to the kind of help they can give. I'm not saying it's impossible to fix without seeing your forum, but you do run the risk of having to wait a while at minimum. Case in pont: I'm not super great with javascript as a for instance, so I can't diagnose based on raw javascript. You'll have to wait to see if someone else chimes in. Good luck! Well... it's not really a problem. That's just the behavior of every of every proboards forum I think. For an example, you could go to here: forumofcolumbo.boards.net/thread/154/theme-selection I think you could see probably the next/prev buttons. If you click on either one, it doesn't really work out, because there is no next or previous page. So basically, what I think would be great is that the next and previous buttons should not appear if there is no next or previous page respectively. Sorry if I'm not making sense, or anything, and thank you for your time.
|
|
Kami
Forum Cat
Posts: 40,203
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,203
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jun 10, 2020 14:31:03 GMT -8
I (and others) cannot diagnose a problem that can't be seen. While we can probably look at that plugin to see if there is a change that can be made, without knowing how your forum is set up, if it's modified template-wise, or what other plugins you're running, we can't give you a completely accurate answer. Depending on the issue, we may also need to see how the plugin works to get an idea of how the script is put together. At the end of the day, if you need assistance with stuff you've added to your forum, you'll need to provide a URL. If you're not comfortable providing one, that's fine, but then volunteer hands are limited to the kind of help they can give. I'm not saying it's impossible to fix without seeing your forum, but you do run the risk of having to wait a while at minimum. Case in pont: I'm not super great with javascript as a for instance, so I can't diagnose based on raw javascript. You'll have to wait to see if someone else chimes in. Good luck! Well... it's not really a problem. That's just the behavior of every of every proboards forum I think. For an example, you could go to here: forumofcolumbo.boards.net/thread/154/theme-selection I think you could see probably the next/prev buttons. If you click on either one, it doesn't really work out, because there is no next or previous page. So basically, what I think would be great is that the next and previous buttons should not appear if there is no next or previous page respectively. Sorry if I'm not making sense, or anything, and thank you for your time. I see what you're saying. That said, I am not 100% sure if there is a way to check to see if there's another thread in the board whilst inside a thread -- basically, Javascript can only manipulate content if that content exists on the page. If it doesn't, there's nothing for the Javascript to find (or "call", as they say it) and therefore the script won't execute. Since this is just moving default functionality outside of the dropdown, and seeing as pressing the 'go to' button inside the drop down has the same result, it might not be possible to show/hide based on whether or not there are any additional threads. This does seem to be outside of my purview though, I'm afraid, so I'll have to bow out. I would definitely, however, recommend asking in the plugins board instead since this isn't template related (:
|
|
Former Member
inherit
guest@proboards.com
253222
0
Dec 4, 2024 8:14:08 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jun 10, 2020 14:32:17 GMT -8
Well... it's not really a problem. That's just the behavior of every of every proboards forum I think. For an example, you could go to here: forumofcolumbo.boards.net/thread/154/theme-selection I think you could see probably the next/prev buttons. If you click on either one, it doesn't really work out, because there is no next or previous page. So basically, what I think would be great is that the next and previous buttons should not appear if there is no next or previous page respectively. Sorry if I'm not making sense, or anything, and thank you for your time. I see what you're saying. That said, I am not 100% sure if there is a way to check to see if there's another thread in the board whilst inside a thread -- basically, Javascript can only manipulate content if that content exists on the page. If it doesn't, there's nothing for the Javascript to find (or "call", as they say it) and therefore the script won't execute. Since this is just moving default functionality outside of the dropdown, and seeing as pressing the 'go to' button inside the drop down has the same result, it might not be possible to show/hide based on whether or not there are any additional threads. This does seem to be outside of my purview though, I'm afraid, so I'll have to bow out. I would definitely, however, recommend asking in the plugins board instead since this isn't template related (: Can this thread get moved, or do I have to repost it?
|
|
Kami
Forum Cat
Posts: 40,203
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,203
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jun 10, 2020 14:35:24 GMT -8
I see what you're saying. That said, I am not 100% sure if there is a way to check to see if there's another thread in the board whilst inside a thread -- basically, Javascript can only manipulate content if that content exists on the page. If it doesn't, there's nothing for the Javascript to find (or "call", as they say it) and therefore the script won't execute. Since this is just moving default functionality outside of the dropdown, and seeing as pressing the 'go to' button inside the drop down has the same result, it might not be possible to show/hide based on whether or not there are any additional threads. This does seem to be outside of my purview though, I'm afraid, so I'll have to bow out. I would definitely, however, recommend asking in the plugins board instead since this isn't template related (: Can this thread get moved, or do I have to repost it? Uhhhh generally you can just start a new thread and link to your old thread OR you can report your post and ask for a mod to move it in the "reason" box -- that said I think the former is faster because there's no telling when a mod will have the time to move it (:
|
|
inherit
257284
0
Nov 13, 2024 10:37:51 GMT -8
Eton Bones
70
December 2018
etonbones
|
Post by Eton Bones on Jun 11, 2020 22:19:49 GMT -8
There would be nothing in the available information for a script to determine if a previous thread exists, that determination is made on the backend once the request is received by the server and database query is made. If nothing else exists then an error is shown which is totally normal behavior. A quick test also reveals that this prev/last is based solely on ascending reverse_order_on sorting so if you were to do a reverse chronological thread starter sort the next/prev would still honor the default sorting order once you've click into the thread
Edit: Since this is a script running within a template it does have the advantage of having access to template variables so it can in fact detect when there are no more threads in NEXT actions (unfortunately there is no corresponding PREVIOUS thread detection) which solves half the problem. Try replacing the script portion with this modified script that uses the $[thread.board.last_thread] variable to detect when we are viewing the last thread and remove the next thread button. <script>(function($, proboards){ var viewThread = function(){
// remove items from action menu $('.control-bar .select_menu_list > li.view').remove();
// setup the buttons and bind a click handler var buttons = $('[data-group]'); buttons.on('click', 'button', function(e){ var target = $(e.currentTarget); var route = (target.data('thread-view') === 'previous') ? 'previous_thread' : 'next_thread'; var thread_id = proboards.data('thread_id'); return window.location = proboards.route(route, { thread_id: thread_id }) });
}; $(viewThread); function url_id(u){ let id = void 0; /(thread|board|post)\/(\d+)/i.test(u) && (id = [RegExp.$1+"_id",+RegExp.$2]); return id; } const lastThread = url_id('$[thread.board.last_thread.href]') ; lastThread && pb.data('route').params[lastThread[0]] == lastThread[1] && $(()=>$('button[data-thread-view="next"]').hide()) })(jQuery, proboards)</script>
|
|