1
bricex
changing theme via url
  • 2006/6/11 16:09

  • bricex

  • Just popping in

  • Posts: 71

  • Since: 2003/1/16


hi
i have for my XOOPS site 2 themes
but i need to make possible that i can use two different url to decide which theme is diplayed...

for example:

if i type www.mysite/index.php?theme1
site appears whith theme1

and if i type www.mysite/index.php?theme2
site appears whith theme2

how can i get this or something like this?????
...

2
snow77
Re: changing theme via url
  • 2006/6/11 17:40

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


I've done this before using the Theme Changer module where you can put themes according to modules I think it is.

There's also this code which you can use, but I have never tried it this way before and I don't know if it works:

Quote:

<{php}>$mod = $GLOBALS['xoopsModule'];
$dirname = (isset($mod) ? $mod->getVar('dirname') :'system');
function toggleDisplay(obj,display1,display2){
if ($dirname == 'newbb') {
$theme='ThemeB';
} else {
$theme='ThemeA';
}
$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"}>

www.polymorphee.com
www.xoopsdesign.com

Login

Who's Online

136 user(s) are online (90 user(s) are browsing Support Forums)


Members: 0


Guests: 136


more...

Donat-O-Meter

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

Latest GitHub Commits