1
perhol
Selecting theme on command line
  • 2004/3/18 11:53

  • perhol

  • Just popping in

  • Posts: 22

  • Since: 2004/2/11


This may be stupid question so I'm hoping for a simple stupid answer.

Is there a way to load a theme on the command line like;

http://xxx.yyy.zzz?theme=nameoftheme

This way a user can bookmark the site with his favourite theme.

2
Mithrandir
Re: Selecting theme on command line

Short answer: No

Long answer: Theme changes are initiated by a POST request, which is not possible from simple URL (or "command line") requests.

3
perhol
Re: Selecting theme on command line
  • 2004/3/18 20:41

  • perhol

  • Just popping in

  • Posts: 22

  • Since: 2004/2/11


I don't know if this is good "xoops-practice" but I solved it by adding the following code to header.php after the line: include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';


Quote:

if (!empty($HTTP_GET_VARS['theme'])) {
$xoopsConfig['theme_set'] = $HTTP_GET_VARS['theme'];
$HTTP_SESSION_VARS['xoopsUserTheme'] = $HTTP_GET_VARS['theme'];
}

4
Mithrandir
Re: Selecting theme on command line

it's your XOOPS Do what you want with it.

I was speaking from a non-hacking point of view. If you hack XOOPS, you can more or less do anything you want - but it will be harder to upgrade. So I only recommend hacking if it is vital to you and you know what you are doing.

Talking "good xoops-practice", it would be better to use $_GET and $_SESSION instead of their $HTTP_ counterparts - but since most of XOOPS still uses $HTTP_ it doesn't really matter yet.

5
perhol
Re: Selecting theme on command line
  • 2004/3/18 20:57

  • perhol

  • Just popping in

  • Posts: 22

  • Since: 2004/2/11


I know what you're saying. I'm aware of the upgrade issues but this functionality is vital to my application. The background is that i want to be able to load a high contrast theme that people with bad vision can use as their default theme. I'm pretty sure this functionality could be useful also to others.

Thanks for your advice.

6
Mithrandir
Re: Selecting theme on command line

Sure - but what's wrong with the theme selection block?

7
perhol
Re: Selecting theme on command line
  • 2004/3/18 21:43

  • perhol

  • Just popping in

  • Posts: 22

  • Since: 2004/2/11


Nothing's wrong with the theme selection block. -As long as you can see it and know how to use it...

I want users to be able to set their browser start page to my xoops-site with the theme of their choice. The targeted group for this high-contrast-theme is elderly people that I hope will be frequent visitors to my site.

8
Tekfrog
Re: Selecting theme on command line
  • 2004/3/19 5:03

  • Tekfrog

  • Just popping in

  • Posts: 8

  • Since: 2003/2/8 2


Just as an aside, wouldn't it be cool if you could read the theme settings for WindowsXP and/or IE and customize the XOOPS page to match the users selection? That way if you have an elderly person using a large font/high contrast desktop the webpages they view would match? Too many websites out there, mine included, lock down everything so we can maintain a certain look and sacrifice usability for visually impaired people.

Just thinking outloud, don't mind me.

9
perhol
Re: Selecting theme on command line
  • 2004/3/19 14:54

  • perhol

  • Just popping in

  • Posts: 22

  • Since: 2004/2/11


It would be cool! Another platform/browser independent approach could be if the browser flagged that it wanted the page presented in a certain way, maybe in the referer string.

Login

Who's Online

237 user(s) are online (164 user(s) are browsing Support Forums)


Members: 0


Guests: 237


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