function b_cubeUtils_igoogle_show($options)
{
    require_once dirname(dirname(__FILE__)) . '/include/blockFunc.inc.php';
    $bid = intval($options[0]);
    $result = cubeUtils_GetBlock($bid);
    $result['bid'] = $bid;
    return $result;
}
Exemple #2
0
$mode = !empty($_GET['mode']) ? intval($_GET['mode']) : '';
$content = '';
$preflist = '';
$blockHandler =& xoops_gethandler('block');
$blockObjects = $blockHandler->getAllBlocksByGroup(XOOPS_GROUP_ANONYMOUS);
$blockCount = 0;
foreach ($blockObjects as $blockObject) {
    if ($blockObject->getVar('mid') == $GLOBALS['xoopsModule']->getVar('mid') && $blockObject->getVar('show_func') == 'b_cubeUtils_igoogle_show') {
        $block_type = $blockObject->getVar("block_type");
        $name = $blockObject->getVar("name");
        $blockCount++;
        if ($mode == 'raw' && $up_block == $blockObject->getVar('bid')) {
            $bid = $blockObject->getVar('options');
            $bid = explode('|', $bid);
            $bid = $bid[0];
            $resut = cubeUtils_GetBlock($bid, $useCache = true);
            $content = xoops_utf8_encode($resut['content']);
        } else {
            $bid = $blockObject->getVar('bid');
            $preflist .= '<EnumValue value="' . $bid . '" display_value="[' . $bid . ']' . xoops_utf8_encode($name) . '" />';
        }
    }
}
if ($blockCount == 0) {
    header('HTTP/1.0 404 Not Found');
    exit('404 Not Found');
}
if (!empty($_GET['mode']) && $_GET['mode'] === 'raw') {
    $refresh = !empty($_GET['up_refresh']) ? intval($_GET['up_refresh']) : 600;
    if ($refresh < 300) {
        $refresh = 300;