vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   User-optional Replacements-based Censorship (https://vborg.vbsupport.ru/showthread.php?t=63875)

ptbyjason 04-15-2004 03:29 PM

Oh thank you so much! I have been wanting to do this but I had no idea how. Now everyone will be happy. THANK YOU! :)

tjdrico 04-15-2004 08:31 PM

Quote:

Originally Posted by Sonikku
I tried to install it but dunno why it af fected it, but my background image disappeared. 'Twas odd. I uninstalled it. Oh well, nice hack though. :)

I can't imagine why that would be, unless you were already using the replacement variables for something else, or added a word that modified your display template somehow. The replacement variables don't just get operated upon post contents, but entire templates, so it's quite possible that something like that happened. If you try re-installing the hack, check that it doesn't affect your forum display before adding any words. If it only happens with some words, then change those words, or change the part of the template that's being altered (such as the image name or URL). I can't think why else it would be happening.

Cyricx 04-18-2004 03:09 PM

Very awesome! Thank you TONS :)

Gio Takahashi 04-19-2004 01:16 AM

this is interesting however, I want to make it so that it is censored from Guests. Is it possible?

tjdrico 04-19-2004 08:04 AM

Quote:

Originally Posted by Gio Takahashi
this is interesting however, I want to make it so that it is censored from Guests. Is it possible?

Yes, it's a simple change.

Open ./includes/functions.php and replace this:

PHP Code:

    // USER OPTIONAL REPLACEMENTS AS WORD CENSOR HACK
    // Use replacements as an optional display-time swear filter.
    
if (== $bbuserinfo['usereplacementscensor'])
    {
        
// this user doesn't want censoring
        // so just return the text as given
        
return $newtext;
    } 

with this:

PHP Code:

    // USER OPTIONAL REPLACEMENTS AS WORD CENSOR HACK
    // Use replacements as an optional display-time swear filter.
    
if ( (== $bbuserinfo['usereplacementscensor']) && (!= $bbuserinfo['userid']) )
    {
        
// this user doesn't want censoring
        // so just return the text as given
        
return $newtext;
    } 

Save and close the file. That should be that, and guests will be subject to censorship. I'll update the main instructions with this information.

Oblivion Knight 04-20-2004 10:54 AM

The zip file has disappeared.. ;)
I was just going to install this, and now I can't.!

tjdrico 04-20-2004 11:26 AM

Quote:

Originally Posted by Oblivion Knight
The zip file has disappeared.. ;)
I was just going to install this, and now I can't.!

Oddness! Hehe, I think I screwed up when I was updating the instructions. Should be back now - sorry about that. =)

Oblivion Knight 04-20-2004 12:24 PM

It doesn't appear to be working for me.. :(

I'm using 3.0.1.. The Microstats hack also touches the same area of code in includes/functions.php, but I don't think that's the cause of it. The censor is disabled in the Admin CP, and tested on my account to enable the censor option - and the words are still visible uncensored..

Any ideas?

007 04-20-2004 01:06 PM

Good work tjdrico. I don't have VB3 yet (plan to upgrade in the next week or so) so it will be nice not to have to rehack this one. Thanks for giving me credit for the idea. Looks like you have managed to take yours a step further and get it to work with titles as well. Looks good. I will install for sure when I upgrade.

tjdrico 04-20-2004 04:13 PM

Thanks 006, but there was absolutely zero extra effort involved in getting it to work with titles as well as thread bodies. The way the replacements system works, the entire page seems to be fed through the filter before it's sent to the browser, so it's always likely to catch everything. I may be wrong there, but it seems that way.

It could present a problem if a forum used a, image URL or something that matches part of the replaced text - users with the censorship turned on would end up with missing images. =)


All times are GMT. The time now is 06:54 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.01297 seconds
  • Memory Usage 1,744KB
  • 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_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete