getAllBlocksByGroup($xoopsUser->getGroups(), true, $side, XOOPS_BLOCK_VISIBLE); } else { $block_arr =& $xoopsblock->getAllBlocksByGroup(XOOPS_GROUP_ANONYMOUS, true, $side, XOOPS_BLOCK_VISIBLE); } $block_count = count($block_arr); if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) { include_once XOOPS_ROOT_PATH.'/class/template.php'; $xoopsTpl = new XoopsTpl(); } else { $xoopsTpl =& $GLOBALS['xoopsTpl']; } $xoopsLogger =& XoopsLogger::instance(); for ($i = 0; $i < $block_count; $i++) { $bcachetime = intval($block_arr[$i]->getVar('bcachetime')); if (empty($bcachetime)) { $xoopsTpl->xoops_setCaching(0); } else { $xoopsTpl->xoops_setCaching(2); $xoopsTpl->xoops_setCacheTime($bcachetime); } $btpl = $block_arr[$i]->getVar('template'); if ($btpl != '') { if (empty($bcachetime) || !$xoopsTpl->is_cached('db:'.$btpl)) { $xoopsLogger->addBlock($block_arr[$i]->getVar('name')); $bresult =& $block_arr[$i]->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('block', $bresult); $bcontent =& $xoopsTpl->fetch('db:'.$btpl); $xoopsTpl->clear_assign('block'); } else { $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime); $bcontent =& $xoopsTpl->fetch('db:'.$btpl); } } else { $bid = $block_arr[$i]->getVar('bid'); if (empty($bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html', 'blk_'.$bid)) { $xoopsLogger->addBlock($block_arr[$i]->getVar('name')); $bresult =& $block_arr[$i]->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('dummy_content', $bresult['content']); $bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_'.$bid); $xoopsTpl->clear_assign('block'); } else { $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime); $bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_'.$bid); } } switch ($block_arr[$i]->getVar('side')) { case XOOPS_SIDEBLOCK_LEFT: themesidebox($block_arr[$i]->getVar('title'), $bcontent); break; case XOOPS_SIDEBLOCK_RIGHT: if (function_exists("themesidebox_right")) { themesidebox_right($block_arr[$i]->getVar('title'), $bcontent); } else { themesidebox($block_arr[$i]->getVar('title'), $bcontent); } break; } unset($bcontent); } } /* * Function to display center block */ function make_cblock() { global $xoopsUser, $xoopsOption; $xoopsblock = new XoopsBlock(); $cc_block = $cl_block = $cr_block = ""; $arr = array(); if ($xoopsOption['theme_use_smarty'] == 0) { if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) { include_once XOOPS_ROOT_PATH.'/class/template.php'; $xoopsTpl = new XoopsTpl(); } else { $xoopsTpl =& $GLOBALS['xoopsTpl']; } if (is_object($xoopsUser)) { $block_arr =& $xoopsblock->getAllBlocksByGroup($xoopsUser->getGroups(), true, XOOPS_CENTERBLOCK_ALL, XOOPS_BLOCK_VISIBLE); } else { $block_arr =& $xoopsblock->getAllBlocksByGroup(XOOPS_GROUP_ANONYMOUS, true, XOOPS_CENTERBLOCK_ALL, XOOPS_BLOCK_VISIBLE); } $block_count = count($block_arr); $xoopsLogger =& XoopsLogger::instance(); for ($i = 0; $i < $block_count; $i++) { $bcachetime = intval($block_arr[$i]->getVar('bcachetime')); if (empty($bcachetime)) { $xoopsTpl->xoops_setCaching(0); } else { $xoopsTpl->xoops_setCaching(2); $xoopsTpl->xoops_setCacheTime($bcachetime); } $btpl = $block_arr[$i]->getVar('template'); if ($btpl != '') { if (empty($bcachetime) || !$xoopsTpl->is_cached('db:'.$btpl)) { $xoopsLogger->addBlock($block_arr[$i]->getVar('name')); $bresult =& $block_arr[$i]->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('block', $bresult); $bcontent =& $xoopsTpl->fetch('db:'.$btpl); $xoopsTpl->clear_assign('block'); } else { $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime); $bcontent =& $xoopsTpl->fetch('db:'.$btpl); } } else { $bid = $block_arr[$i]->getVar('bid'); if (empty($bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html', 'blk_'.$bid)) { $xoopsLogger->addBlock($block_arr[$i]->getVar('name')); $bresult =& $block_arr[$i]->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('dummy_content', $bresult['content']); $bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_'.$bid); $xoopsTpl->clear_assign('block'); } else { $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime); $bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_'.$bid); } } $title = $block_arr[$i]->getVar('title'); switch ($block_arr[$i]->getVar('side')) { case XOOPS_CENTERBLOCK_CENTER: if ($title != "") { $cc_block .= ''.$title.'
'.$bcontent.'

'."\n"; } else { $cc_block .= ''.$bcontent.'

'."\n"; } break; case XOOPS_CENTERBLOCK_LEFT: if ($title != "") { $cl_block .= '

'.$title.'


'.$bcontent.'

'."\n"; } else { $cl_block .= '

'.$bcontent.'

'."\n"; } break; case XOOPS_CENTERBLOCK_RIGHT: if ($title != "") { $cr_block .= '

'.$title.'


'.$bcontent.'

'."\n"; } else { $cr_block .= '

'.$bcontent.'

'."\n"; } break; default: break; } unset($bcontent, $title); } echo ''.$cc_block.'
'.$cl_block.''.$cr_block.'
'."\n"; } } function openThread($width="100%") { echo "
"; } function showThread($color_number, $subject_image, $subject, $text, $post_date, $ip_image, $reply_image, $edit_image, $delete_image, $username="", $rank_title="", $rank_image="", $avatar_image="", $reg_date="", $posts="", $user_from="", $online_image="", $profile_image="", $pm_image="", $email_image="", $www_image="", $icq_image="", $aim_image="", $yim_image="", $msnm_image="") { if ( $color_number == 1 ) { $bg = 'bg1'; } else { $bg = 'bg3'; } echo ""; echo ""; echo ""; } function closeThread() { echo '
". _CM_POSTER ."". _CM_THREAD ."
$username
$rank_title
$rank_image
$avatar_image

$reg_date
$posts
$user_from

$online_image
"; echo "
$subject_image $subject".$ip_image."".$reply_image."".$edit_image."".$delete_image."

$text

$post_date".$profile_image."".$pm_image."".$email_image."".$www_image."".$icq_image."".$aim_image."".$yim_image."".$msnm_image."
'; } ?>