21
Mithrandir
Re: Changing Theme Hack

it is at the right spot, yes.

Nothing changes, when you go to the news module?

22
Wilco
Re: Changing Theme Hack
  • 2004/5/6 12:37

  • Wilco

  • Friend of XOOPS

  • Posts: 49

  • Since: 2004/4/27


You're right, nothing changes is not quite right. The theme changes but the news category related to the theme didn't.

Let me try to describe what I did:

I edited the file index.php in the /modules/news directory as described before. I saved it and uploaded it. Then I updated the news module. After that I changed theme from default (Infonet) to Bredervoort. So when I navigate to theme Bredervoort the theme changes, not the news category.

23
Mithrandir
Re: Changing Theme Hack

That is correct. JackJ's code switches the theme AND goes to a news category (always the same) when you select a new theme.

MY code changes the theme, when you go to the news index.

My idea was that you could setup a switch statement to find the category and have different themes for different categories - or as it is, you would have a different theme for the news index page.

So my code does nothing to the theme selection block.

24
Wilco
Re: Changing Theme Hack
  • 2004/5/9 20:04

  • Wilco

  • Friend of XOOPS

  • Posts: 49

  • Since: 2004/4/27


I'll keep struggling with the problem. It really does not work for me. There must be something that I don't know. Something what for you guys is very logical. I guess you know I am a newbie. So maybe you can do a suggestion ? Can anyone help me?

BTW: I'll like Mithrandir's solution the most, however I am really also looking for a solution where the newtopic changes when you choose another theme through the theme navigator.

25
GIJOE
Re: Changing Theme Hack
  • 2004/5/9 21:25

  • GIJOE

  • Quite a regular

  • Posts: 265

  • Since: 2003/8/13


Yesterday, an epoch-making module was announced by HIDETO.N.
The module is named "THEME CHANGER".

You need not any hacks.
All you have to do is installing this module and changing your theme into "z_changeable_theme" bundled in the archive.

Its novelty of the idea is preparing "a starting theme for switching".
Thus, you can change themes by each modules without hack.

download from here.
http://tms.s10.xrea.com:8080/mydownloads-singlefile-cid-1-lid-5.html

Though this is a Japanese site, the module has english files.

26
Wilco
Re: Changing Theme Hack
  • 2004/5/11 22:30

  • Wilco

  • Friend of XOOPS

  • Posts: 49

  • Since: 2004/4/27


Thanx GIJOE, Thats nice! But,.... I want not (only) the theme changing when changing from module but I want to change the theme when changing the newstopic(category)



27
Wilco
Re: Changing Theme Hack
  • 2004/5/17 20:37

  • Wilco

  • Friend of XOOPS

  • Posts: 49

  • Since: 2004/4/27


Anyone any time to help me figuring that out?

28
Mithrandir
Re: Changing Theme Hack

My code snippet didn't work?

29
Wilco
Re: Changing Theme Hack
  • 2004/5/19 20:06

  • Wilco

  • Friend of XOOPS

  • Posts: 49

  • Since: 2004/4/27


That’s right! you’re code snippet didn't work for me.
I described before how I did it…. in ../modules/news/index.php
Quote:
include '../../mainfile.php';
$xoopsOption['template_main'] = 'news_index.php';
$xoopsOption['theme_set'] = Infonet';
include XOOPS_ROOT_PATH.'/header.php';
include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';

switch($xoopsOption['storytopic']) {
case '21': //if it is topic with id 21
$xoopsConfig['theme_set'] = "Bredervoort";
break;

case '22': //if it is topic with id 22
$xoopsConfig['theme_set'] = "Commujon";
break;
}

if (isset($HTTP_GET_VARS['storytopic'])) {
$xoopsOption['storytopic'] = intval($HTTP_GET_VARS['storytopic']);
} else {
$xoopsOption['storytopic'] = 0;
}
etc...........



I updated the newsmodule through the systemadmin-modules-news
After that I changed storytopic…. Theme didn’t change…


30
Mithrandir
Re: Changing Theme Hack

You are adding the switch($xoopsOption['storytopic']) before it is set.

it is set in the
if (isset($HTTP_GET_VARS['storytopic'])) {
$xoopsOption['storytopic'] = intval($HTTP_GET_VARS['storytopic']);
} else {
$xoopsOption['storytopic'] = 0;
}

so put it in somewhere after $xoopsOption['storytopic'] is set and upload the new index.php - you shouldn't need a module update for this to take effect.

Login

Who's Online

134 user(s) are online (69 user(s) are browsing Support Forums)


Members: 0


Guests: 134


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