1
spiff
Browser-contextual themes
  • 2005/1/9 16:05

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


Thought this might come in handy to folks out there wanting to design different themes according to the browser/OS used.

Paste the following at the bottom of 'include/common.php', just before the closing bracket:

if (preg_match('/msie/i',$_SERVER['HTTP_USER_AGENT'])) {
  
$xoopsConfig['theme_set'] = 'explorertheme';
}


Explanation: if the user agent mentions MSIE (the user is accessing XOOPS with Internet Explorer), present the site with the theme defined in '/themes/explorertheme', otherwise use the theme set in XOOPS preferences.

Note: This brute force method overrides manual theme selection for anyone matching the test, so you might have to turn off user-selectable themes.

There may be other ways to implement browser-contextual themes, but a quick browse didn't produce any results. Did anyone else do it in a different way?

2
carnuke
Re: Browser-contextual themes
  • 2005/1/9 16:15

  • carnuke

  • Home away from home

  • Posts: 1955

  • Since: 2003/11/5


Spiff, this is an interesting idea that I have not yest tried. When this thread is done and any other comments come out, please post a FAQ on this.

Thanks.

Login

Who's Online

132 user(s) are online (68 user(s) are browsing Support Forums)


Members: 0


Guests: 132


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