1
kerkyra
Changing theme through modules settings
  • 2010/12/28 20:32

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


does anybody know how to load a non-default theme when visiting a module based on user or module preferences?

For example i use newbb but the theme selection in module preferences doesnt seem to work.

I want the forum to have a different theme than the rest of the site. With an option to choose from 2 different forum themes.

This cant be done with defacer.

I tried

Quote:

xoops_setConfigOption('theme_set', $theme);
$_SESSION['xoopsUserTheme'] = $theme;


in the begining of the index.php file but it doesnt work.

Any ideas???

2
Mamba
Re: Changing theme through modules settings
  • 2010/12/28 21:45

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


There is an old module Theme Changer that was supposed to do it.

Download: here

Since it's old, I am not sure that it still works. But at least you can give it a try...
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

3
kerkyra
Re: Changing theme through modules settings
  • 2010/12/28 22:23

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


i'll give it a try mamba. thanks!

although i would also like to know if there is some way perhaps to do it without installing any other module.

thanks again mate

www.guidemap.gr - Beta is out...

4
kerkyra
Re: Changing theme through modules settings
  • 2010/12/28 22:31

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


i did try it mate. It doesn't meet my needs unfortunatelly.

www.guidemap.gr - Beta is out...

5
kris_fr
Re: Changing theme through modules settings
  • 2010/12/29 0:00

  • kris_fr

  • Theme Designer

  • Posts: 1009

  • Since: 2005/12/31


this solution ?

http://demo.xoofoo.org/index.php

http://demo.xoofoo.org/modules/sitemap/

always same theme

6
kerkyra
Re: Changing theme through modules settings
  • 2010/12/29 0:48

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


whats in there?
www.guidemap.gr - Beta is out...

7
Mamba
Re: Changing theme through modules settings
  • 2010/12/29 0:55

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


What Kris is showing is that there are two different themes in different location on the same Website, i.e. exactly what you're looking for

Now he needs to share the secret how he did it...
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

8
kris_fr
Re: Changing theme through modules settings
  • 2010/12/29 1:23

  • kris_fr

  • Theme Designer

  • Posts: 1009

  • Since: 2005/12/31


I just use the overring of the theme to override another theme in a module, or part of the theme (for example the columns layout or header, or footer, ...)

ex. for sitemap module -http://xoofoo.svn.sourceforge.net/viewvc/xoofoo/xoops/themes/interface_publique/demo/trunk/modules/sitemap/

some videos here **>http://tv.xoofoo.org/modules/mytube/viewcat.php?op=&cid=34

9
kerkyra
Re: Changing theme through modules settings
  • 2010/12/29 1:30

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


hmmm i dont think i follow you kris! could you elaborate that a lil bit please...
www.guidemap.gr - Beta is out...

10
vamptrix
Re: Changing theme through modules settings
  • 2010/12/29 5:28

  • vamptrix

  • Theme Designer

  • Posts: 424

  • Since: 2008/5/3 1


Just guessing, but isn't this code able to do this?

<?php function curPageURL() {  $pageURL 'http';  if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}  $pageURL .= "://";  if ($_SERVER["SERVER_PORT"] != "80") {   $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];  } else {   $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];  }  return $pageURL; } ?>

<?php

if(curPageURL(); == http://www.yoursite.com/modules/news)
{
// link to specific theme stylesheet
}
else
{
//link to normal stylesheet
}
?>


It's early, so it probably has a few mistakes in there, but what it does is declaring a new function which will look for the current page URL. It's then being checked by an if statement if it's true and loads a stylesheet depending on the result.
I used to use this account, but no longer.

Login

Who's Online

241 user(s) are online (146 user(s) are browsing Support Forums)


Members: 0


Guests: 241


more...

Donat-O-Meter

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

Latest GitHub Commits