mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-17 19:29:28 +01:00
add a global_api variable for buildIndex
This commit is contained in:
parent
453ecfdc6b
commit
3f381ee569
@ -1498,7 +1498,7 @@ function checkMute() {
|
||||
}
|
||||
}
|
||||
|
||||
function buildIndex() {
|
||||
function buildIndex($global_api = "yes") {
|
||||
global $board, $config, $build_pages;
|
||||
|
||||
$pages = getPages();
|
||||
@ -1513,8 +1513,8 @@ 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['api']['enabled'] && $config['try_smarter'] && isset($build_pages) && !empty($build_pages)
|
||||
&& !in_array($page, $build_pages) )
|
||||
if (!$config['api']['enabled'] && $global_api != "skip" && $config['try_smarter'] && isset($build_pages)
|
||||
&& !empty($build_pages) && !in_array($page, $build_pages) )
|
||||
continue;
|
||||
$content = index($page);
|
||||
if (!$content)
|
||||
@ -1530,8 +1530,8 @@ function buildIndex() {
|
||||
$catalog[$page-1] = $threads;
|
||||
}
|
||||
|
||||
if ($config['api']['enabled'] && $config['try_smarter'] && isset($build_pages) && !empty($build_pages)
|
||||
&& !in_array($page, $build_pages) )
|
||||
if ($config['api']['enabled'] && $global_api == "skip" && $config['try_smarter'] && isset($build_pages)
|
||||
&& !empty($build_pages) && !in_array($page, $build_pages) )
|
||||
continue;
|
||||
|
||||
if ($config['try_smarter']) {
|
||||
@ -1560,7 +1560,7 @@ function buildIndex() {
|
||||
}
|
||||
|
||||
// json api catalog
|
||||
if ($config['api']['enabled']) {
|
||||
if ($config['api']['enabled'] && $global_api != "skip") {
|
||||
$json = json_encode($api->translateCatalog($catalog));
|
||||
$jsonFilename = $board['dir'] . 'catalog.json';
|
||||
file_write($jsonFilename, $json);
|
||||
|
Loading…
x
Reference in New Issue
Block a user