1
Wilco
Changing Theme Hack
  • 2004/5/1 12:53

  • Wilco

  • Friend of XOOPS

  • Posts: 49

  • Since: 2004/4/27


When a visitor changes the theme, I want the visitor sees news from a certain category at the same time.
I guess the solution for my questions is simple. Probably I have to edit the template which manage the box with themes? But what exactly do I have to do?

2
limecity
Re: Changing Theme Hack
  • 2004/5/1 13:02

  • limecity

  • Friend of XOOPS

  • Posts: 1602

  • Since: 2003/7/6 0


Quote:
I want the visitor sees news from a certain category at the same time.


What you mean by that?

3
Wilco
Re: Changing Theme Hack
  • 2004/5/1 13:14

  • Wilco

  • Friend of XOOPS

  • Posts: 49

  • Since: 2004/4/27


I mean when the vistor choose theme a, I want him to see news from category a. When het choose theme b, I want him to see news from category b.

4
CBlue
Re: Changing Theme Hack

That would have to be done through scripts that you have put into the theme.html file of each theme. Redirect, I believe. If it will work.

5
JackJ
Re: Changing Theme Hack
  • 2004/5/1 13:49

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


An easier way to go is too edit the "block themes" block template

system_block_themes.html (in the system set of templates)

from this:




<{$block.theme_select}>



to this



<{$block.theme_select}>



Note: storytopic=1 is the first news category etc

6
Wilco
Re: Changing Theme Hack
  • 2004/5/1 13:51

  • Wilco

  • Friend of XOOPS

  • Posts: 49

  • Since: 2004/4/27


Well, I'll give it a try. Immediately!

7
CBlue
Re: Changing Theme Hack

JackJ you are brilliant! I'm still learning something new about XOOPS everyday thanks to you and some other brilliant members.

8
Mithrandir
Re: Changing Theme Hack

OR
In your news module code put this in somewhere, where it makes sense (i.e. after you have found topic id):
switch($xoopsOption['storytopic']) {
    case 
'1'//if it is topic with id 1
        
$xoopsConfig['theme_set'] = "New Theme Name";
        break;

    case 
'2'//if it is topic with id 2
        
$xoopsConfig['theme_set'] = "Another theme name";
        break;
}


I guess it is possible to hack into the topic manager to set a theme for each topic, but I'll leave you to try out this first.

9
Wilco
Re: Changing Theme Hack
  • 2004/5/1 14:09

  • Wilco

  • Friend of XOOPS

  • Posts: 49

  • Since: 2004/4/27


Great, I appreciate youre responses... I'll try it and let you know.

10
JackJ
Re: Changing Theme Hack
  • 2004/5/1 14:15

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


Thanks Cblue

You made my day, I won't get my head out the door now.:)

It does work for me, I always try my suggestions out on my own test site first.

Login

Who's Online

403 user(s) are online (253 user(s) are browsing Support Forums)


Members: 0


Guests: 403


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