Exemple #1
0
            $gStructure->loadPath();
            $gBitSmarty->assign('structureInfo', $gStructure->mInfo);
        }
    }
}
if ($gStructure and !empty($gStructure->mInfo['structure_path'])) {
    $secondbox = 0;
    $tree = 1;
    $gStructure->mInfo['structure_path'][0]['structure_id'];
    if ($gStructure->mInfo['parent']['structure_id'] == 4) {
        $sidebox = $gStructure->mInfo['content_id'] - 3;
    } elseif ($gStructure->mInfo['parent']['content_id'] > 4) {
        $sidebox = $gStructure->mInfo['parent']['content_id'] - 3;
    } else {
        $sidebox = 1;
    }
    if ($gStructure->mInfo['content_id'] != 4) {
        $menu = $gStructure->buildTreeToc($tree);
        $gBitSmarty->assignByRef('menu', $menu[0]['sub']);
        $gBitSmarty->assign('sidebox', $sidebox);
        if ($secondbox) {
            $secondmenu = $gStructure->buildTreeToc($secondbox);
            $gBitSmarty->assignByRef('secondmenu', $secondmenu[0]['sub']);
        }
    }
} else {
    require_once LIBERTY_PKG_PATH . 'LibertyStructure.php';
    $gStructure = new LibertyStructure(1);
    $menu = $gStructure->buildTreeToc(1);
    $gBitSmarty->assignByRef('menu', $menu[0]['sub']);
}
Exemple #2
0
 *
 * @package wiki
 * @subpackage functions
 */
/**
 * required setup
 */
require_once '../kernel/setup_inc.php';
require_once WIKI_PKG_PATH . 'BitBook.php';
$book = new BitBook();
$gSiteMapHash = array();
$listHash = array();
if ($bookList = $book->getList($listHash)) {
    foreach ($bookList['data'] as $bookHash) {
        $bookStructure = new LibertyStructure($bookHash['structure_id']);
        $listBook = $bookStructure->buildTreeToc($bookHash['structure_id']);
        process_book_list($listBook);
    }
}
function process_book_list($pList, $pDepth = 1)
{
    global $gSiteMapHash;
    foreach (array_keys($pList) as $key) {
        if (!empty($pList[$key]['display_url'])) {
            $hash = array();
            $hash['loc'] = BIT_BASE_URI . $pList[$key]['display_url'];
            $hash['lastmod'] = date('Y-m-d', $pList[$key]['last_modified']);
            if (time() - $pList[$key]['last_modified'] < 86400) {
                $freq = 'daily';
            } elseif (time() - $pList[$key]['last_modified'] < 86400 * 7) {
                $freq = 'weekly';