1
kavaXtreme
Dynamic Theme
  • 2005/4/5 12:53

  • kavaXtreme

  • Repository Maintainer

  • Posts: 110

  • Since: 2005/1/17


I'm working on a dynamic theme that will display differently depending on what module is being accessed. Of course this must be done using PHP, however this is my first ever PHP project. My question is this: does anyone know of a variable used by XOOPS that lets it know which module is being displayed currently?

Input MUCHLY appreciated!

2
ackbarr
Re: Dynamic Theme

the current module is stored in the $xoopsModule variable, which is an object of type XoopsModule

If the user is accessing a page not associated with any module (user.php, notifications.php, viewpmsg.php) $xoopsModule not be initialized.

3
christian
Re: Dynamic Theme
  • 2005/4/5 13:32

  • christian

  • Just can't stay away

  • Posts: 401

  • Since: 2002/2/24


Hi

Have you look this FAQ and this sample with http://www.myxoops.org/ ?

Best regards

4
kavaXtreme
Re: Dynamic Theme
  • 2005/4/6 10:49

  • kavaXtreme

  • Repository Maintainer

  • Posts: 110

  • Since: 2005/1/17


Thanks guys!

The FAQ in particular is going to help answer questions I didn't know I should be asking. I've already found one such answer.

Now to put it together...

5
banned
Re: Dynamic Theme
  • 2005/4/6 12:01

  • banned

  • Not too shy to talk

  • Posts: 159

  • Since: 2004/5/16


Since XOOPS v 2.0.10 there is a new smarty var avaible, $xoops_dirname that return the module's directory.
When you are in user.php, edituser.php, etc this variable will return 'system' (methink.. I've not installed yet 2.0.10.. )

6
DocuAnt
Re: Dynamic Theme
  • 2005/4/6 13:00

  • DocuAnt

  • Just popping in

  • Posts: 6

  • Since: 2005/3/22


Hi

Could the module ThemeChanger be helpful for your project? You can get it here:http://xoops.suin.jp/mydownloads/index.cgi

7
kavaXtreme
Re: Dynamic Theme
  • 2005/4/16 20:01

  • kavaXtreme

  • Repository Maintainer

  • Posts: 110

  • Since: 2005/1/17


You guys are tops! Thanks for all the great input.

I think I'm nearly where I need to be, but there's still something I can't figure out.

$xoops_cmod works fine if I use it with an operator and a text string. (i.e. $xoops_cmod == "theme") What doesn't seem to work for me is if I assign text to a variable early on and then try to use that with an operator later. (i.e. $xoops_cmod == $themetitle)

Any ideas? Could it be that the variable needs to be made into a Smarty variable? And if so, how does one do that?

8
kavaXtreme
Re: Dynamic Theme
  • 2005/4/20 11:42

  • kavaXtreme

  • Repository Maintainer

  • Posts: 110

  • Since: 2005/1/17


Solved that one. Yes, it does need to be made into a Smarty (or at least a-typical) variable. It follows this format:
$GLOBALS['xoopsTpl']->assign( 'xoops_cmod', $dirname );
where xoops_cmod becomes the Smarty variable and $dirname is the value it contains.

And with that the Kubrick theme is nearly ready. You can check out the results of your input at kavaxtreme.radiantchristians.com. Thanks a ton for making it possible for me to get this far.

Login

Who's Online

235 user(s) are online (142 user(s) are browsing Support Forums)


Members: 0


Guests: 235


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