1
il_berry
Xlanguage block and theme.html
  • 2006/3/25 19:20

  • il_berry

  • Just popping in

  • Posts: 7

  • Since: 2005/11/13


Hi everyone!
I'm trying to use Xlanguage! It's a great and simple module.
I'd like to display the block not in the left or right column but in the menu or in an other position.
In the theme.html, in the left column for example, there's this code used to display all block:
<{foreach item=block from=$xoops_lblocks}>
<{$block.title}>
<{$block.content}>
<{/foreach}>

How is the code can I use to display only the xlanguage's block?


How can I do it? (if is it possible...)
What code i must put in the theme.html file?

Thanks a lot for your help!
Best regards.

2
V6-Maniac
Re: Xlanguage block and theme.html
  • 2006/3/25 21:27

  • V6-Maniac

  • Just popping in

  • Posts: 86

  • Since: 2005/2/15


You can try this for example:

<a href="index.php?lang=english"><img src="<{$xoops_imageurl}>images/english.gif">a>
<
a href="index.php?lang=german"><img src="<{$xoops_imageurl}>images/german.gif">a>


You can use your own flags.

3
il_berry
SOLVED
  • 2006/3/27 9:09

  • il_berry

  • Just popping in

  • Posts: 7

  • Since: 2005/11/13


Hi!
in the meantime, I've resolved the trouble!!
Before, I've tryed like you have suggest me. But not only putting a link
with an url like: index.php?lang=english
but adding at the end of the url a $querystring var.
So was good...

After, an idea shining my mind!
I've used Center left block, and I've put it at the top of the left column before the foreach cicle of the left block.
So it's Very good.

This is a small tip! (new for me)
and can be used with whichever block

I hope can be useful!
Thanks and bye!
Ste

4
domecc
Re: SOLVED
  • 2006/8/8 17:05

  • domecc

  • Just popping in

  • Posts: 71

  • Since: 2005/10/30


Quote:

il_berry wrote:
Hi!
in the meantime, I've resolved the trouble!!
Before, I've tryed like you have suggest me. But not only putting a link
with an url like: index.php?lang=english
but adding at the end of the url a $querystring var.
So was good...


Please tell us detail.
Thanks!
XoopsChina Webmaster

5
irmtfan
Re: SOLVED
  • 2006/8/8 17:41

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


using xlanguage 3 final:
https://xoops.org/modules/news/article.php?storyid=3216
it has a new feature to put "select langauge" anywhere in your theme.html

6
domecc
Re: SOLVED
  • 2006/8/9 2:15

  • domecc

  • Just popping in

  • Posts: 71

  • Since: 2005/10/30


Quote:

irmtfan wrote:
using xlanguage 3 final:
https://xoops.org/modules/news/article.php?storyid=3216
it has a new feature to put "select langauge" anywhere in your theme.html


You are right. But it's still not flexible enough.
For example, we have design the theme like this:

<a href="xxxx"><img src="<{$xoops_imageurl}>images/english.gif">a>
<
a href="yyyy"><img src="<{$xoops_imageurl}>images/schinese.gif">a>


Thus, we can't use xlanguage's smarty var.
XoopsChina Webmaster

7
irmtfan
Re: SOLVED
  • 2006/8/9 3:38

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


it shows like whatever you want.
i dont use this module but you can find some sites using the smarty variable:
http://polfran.pl/modules/liaise/

8
domecc
SOLVED
  • 2006/8/9 5:57

  • domecc

  • Just popping in

  • Posts: 71

  • Since: 2005/10/30


Scottlai from XOOPS China has given me a solution:
Is there any better solution?

/** 
      * 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

9
eoviedo
Re: SOLVED
  • 2006/8/9 16:51

  • eoviedo

  • Documentation Writer

  • Posts: 6

  • Since: 2003/5/5 1


$last_character = substr($_SERVER['REQUEST_URI'], -1);

if ($last_character == "/" ) {
$xoopsTpl->assign('en', $_SERVER['REQUEST_URI'].'index.php?lang=english');
$xoopsTpl->assign('es', $_SERVER['REQUEST_URI'].'index.php?lang=spanish');
$xoopsTpl->assign('fr', $_SERVER['REQUEST_URI'].'index.php?lang=french');
}

if ($last_character == "p") {
$xoopsTpl->assign('en', $_SERVER['REQUEST_URI'].'?lang=english');
$xoopsTpl->assign('es', $_SERVER['REQUEST_URI'].'?lang=spanish');
$xoopsTpl->assign('fr', $_SERVER['REQUEST_URI'].'?lang=french');
}

if ($last_character != "/" && $last_character != "p") {
$xoopsTpl->assign('en', $_SERVER['REQUEST_URI'].'&lang=english');
$xoopsTpl->assign('es', $_SERVER['REQUEST_URI'].'&lang=spanish');
$xoopsTpl->assign('fr', $_SERVER['REQUEST_URI'].'&lang=french');
}

... using this way you can change the language if the url ends in '.php', '/' or a file with variables.

10
domecc
Re: SOLVED
  • 2006/8/9 17:37

  • domecc

  • Just popping in

  • Posts: 71

  • Since: 2005/10/30


XoopsChina Webmaster

Login

Who's Online

314 user(s) are online (189 user(s) are browsing Support Forums)


Members: 0


Guests: 314


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