vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   telling a plugin not to do what it does for mobile themes (https://vborg.vbsupport.ru/showthread.php?t=317681)

MistViper 03-08-2015 11:29 AM

telling a plugin not to do what it does for mobile themes
 
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

Quote:

Originally Posted by Black Snow (Post 2539831)

Great but were do I add that code in your mod? The expand user info one.

I tried adding it myself but get errors.
Code:

<!-- 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>


kh99 03-08-2015 01:21 PM

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:

Code:

$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.

kh99 03-08-2015 01:24 PM

...and it seems that there is, it's IS_MOBILE_STYLE. So you would just want:

Code:

if (!IS_MOBILE_STYLE)
{
  // problem code here
}


MistViper 03-08-2015 02:30 PM

1 Attachment(s)
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.


All times are GMT. The time now is 05:31 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01264 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete