inherit
206056
0
Oct 22, 2024 12:06:59 GMT -8
adminabp
378
February 2014
adminabp
|
Post by adminabp on Aug 7, 2018 4:43:01 GMT -8
I've edited my templates to add the board posted in information to the "last post" section on my "recent Threads" abetterplace.boards.net/threads/recentI would like to do the same to the page for "Participated Threads"... abetterplace.boards.net/threads/participated...but there is no template to edit for that page. From searching through related topics in the forums,I think it might be possible with a script to the Global Header, but nothing I have tried to cobble together with my limited coding knowledge has worked. Any help would be appreciated.
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 10, 2018 8:46:21 GMT -8
I have the following code as a bookmarklet so I can conveniently run it when I need to see that info javascript : void function (a) { var e = function (a) { (function () { function e() { (o && n && !/board/.test(n.name) || a("#recent-threads").is(":visible")) && a.each(o, function (e, t) { var n = a(".js-thread__title-link.thread-" + t.id + ":not(.show-board)"), o = n.closest(r[d.closest]); r[d.find] && (o = o.find(r[d.find])), r[d.manipulation] && o[r[d.manipulation]]((r[d.template] || "{board}").replace(/\{board\}/g, function (e) { var o = a(".nav-tree-board-" + t.board_id + ":first>a .item-text").text(); return n.addClass("show-board"), o ? '<a href="/board/' + t.board_id + '">' + o + "</a>" : "(unknown)" })) }) } function t() { o = o || {}, a("#recent-threads .js-thread__title-link:not(.show-board)").each(function (e, t) { var n = a(t).idFromClass("thread"), r = a(t).idFromClass("board"); o[n] = o[n] || { id : n, board_id : r } }) } var n = pb.data("route"), o = pb.data("proboards.thread"), r = [".main,.subject", "", "append", '<div class="description"><b>Board: </b>{board}</div>'], d = { closest : 0, find : 1, manipulation : 2, template : 3 }; pb.events.on("afterSearch", e), e(), a(document).on("dialogopen", "#recent-threads", function () { t(), e() }) })() }, t = a && a.fn && parseFloat(a.fn.jquery) >= 1.7; if (t) e(a); else { var n = document.createElement("script"); n.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js", n.onload = n.onreadystatechange = function () { var a = this.readyState; a && "loaded" !== a && "complete" !== a || e(jQuery.noConflict()) } document.getElementsByTagName("head")[0].appendChild(n) } } (window.jQuery);
Note: all ampersands, hash and question marks in the code need to be converted back to their URIEncoded character equivalents (%26, %23, %3F) if using as a bookmarklet. If planning to use as a global footer code instead then drop the "javascript:" protocol at the beginning of the code and wrap in <script> tags. Just be warned that I never actually tried it in global footer. Brian Ordonez also created a template modification version which he has added to two themes on this support forum, if you ask nicely he might share... Added to ProBoards.com and Cave of the Err Bear theme.
|
|
inherit
206056
0
Oct 22, 2024 12:06:59 GMT -8
adminabp
378
February 2014
adminabp
|
Post by adminabp on Aug 13, 2018 10:11:42 GMT -8
Thanks Chris No luck with putting that code(with <script> tags) in the Global Footer on my forum. I'm also not seeing any results of that modification on either of the 'ProBoards.com'(my default) and 'Cave of the Err Bear' themes here at Support. I also downloaded the 'Cave of the Err Bear' theme from venompbx.proboards.com and tried it on my forum with no visible change. Tagging Brian for any assistance/information he can render, it would be appreciated.
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 13, 2018 12:34:36 GMT -8
There's a syntax error due to the fact that the Script tag placed at the beginning is not fully formed On line 2012 in the image above the script tag is missing its closing >
|
|
inherit
206056
0
Oct 22, 2024 12:06:59 GMT -8
adminabp
378
February 2014
adminabp
|
Post by adminabp on Aug 13, 2018 18:28:26 GMT -8
Chris I fixed the syntax error, it still isn't working. Based off the number of times I see .recent-threads in this code, is it maybe actually made for the recent threads page, and not the participated threads page? I ask because the recent threads page is the only place this code is working, not the participated page, and I've already done a template mod to show the boards in the last column for recent threads, so I don't need it there.
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 13, 2018 20:14:38 GMT -8
My fault adminabp , I manually converted the bookmarklet when I posted the code and interpreted %23 as a period when it is actually a hash, all instances of .recent-threads that appear in that code should instead be #recent-threads
|
|
inherit
206056
0
Oct 22, 2024 12:06:59 GMT -8
adminabp
378
February 2014
adminabp
|
Post by adminabp on Aug 14, 2018 4:42:22 GMT -8
Awesome! Thank you so much, Chris One thing...it's appearing all over my forum in the thread lists under subject instead of just on the participated threads page. I already have the boards listed in the last post column for thread lists with a template mod. Any way to get this to show JUST on the participated?
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 14, 2018 8:22:26 GMT -8
Since it is an on-demand bookmarklet script, the way it was written means it does not discriminate on types of thread listings and only determines if this is indeed a thread listing that is not within a board (i.e. gathered from a general search or a specialized search such as recent threads or participated). It would need to be a totally different script to target just participated dialog so can you undo the template mod instead (or run it as a bookmarklet where you can see that info when you click the bookmarklet and not on every page load)?
|
|
inherit
206056
0
Oct 22, 2024 12:06:59 GMT -8
adminabp
378
February 2014
adminabp
|
Post by adminabp on Aug 14, 2018 8:25:47 GMT -8
Got it. Thank you again Chris
|
|