Sav
Junior Member
Posts: 266
inherit
115211
0
Oct 21, 2024 0:11:57 GMT -8
Sav
266
December 2007
sav
|
Post by Sav on Jul 30, 2013 2:00:50 GMT -8
We used the code at the foot of this post to hide non-essential boards from swamping recent posts displays (e.g. our quizzes).
Could similar be done in Version 5 please?
(Members can still do a full search on the search button)
Thanks in advance
Sav
========================================================= Old Code in main footer
<script type="text/javascript"> <!-- /* hide selected boards from search results */
var boards = /^(quiz|deadquizheaven)$/gi;
if(location.href.match(/ion=(search2|(user)?recent)/)) { var a = document.getElementsByTagName('a'); for(i=0; i<a.length; i++) { if(a.item(i).href.match(/action=display&board=(\w+)&thread=(\d+?)&page=\d+$/) && a.item(i).parentNode.className == 'cattext') { if(RegExp.$1.match(boards)) { var obj = a.item(i).parentNode; while(obj.className != 'bordercolor') { obj = obj.parentNode; } obj.style.display = 'none'; if(obj.nextSibling) { obj.nextSibling.style.display = 'none'; if(obj.nextSibling.nextSibling) obj.nextSibling.nextSibling.style.display = 'none'; } } } } } //--> </script>
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Jul 30, 2013 8:44:04 GMT -8
we talkin a LOT of boards or just a couple? because it seems this would be an easy template modification if just a couple.
|
|
Sav
Junior Member
Posts: 266
inherit
115211
0
Oct 21, 2024 0:11:57 GMT -8
Sav
266
December 2007
sav
|
Post by Sav on Jul 30, 2013 9:11:59 GMT -8
Thx for taking time to reply.
On my forum it would only be about four boards max where multiple posts irrelevant to our boards purpose are flooding the 'Recent Posts' display.
Quick and dirty would be fine!
Sav
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Jul 31, 2013 14:32:07 GMT -8
Thx for taking time to reply. On my forum it would only be about four boards max where multiple posts irrelevant to our boards purpose are flooding the 'Recent Posts' display. Quick and dirty would be fine! Sav are we talking about the "recent posts" link in the IC? support.proboards.com/posts/recent/^ that?
|
|
Sav
Junior Member
Posts: 266
inherit
115211
0
Oct 21, 2024 0:11:57 GMT -8
Sav
266
December 2007
sav
|
Post by Sav on Jul 31, 2013 23:10:54 GMT -8
Yes we are, and we have configured a button in the top menu strip as well.
Sav
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Aug 1, 2013 1:42:59 GMT -8
here is the "Thread Listing" template I came up with:
{foreach $[thread]} {if $[route.name] == "recent_threads" && $[thread.board.id] == "15" } {elseif $[route.name] == "recent_threads" && $[thread.board.id] == "17" } {elseif $[route.name] == "recent_threads" && $[thread.board.id] == "4" } {else} <tr id="$[thread.content_id]" class="$[thread.content_class]"> <td class="icon">$[thread.icon]</td> <td class="checkbox clickable">$[thread.checkbox]</td> <td class="main clickable" title="$[thread.short_content]"> <table> <tr> <td>$[thread.icons]</td> <td> $[thread.labels] <span class="link target">$[thread]</span> {if $[thread.pagination]}<div class="ui-micro-pagination">Pages: $[thread.pagination]</div>{/if} </td> </tr> </table> </td> <td class="created-by clickable">$[thread.created_by_user]</td> <td class="replies clickable">$[thread.replies]</td> <td class="views">$[thread.views]</td> <td class="latest last">by $[thread.last_post.created_by_user]<br />$[thread.last_post.date]</td> </tr> {/if} {/foreach} {if !$[thread]} <tr class="last"> <td class="last center" colspan="7">No threads were found.</td> </tr> {/if}
|
|
Sav
Junior Member
Posts: 266
inherit
115211
0
Oct 21, 2024 0:11:57 GMT -8
Sav
266
December 2007
sav
|
Post by Sav on Aug 4, 2013 23:53:43 GMT -8
Thanks, I can see a 'Thread' template which has three tabs. 'Thread', 'Post List' and 'Quick Reply'
Does this go in at the end of the 'Post List' template please? where I can see code relating to recent posts?
The logic of your template
for each post if unwanted board 1 elseif unwanted board 2 else post it end for each
I've been looking for existing code to replace.
advice appreciated
Sav
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Aug 8, 2013 1:29:24 GMT -8
look under the board template. you will see a "thread list" template
I just threw in arbitrary numbers. you just need to replace with the board ids of the boards you want to affect. if you have more, just duplicate the line:
{elseif $[route.name] == "recent_threads" && $[thread.board.id] == "17" }
and you need to replace ALL of your thread list template with what I have, not just add the lines at the top. the bottom has the closing {/if}
|
|
Sav
Junior Member
Posts: 266
inherit
115211
0
Oct 21, 2024 0:11:57 GMT -8
Sav
266
December 2007
sav
|
Post by Sav on Aug 8, 2013 9:08:31 GMT -8
Many thanks, will try later this evening.
Sav
|
|
Sav
Junior Member
Posts: 266
inherit
115211
0
Oct 21, 2024 0:11:57 GMT -8
Sav
266
December 2007
sav
|
Post by Sav on Aug 10, 2013 10:37:59 GMT -8
Have made the alterations and it works fine for recent threads thanks.
I was actually after 'recent posts' specific board exclusions, is that possible please?
Thanks again,
Sav.
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Aug 10, 2013 17:03:36 GMT -8
same concept in the "post list" template:
{foreach $[post]} {if $[route.name] == "all_recent_posts" && $[post.thread.id] == "6" } {elseif $[route.name] == "all_recent_posts" && $[post.thread.id] == "8" } {else} <tr id="$[post.content_id]" class="$[post.content_class]{if $[post.even]} even{/if}{if $[viewing_recent_posts]} recent{/if}"> <td class="$[post.unblocked_class]"> <table role="grid"> <tr> <td class="left-panel" rowspan="2"> $[post.created_by.miniprofile] </td> <td class="content"> <article> <div class="content-head ui-helper-clearfix"> <div class="info"> $[post.thread] <span class="date">$[post.created_on]</span> {if $[post.how_posted]} <span class="post-method">via $[post.how_posted]</span> {/if} $[post.likes] </div> <div class="controls"> $[post.quote_button] $[post.edit_button] $[post.likes.button] $[post.select_options] </div> </div> <h3 class="title aria-hidden">Post by $[post.created_by.name] on $[post.created_on]</h3> <div class="message">$[post.message]</div> </article> </td> </tr> <tr> <td class="foot"> {if $[post.edited]} <div class="edited_by"><span class="italic">Last Edit:</span> $[post.edited.date] by $[post.edited.by_user]{if $[post.edited.reason]}: $[post.edited.reason]{/if}</div> {/if} {if $[post.created_by.signature]} <div class="signature">$[post.created_by.signature]</div> {/if} </td> </tr> </table> </td> {if $[post.is_blocked]} <td class="$[post.blocked_class] content center"> <div class="message note pad-bottom">This post is hidden</div> $[post.display_blocked_post_button] </td> {/if} </tr> {/if} {/foreach} {if !$[post]} <tr class="last"><td class="last center" colspan="1">No posts were found.</td></tr> {/if}
|
|
Sav
Junior Member
Posts: 266
inherit
115211
0
Oct 21, 2024 0:11:57 GMT -8
Sav
266
December 2007
sav
|
Post by Sav on Aug 10, 2013 21:37:12 GMT -8
Very many thanks, will try this evening or tomorrow as soon as I can.
Sav
|
|
Sav
Junior Member
Posts: 266
inherit
115211
0
Oct 21, 2024 0:11:57 GMT -8
Sav
266
December 2007
sav
|
Post by Sav on Aug 11, 2013 23:47:48 GMT -8
Tried that but did not get anywhere thanks.
I guess it's because this triggers on post.thread.id and not board.id as before and I was trying for. Tried changing it to post.board.id but without success thanks.
Sav
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Aug 11, 2013 23:50:38 GMT -8
sorry I dont know what I was thinking
try post.board_id
|
|
Sav
Junior Member
Posts: 266
inherit
115211
0
Oct 21, 2024 0:11:57 GMT -8
Sav
266
December 2007
sav
|
Post by Sav on Aug 11, 2013 23:53:29 GMT -8
Wow, that was quick!!
Nocturnal??
Sav
|
|