vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Staff can view censored words in postbit (https://vborg.vbsupport.ru/showthread.php?t=312105)

Max Taxable 06-13-2014 02:25 AM

Staff can view censored words in postbit
 
I have a friend who admins a large v4.2.1 board and he wants himself and his staff to be able to see the censored words in postbit instead of the asterisks.

Offhand I can see this being a usergroup permission thing perhaps?

Anyone with any thoughts on this?

kh99 06-13-2014 07:09 AM

My first thought is that I believe the censoring feature replaces the word with asterisks before it's saved in the database, so that you'd need to change how that works. Or maybe you could use a hook before the censoring to find the words and log them to a different table, then use that data somehow when a staff member displays a post.

Max Taxable 06-13-2014 01:10 PM

Quote:

Originally Posted by kh99 (Post 2501740)
My first thought is that I believe the censoring feature replaces the word with asterisks before it's saved in the database, so that you'd need to change how that works. Or maybe you could use a hook before the censoring to find the words and log them to a different table, then use that data somehow when a staff member displays a post.

I was thinking something like this, were this a vB 3.8.

includes/functions.php find:
HTML Code:

function censortext($text) {
  global $enablecensor,$censorwords,$censorword,$censorchar;


Replace with:
HTML Code:

function censortext($text) {
  global $enablecensor,$censorwords,$censorword,$censorchar,$bbuserinfo;
  if(($bbuserinfo[usergroupid] == 5) or ($bbuserinfo[usergroupid] == 6) or ($bbuserinfo[usergroupid] == 7)){
    $enablecensor = 0;
  }

Then find

HTML Code:

        $bbcode=str_replace("{", "{", $bbcode); // stop people posting replacements in their posts

  return censortext($bbcode);

Replace with:

HTML Code:

        $bbcode=str_replace("{", "{", $bbcode); // stop people posting replacements in their posts

  return $bbcode; 


But I have no idea the version 4 use of this.

kh99 06-13-2014 08:17 PM

I don't find any function called censortext() in vb3.8.8. Maybe it's an older version that works differently? I see a function called fetch_censored_text(), but if you added a check of bbuserinfo[userid] I believe you'd be checking the usergroup of the user who was posting, since it's called when the post is saved and not every time it's viewed.

Max Taxable 06-13-2014 08:27 PM

Quote:

Originally Posted by kh99 (Post 2501839)
I don't find any function called censortext() in vb3.8.8. Maybe it's an older version that works differently? I see a function called fetch_censored_text(), but if you added a check of bbuserinfo[userid] I believe you'd be checking the usergroup of the user who was posting, since it's called when the post is saved and not every time it's viewed.

Yes I hadn't thought of that. That check would merely allow those usergroups to not have to pass the censor.

Any way you can think of, for the staff of a board to be able to see what was actually typed and not the asterisks?

tbworld 06-13-2014 11:39 PM

I looked at at the vb4 code since I kind of liked @kh99's idea and I knew he was on the right track. I was hoping in the post table "pagetext" the censored words were still there and in some magical way they were only parsed before storing as a "parsed-post". I kind of new this was wrong, but was still hoping. Anyway, no-go.

One problem I noticed was the check for censored words via "fetch_censored_text" occurs everywhere for different contexts. It simply censors the string without caring from where it came from. I think I would want to write an interim function for "Fetch_censored_text" which stores the censored words and the context from which it came. In this way you can store the censored text from other areas of the board. The title of the post for example, Social group messages or CMS articles.

If you just wanted to just handle the "post text" then of course that would simplify the process -- there would be no reason to store the context.

It looks to me that if we used "class_dm_threadpost.php" --> class method "vB_DataManager::verify_pagetext" and extend the class with a modified method "verify_pagetext" --> which would call a modified function "fetch_sensored_text", where we would store the sensor-ed words in the new table that was created. We could simply add a simple AJAX call to query and display the results, since only admins and maybe mods would be using it.

Anyway, it does seem to be possible.

Max Taxable 06-14-2014 12:43 AM

Quote:

Originally Posted by tbworld (Post 2501845)

If you just wanted to just handle the "post text" then of course that would simplify the process -- there would be no reason to store the context.

It looks to me as if you use "class_dm_threadpost.php" --> class method "vB_DataManager::verify_pagetext" and extend the class with a modied method "verify_pagetext" --> that would call my modified function "fetch_sensored_text", where I would store the sensor-ed words in my new table. You could simply add a simple AJAX call to query and display the results, since only admins and maybe mods would be using it.

Anyway, it does seem to be possible.

That's interesting and seems a elegant way of accomplishing this.

Code it! :D

CAG CheechDogg 06-14-2014 05:46 AM

Yeah yeah..what he (Max) said ! lol ...:D

ozzy47 06-14-2014 10:14 AM

<a href="https://vborg.vbsupport.ru/showthread.php?t=310258" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=310258</a>

Maybe this mod?

BasicGreatGuy 06-14-2014 11:50 AM

Quote:

Originally Posted by ozzy47 (Post 2501902)

When a regular member posts a curse word, he or she, along with the rest of the forum sees ***. The admins and mods of the site in question would like the ability to see the curse word that was posted without the ***, while still showing *** to the regular members.

Unless I misread your mod, it doesn't appear to have the ability to do what the admins and mods of this site are looking for.


All times are GMT. The time now is 08:38 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.01517 seconds
  • Memory Usage 1,747KB
  • 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
  • (4)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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