Show "most recent" in anti-spam debug page

This commit is contained in:
Michael Save 2013-01-24 19:25:07 +11:00
parent 85710249b7
commit 060be53797
2 changed files with 45 additions and 0 deletions

View File

@ -1764,6 +1764,9 @@ function mod_debug_antispam() {
$query = query('SELECT * FROM `antispam` ' . ($where ? "WHERE $where" : '') . ' ORDER BY `passed` DESC LIMIT 40') or error(db_error()); $query = query('SELECT * FROM `antispam` ' . ($where ? "WHERE $where" : '') . ' ORDER BY `passed` DESC LIMIT 40') or error(db_error());
$args['top'] = $query->fetchAll(PDO::FETCH_ASSOC); $args['top'] = $query->fetchAll(PDO::FETCH_ASSOC);
$query = query('SELECT * FROM `antispam` ' . ($where ? "WHERE $where" : '') . ' ORDER BY `created` DESC LIMIT 20') or error(db_error());
$args['recent'] = $query->fetchAll(PDO::FETCH_ASSOC);
mod_page(_('Debug: Anti-spam'), 'mod/debug/antispam.html', $args); mod_page(_('Debug: Anti-spam'), 'mod/debug/antispam.html', $args);
} }

View File

@ -1,4 +1,45 @@
<p style="text-align:center"> <p style="text-align:center">
Most recent:
</p>
<table class="modlog" style="width:700px;margin:auto">
<tr>
<th>Board</th>
<th>Thread</th>
<th>Hash (SHA1)</th>
<th>Created</th>
<th>Expires</th>
<th>Passed</th>
</tr>
{% for hash in recent %}
<tr>
<td>{{ config.board_abbreviation|sprintf(hash.board) }}</td>
<td>
{% if hash.thread %}
{{ hash.thread }}
{% else %}
-
{% endif %}</td>
<td>
<small><code>{{ hash.hash }}</code></small>
</td>
<td>
<span title="{{ hash.created|date(config.post_date) }}">{{ hash.created|ago }} ago</span>
</td>
<td>
{% if hash.expires %}
<span title="{{ hash.expires|date(config.post_date) }}">
{{ hash.expires|until }}
</span>
{% else %}
-
{% endif %}
</td>
<td>{{ hash.passed }}</td>
</tr>
{% endfor %}
</table>
<p style="text-align:center">
Most used (in active): Most used (in active):
</p> </p>
<table class="modlog" style="width:700px;margin:auto"> <table class="modlog" style="width:700px;margin:auto">
@ -38,6 +79,7 @@
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
<p style="text-align:center"> <p style="text-align:center">
Total: <strong>{{ total }}</strong> (<strong>{{ expiring }}</strong> set to expire) Total: <strong>{{ total }}</strong> (<strong>{{ expiring }}</strong> set to expire)
</p> </p>