11
irmtfan
Re: SOLVED
  • 2006/8/9 20:20

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


domecc and the others:
i still cant understand your problem with smarty variable.

it can be done eaily in xlanguage 3 and you have selected languages as "Links" ,"images" , ... anywhere you like.

this problem you mentioned is the one i mentioned 1 month ago and phppp solve it by define the smarty var.
see this topic in xoopsforge.com:

xlanguage: how to hard code "select languages" in theme?

12
domecc
Re: SOLVED
  • 2006/8/10 2:49

  • domecc

  • Just popping in

  • Posts: 71

  • Since: 2005/10/30


Quote:

irmtfan wrote:
domecc and the others:
i still cant understand your problem with smarty variable.

it can be done eaily in xlanguage 3 and you have selected languages as "Links" ,"images" , ... anywhere you like.

this problem you mentioned is the one i mentioned 1 month ago and phppp solve it by define the smarty var.
see this topic in xoopsforge.com:

xlanguage: how to hard code "select languages" in theme?


Just like #6 said:
<a href="xxxx"><img src="<{$xoops_imageurl}>images/english.gif">a>
<
a href="yyyy"><img src="<{$xoops_imageurl}>images/schinese.gif">a>


I just need ability to difine xxx and yyy, but not the whole links code. Thus, it would be more flexible in theme design.

If you visit my website, http://www.malan.com.cn, you may understand what I want.

And now, I use this solution:
<{php}> 
    
/** 
    * code by: scottlai 
    * mailto: scottlai1983 at hotmail dot com 
    */ 
    
global $xoopsTpl
    
$url "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; 
    
$query_string_arg = array(); 
    if (
count($_GET) > 0) { 
        if (isset(
$_GET['lang'])) unset($_GET['lang']); 
        foreach (
$_GET as $key => $val) { 
           
$query_string_arg[$key] = "$key=$val"
        } 
        
$query_string implode("&"$query_string_arg)."&"
    } 
    
$query_string .= "lang="
    
$url .= "?".$query_string
    
//echo $url; 
    
$xoopsTpl->assign("url"$url); 
<{/
php}> 

<
a href="<{$url}>english">Englisha>  
<
a href="<{$url}>schinese">&#31616;体中文  
<a href="<{$url}>tchinese">&#32321;體中文  
<a href="<{$url}>UTF-8">UTF-8a>
XoopsChina Webmaster

13
irmtfan
Re: SOLVED
  • 2006/8/10 3:13

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


domecc:
You have a very well design and good looking site.
never think XOOPS can do it better!

but about the xlanguage the only thing i see in your site that xlanguage cant do is the " multiple location " of language icons.
in your front page icons sorted vertically
but its only in your front page.
in the other pages untill i could see all 2 icons location can be done with smarty var.

i still cant understand what you mean by this:

Quote:
I just need ability to difine xxx and yyy


i dont see any changes in your links and xlanguage smarty var links.

14
domecc
Re: SOLVED
  • 2006/8/10 4:20

  • domecc

  • Just popping in

  • Posts: 71

  • Since: 2005/10/30


Quote:

irmtfan wrote:
In your front page icons sorted vertically
but its only in your front page.
in the other pages untill i could see all 2 icons location can be done with smarty var.

Yes, you're right! But I want a more common solution.

Quote:

I still cant understand what you mean by this:

Quote:
I just need ability to difine xxx and yyy


i dont see any changes in your links and xlanguage smarty var links.

Links is same as xlanguage smarty var.
But sometimes language links need interlace with other code. Just like my front page code, If xlanguage can output just "href" smarty var, but not the complete "", it would be more flexible.
<table border="0" cellpadding="0" cellspacing="0" id="header">
  <
tr>
    <
td rowspan="3" id="headerlogo"><a href="<{$xoops_url}>"><img src="<{$xoops_imageurl}>images/logo.gif" alt="<{$xoops_sitename}>" width="157" height="59" />a>td>
    <
td colspan="2" id="headerwelcome"><{if $xoops_isuser}>Hello <{$xoops_uname}>&#65292;Welcome to <{$xoops_sitename}>!<{else}>Welcome to <{$xoops_sitename}>!<{/if}>
  
tr>
  <
tr>
    <
td rowspan="2" id="headermenu"><{include file="$xoops_theme/../malan_default/mainmenu/menu_en.html"}>td>
    <
td id="headerchinese"><a href="<{$xoops_url}>/index.php?lang=schinese"><img src="<{$xoops_imageurl}>images/chinese.gif" alt="中文" width="77" height="18" border="0" />a>td>
  tr>
  <
tr>
    <
td id="headerenglish"><a href="<{$xoops_url}>/index.php?lang=english"><img src="<{$xoops_imageurl}>images/english.gif" alt="英文" width="77" height="18" border="0" />a>td>
  tr>
table>
XoopsChina Webmaster

15
irmtfan
Re: SOLVED
  • 2006/8/10 4:40

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


its all can be done with "delimiter" in xlanguage smarty var.

but unfortunately the delimitor doesnt work in the last version.

here is my solution:

in xlanguage/include/functions.php:
around line 242 change this:
if( ( $i++ % $block["number"] ) == 0){
                
$content .= "";
            }


like this:
if( ( $i++ % $block["number"] ) == 0){
                
$content .= "";
            } elseif( 
$i <= count($block["languages"]) ){ //added by irmtfan
                
$content .=$block["delimitor"];
            }

so you can put anything even html code between icons


i said this because i just can see an "space" between 2 images icon in your theme.

im totaly sure at least your icons can be done easily.

16
domecc
Re: SOLVED
  • 2006/8/10 4:45

  • domecc

  • Just popping in

  • Posts: 71

  • Since: 2005/10/30


Cool! Thanks!
XoopsChina Webmaster

17
jagibu
Re: Xlanguage block and theme.html
  • 2008/4/29 12:15

  • jagibu

  • Just popping in

  • Posts: 68

  • Since: 2005/6/17


I make useful hack to xlanguage 3.01 based on Gijoe EMLH multilanguage hack.
You can put tags like [flag_en] or [flag_pl] everywhere in content text, theme, template of module, admin area - with any deliminators - tags are auto changed to image.
You can use tag to easy sign up translated part of content (useful if content isn't translated in all languages).
Images for tags are define in administration of xlanguage.
demo :
tags used in content text area
tags used in template of module

18
jagibu
Re: Xlanguage block and theme.html
  • 2008/4/29 12:16

  • jagibu

  • Just popping in

  • Posts: 68

  • Since: 2005/6/17


I make useful hack to xlanguage 3.01 based on Gijoe EMLH multilanguage hack.
You can put tags like [flag_en] or [flag_pl] everywhere in content text, theme, template of module, admin area - with any deliminators - tags are auto changed to image.
You can use tag to easy sign up translated part of content (useful if content isn't translated in all languages).
Images for tags are define in administration of xlanguage.
demo :
tags used in content text area
tags used in template of module

19
jagibu
Re: Xlanguage block and theme.html
  • 2008/4/29 12:17

  • jagibu

  • Just popping in

  • Posts: 68

  • Since: 2005/6/17


I make useful hack to xlanguage 3.01 based on Gijoe EMLH multilanguage hack.
You can put tags like [flag_en] or [flag_pl] everywhere in content text, theme, template of module, admin area - with any deliminators - tags are auto changed to image.
You can use tag to easy sign up translated part of content (useful if content isn't translated in all languages).
Images for tags are define in administration of xlanguage.
demo :
tags used in content text area
tags used in template of module

20
jagibu
Re: Xlanguage block and theme.html
  • 2008/4/29 12:18

  • jagibu

  • Just popping in

  • Posts: 68

  • Since: 2005/6/17


I make useful hack to xlanguage 3.01 based on Gijoe EMLH multilanguage hack.
You can put tags like [flag_en] or [flag_pl] everywhere in content text, theme, template of module, admin area - with any deliminators - tags are auto changed to image.
You can use tag to easy sign up translated part of content (useful if content isn't translated in all languages).
Images for tags are define in administration of xlanguage.
demo :
tags used in content text area
tags used in template of module

Login

Who's Online

203 user(s) are online (132 user(s) are browsing Support Forums)


Members: 0


Guests: 203


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits