The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Plugin based on user's screen size?
Hi everyone,
I saw this thread here: https://vborg.vbsupport.ru/showthread.php?p=2415381 and am trying to do something similar. I would like to be able to have certain code run only when a user's screen width is larger than a certain amount. On my site I currently have a plugin that hooks into global_setup_complete and determines when to show a second advertisement on my forum to a guest visitor. Currently it is setup to only show a second advert if the user is not using a tablet or a phone to view the page. I would also like to add the check for screen width at the plugin level. I have the following code: Code:
global $vbulletin, $show; //If the user isn't using a phone or tablet to view the site, show the second advertisement. if (!$vbulletin->detect->isMobile() AND !$vbulletin->detect->isTablet() ){ $show['second_header_ad'] = true; } In the thread I linked above, they are using the following code in a template. How can I modify that to work inside my plugin code? Code:
<vb:if condition="screen.width <= 1280"> Code if screen width is smaller than 1280 <vb:else/> Code if screen width is bigger than 1280 </vb:if> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|