xoops_block plugin and D3 module's block(1)

Date 2007-03-28 05:36:49 | Category: XOOPS

in englishin japanese
For describing some text into theme, a smarty plugin "tinyD" has been used well.
TinyD plugin
I have to make a plugin for pico, because I marked TinyD "dead-end".
Refer the code of bottom.

But I remember more versatile plugin "xoops_block" made by Tom_G3X.
xoops_block plugin

This plugin reassigns block's assignment.
This spec must be useful for professionals.

But, blocks of D3 modules returns not a assignment but a content rendered by XoopsTpl already.

I have to modify the spec of blocks of D3 modules for such purpose.
class/smarty/plugins/function.pico.php

<?php
function smarty_function_pico( $params , &$smarty )
{
	$dirname = @$params['dir'] . @$params['dirname'] ;
	$content_id = @$params['id'] + @$params['content_id'] ;
	$template = @$params['template'] ;

	if( empty( $dirname ) ) {
		echo 'error smarty_function_pico [specify dir]';
		return ;
	} else if( empty( $content_id ) ) {
		echo 'error smarty_function_pico [specify id]';
		return ;
	}

	require_once XOOPS_TRUST_PATH.'/modules/pico/include/common_functions.php' ;
	require_once XOOPS_TRUST_PATH.'/modules/pico/blocks/content.php' ;

	$block = b_pico_content_show( array( $dirname , $content_id , $template ) ) ;

	echo @$block['content'];
}
?>

USAGE: <{pico dir="pico" id="1"}>



You can read more news at PEAK XOOPS.
http://xoops.peak.ne.jp

The URL for this story is:
http://xoops.peak.ne.jp/md/news/index.php?page=article&storyid=415