PDA

View Full Version : vb4 conditionals for mobile devices


huskermax
09-06-2014, 08:45 PM
<vb:if condition="$bbuserinfo[userid] == 187">
</td><td style="vertical-align:top; width: 160px !important; padding-left:7px; padding-top: 10px;">
</vb:if>

I have the above in my showthread template. The condition coed around the spacing code is preventing user 187 from seeing some ads that use that space. His issue is on his iPad the ads in that space push the margins so bad he can't use the board on his ipad. So with that code he can now. What I would like to do is set this up with a conditional that would make all mobile users not see these ads in showthread. I do have the mobile style installed with id of 19 but users can choose to use it or not. User 187 likes using our normal style rather then the mobile style. (most of my users do)

I cold not get this code to work:



<vb:if condition=="$bbuserinfo['styleid']==19"></td><td style="vertical-align:top; width: 160px !important; padding-left:7px; padding-top: 10px;">
<vb:else /></vb:if>

Is this possible?

tbworld
09-06-2014, 09:11 PM
Use something like this from @Bop5.

Mobile Device & Browser Detection (Adapted by BOP5)
https://vborg.vbsupport.ru/showthread.php?t=292704

and then use a conditional to alter the CSS and HTML accordingly.
Just a suggestion. :)

huskermax
09-07-2014, 03:30 PM
Thanks for the info. I will take a look!