vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Can't seem to figure out how to exclude styles from showing a code (https://vborg.vbsupport.ru/showthread.php?t=266532)

HMBeaty 07-09-2011 06:08 PM

Can't seem to figure out how to exclude styles from showing a code
 
Maybe I'm tired, I dunno lol, but I can't seem to figure out how to exclude style(s) from showing a plugin code.

I've started off with this, which I know is right (I think lol)
PHP Code:

$navnetstyle explode(','$vbulletin->options['usml_navnet_styles']); 

and I've already got the plugin so certain usergroups can be excluded by using this:
PHP Code:

$navnetugs explode(','$vbulletin->options['usml_navnet_ugrest']);

if (!
is_member_of($vbulletin->userinfo$navnetugs))
{
     
code here


But, how do I do it for styles? :confused:

kh99 07-09-2011 06:22 PM

You want to eliminate some code if a certain style is showing? I think you want

PHP Code:

$navnetstyle explode(','$vbulletin->options['usml_navnet_styles']);  

if (!
in_array(STYLEID$navnetstyle))
{
     
code here



HMBeaty 07-09-2011 06:31 PM

Quote:

Originally Posted by kh99 (Post 2218596)
You want to eliminate some code if a certain style is showing? I think you want

PHP Code:

$navnetstyle explode(','$vbulletin->options['usml_navnet_styles']);  

if (!
in_array(STYLEID$navnetstyle))
{
     
code here



That doesn't work either :(

kh99 07-09-2011 06:33 PM

I guess I should have asked, what is the format of the 'usml_navnet_styles' options (comma separated style ids?) and what hook locaiton are you using (hopefully it's after the style is loaded)?

HMBeaty 07-09-2011 06:35 PM

Quote:

Originally Posted by kh99 (Post 2218601)
I guess I should have asked, what is the format of the 'usml_navnet_styles' options (comma separated style ids?) and what hook locaiton are you using (hopefully it's after the style is loaded)?

Yes, comma separated list. The hook location is parse_templates

kh99 07-09-2011 06:56 PM

Hmm...then I'm stumped, seems like it should work.

Badshah93 07-09-2011 07:01 PM

try this it will work

Code:

if (!in_array(STYLEID, explode(",", $vbulletin->options['usml_navnet_styles'])))
{
COde here
}


HMBeaty 07-09-2011 07:20 PM

Quote:

Originally Posted by aayushagrawal90 (Post 2218610)
try this it will work

Code:

if (!in_array(STYLEID, explode(",", $vbulletin->options['usml_navnet_styles'])))
{
COde here
}


Awesome, thanks :) Tested and working


All times are GMT. The time now is 08: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.02616 seconds
  • Memory Usage 1,734KB
  • 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
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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