mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-24 07:30:10 +01:00
Minor $config['try_smarter'] work
This commit is contained in:
parent
7b817eea11
commit
a8e3754375
@ -1306,7 +1306,7 @@ function buildIndex() {
|
|||||||
for ($page = 1; $page <= $config['max_pages']; $page++) {
|
for ($page = 1; $page <= $config['max_pages']; $page++) {
|
||||||
$filename = $board['dir'] . ($page == 1 ? $config['file_index'] : sprintf($config['file_page'], $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))
|
&& !in_array($page, $build_pages) && is_file($filename))
|
||||||
continue;
|
continue;
|
||||||
$content = index($page);
|
$content = index($page);
|
||||||
@ -1352,6 +1352,9 @@ function buildIndex() {
|
|||||||
$jsonFilename = $board['dir'] . 'catalog.json';
|
$jsonFilename = $board['dir'] . 'catalog.json';
|
||||||
file_write($jsonFilename, $json);
|
file_write($jsonFilename, $json);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($config['try_smarter'])
|
||||||
|
$build_pages = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildJavascript() {
|
function buildJavascript() {
|
||||||
|
@ -35,7 +35,7 @@ function load_twig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Element($templateFile, array $options) {
|
function Element($templateFile, array $options) {
|
||||||
global $config, $debug, $twig;
|
global $config, $debug, $twig, $build_pages;
|
||||||
|
|
||||||
if (!$twig)
|
if (!$twig)
|
||||||
load_twig();
|
load_twig();
|
||||||
@ -51,6 +51,8 @@ function Element($templateFile, array $options) {
|
|||||||
unset($debug['start']);
|
unset($debug['start']);
|
||||||
unset($debug['start_debug']);
|
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['included'] = get_included_files();
|
||||||
$debug['memory'] = round(memory_get_usage(true) / (1024 * 1024), 2) . ' MiB';
|
$debug['memory'] = round(memory_get_usage(true) / (1024 * 1024), 2) . ' MiB';
|
||||||
$options['body'] .=
|
$options['body'] .=
|
||||||
|
2
post.php
2
post.php
@ -682,7 +682,7 @@ if (isset($_POST['delete'])) {
|
|||||||
incrementSpamHash($post['antispam_hash']);
|
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();
|
$insert_rows = array();
|
||||||
foreach ($post['tracked_cites'] as $cite) {
|
foreach ($post['tracked_cites'] as $cite) {
|
||||||
$insert_rows[] = '(' .
|
$insert_rows[] = '(' .
|
||||||
|
Loading…
Reference in New Issue
Block a user