1
nmshah
Browser specific theme
  • 2010/7/15 14:06

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


My website is http://swayamsat.org

The theme is custom made and displays perfectly with all modern browser but its display is very bad in internet explorer 6 and below. Is there a way by which if the browser is internet explorer 6 or below then the browser will automatically choose a diferent theme.

2
bjuti
Re: Browser specific theme
  • 2010/7/15 14:14

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Forget about IE6. :) It's PITA to make it work, and you should add javascript on you theme that inform users to upgrade to modern browser :)

3
nmshah
Re: Browser specific theme
  • 2010/7/15 14:22

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


That is what I am planning to do as of now. But I am in India and since majority of user continue to use IE 6 here, I need some other alternative

4
nmshah
Re: Browser specific theme
  • 2010/7/19 14:59

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


So is there any way to select a theme based on browser???

5
Mamba
Re: Browser specific theme
  • 2010/7/19 15:25

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Defacer can switch theme based on the module, but I am not sure if it can based on the browser.

Maybe you can modify it so it changes theme based on the browser.

You might also look at this tip and maybe build on it.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

6
Mamba
Re: Browser specific theme
  • 2010/7/19 15:40

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


There are also some PHP classes to detect a browser, e.g. this one, so maybe you can put this all together and make it work.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

7
techdb
Re: Browser specific theme
  • 2010/7/19 15:50

  • techdb

  • Just popping in

  • Posts: 23

  • Since: 2005/3/7 1


Ghia gave me this solution for an IE6 Redirect... works very well

https://xoops.org/modules/newbb/viewtopic.php?topic_id=69599&forum=17&post_id=317355#forumpost317355

8
nmshah
Re: Browser specific theme
  • 2010/7/19 16:52

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


thanks a lot mamba and techdb but my knowledge about php is really bad. Will still see if I can make it work

@techdb can you tell me what steps did you take to make this work

9
techdb
Re: Browser specific theme
  • 2010/7/21 15:23

  • techdb

  • Just popping in

  • Posts: 23

  • Since: 2005/3/7 1


1. Create a theme for ie 6 and call it ie6theme
2. Download your common.php file from inside the folder include/
3. Open the file inside an editor
4. Around line 260 or so (before the text
/**
* Theme Selection
*/)
Cut and paste the following code:


// IE6 string from user_agent
$ie6 = "MSIE 6.0"; // detect browser
$browser = $_SERVER['HTTP_USER_AGENT']; // yank the version from the string
$browser = substr("$browser", 25, 8); // if IE6 set the $alert
if($browser == $ie6){ $_SESSION['xoopsUserTheme'] = 'ie6theme';}

5. Save your common.php file
6. upload it back to inside the folder include/

Login

Who's Online

227 user(s) are online (128 user(s) are browsing Support Forums)


Members: 0


Guests: 227


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits