diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-03 17:42:34 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-03 17:42:34 -0400 |
| commit | a3fbff225927469e68efc7ab31977736f34c7480 (patch) | |
| tree | 4f2694678c08c1b859b88b53a08827b49dca720d /inc | |
| parent | f7d068536a874d25d6d645150e6ceb027c855e9b (diff) | |
Update $config['try_smarter']. Should be working now.
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/config.php | 3 | ||||
| -rw-r--r-- | inc/functions.php | 13 |
2 files changed, 12 insertions, 4 deletions
diff --git a/inc/config.php b/inc/config.php index 120f3865..15af9661 100644 --- a/inc/config.php +++ b/inc/config.php @@ -262,7 +262,8 @@ 'recaptcha_challenge_field', 'recaptcha_response_field', 'spoiler', - 'quick-reply' + 'quick-reply', + 'page' ); // Enable reCaptcha to make spam even harder. Rarely necessary. diff --git a/inc/functions.php b/inc/functions.php index b6862444..309546ef 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -841,11 +841,14 @@ function post(array $post) { } function bumpThread($id) { - global $board; + global $config, $board, $build_pages; if (event('bump', $id)) return true; + if ($config['try_smarter']) + $build_pages[] = thread_find_page($id); + $query = prepare(sprintf("UPDATE ``posts_%s`` SET `bump` = :time WHERE `id` = :id AND `thread` IS NULL", $board['uri'])); $query->bindValue(':time', time(), PDO::PARAM_INT); $query->bindValue(':id', $id, PDO::PARAM_INT); @@ -1274,7 +1277,8 @@ function buildIndex() { global $board, $config, $build_pages; $pages = getPages(); - $antibot = create_antibot($board['uri']); + if (!$config['try_smarter']) + $antibot = create_antibot($board['uri']); for ($page = 1; $page <= $config['max_pages']; $page++) { $filename = $board['dir'] . ($page == 1 ? $config['file_index'] : sprintf($config['file_page'], $page)); @@ -1285,8 +1289,11 @@ function buildIndex() { if (!$content) break; + if ($config['try_smarter']) { + $antibot = create_antibot($board['uri'], 0 - $page); + $content['current_page'] = $page; + } $antibot->reset(); - $content['pages'] = $pages; $content['pages'][$page-1]['selected'] = true; $content['btn'] = getPageButtons($content['pages']); |
