当前位置: 首页>>代码示例>>PHP>>正文


PHP Catalog::build方法代码示例

本文整理汇总了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();
    }
}
开发者ID:anastiel,项目名称:lainchan,代码行数:31,代码来源:theme.php

示例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);
        }
    }
}
开发者ID:odilitime,项目名称:infinity,代码行数:35,代码来源:theme.php

示例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);
    }
}
开发者ID:vicentil,项目名称:vichan,代码行数:20,代码来源:theme.php


注:本文中的Catalog::build方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。