diff options
| author | Michael Save <savetheinternet@tinyboard.org> | 2012-04-12 21:56:01 +1000 |
|---|---|---|
| committer | Michael Save <savetheinternet@tinyboard.org> | 2012-04-12 21:56:01 +1000 |
| commit | a564a95ab40eb1c9cc7de142db60aedb3e749176 (patch) | |
| tree | b94f1e2bdb8996ca31b75f6270930636d3f3fa39 /inc/functions.php | |
| parent | dd0f421015059247464efd5f6d2735c5ee08a400 (diff) | |
Improved Tinyboard anti-bot/spam filter. See large comment in inc/config.php for details.
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/inc/functions.php b/inc/functions.php index 3761b608..da58675c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -13,7 +13,6 @@ require_once 'inc/display.php'; require_once 'inc/template.php'; require_once 'inc/database.php'; require_once 'inc/events.php'; -require_once 'inc/anti-bot.php'; require_once 'inc/lib/gettext/gettext.inc'; // the user is not currently logged in as a moderator @@ -210,6 +209,11 @@ function _syslog($priority, $message) { } } +function create_antibot($board, $thread = null) { + require_once 'inc/anti-bot.php'; + + return _create_antibot($board, $thread); +} function rebuildThemes($action) { // List themes @@ -1175,6 +1179,7 @@ function buildIndex() { $content['pages'] = $pages; $content['pages'][$page-1]['selected'] = true; $content['btn'] = getPageButtons($content['pages']); + $content['antibot'] = create_antibot($board['uri']); file_write($filename, Element('index.html', $content)); if(isset($md5) && $md5 == md5_file($filename)) { @@ -1492,6 +1497,7 @@ function buildThread($id, $return=false, $mod=false) { 'config' => $config, 'id' => $id, 'mod' => $mod, + 'antibot' => $mod ? false : create_antibot($board['uri'], $id), 'boardlist' => createBoardlist($mod), 'return' => ($mod ? '?' . $board['url'] . $config['file_index'] : $config['root'] . $board['uri'] . '/' . $config['file_index']) )); |
