1
hagan
User Selectable Themes?
  • 2004/1/8 4:46

  • hagan

  • Just popping in

  • Posts: 2

  • Since: 2003/8/12


Can't seem to find this. In "Preferences", you can highlight the themes your users can select. But I can't find a block, or a menu item, for people to use to select a theme.

If I need to create a block to do it, how is that done?

2
Dave_L
Re: User Selectable Themes?
  • 2004/1/8 5:00

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


There's a system block named "Themes" that provides this function.

3
philou
Re: User Selectable Themes?
  • 2004/1/8 5:47

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


it's right.. and with a little hack in the common.php your members can chose their theme.

4
GadgetMn
Re: User Selectable Themes?
  • 2004/1/8 10:29

  • GadgetMn

  • Just popping in

  • Posts: 55

  • Since: 2003/7/15


Is this a member specific default theme? I would like to be able the site to remember the users theme selection and use it when they return to the site.

I would also like this to apply if the user has been cookied and can be detected. Is this possible?

And with 2.1 it should be able to set the theme if the user has ticked "Remember Me". Will this also be the case?

Cheers,

GadgetMn

5
philou
Re: User Selectable Themes?
  • 2004/1/8 17:15

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


you should hack the file /include/common.php

at the line 206 (approx)
you have this :
if ( isset( $HTTP_POST_VARS['xoops_theme_select'] ) && in_array$HTTP_POST_VARS['xoops_theme_select'], $xoopsConfig['theme_set_allowed'] ) ) {
        
$xoopsConfig['theme_set'] = $HTTP_POST_VARS['xoops_theme_select'];
        
$HTTP_SESSION_VARS['xoopsUserTheme'] = $HTTP_POST_VARS['xoops_theme_select'];

just after paste this :
if(is_object($xoopsUser) == true)
        {
            
$xoopsDB->queryF("UPDATE ".$xoopsDB->prefix('users')." SET theme='".$xoopsConfig['theme_set']."' WHERE uid=".$xoopsUser->uid());
        }


6
Dave_L
Re: User Selectable Themes?
  • 2004/1/8 17:21

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Thanks, I was going to ask what you meant above by hacking common.php.

Minor nitpick: Is there a particular reason for using
if(is_object($xoopsUser) == true)
instead of
if(is_object($xoopsUser))
?

7
philou
Re: User Selectable Themes?
  • 2004/1/8 17:26

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


Oups ! It's right...

You can do this of course it's better !

8
Jennifah
Re: User Selectable Themes?
  • 2004/1/17 10:22

  • Jennifah

  • Just popping in

  • Posts: 35

  • Since: 2003/2/19


I am using XOOPS 2.0 and I tried the above instructions but it didnt work. Any clues why and how I can hack it? Thanks :)

Login

Who's Online

230 user(s) are online (159 user(s) are browsing Support Forums)


Members: 0


Guests: 230


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