1
BCdudes
Scripting help, please, Theme switch.
  • 2006/11/29 13:38

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


I posted this in Q&A, but have not got an answer yet, please help.


Hey All

I have the following script that I put in a folder called "multi" under "themes" as the theme.html file, so it can choose the theme for me according to my modules.

<{php}>
    
$mod $GLOBALS['xoopsModule'];
    
$dirname = (isset($mod) ? $mod->getVar('dirname') :'system');
if (
$dirname == 'jar') {
   
$theme='jartheme';
  } else {




   
$theme='geometric_red';
}




$this->assign('themename'$theme.'/theme.html');
$this->assign('xoops_theme'$theme);
$this->assign('xoops_themecss'XOOPS_URL.'/themes/'.$theme.'/style.css');
$this->assign('xoops_imageurl'XOOPS_URL.'/themes/'.$theme.'/');
<{/
php}>
<{include 
file="$themename"}>



The script is great and works very well ( I think I got it from here,from a very kind person, thank you)...

What I need is to use a similar script, but instead of modules, i want it to be languages, something as such:
if langcode=en then use "ThemeEN"
if langcode=fr then use "ThemeFR"
else use "ThemeGeneric"

I think all I need is the exact same code, but a change in the IF-Clause ,, I use xLanguage for Multilangs.

Thank you for your help in advance

Regards

BCdudes

2
BCdudes
Re: Scripting help, please, Theme switch.
  • 2006/11/29 14:30

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


never mind, i found the solution:

Edit "header.php" in the root folder
and insert this code:

if ($xoopsConfig['language'] == 'arabic') { 
   
$xoopsConfig['theme_set']='arabicversion'
  } else { 
   
$xoopsConfig['theme_set']='englishversion'
}


before this line (at about line 30)
include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';

Login

Who's Online

432 user(s) are online (106 user(s) are browsing Support Forums)


Members: 0


Guests: 432


more...

Donat-O-Meter

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

Latest GitHub Commits