PEAK XOOPS - Re: EMLH smarty plugin and smarty default_modifiers in englishin japanese

Re: EMLH smarty plugin and smarty default_modifiers

List posts in the topic

question Re: EMLH smarty plugin and smarty default_modifiers

msg# 1.1
depth:
1
Previous post - Next post | Parent - Children.1 | Posted on 2005/6/20 15:06
domifara  Private 1st Class   Posts: 19
Re: EMLH smarty plugin and smarty default_modifiers


The one to call easiestml as an edit plug-in of the template was tested making it.

Reason to make this
'Management of content of article'

for the omission
ext.
en , ja , zh

if I writed
[en] [ja]
only lang tag articles
,
when lang tag is zh
too
display
[en] lang tag article

html/class/smarty/plugins/modifier.domi_easiestml.php
function smarty_modifier_domi_easiestml($str)
{
	//option initialize
	if (!isset($str)) {
	    return $str;
	}
	if (empty($str) || !is_string($str)) {
	    return $str;
	}
	global $easiestml_lang;
	if (function_exists('easiestml') && isset($easiestml_lang) && defined( 'EASIESTML_LANGS' )) {
		$original_easiestml_lang = $easiestml_lang ;
		$easiestml_langs = explode( ',' , EASIESTML_LANGS ) ;
		if ($easiestml_lang != $easiestml_langs[0] && !preg_match('/\['.preg_quote($easiestml_lang).'\]/i' , $str)) {
			$easiestml_lang = $easiestml_langs[0] ;
		}
		$str = easiestml($str);
		$easiestml_lang = $original_easiestml_lang ;
	}
    return $str;
}


html/class/template.php
Constructor
function XoopsTpl
about last lines  add line

$this->default_modifiers = array('domi_easiestml'); 


html/class/template.php
//	ob_start( 'easiestml' ) ;
Votes:5 Average:4.00

Posts tree

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!