MyBB Community Forums

Full Version: Make user switch theme when mobile!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings everyone,

I have a theme on my mybb site and a one for mobile. I have both themes installed already my question is how do I get it to where when a user views the forum on his mobile it automatically switches his theme to the mobile one and when he views it on his desktop or laptop it switches back to the theme he had chosen?
instead of using two different themes that we know nothing about, you may need to go with one theme that is responsive. what do u think?
As Michael suggested, you can go with responsive theme or try this PHP implementation of user agent switching
https://github.com/donatj/PhpUserAgent

Regards
WallBB
Im going to try this php agent switcher. I am having a bit of trouble though all I see is this master files I am not familiar with this but isn't it suppose to be one php file or do I just upload all these files into my root of the website?
Use cloudflare, they offer this type of service.

To elaborate: Make a mobile.yourdomain.xxx and then simply redirect mobile clients there, where the default theme is your mobile one!!
(2017-02-23, 02:15 PM)Elitas Wrote: [ -> ]Use cloudflare, they offer this type of service.

To elaborate: Make a mobile.yourdomain.xxx and then simply redirect mobile clients there, where the default theme is your mobile one!!

I am not sure if this is the way to do it wouldn't that require me to remake the forum in the subdomain & have to keep merging databases? I was able to do what i'm asking for with the Mybb GoMobile theme but I do not like that theme and already have a mobile theme installed that looks better & I would like to have it switch them to that theme. Isn't there a php file I can add to the inc folder to do this?
(2017-02-23, 01:42 PM)DeMoN100 Wrote: [ -> ]Im going to try this php agent switcher. I am having a bit of trouble though all I see is this master files I am not familiar with this but isn't it suppose to be one php file or do I just upload all these files into my root of the website?

There is a documentation for that in the above link, you should read that first Smile