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 06-13-2014, 03:25 AM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 06-13-2014, 08:09 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
tbworld
  #3  
Old 06-13-2014, 02:10 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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.
Reply With Quote
Благодарность от:
RichieBoy67
  #4  
Old 06-13-2014, 09:17 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 06-13-2014, 09:27 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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?
Reply With Quote
  #6  
Old 06-14-2014, 12:39 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
Max Taxable
  #7  
Old 06-14-2014, 01:43 AM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tbworld View Post

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!
Reply With Quote
2 благодарности(ей) от:
BasicGreatGuy, CAG CheechDogg
  #8  
Old 06-14-2014, 06:46 AM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah yeah..what he (Max) said ! lol ...
Reply With Quote
  #9  
Old 06-14-2014, 11:14 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Maybe this mod?
Reply With Quote
  #10  
Old 06-14-2014, 12:50 PM
BasicGreatGuy BasicGreatGuy is offline
 
Join Date: Oct 2006
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ozzy47 View Post
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.
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 09:14 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07130 seconds
  • Memory Usage 2,270KB
  • Queries Executed 13 (?)
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
  • (4)bbcode_html
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (5)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete