We can add a select all functionality to the showthread.php page (where you see every single post) by exploiting the javascript that's already in mybb. This can be done in both icyboards and self-hosted mybb. The end result natively, doesn't look extremely neat but it works and with some styling to match the rest of your theme, you can get it looking sweet yourself.
Go to Templates & Style > Templates > your template set
Click on showthread templates
Click on showthread
Find this piece of code
<div id="posts"> {$posts} </div>
And directly above it paste in the following
<!--select all posts--> <div style="position: relative; padding: 10px;" class="modonly inlinepostsall{$mybb->user['usergroup']}"> <div style="position: absolute; right: 5px;"> <input type="checkbox" name="allbox" onclick="inlineModeration.checkAll(this)" /> <input type="button" onclick="inlineModeration.clearChecked();" value="{$lang->clear}" class="button" /> </div> </div> <!--select all posts-->
So you should end up with the following:
<!--select all posts--> <div style="position: relative; padding: 10px;" class="modonly inlinepostsall{$mybb->user['usergroup']}"> <div style="position: absolute; right: 5px;"> <input type="checkbox" name="allbox" onclick="inlineModeration.checkAll(this)" /> <input type="button" onclick="inlineModeration.clearChecked();" value="{$lang->clear}" class="button" /> </div> </div> <!--select all posts--> <div id="posts"> {$posts} </div>
Save it. It works now but it's available to everyone, we're going to fix this with the stylesheets.
Go to your global stylesheet and paste the following anywhere.
.modonly { display: none; } .modonly.inlinepostsall4, .modonly.inlinepostsall3, .modonly.inlinepostsall6 { display: block; }
The numbers on the end of the class refer to the usergroup identifiers. 4 is the Administrator. 3 is super moderator. 6 are the moderators You can add more groups by adding them below .modonly.inlinepostsall6 Get the group ID by going to User & Groups and click on Groups. When you hover over the groups you have, a URL will pop up at the bottom left hand side of your screen. On the end of the URL is a number. This number if the Group ID that you want.
If you want to have the buttons above and below all of your posts, find this piece of code again
<div id="posts"> {$posts} </div>
Paste this below it
<!--select all posts--> <div style="position: relative; padding: 10px;" class="modonly inlinepostsall{$mybb->user['usergroup']}"> <div style="position: absolute; right: 5px;"> <input type="checkbox" name="allbox" onclick="inlineModeration.checkAll(this)" /> <input type="button" onclick="inlineModeration.clearChecked();" value="{$lang->clear}" class="button" /> </div> </div> <!--select all posts-->
Now it's above and below all of your posts and it is only available for moderators and administrators!
Edited by Kit the Human