MyBB Community Forums

Full Version: UA Theme
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone! It's been a long time since I last created a plugin for MyBB. This one I'm a bit surprised I haven't seen yet (or perhaps I just didn't look hard enough) so I spent a couple of hours to make it.

What is it? A plugin that allows user-agent-specific theme overrides. This means that you can have your guests viewing the site on, say, a mobile browser see it in a theme that is best suited for their device.

It is based on regexes, so you have a great deal of control over what browsers get what theme. If a browser doesn't have a theme override, it just goes back to normal theme loading mode.

Note that it will use a theme even if a user normally isn't able to even see it.

I've included some common regexes in the readme file, so don't worry if you don't know how to do them.

Link: http://mods.mybboard.net/view/ua-theme (put in by polar)
nice... i will try this..
Thanks.
Yes! Thank you, its amazing Smile
Nice work....
Thanks, polar. I posted that at 4AM and shortly after I clicked the post button I realized I forgot any links or description of where to find it.

Ideally you'll only need a few regexes: One set for text-only browsers like Lynx, and a set for mobile browsers like the iPhone's Safari. You can use it however you want, though.

The plugin is so simple, most likely any updates will be to pretty it up. Right now there are a couple of cases where it will silently fail if you try to do something to a nonexistant regex, which isn't too much of a problem but might bug some people. I also might move the 'add new' link to the top of the list if people want me to.