Browser Detection (Mobile/MSIE)

Browser Detection (Mobile/MSIE) 1.3.3

No permission to download
@cclaerhout

Got an error after installing the update:

Code:
Server Error Log
Error Info
ErrorException: Fatal Error: syntax error, unexpected end of file, expecting ')' -library/Sedo/DetectBrowser/Listener/Visitor.php:225
Generated By: Unknown Account, 17 minutes ago
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
["url"] => string(63) "http://inthegame.nl/forums/threads/ons-anti-cheat-beleid.32089/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}

Please advice?
 
I have uninstalled, re-uploaded and reinstalled this 5 times but I still receive the message in Options -> Appearance for your mobile style selector add-on..

Required addon not installed In order to work the option "Default Tablet Style" needs this addon.
 
I have uninstalled, re-uploaded and reinstalled this 5 times but I still receive the message in Options -> Appearance for your mobile style selector add-on..

Required addon not installed In order to work the option "Default Tablet Style" needs this addon.
  1. Installing, 5, 10, 100 times addon is not very usefull if it doesn't work the first time and you didn't get an error message during install
  2. "Options -> Appearance for your mobile style selector add-on" => Where does it come from? From this addon? If yes, I've just tested and everything is working fine for me.
  3. The current addon doesn't require any configuration. It just add variables to the visitor object so the visitor browser can be checked in templates or in php.
 
Great addon! Is there a way to output what device the user is actually using within the template? e.g. {$visitor.getBrowser}
 
I tried to use this

Code:
<xen:if is="{$visitor.getBrowser.isMobile}">
You are using mobile.
<xen:else />
You are not using mobile
</xen:if>

However if i visited using mobile, at first impression, i still get "You are not using mobile".
But on next impression (for example after i refresh), i get "You are using mobile".

Do you experience the same too?
 
Hey guys, I was reading all the previous comments above and still trying to get a grasp on this (slightly new to xenforo).

I originally downloaded this template: https://xenforo.com/community/resources/xforobook-mobile.1867/

Then it linked me to download another addon: https://xenforo.com/community/resources/mobile-style-selector.1190/

Then finally told me to download this one (Detection mobile).

Now they all installed fine, no problem. The template works fine when I'm on desktop. BUT, when I switch to mobile, the mobile template doesn't show up. I saw that you need to add some coding pertaining to $visitor and browser information.

I'm just a little lost what exactly to put, and kudos to the developer, the directions are clear, it's just mainly my lack of coding knowledge (rookie here). I'm learning as I go here, I know it's probably not the best way.

I was wondering if anybody could pass on some knowledge/direction as to how to get it working.

Thanks and Cheers,

~Steve
 
Fantastic addon, thank you!

I want to load a different JavaScript for desktops, tablets, and mobiles. Since tablets are detected as mobile, how can I prevent loading the mobile JS on a tablet?

I tried it like this but I know it's wrong. Just sharing to illustrate that I did try before asking ;)

Code:
<xen:if is="{$visitor.getBrowser.isMobile}">
         Mobile.js
<xen:elseif is="{$visitor.getBrowser.isTablet}" />
         Tablet.js
<xen:else />
         Desktop
</xen:if>
 
I think I got it.

Code:
<xen:if is="{$visitor.getBrowser.isMobile} AND {$visitor.getBrowser.isTablet}">
Tablet
<xen:elseif is="{$visitor.getBrowser.isMobile}" />
Mobile
<xen:else />
Desktop
</xen:if>
 
I think I got it.

Code:
<xen:if is="{$visitor.getBrowser.isMobile} AND {$visitor.getBrowser.isTablet}">
Tablet
<xen:elseif is="{$visitor.getBrowser.isMobile}" />
Mobile
<xen:else />
Desktop
</xen:if>
Nope ;)
When a device is detected as a tablet, it will be also detected as a mobile one. So your first condition is redundant. But you gave yourself the solution using words :rolleyes:
how can I prevent loading the mobile JS on a tablet?
=> continue if variable is detected as mobile but not tablet ;)

Code:
<xen:if is="{$visitor.getBrowser.isTablet}">
         Tablet.js
<xen:elseif is="{$visitor.getBrowser.isMobile} AND !{$visitor.getBrowser.isTablet}" />
         OnlyMobile.js
<xen:else />
         Desktop
</xen:if>


Edit: now i'm not sure it is worth coding tree different JS files. Using screen size might be more efficient.
 
Interesting. Is that for some custom development, or a regular service/add-on you are using?

Nope ;)
When a device is detected as a tablet, it will be also detected as a mobile one. So your first condition is redundant. But you gave yourself the solution using words :rolleyes:

=> continue if variable is detected as mobile but not tablet ;)

Code:
<xen:if is="{$visitor.getBrowser.isTablet}">
         Tablet.js
<xen:elseif is="{$visitor.getBrowser.isMobile} AND !{$visitor.getBrowser.isTablet}" />
         OnlyMobile.js
<xen:else />
         Desktop
</xen:if>


Edit: now i'm not sure it is worth coding tree different JS files. Using screen size might be more efficient.

Thanks! I'm actually using it for the JS which sets up our DFP ad units.
 
Top Bottom