PEAK XOOPS - EMLHの要望 in englishin japanese

EMLHの要望

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum

question EMLHの要望

msg# 1
Previous post - Next post | Parent - Children.1 | Posted on 2005/4/25 11:34
Nu-nrg  Private   Posts: 10
お世話さまです。
EMLHを便利に使わせていただいてます。
EMLHの要望がありまして、宜しければご検討いただけないでしょうか?

3つ以上の言語を使う場合、
ブロックタイトル等文字数の制限がありますが、
今の機能ですと全くタグを使用しないか、または全ての言語タグを記入しなければなりません。
翻訳をしきれていないもの(後回しとか)に対応できないです。

例)英語、日本語、フランス語を使っているがフランス語約がわからないので後回しにし、とりあえず英語で記載しておこうとなって、全てタグで記載しないといけない
[英語]hogehoge[/英語]
[日本語]ほげほげ[/日本語]
[フランス語]hogehoge[/フランス語]

これを横着して[フランス語]hogehoge[/フランス語]と記入しないとすると、
hogehoge[日本語]ほげほげ[/日本語]と記入し、日本語を選択すると表示は、''hogehogeほげほげ''と表示される。
英語、フランス語を選択すると日本語は表示されないのでOK。

まとめると、タグではさまないものは常に表示されてしまうので、
タグではさんでいないものを選択した場合に、デフォルトで表示されるタグみたいなものを新設です。
[全て]とかで
[全て]hogehoge[/全て][日本語]ほげほげ[/日本語]とすませてしまう。


説明が難しくわかりにくく、またニッチですが、
ご一考いただければ嬉しいです。
宜しくお願いいたします。
Votes:0 Average:0.00
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
Previous post - Next post | Parent - Children.1 | Posted on 2005/6/20 16:47
GIJOE  Gunnery Sergeant   Posts: 4110
なるほど。コンパイラフックですか!
どこでもXOOPSコメントと似ていながら違う方式で、かなり面白い手ですね。
確かにこれなら、デフォルト値の設定が可能ですね。

ただ、私の場合、どうしてもキャッシュを有効に効かせたい、という大前提があります。
私自身、サーバ管理者なので、「重い処理は勘弁して」というのが本音ですから

同じフック処理なら、各HTMLキャッシュの読み出し部分を乗っ取る、なんてのも手としてはアリかもしれませんね。それならキャッシュとしては効いていますし、全体のフィルターよりは副作用も少ないでしょう。

Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2005/6/24 13:26
domifara  Private 1st Class   Posts: 19

Afterwards, it understood from the present left as information.

Another side effect of method situation that uses
$this->default_modifiers = array('domi_easiestml'); 
specification of default_modifiers

Symptom:
The smarty debugging of Xoops was not displayed because of the error.

debug.tpl of smary.

It is (present smarty2.6.9) to the error an example using isset because of the description of the template.
{ if isset($_smarty_debug_output)

Quote:
Hereafter, it is specification quote Parse error:parse error and unexpected ('' expecting T_VARIABLE or'$'in/home/XXXXXX/xo/templates_c/%%XX^XXX^XXXXXXXXXXXX%%debug.tpl.php on line 10

I edited template to changed
 { if isset($_smarty_debug_output|smarty:nodefaults)

Votes:3 Average:3.33

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!