Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 05-25-2015, 04:02 PM
hazem_aliraqi's Avatar
hazem_aliraqi hazem_aliraqi is offline
 
Join Date: Oct 2010
Location: iraq
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Prevent one member from writing a specific word

hi

i want to ban someone of user to write a word

if there is any plugin to do this ?
Reply With Quote
  #2  
Old 05-25-2015, 04:52 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can create 2 plugins, at the following hook locations:
  • editpost_update_start
  • newreply_post_start

And use the following Plugin PHP Code:

PHP Code:
if ($vbulletin->userinfo['userid'] == XX)
{
    
$vbulletin->GPC['message'] = str_ireplace("banned_text"""$vbulletin->GPC['message']);

Replace XX with the userid of the user for whom the word is banned and replace banned_text with the actual banned word. The banned word will just be removed from the post content (regardless of case) for that user when creating new posts and editing existing posts.
Reply With Quote
5 благодарности(ей) от:
Black Snow, ForceHSS, hazem_aliraqi, kh99, Lynne
  #3  
Old 05-26-2015, 06:14 AM
hazem_aliraqi's Avatar
hazem_aliraqi hazem_aliraqi is offline
 
Join Date: Oct 2010
Location: iraq
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank u mark

--------------- Added [DATE]1432629398[/DATE] at [TIME]1432629398[/TIME] ---------------

not work for arabic word ?
Reply With Quote
  #4  
Old 05-26-2015, 09:27 AM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It should work for the word you put in there does not matter if its arabic or english
Reply With Quote
  #5  
Old 05-26-2015, 09:59 AM
hazem_aliraqi's Avatar
hazem_aliraqi hazem_aliraqi is offline
 
Join Date: Oct 2010
Location: iraq
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ForceHSS View Post
It should work for the word you put in there does not matter if its arabic or english

not work i try it



HTML Code:
if ($vbulletin->userinfo['userid'] == 1)
{
    $vbulletin->GPC['message'] = str_ireplace("حازم", "", $vbulletin->GPC['message']);
}
Reply With Quote
  #6  
Old 05-26-2015, 10:34 AM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You made them plugins the both of them. What vb version? and did you use notepad++ to edit it or just copy and paste from here
Reply With Quote
  #7  
Old 05-26-2015, 10:40 AM
hazem_aliraqi's Avatar
hazem_aliraqi hazem_aliraqi is offline
 
Join Date: Oct 2010
Location: iraq
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ForceHSS View Post
You made them plugins the both of them. What vb version?

no only in newreply_post_start

and it work with English word


vb 4.2.3
Reply With Quote
  #8  
Old 05-26-2015, 10:43 AM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have the same version will test

ok tested does not block حازم
Reply With Quote
  #9  
Old 05-26-2015, 11:10 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
3 благодарности(ей) от:
ForceHSS, hazem_aliraqi, MarkFL
  #10  
Old 05-26-2015, 11:13 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ForceHSS View Post
Have the same version will test

ok tested does not block حازم
That's odd...it blocks that text for me (on my vB 4.2.1 local dev site)...
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:31 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.04054 seconds
  • Memory Usage 2,266KB
  • 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
  • (1)bbcode_html
  • (2)bbcode_php
  • (3)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
  • (8)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)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