vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Prevent one member from writing a specific word (https://vborg.vbsupport.ru/showthread.php?t=318812)

kh99 05-26-2015 11:15 AM

Quote:

Originally Posted by MarkFL (Post 2546448)
That's odd...it blocks that text for me (on my vB 4.2.1 local dev site)...:confused:

Hmm...it could have something to do with what encoding the user's OS or the forum it set for. I don't really understand the whole encoding thing very well, but when I tried your code I found that the message text had the arabic word '%u' encoded so that it wouldn't match the literal string in the code. Maybe if you have a forum set to use UTF-8 that wouldn't happen, or something like that.

hazem_aliraqi 05-26-2015 11:20 AM

Quote:

Originally Posted by kh99 (Post 2546446)
There's an encoding issue, so that the str_ireplace() doesn't match the word. I can't figure out how to encode your word so that it will match, but I have a different suggestion: use the existing censoring and add the word only for the given user by using a plugin on hook global_bootstrap_init_start and code like this:
PHP Code:

if ($vbulletin->userinfo['userid'] == XX)
{
    
$vbulletin->options['censorwords'] .= "\nحازم";


This is different because it will replace the word with a lot of '*' characters instead of deleting it, and also it will work everywhere the censor works instead of just for posts (which may or may not be an advantage for you).

If you'd rather not using the censoring mechanism, there are probably other hooks that can be used with MarkFL's code which will do the str_ireplace after the message text has been decoded.


thank you kh99 for your help

its work fine now :)


thanks for Force and mark too ;)


All times are GMT. The time now is 02:59 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.00998 seconds
  • Memory Usage 1,727KB
  • 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
  • (2)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
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete