View Full Version : telling a plugin not to do what it does for mobile themes
MistViper
03-08-2015, 11:29 AM
There is a plugin I use that replaced a bit of the postbit mini profile but this causes the mobile themes not to display the postbit correctly. Can't see posts on the mobile theme.
Is there like a style condition ID to allow the mod to only work on a selected amount of styles and not on mobile styles?
Black Snow
03-08-2015, 11:57 AM
See: https://vborg.vbsupport.ru/showthread.php?t=267775
MistViper
03-08-2015, 01:11 PM
See: https://vborg.vbsupport.ru/showthread.php?t=267775
Great but were do I add that code in your mod? The expand user info one.
I tried adding it myself but get errors.
<!-- see bottom of postbit.css for .userinfo .popupmenu styles -->
<phpcode>
$xstyleid = '5 3 7';
$nstyleid = preg_split('#\s+#s', $xstyleid, -1, PREG_SPLIT_NO_EMPTY);
if (in_array($style['styleid'],$nstyleid))
{
</phpcode>
your code here
<phpcode>
}
</phpcode>
{vb:raw template_hook.postbit_end}]]></template>
I don't know what the person who posted that was getting at. If you want to check a list of styles, then it would be easier to just create an array instead of using a regular expression to split a string. In any case, maybe you want something like this:
$standard_styles = array(3, 5, 7);
if (in_array(STYLEID, $standard_styles))
{
your code here
}
But that thread wasn't asking specifically about mobile styles. I'm thinking since they're in a separate section in the style manager, there has to be a way to check if the current style is a mobile style without having to list the ids in the code.
...and it seems that there is, it's IS_MOBILE_STYLE. So you would just want:
if (!IS_MOBILE_STYLE)
{
// problem code here
}
MistViper
03-08-2015, 02:30 PM
Thank you for your help but were would I add that in the attachment below?
I'm really bad at code other then CSS. The goal is to let the plugin only work on normal themes and not do anything on mobile themes.
Thanks so much for your help!
MistViper
03-11-2015, 01:17 PM
Any help guys? I'm still stuck at solving this.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.