vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Disable Swear Censor (https://vborg.vbsupport.ru/showthread.php?t=293044)

CoffeeLovesYou 12-16-2012 08:33 PM

Disable Swear Censor
 
What is wrong with my code?

PHP Code:

if ($post['field6'] == "Yes"
{
$vbulletin->options['enablecensor'] = 1;
} else {
$vbulletin->options['enablecensor'] = 0;


I want it to disable the censor if the profile field6 is set to No. If it's set to Yes, I want the censor to be enabled.
This plugin is hooked to global_start, by the way. I know it works, but my if conditionals are broken.
I have the censor enabled already in vB Options. I just want it so people can turn on the censor and words will censor. No will keep the censor off (and is default option). The problem right now is when selecting Yes, the censor isn't turning on.

kh99 12-16-2012 08:46 PM

You can't use $post at global_start. Use $vbulletin->userinfo['field6'] instead.


All times are GMT. The time now is 11:40 PM.

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.01184 seconds
  • Memory Usage 1,708KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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