1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-27 17:00:52 +01:00

Minor $config['try_smarter'] work

This commit is contained in:
Michael Foster 2013-08-29 18:55:25 +10:00
parent 7b817eea11
commit a8e3754375
3 changed files with 8 additions and 3 deletions

View File

@ -1306,7 +1306,7 @@ function buildIndex() {
for ($page = 1; $page <= $config['max_pages']; $page++) {
$filename = $board['dir'] . ($page == 1 ? $config['file_index'] : sprintf($config['file_page'], $page));
if ($config['try_smarter'] && isset($build_pages) && count($build_pages)
if ($config['try_smarter'] && isset($build_pages) && !empty($build_pages)
&& !in_array($page, $build_pages) && is_file($filename))
continue;
$content = index($page);
@ -1352,6 +1352,9 @@ function buildIndex() {
$jsonFilename = $board['dir'] . 'catalog.json';
file_write($jsonFilename, $json);
}
if ($config['try_smarter'])
$build_pages = array();
}
function buildJavascript() {

View File

@ -35,7 +35,7 @@ function load_twig() {
}
function Element($templateFile, array $options) {
global $config, $debug, $twig;
global $config, $debug, $twig, $build_pages;
if (!$twig)
load_twig();
@ -51,6 +51,8 @@ function Element($templateFile, array $options) {
unset($debug['start']);
unset($debug['start_debug']);
}
if ($config['try_smarter'] && isset($build_pages) && !empty($build_pages))
$debug['build_pages'] = $build_pages;
$debug['included'] = get_included_files();
$debug['memory'] = round(memory_get_usage(true) / (1024 * 1024), 2) . ' MiB';
$options['body'] .=

View File

@ -682,7 +682,7 @@ if (isset($_POST['delete'])) {
incrementSpamHash($post['antispam_hash']);
}
if (isset($post['tracked_cites']) && count($post['tracked_cites'])) {
if (isset($post['tracked_cites']) && !empty($post['tracked_cites'])) {
$insert_rows = array();
foreach ($post['tracked_cites'] as $cite) {
$insert_rows[] = '(' .