Jump to content

Add a Select All Button in Showthread
   (1 review)

Kit the Human
  • Would it be easier for you to select all posts in a thread for moderating? This functionality can be useful when you want to mod nearly all of the posts in a thread, leaving some of them unmodded. 

    Type: Other Software: MyBB

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





User Feedback

Create an account or sign in to leave a review

You need to be a member in order to leave a review

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Arasnia

  

Who would think that this issue is so easy to solve! <.< Thanks that looks so much better ! 

Share this review


Link to review

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.