Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-22-2002, 04:47 PM
Remi Remi is offline
 
Join Date: Nov 2001
Location: London, UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Eximpt super-mods from censortext!!

neo

I don't think FireFly has got this one
Reply With Quote
  #2  
Old 03-24-2002, 08:56 PM
Remi Remi is offline
 
Join Date: Nov 2001
Location: London, UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any idia how can this be done please!!
Reply With Quote
  #3  
Old 03-25-2002, 05:05 AM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In functions.php:

look for:

PHP Code:
function censortext($text) {
  global 
$enablecensor,$censorwords,$censorword,$censorchar
replace with:
PHP Code:
function censortext($text) {
  global 
$enablecensor,$censorwords,$censorword,$censorchar,$bbuserinfo;
if(
$bbuserinfo[usergroupid] == 5) {
  
$enablecensor 0;

Viola...
Reply With Quote
  #4  
Old 03-25-2002, 05:08 AM
Neo's Avatar
Neo Neo is offline
 
Join Date: Oct 2001
Location: Anywhere
Posts: 1,817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HAHAHAHAH.. thanks for the mentions Remi
Reply With Quote
  #5  
Old 03-25-2002, 11:05 AM
Remi Remi is offline
 
Join Date: Nov 2001
Location: London, UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much, but it is not working!!

My functions.php is a bit deferint

======
PHP Code:
// ###################### Start censortext #######################
function censortext($text) {
  global 
$enablecensor,$censorwords,$censorword,$censorchar;
  if (
$enablecensor==and $censorwords!="") {
    if (!isset(
$censorword)) { 
any other suggestions please?
Reply With Quote
  #6  
Old 03-25-2002, 02:24 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What version are you on?

This works like a charm in version 2.2.4.
Reply With Quote
  #7  
Old 03-25-2002, 03:21 PM
Remi Remi is offline
 
Join Date: Nov 2001
Location: London, UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am using 2.2.4 !!

I have noticed you dont have this line in your code:

if ($enablecensor==1 and $censorwords!="") {

Do I have to remove it ?

Thanks
Reply With Quote
  #8  
Old 03-25-2002, 03:57 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, you keep everything else the same. Maybe my lack of indentation threw you off.

Original censortext:
PHP Code:
function censortext($text) {
  global 
$enablecensor,$censorwords,$censorword,$censorchar;
  if (
$enablecensor==and $censorwords!="") {
    if (!isset(
$censorword)) {
      
$censorwords preg_quote($censorwords);
      
$censorwords str_replace('/''\\/'$censorwords);
      
$censorword=explode(" ",$censorwords);
    } else {
      
reset($censorword);
    }

    while (list(
$key,$val)=each($censorword)) {
      if (
$val!="") {
        if (
substr($val,0,2)=="\\{") {
          
$val=substr($val,2,-2);

          
$text=trim(preg_replace("/([^A-Za-z])".$val."(?=[^A-Za-z])/si","\\1".repeatchar($censorchar,strlen($val)),$text "));
        } else {
          
$text=trim(preg_replace("/$val/si",repeatchar($censorchar,strlen($val)),$text "));
        }
      }
    }
  }
  return 
$text;

Modified censortext:
PHP Code:
function censortext($text) {
global 
$enablecensor,$censorwords,$censorword,$censorchar,$bbuserinfo;
  if(
$bbuserinfo[usergroupid] == 5) {
    
$enablecensor 0;
  }
  if (
$enablecensor==and $censorwords!="") {
    if (!isset(
$censorword)) {
      
$censorwords preg_quote($censorwords);
      
$censorwords str_replace('/''\\/'$censorwords);
      
$censorword=explode(" ",$censorwords);
    } else {
      
reset($censorword);
    }

    while (list(
$key,$val)=each($censorword)) {
      if (
$val!="") {
        if (
substr($val,0,2)=="\\{") {
          
$val=substr($val,2,-2);

          
$text=trim(preg_replace("/([^A-Za-z])".$val."(?=[^A-Za-z])/si","\\1".repeatchar($censorchar,strlen($val)),$text "));
        } else {
          
$text=trim(preg_replace("/$val/si",repeatchar($censorchar,strlen($val)),$text "));
        }
      }
    }
  }
  return 
$text;

Reply With Quote
  #9  
Old 03-25-2002, 04:29 PM
Remi Remi is offline
 
Join Date: Nov 2001
Location: London, UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank very much Zzed

Now I understand what do you mean, it still doesn't work for me.

but I think the problem is with my overhacked functions.php file.

I will try it later on a clean board

Thanks
Reply With Quote
  #10  
Old 03-25-2002, 04:39 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah... I see. It 's working fine on my board.

You are very welcome.

BTW, I released this as a hack.
Reply With Quote
Reply


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 02:15 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.04301 seconds
  • Memory Usage 2,281KB
  • Queries Executed 11 (?)
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
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete