inherit
201888
0
Nov 18, 2020 8:42:56 GMT -8
jok3r
47
November 2013
jok3r
|
Post by jok3r on Nov 17, 2014 2:48:44 GMT -8
Hi! I have grab an excellent code from here (can't find thread to link) that included "Recent Post" alongside with "Participated" button in top-right of my forum. The global header in my forum is as this: <script>
$(function(){ $("a.recent-threads-button").clone().attr("href", "/posts/recent").html("Recent Posts").insertBefore($("#navigation-tree")); });
</script> I would also like to include a "Mark All Boards Read" on the right side of those if possible. What should i add to the code above? Image Thanks
|
|
inherit
201888
0
Nov 18, 2020 8:42:56 GMT -8
jok3r
47
November 2013
jok3r
|
Post by jok3r on Nov 23, 2014 3:24:41 GMT -8
Hmm i was surprised to see this not solved. As i am a noob please someone tell me if no replies means either: a) too hard/needs time to make b) too easy to bother to post hoping for a solution
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 8, 2014 20:44:59 GMT -8
A slight problem with this is behind the scenes the markBoardsRead function pulls data about the AJAX URL to use from the page data but that URL is only available when on the home page. It can be fixed by specifying an URL manually so the function completes successfully
<script> $(function () { $("a.recent-threads-button:first").clone().attr({ "href" : "/posts/recent", "title" : "Recent forum Posts" }).html("Recent Posts").insertBefore($("#navigation-tree")); $("a.recent-threads-button:first").clone().attr({ "href" : "javascript:proboards.home.markBoardsRead()", "title" : "Mark all boards read" }).html("Mark All Read").insertBefore($("#navigation-tree")); /* make sure board read url is set if not */ if (!proboards.data('mark_boards_read_url')) { proboards.data('mark_boards_read_url', /* location.origin + */ location.protocol + "//" + location.host + '/boards/mark/read') } }); </script>
|
|
inherit
201888
0
Nov 18, 2020 8:42:56 GMT -8
jok3r
47
November 2013
jok3r
|
Post by jok3r on Dec 9, 2014 12:49:37 GMT -8
Thank you a lot for this (and the great PlugIns as well!) Works perfectly
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 10, 2014 16:51:29 GMT -8
I actually overlooked the fact that you wanted it after the participated button so if you change the following line
}).html("Mark All Read").insertBefore($("#navigation-tree"));
to
}).html("Mark All Read").insertAfter($("#navigation-tree").siblings(':first-child'));
that should rearrange the order
|
|
inherit
201888
0
Nov 18, 2020 8:42:56 GMT -8
jok3r
47
November 2013
jok3r
|
Post by jok3r on Dec 11, 2014 13:58:55 GMT -8
Thanks again! Haha that minor change was requested by other Admins but i thought it was not possible. I applied it now. I think this is something more people will be interested to see in Header-Footer/Template Library
|
|