vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Removing Plugin from one skin? (https://vborg.vbsupport.ru/showthread.php?t=326254)

shibby2 03-31-2018 04:11 AM

Removing Plugin from one skin?
 
Hey, if anyone could help me, that would be awesome.

I'm making a light mobile skin for my forum. I have a plugin installed that shows random pictures from members' albums on the forum index, below the Navbar.

Since I want this skin to be as light as possible, I really don't want this plugin to work in this skin.

Is there a way I can disable/remove it JUST from this new mobile skin I'm making?

Thanks!

MarkFL 03-31-2018 11:18 AM

I would try wrapping the relevant PHP plugin code in the following:

PHP Code:

if (!IS_MOBILE_STYLE)
{
    
plugin code here...



shibby2 04-02-2018 04:16 PM

Thanks, I'll give it a try! :) I'll update soon..


EDIT: Actually, I don't even know where the plugin code is located. I looked through all the templates, and can't find anything that has it. :(

MarkFL 04-02-2018 04:59 PM

Look in your plugins, not your templates. Look for the block titled "Plugins & Products" and then click "Plugin Manager" and look at the relevant plugins associated with the product you're trying to affect.

shibby2 04-03-2018 02:59 AM

Ok, it worked, but it removed it on all my skins. lol

I think maybe I didn't put the style in correctly? What exactly would I type where you put "IS_MOBILE_STYLE"?

Thanks!

MarkFL 04-03-2018 06:46 AM

You should have "!IS_MOBILE_STYLE" but perhaps that constant isn't defined for vB 3...I don't know.

shibby2 04-03-2018 04:01 PM

Oh, it will know automatically what the mobile style is? I put the name of the style (lightweight), but it didn't work. I'll give that a try, thanks!

MarkFL 04-03-2018 04:39 PM

Yes, it should contain the styleid of your mobile style.

If that constant isn't defined for vB 3, we can try something else, but I will wait until I hear back from you on this...:)

shibby2 04-03-2018 11:18 PM

I'm a little confused. Don't mind me, I'm just really, really stupid. :D

So if the name of my style is 'lightweight,', I would want it like this:

Code:

if (!lightweight)
{
    plugin code here...
}

?

MarkFL 04-03-2018 11:46 PM

No, that's not going to work...have you tried what I initially posted?

shibby2 04-04-2018 12:56 AM

Yes I did, but it also removed it from all styles, not just the mobile one. :(

MarkFL 04-04-2018 02:48 AM

Okay, what is the styleid of your mobile style?

shibby2 04-04-2018 03:27 AM

Style ID is 4.

MarkFL 04-04-2018 04:50 AM

Okay, then try:

PHP Code:

if (STYLEID != 4)
{
    
plugin code here...



shibby2 04-04-2018 06:36 AM

That worked! :) Thank you so much!

Just wondering...and if it's not possible or too hard, please ignore...but how hard would it be to make it so users could just click a button or something to 'turn on' the random album pics if they wish to? So it would normally always be off for that style, but they have the choice to display it if they wish.

Thanks again for all the help! :)

MarkFL 04-04-2018 10:57 AM

Quote:

Originally Posted by shibby2 (Post 2593921)
That worked! :) Thank you so much!

Just wondering...and if it's not possible or too hard, please ignore...but how hard would it be to make it so users could just click a button or something to 'turn on' the random album pics if they wish to? So it would normally always be off for that style, but they have the choice to display it if they wish.

Thanks again for all the help! :)

You could set up a "yes/no" custom profile field that would allow users to toggle whether this feature works or not. Then include in the conditional:

PHP Code:

$vbulletin->userinfo['fieldX'] == 'Yes' 

where X is the id number of the custom profile field.

shibby2 04-04-2018 10:22 PM

Hmm, I like that, but I was also thinking a lot of people won't bother going into their User CP. So maybe something right there on forumhome where the pics would be, like a button or link that would turn it on? Is that possible?

MarkFL 04-04-2018 10:40 PM

Yes, that could be done, but it would require a bit of javascript coding, particularly if you want the user's choice to be remembered. Or you could wrap the whole thing in a collapsible block.

shibby2 04-04-2018 11:52 PM

That would be perfect, a collapsible box. Would that be hard?

MarkFL 04-05-2018 01:57 AM

Is the information displayed by the addon done so with a custom template?

shibby2 04-05-2018 03:41 AM

I don't know, don't really understand the question. Again, I'm dumb. lol

Normally, on all other styles, the album pics are in a collapsible box. Maybe there's a way to make it for the mobile style that the box is minimized by default, instead of being maximized by default on the other styles?

Thanks so much for all your help so far!

kai_sey 04-14-2018 10:51 AM

Was looking for something similar, although applied to a product, not plugin.

So in such a scenario, how would I block a product from loading on my mobile style?

Would I simply wrap the .xml plugin file with:

Code:

if (STYLEID != x)
{
    plugin code here...
}


Many thanks.

MarkFL 04-14-2018 11:44 AM

Quote:

Originally Posted by kai_sey (Post 2594157)
Was looking for something similar, although applied to a product, not plugin.

So in such a scenario, how would I block a product from loading on my mobile style?

Would I simply wrap the .xml plugin file with:

Code:

if (STYLEID != x)
{
    plugin code here...
}


Many thanks.

In this case you would need to wrap the code of all the product's plugins (except for those that cache templates or update AdminCP settings, etc.) in that if statement.

kai_sey 04-14-2018 03:45 PM

Quote:

Originally Posted by MarkFL (Post 2594158)
In this case you would need to wrap the code of all the product's plugins (except for those that cache templates or update AdminCP settings, etc.) in that if statement.

Just tested this, and it worked a treat. Many thanks!


All times are GMT. The time now is 05:04 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.01873 seconds
  • Memory Usage 1,762KB
  • 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
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)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