vanillaforums/Garden — Issue #1166: Mobile forums do not show for webOS smartphones
Author: dvangennip
Created: 2011-10-18 21:35:45+00:00
State: open

Although webOS may not be the most popular flavour these days, it would be a nice feature if such smartphones would be served the mobile version of Vanilla.

Based on some comparison of user-agents it seems adding *webos* to the _library/core/functions.general.php_ file *IsMobile* function works perfectly fine. webOS smartphones use *webos* as part of the user-agent string, while their bigger brother, the 10" TouchPad tablet uses *wOSBrowser* in its user-agent string. So it is quite simple to just serve mobile pages to the smartphones (basically I just added |webos after |kindle).

So replacing this code (currently around line 1250 in master branch)...

if (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|opera m|kindle)/i', $UserAgent))

With this...

if (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|opera m|kindle|webos)/i', $UserAgent))

.. did the trick for me. Tested with a Pre3 smartphone which now gets mobile and TouchPad tablet which gets the normal forum pages. It seems superficial for a pull request, but I hope it the code above helps.