diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 5af6dc10..ce7bdffb 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2328,11 +2328,21 @@ function mod_debug_recent_posts() { $query = query($query) or error(db_error()); $posts = $query->fetchAll(PDO::FETCH_ASSOC); + // Fetch recent posts from flood prevention cache + $query = query("SELECT * FROM ``flood`` ORDER BY `time` DESC") or error(db_error()); + $flood_posts = $query->fetchAll(PDO::FETCH_ASSOC); + foreach ($posts as &$post) { $post['snippet'] = pm_snippet($post['body']); + foreach ($flood_posts as $flood_post) { + if ($flood_post['time'] == $post['time'] && + $flood_post['posthash'] == make_comment_hex($post['body_nomarkup']) && + $flood_post['filehash'] == $post['filehash']) + $post['in_flood_table'] = true; + } } - mod_page(_('Debug: Recent posts'), 'mod/debug/recent_posts.html', array('posts' => $posts)); + mod_page(_('Debug: Recent posts'), 'mod/debug/recent_posts.html', array('posts' => $posts, 'flood_posts' => $flood_posts)); } function mod_debug_sql() { diff --git a/templates/mod/debug/antispam.html b/templates/mod/debug/antispam.html index 95aa61a6..9979a093 100644 --- a/templates/mod/debug/antispam.html +++ b/templates/mod/debug/antispam.html @@ -14,11 +14,14 @@
{{ hash.hash }}
{{ hash.hash }}
+ Flood prevention cache: +
+# | +Time | +Board | +Post hash | +File hash | +
---|---|---|---|---|
{{ post.id }} | ++ {{ post.time | ago }} ago + | ++ + {{ config.board_abbreviation|sprintf(post.board) }} + + | +{{ post.posthash }} |
+
+ {% if post.filehash %}
+ {{ post.filehash }}
+ {% else %}
+ No file
+ {% endif %}
+ |
+
+ Most recent {{ posts|count }} posts: +
Time | @@ -12,11 +49,13 @@|||
---|---|---|---|
+ | {{ post.time | ago }} ago | - {{ config.board_abbreviation|sprintf(post.board) }} + + {{ config.board_abbreviation|sprintf(post.board) }} + | {% if post.thread %} |