miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

Toggle all checkboxes (to mass-move or mass-delete messages)

Author tom322
Registered
#1 | Posted: 11 Apr 2014 00:11 | Edited by: tom322 
For heavy forum users (especially moderators/admins;), here is a little script you can add to your Mass Move link (or as a separate link) to create a checkbox and set/unset all checkboxes with one click. It can be useful not only for mass moving but also mass deleting of posts. All you have to do is to open bb_plugins.php, find: $massMoveLink and extend it to the code in bold:

$massMoveLink="{$l_sepr} <a href=\"JavaScript:massMove();\">{$l_moveMass}</a> <script>function toggle(source){checkboxes = document.getElementsByName('deleteAll[]');for(var i=0, n=checkboxes.length;i<n;i++) {checkboxes[i].checked = source.checked;}}</script><label><input type=\"checkbox\" onClick=\"toggle(this);\" />Toggle All</label>";


Author Jaime
Registered
#2 | Posted: 12 Apr 2014 08:39 
Thanks Tom, it works! But in the first line of the original code at the end, you have to make sure the signs "; to delete. Not that anybody now the code just expanded ... it is then expected when calling the forum a blank page :)

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications / Toggle all checkboxes (to mass-move or mass-delete messages) Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB