Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 03-08-2015, 11:29 AM
MistViper MistViper is offline
 
Join Date: Jan 2015
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 03-08-2015, 11:57 AM
Black Snow Black Snow is offline
 
Join Date: Jul 2012
Location: Scotland
Posts: 471
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

See: https://vborg.vbsupport.ru/showthread.php?t=267775
Reply With Quote
  #3  
Old 03-08-2015, 01:11 PM
MistViper MistViper is offline
 
Join Date: Jan 2015
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Black Snow View Post
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>
Reply With Quote
  #4  
Old 03-08-2015, 01:21 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 03-08-2015, 01:24 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Code:
if (!IS_MOBILE_STYLE)
{
  // problem code here
}
Reply With Quote
  #6  
Old 03-08-2015, 02:30 PM
MistViper MistViper is offline
 
Join Date: Jan 2015
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Attached Files
File Type: xml product-vbm_expand_userinfo.xml (20.0 KB, 3 views)
Reply With Quote
  #7  
Old 03-11-2015, 01:17 PM
MistViper MistViper is offline
 
Join Date: Jan 2015
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any help guys? I'm still stuck at solving this.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:18 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06129 seconds
  • Memory Usage 2,232KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (1)postbit_attachment
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete