FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » Select theme, language by browser locale
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Select theme, language by browser locale [message #159062 is a reply to message #158937] Thu, 30 April 2009 23:44 Go to previous messageGo to previous message
Ernesto is currently offline  Ernesto   
Messages: 413
Registered: August 2005
Karma:
Senior Member
It seems you can do it in two ways.

Either you can redirect with htaccess or directly with an apache module, so I guess one can set up a forum copy on a different folder, but connect to the same database, since I think the default/allowed themes are controlled from the GLOBALS file and not the database, right?

I found this PHP example:
<?php
$isMobile 
false;
$isBot false;

$op strtolower($_SERVER['HTTP_X_OPERAMINI_PHONE']);
$ua strtolower($_SERVER['HTTP_USER_AGENT']);
$ac strtolower($_SERVER['HTTP_ACCEPT']);
$ip $_SERVER['REMOTE_ADDR'];

$isMobile strpos($ac'application/vnd.wap.xhtml+xml') !== false
        
|| $op != ''
        
|| strpos($ua'sony') !== false 
        
|| strpos($ua'symbian') !== false 
        
|| strpos($ua'nokia') !== false 
        
|| strpos($ua'samsung') !== false 
        
|| strpos($ua'mobile') !== false
        
|| strpos($ua'windows ce') !== false
        
|| strpos($ua'epoc') !== false
        
|| strpos($ua'opera mini') !== false
        
|| strpos($ua'nitro') !== false
        
|| strpos($ua'j2me') !== false
        
|| strpos($ua'midp-') !== false
        
|| strpos($ua'cldc-') !== false
        
|| strpos($ua'netfront') !== false
        
|| strpos($ua'mot') !== false
        
|| strpos($ua'up.browser') !== false
        
|| strpos($ua'up.link') !== false
        
|| strpos($ua'audiovox') !== false
        
|| strpos($ua'blackberry') !== false
        
|| strpos($ua'ericsson,') !== false
        
|| strpos($ua'panasonic') !== false
        
|| strpos($ua'philips') !== false
        
|| strpos($ua'sanyo') !== false
        
|| strpos($ua'sharp') !== false
        
|| strpos($ua'sie-') !== false
        
|| strpos($ua'portalmmm') !== false
        
|| strpos($ua'blazer') !== false
        
|| strpos($ua'avantgo') !== false
        
|| strpos($ua'danger') !== false
        
|| strpos($ua'palm') !== false
        
|| strpos($ua'series60') !== false
        
|| strpos($ua'palmsource') !== false
        
|| strpos($ua'pocketpc') !== false
        
|| strpos($ua'smartphone') !== false
        
|| strpos($ua'rover') !== false
        
|| strpos($ua'ipaq') !== false
        
|| strpos($ua'au-mic,') !== false
        
|| strpos($ua'alcatel') !== false
        
|| strpos($ua'ericy') !== false
        
|| strpos($ua'up.link') !== false
        
|| strpos($ua'vodafone/') !== false
        
|| strpos($ua'wap1.') !== false
        
|| strpos($ua'wap2.') !== false;

        
$isBot =  $ip == '66.249.65.39' 
        
|| strpos($ua'googlebot') !== false 
        
|| strpos($ua'mediapartners') !== false 
        
|| strpos($ua'yahooysmcm') !== false 
        
|| strpos($ua'baiduspider') !== false
        
|| strpos($ua'msnbot') !== false
        
|| strpos($ua'slurp') !== false
        
|| strpos($ua'ask') !== false
        
|| strpos($ua'teoma') !== false
        
|| strpos($ua'spider') !== false 
        
|| strpos($ua'heritrix') !== false 
        
|| strpos($ua'attentio') !== false 
        
|| strpos($ua'twiceler') !== false 
        
|| strpos($ua'irlbot') !== false 
        
|| strpos($ua'fast crawler') !== false                        
        
|| strpos($ua'fastmobilecrawl') !== false 
        
|| strpos($ua'jumpbot') !== false
        
|| strpos($ua'googlebot-mobile') !== false
        
|| strpos($ua'yahooseeker') !== false
        
|| strpos($ua'motionbot') !== false
        
|| strpos($ua'mediobot') !== false
        
|| strpos($ua'chtml generic') !== false
        
|| strpos($ua'nokia6230i/. fast crawler') !== false;
?>


So, basically, in the theme manager, you can get an option to set also the mobile default theme as well as the regular default theme.

I don't think it should require all too much work to add the functionality, although for sure it will be annoying to make a theme for the mobile, but that is a later headache hehe.

Of course, if there is no real need for such a function in the community, I guess I can tweak myself, but with the increasing mobile browsing market, I think it could be pretty cool.


[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Get a FUDforum cloud instance in less than 30 seconds.
Next Topic: tapatalk - do you heard about it?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 12:23:44 GMT 2024

Total time taken to generate the page: 0.04601 seconds