We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Report Control Panel
Topic Started: Sep 3 2015, 05:11 PM (322 Views)
lala1993
Member
[ *  * ]
Board Address: (Link to your board) Private
Board Software: (ZetaBoards or zIFBoards) Zetaboard
Description: (What you want your code to do) I want select all button reported posts move to trash can. I get fed up deleting bunch of posts one at time.
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Admin CP >> Board Template >> Below the Board
Code:
 
<script type="text/javascript">
if (location.href === main_url + 'report/') {
var $this = $('#rcp_post_list');
while (!$this.parent('#main').length) {
$this = $this.parent();
}
$this.before('<button type="button" id="trash_reported_posts">Trash Reported Posts</button>');

$('#trash_reported_posts').click(function() {
$('#rcp_post_list tbody tr[class*="row"]:lt(10)').each(function() {
var $that = $(this);
var $link = $that.find('td:first a[href*="/report/"]').attr('href');
$.get($link + '?force_ads', function(data) {
$('#rcp_action_options tbody', data).find('select[name="post_action"]', data).val('trash');
var $form = $('form:has(#rcp_action_options)', data);
$.ajax({
type: "POST",
url: $form.attr('action'),
data: $form.serialize().replace('post_action=0', 'post_action=trash'),
success: function() {
$that.fadeOut('slow');
}
});
});
});
});
}
</script>
This code adds a button above the Reported Posts category. Click it once and it should get ride of 10 of the reported posts and send them to the trash. Once the first 10 are gone, you may click again to get rid of 10 more.
Offline Profile Goto Top
 
lala1993
Member
[ *  * ]
Thank you so much!!!!!
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

I assume that means it works on your board?
Offline Profile Goto Top
 
lala1993
Member
[ *  * ]
DaPizzaMan
Sep 10 2015, 09:59 PM
I assume that means it works on your board?
Yes the code does work on my board.

Thanks!
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Perfect! I'm glad you like it. :)

Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic