MyBB Community Forums

Full Version: Select all posts in a thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys,

I often have threads with 100+ unapproved posts, and when I want to approve them all, I have to select each post individually, what a pain... Even using the ModCP to "select all posts" is of no use, because there are some threads with unppaorved posts that I wanna keep unapproved.

Is there a way to select all posts in a thread automatically? 

For threads in a forum, somehting like that already exists: Once you select all threads on one page, an option appears to select all threads in the entire (Sub)Forum. 

Why is something like that not included for posts? Or why is there no modtool "select all posts" or somehting like that? I hope that I just never noticed how this works for posts, else this is a pretty incomprehensible flaw of mybb 1.6. 

Please let me know if there is a way to accomplish this, be it core code change or plugin. 

Thanks Smile
you can try using a bookmarklet - something like below
javascript:(function(){function%20checkFrames(w)%20{try%20{var%20inputs%20=%20w.document.getElementsByTagName('input');for%20(var%20i=0;%20i%20<%20inputs.length;%20i++)%20{if%20(inputs[i].type%20&&%20inputs[i].type%20==%20'checkbox'){inputs[i].checked%20=%20!inputs[i].checked;}}}%20catch%20(e){}if(w.frames%20&&%20w.frames.length>0){for(var%20i=0;i<w%20.frames.length;i++){var%20fr=w.frames[i];checkFrames(fr);}}}checkFrames(window);})()
(2014-12-10, 02:13 PM).m. Wrote: [ -> ]you can try using a bookmarklet - something like below


javascript:(function(){function%20checkFrames(w)%20{try%20{var%20inputs%20=%20w.document.getElementsByTagName('input');for%20(var%20i=0;%20i%20<%20inputs.length;%20i++)%20{if%20(inputs[i].type%20&&%20inputs[i].type%20==%20'checkbox'){inputs[i].checked%20=%20!inputs[i].checked;}}}%20catch%20(e){}if(w.frames%20&&%20w.frames.length>0){for(var%20i=0;i<w%20.frames.length;i++){var%20fr=w.frames[i];checkFrames(fr);}}}checkFrames(window);})()

I'm not familiar how to work with bookmarklets or javascript on a browser. 

When I open the developer tools in chrome and try to run that function in the console, an error occurs:

[attachment=33239]
which browser you use
you can add the code as a regular bookmark with a name (eg. toggle all) and click on it when you are viewing a thread
(2014-12-10, 03:08 PM).m. Wrote: [ -> ]which browser you use 
you can add the code as a regular bookmark with a name (eg. toggle all) and click on it when you are viewing a thread 


I did that and it worked in terms of adding a "select sign" to all post check boxes, but it didnt work in terms of "telling mybb, that all posts are selected". To be precise:

1.) The post background is not yellow (which always indicates that you have selected a post)
2.) Nor does the amount of posts show in the mod tools at the bottom of the thread (it still says (0), when I try to run the "approve post" mod tool, it says that I havent selected any posts.)

You understand what I mean? Let's say the javascript ticked the post selection box, but it had no influence on the thread/posts whatsoever. Wink
^ hmm., yes, that is not working! I'll try again and inform if I get positive result
Thank you, I appreciate the effort Smile