remove spams quicker

This commit is contained in:
Claude 2013-04-13 20:35:49 +02:00
parent e30e26a159
commit ea7e475070
3 changed files with 29 additions and 9 deletions

View File

@ -159,7 +159,7 @@ h4 {
margin-bottom: 10px;
}
.form_wrapper .hidden {
.hidden {
display: none;
}
@ -325,6 +325,10 @@ h4 {
width: 100px;
}
.recent .qr {
width: 20px;
}
.recent .hits {
width: 70px;
}

View File

@ -1,11 +1,5 @@
var ST = window.ST || {}
ST.init = function() {
ST.change();
ST.expand();
ST.show_embed();
};
ST.change = function() {
$('.change').oneTime(3000,
function() {
@ -46,6 +40,28 @@ ST.expand = function() {
});
};
ST.spamadmin = function() {
if ($('.content h1').text() == 'Spamadmin') {
$('.content .hidden').show();
$('.content .quick_remove').live('click', function(ev) {
var ip = $(ev.target).data('ip');
if (confirm('Delete all pastes belonging to ' + ip + '?')) {
$.post(base_url + 'spamadmin/' + ip, { 'confirm_remove': 'yes', 'block_ip': 1 }, function() {
window.location.reload();
});
}
return false;
});
}
};
ST.init = function() {
ST.change();
ST.expand();
ST.show_embed();
ST.spamadmin();
};
$(document).ready(function() {
ST.init();
});

View File

@ -13,9 +13,9 @@
<tr>
<th class="title">Title</th>
<th class="name">Name</th>
<th class="lang">Language</th>
<th class="time">When</th>
<th class="time">IP</th>
<th title="Quick remove" class="qr hidden">X</th>
</tr>
<?php foreach($pastes as $paste) {
if(checkNum($n) == TRUE) {
@ -29,9 +29,9 @@
<tr class="<?php echo $eo; ?>">
<td class="first"><a href="<?php echo site_url("view/".$paste['pid']); ?>"><?php echo $paste['title']; ?></a></td>
<td><?php echo $paste['name']; ?></td>
<td><?php echo $paste['lang']; ?></td>
<td><?php $p = explode(",", timespan($paste['created'], time())); echo $p[0]; ?> ago.</td>
<td><a href="<?php echo site_url('spamadmin/' . $paste['ip_address']) ?>"><?php echo $paste['ip_address']; ?></a></td>
<td class="hidden"><a class="quick_remove" title="Quickly remove all entries with this IP" data-ip="<?php echo $paste['ip_address']; ?>" href="">X</a></td>
</tr>
<?php }?>