本文整理汇总了PHP中Catalog::build方法的典型用法代码示例。如果您正苦于以下问题:PHP Catalog::build方法的具体用法?PHP Catalog::build怎么用?PHP Catalog::build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Catalog
的用法示例。
在下文中一共展示了Catalog::build方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: catalog_build
function catalog_build($action, $settings, $board)
{
global $config;
$b = new Catalog($settings);
$boards = explode(' ', $settings['boards']);
// Possible values for $action:
// - all (rebuild everything, initialization)
// - news (news has been updated)
// - boards (board list changed)
// - post (a reply has been made)
// - post-thread (a thread has been made)
if ($action === 'all') {
foreach ($boards as $board) {
if ($config['smart_build']) {
file_unlink($config['dir']['home'] . $board . '/catalog.html');
} else {
$b->build($board);
}
}
} elseif (in_array($board, $boards) && $action == 'post-thread' || $settings['update_on_posts'] && $action == 'post' || $settings['update_on_posts'] && $action == 'post-delete') {
if ($config['smart_build']) {
file_unlink($config['dir']['home'] . $board . '/catalog.html');
} else {
$b->build($board);
}
}
// FIXME: Check that Ukko is actually enabled
if ($settings['enable_ukko'] && ($action === 'all' || $action === 'post' || $action === 'post-thread' || $action === 'post-delete')) {
$b->buildUkko();
}
}
示例2: catalog_build
function catalog_build($action, $settings, $board)
{
global $config;
// Possible values for $action:
// - all (rebuild everything, initialization)
// - news (news has been updated)
// - boards (board list changed)
// - post (a reply has been made)
// - post-thread (a thread has been made)
if ($settings['all']) {
$boards = listBoards(TRUE);
} else {
$boards = explode(' ', $settings['boards']);
}
if ($action == 'all') {
foreach ($boards as $board) {
$b = new Catalog();
if ($config['smart_build']) {
file_unlink($config['dir']['home'] . $board . '/catalog.html');
} else {
$b->build($settings, $board);
}
if (php_sapi_name() === "cli") {
echo "Rebuilding {$board} catalog...\n";
}
}
} elseif ($action == 'post-thread' || $settings['update_on_posts'] && $action == 'post' || $settings['update_on_posts'] && $action == 'post-delete' && in_array($board, $boards) | $settings['all']) {
$b = new Catalog();
if ($config['smart_build']) {
file_unlink($config['dir']['home'] . $board . '/catalog.html');
} else {
$b->build($settings, $board);
}
}
}
示例3: catalog_build
function catalog_build($action, $settings, $board)
{
global $config;
// Possible values for $action:
// - all (rebuild everything, initialization)
// - news (news has been updated)
// - boards (board list changed)
// - post (a reply has been made)
// - post-thread (a thread has been made)
$boards = explode(' ', $settings['boards']);
if ($action == 'all') {
foreach ($boards as $board) {
$b = new Catalog();
$b->build($settings, $board);
}
} elseif ($action == 'post-thread' || $settings['update_on_posts'] && $action == 'post' || $settings['update_on_posts'] && $action == 'post-delete' && in_array($board, $boards)) {
$b = new Catalog();
$b->build($settings, $board);
}
}