Report message:*
 

block engine with IPF

Subject: block engine with IPF
by sato-san on 2012/10/30 22:03:52

Hello,

I added the block engine within my theme to load block_id's, but the code is not full IPF compatible.
How should I use the icms_core_BlockHandler in this example?

<?php $icms_block_handler = xoops_gethandler('block'); $xobject = $icms_block_handler->get($block_id, TRUE); $template = new icms_view_Tpl(); $block = array( 'id' => $xobject->getVar( 'bid' ), 'module' => $xobject->getVar( 'dirname' ), 'title' => $xobject->getVar( 'title' ), 'weight' => $xobject->getVar( 'weight' ), 'lastmod' => $xobject->getVar( 'last_modified' ), ); $tplName = ( $tplName = $xobject->getVar('template') ) ? "db:$tplName" : "db:system_block_dummy.html"; if ( $bresult = $xobject->buildBlock() ) { $template->assign( 'block', $bresult ); $block['content'] = $template->fetch($tplName); } else { $block = FALSE; } $this->assign('block', $block); ?>