inherit
243717
0
Oct 31, 2022 19:31:14 GMT -8
chrismac777
13
April 2017
chrismac777
|
Post by chrismac777 on May 15, 2017 17:13:27 GMT -8
Hi,
I am painfully trying to create a category with sub-boards, where the sub-board that contains the most recent thread appears at the top.
Can anyone help me on this? Is their some code or plugin I can drop in somewhere specific to this board where the Sub-boards are not static, rather sorted to most recent post/thread within the sub-board?
Thank you so much in advance.
Chris
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on May 19, 2017 11:05:05 GMT -8
Place in board header of the board you want it to apply too. Or if you want it to apply everywhere, then place in global header or download the plugin at the bottom of this post. $(function(){ if(pb.data("route").name == "board"){ var $boards = $("tr.board.item"); $boards.sort(function(a, b){ var date1 = new Date(parseInt($(a).find("td.last abbr.recent_time").attr("data-timestamp"), 10) || 0); var date2 = new Date(parseInt($(b).find("td.last abbr.recent_time").attr("data-timestamp"), 10) || 0); if(date1 < date2){ return 1; } else if(date1 > date2){ return -1; } return 0; }); var $parent = $boards.parent(); $parent.empty(); $parent.append($boards); $parent.find(".first").removeClass("first"); $parent.find(".last").removeClass("last"); $parent.find("tr:first").addClass("first"); $parent.find("tr:last").addClass("last"); } }); Download plugin
|
|
inherit
243717
0
Oct 31, 2022 19:31:14 GMT -8
chrismac777
13
April 2017
chrismac777
|
Post by chrismac777 on Jun 2, 2017 18:14:49 GMT -8
Wow, thank you so much. Will try it out. Again many thanks!
Chris
|
|