ご注意:既にこの方法を用いなくても、携帯対応レンダーでテーマ下テンプレートが使用できるようになっています。
携帯対応レンダー(XOOPS マニア)を使って、XC2.0のサイトを携帯対応する場合に、テーマ下テンプレートを使用する方法です。<?php
function smarty_function_assign_replace($params, &$smarty)
{
$text = isset( $params['text'] ) ? $params['text'] : "" ;
$replace1 = isset( $params['replace1'] ) ? $params['replace1'] : "" ;
$replace2 = isset( $params['replace2'] ) ? $params['replace2'] : "" ;
$replaced_text = str_replace($replace1, $replace2, $text);
$smarty->assign('replaced_text', $replaced_text);
}
?>
<{if $smarty.const.HYP_K_TAI_RENDER}>
<{assign_replace text=$smarty.template replace1='db:' replace2=''}>
<{include file="`$xoops_rootpath`/themes/mobile/templates/`$replaced_text`"}>
<{else}>
PCの場合のテンプレートをここに残す。
<{/if}>