Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
Details »»

Version: , by Niels vdw Niels vdw is offline
Developer Last Online: Mar 2010 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 10-31-2001 Last Update: Never Installs: 5
 
No support by the author.

Requested @ https://vborg.vbsupport.ru/showthrea...threadid=31924

Hey,
this hack allows your members to specify their own list of 'badwords' wich will be blocked within posts.
Note that this only works when Censoring is enabled (In vBulletin Options), if not you won't notice anything from this hack.

First preform this query:
Code:
ALTER TABLE user ADD censorlist VARCHAR(250) AFTER ignorelist
Now goto your Admin CP and add a new template called modifyoptions_censor:
Code:
<tr> 
<td bgcolor="#F1F1F1"><normalfont><b>Words to Censor in a 
Thread :</b></normalfont><br>
<smallfont>Words you don't want to view, seperate them by spaces.</smallfont></td>
<td bgcolor="#F1F1F1">
<input type="text" name="censorlist" size="30" maxlength="250" value="$censorlist">
</td>
</tr>
Now find the template modifyoptions (it is in User Option Templates), open it and find:
Code:
<select name="umaxposts">
<option value="-1" $postsdefaultselected>Use forum default</option>
$maxpostsoptions
</select>
</smallfont></td>
</tr>
After it add:
Code:
$censoroptions
Next open the file member.php and find (line 525):
Code:
$templatesused = "modifyoptions_maxposts,modifyoptions_styleset,modifyoptions_stylecell,usercpnav,modifyoptions";
And replace it with:
Code:
$templatesused = "modifyoptions_maxposts,modifyoptions_styleset,modifyoptions_stylecell,modifyoptions_censor,usercpnav,modifyoptions";
Again in member.php find:
Code:
//MaxPosts by User
And add before:
Code:
//Censorlist
if ($enablecensor == 1) {
$censorlist = $bbuserinfo[censorlist];
eval ("\$censoroptions .= \"".gettemplate("modifyoptions_censor")."\";");
}
Still in member.php find:
Code:
$DB_site->query("UPDATE user
SET ".$updatestyles."adminemail='$adminemail',
showemail='$showemail',invisible='$invisible',cookieuser='$cookieuser',
maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',
startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
emailonpm='$emailonpm',pmpopup='$pmpopup',usergroupid='$bbuserinfo[usergroupid]',
nosessionhash='$nosessionhash'
WHERE userid='$bbuserinfo[userid]'");
And replace it with:
Code:
$DB_site->query("UPDATE user
SET ".$updatestyles."adminemail='$adminemail',
showemail='$showemail',invisible='$invisible',cookieuser='$cookieuser',
maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',
startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
emailonpm='$emailonpm',pmpopup='$pmpopup',usergroupid='$bbuserinfo[usergroupid]',
nosessionhash='$nosessionhash',censorlist='".addslashes($censorlist)."'
WHERE userid='$bbuserinfo[userid]'");
Now in functions.php add:
Code:
// ###################### Start censortext #######################
function censortext($text) {
global $enablecensor,$censorwords,$censorword,$censorchar,$bbuserinfo;
<  Cutted >
return $text;
}
And the following after it:
Code:
// ###################### Start supercensortext #######################
function supercensortext($text) {
global $enablecensor,$censorwords,$censorword,$censorchar,$bbuserinfo;
$censorwords .= ' '.$bbuserinfo[censorlist];
if ($enablecensor==1 and $censorwords!="") {
if (!isset($censorword)) {
$censorwords = preg_quote($censorwords);
$censorwords = str_replace('/', '\\/', $censorwords);
$censorword=explode(" ",$censorwords);
} else {
reset($censorword);
} 
while (list($key,$val)=each($censorword)) {
if ($val!="") {
if (substr($val,0,2)=="\\{") {
$val=substr($val,2,-2);

$text=trim(preg_replace("/([^A-Za-z])".$val."(?=[^A-Za-z])/si","\\1".repeatchar($censorchar,strlen($val))," $text "));
} else {
$text=trim(preg_replace("/$val/si",repeatchar($censorchar,strlen($val))," $text "));
}
}
}
}
return $text;
}
Finally in functions.php find:
Code:
return censortext($bbcode);
And replace it with:
Code:
return supercensortext($bbcode);
You can always reread it at http://www.vanderwildt.com/~vbulletin/personcensor.htm
It is tested, i cannot give you a demo as our boards aren't public yet, sorry

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 11-01-2001, 11:15 PM
damicatz damicatz is offline
 
Join Date: Oct 2001
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool hack, I'll have to install it later

On another note, out of curiosity, are you The Niels that makes OpenBB?
Reply With Quote
  #3  
Old 11-01-2001, 11:33 PM
Syphin Syphin is offline
 
Join Date: Oct 2001
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cool hack... ^^ Ill install it in a little bit.. Good idea...


-Syphin
Reply With Quote
  #4  
Old 11-02-2001, 12:25 AM
damicatz damicatz is offline
 
Join Date: Oct 2001
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

EDIT : Minor Modifications

Wierd

I think I found another bug in vBulletin, it changes first alt color with brackets to some wierd color.

Anyways

Code:
<tr> 
<td bgcolor="{ firstaltcolor }"><normalfont><b>Words to Censor in a 
Thread :</b></normalfont><br>
<smallfont>Words you don't want to view, seperate them by spaces.</smallfont></td>
<td bgcolor="{ secondaltcolor }">
<input type="text" name="censorlist" size="30" maxlength="250" class="bginput" value="$censorlist">
</td>
</tr>
Notice the spaces between the brackets and firstalt and secondalt color, you should delete the spaces after copying and pasting. For some odd reason vBulletin wants to convery { firstaltcolor } typed like #13486D to whatever color it is on the board it's being posted on.
Reply With Quote
  #5  
Old 11-02-2001, 09:50 AM
veedee veedee is offline
 
Join Date: Oct 2001
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Waahoooo

I just found this


superb, thanks so much, my code was coming along slowly as was crap.

brilliant !
Reply With Quote
  #6  
Old 11-21-2001, 11:09 PM
gmtalk gmtalk is offline
 
Join Date: Oct 2001
Location: Phillip Island
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works well thanks!
Reply With Quote
  #7  
Old 11-14-2002, 05:32 AM
Night Owl Night Owl is offline
 
Join Date: May 2002
Location: Oklahoma
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can someone update this for 2.2.8?
Reply With Quote
Reply

Thread Tools

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 03:39 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.04252 seconds
  • Memory Usage 2,261KB
  • Queries Executed 20 (?)
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
  • (15)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete