<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : [Plugin] Wordcensor</title>
		<link>https://www.cotonti.com</link>
		<description>Last topic posts</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Sat, 11 Apr 2026 16:53:19 -0000</pubDate>

		<item>
			<title>Raylandar</title>
			<description><![CDATA[<p>I would add it as a module, and store the items you want filtered in the database.</p>

<p> </p>

<p>You could easily create a table, that had three items</p>

<p>id, as int, badword, as varchar(75), permission(as tinyint)</p>

<p>Reference the array instead of bad words by loading the db query</p>

<p> </p>

<p> </p>
]]></description>
			<pubDate>Thu, 31 Mar 2016 14:10:18 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6821&d=0#post41576]]></link>
		</item>
		<item>
			<title>Dave</title>
			<description><![CDATA[<p>hey ppl, i did some small porting to SIENA 9.18 and i stopped, for now, its like i have to make these for tons of 'parts' (like urlkiller mentioned: list),</p>

<p>basicly i have doubts about the idea, i mean first of all there has to be a way to make php file for every input and the second - <span class="short_text" lang="en" xml:lang="en"><span class="hps">which way is better, such plugin or simply bbcode (</span></span>pcre<span class="short_text" lang="en" xml:lang="en"><span class="hps">) i did dig in google but still not sure</span></span><br /><br />
my goal is to block (preg_replace) all bad words and illegal links @ my site<br /><br />
@<a href="https://www.cotonti.com/users/Trustmaster">Trustmaster: </a>i did like u suggested</p>

<pre class="brush:php;gutter:false;toolbar:false;" title="wordcensor.setup.php">
&lt;?PHP

/* ====================
[BEGIN_COT_EXT]
Code=wordcensor
Name=Word Censor
Description=Word filter
Version=0.9b
Date=16-feb-2016
Author=Dave
Copyright=urlkiller (neocrome.net)
Notes=This plugin was coded in 12-09-2007 by urlkiller&lt;br /&gt; Ported to Cotonti Genoa / Siena in 2012-2016.&lt;br /&gt;-Dave.
Auth_guests=R
Lock_guests=W12345A
Auth_members=R
Lock_members=W12345A
[END_COT_EXT]
==================== */

defined('COT_CODE') or die('Wrong URL');

?&gt;</pre>

<pre class="brush:php;gutter:false;toolbar:false;" title="wordcensor.forum.php">
&lt;?PHP

/* ====================
[BEGIN_COT_EXT]
Hooks=forums.posts.loop
[END_COT_EXT]
==================== */

defined('COT_CODE') or die('Wrong URL');

require_once cot_incfile('wordcensor', 'plug');

// overwrite the original output from forum posts...
$t-&gt;assign(array(
	"FORUMS_POSTS_ROW_TEXT" =&gt; str_replace($wc_censor,$wc_replace,$row['fp_text']),
	"FORUMS_POSTS_PAGETITLE" =&gt; str_replace($wc_censor,$wc_replace,$toptitle),
));

// note: need to add line for topic_description

?&gt;</pre>

<pre class="brush:php;gutter:false;toolbar:false;" title="wordcensor.functions.php">
&lt;?PHP

include('wordlist.php');

$filename = $cfg['plugins_dir']."/wordcensor/inc/words.txt";
$fp = fopen( $filename, "r" ) or die("Couldn't open $filename");
while ( ! feof( $fp ) ) {
   $line = fgets( $fp );
    if (trim($line) != "") {
	$values = explode("\t", $line);
	array_push($wc_censor, "/".$values[0]."/i");
	array_push($wc_replace, $values[1]);
	}
      }

?&gt;</pre>

<pre class="brush:php;gutter:false;toolbar:false;" title="wordlist.php">
&lt;?PHP
$wc_censor = array(
'word',
'word2'
'www.link.com'
'www.link2.com'
);
$wc_replace = array(
' CENZORED ',
' CENZORED_different_way ',
' FORBIDDEN LINK '
' ALSO FORBIDDEN' ,
);

?&gt;</pre>

<p> </p>
]]></description>
			<pubDate>Wed, 17 Feb 2016 03:21:49 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6821&d=0#post41400]]></link>
		</item>
		<item>
			<title>urlkiller</title>
			<description><![CDATA[<p>
	@Dave, this is actually looking not that bad... !</p>
<p>
	you'll need to make a part for the list.tpls too.</p>
<p>
	as for comments, this will be a little bit harder then for pages and lists.<br /><br />
	in functions.php (around line 1000) you'll find "comments.loop" as Hook. this is the one you'll need to replace the standart output.<br />
	you just use the following tag: 'COMMENTS_ROW_TEXT' =&gt; $com_text,</p>
<p>
	this should do the trick..<br /><br />
	 </p>
<p><strong>Added 39 seconds later:</strong></p><p>
	and yes, check for deprecated stuff please!!! in PHP as well as cotonti!!</p>
]]></description>
			<pubDate>Fri, 09 Mar 2012 07:46:42 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6821&d=0#post33480]]></link>
		</item>
		<item>
			<title>Dave</title>
			<description><![CDATA[<p>
	guys, easy, maybe i simply named it wrong, its more like WIP, if urlkiller will help get the minichat working ill upload to downloads if he will let me</p>
<p>
	alos i'd expect that easer way would be use bbcode / preg_replace thing</p>
<p>
	also :p as u see u gave some tips, questions, so ill try to develop it a bit, so it wont be some old code ;p</p>
]]></description>
			<pubDate>Thu, 08 Mar 2012 18:49:18 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6821&d=0#post33479]]></link>
		</item>
		<item>
			<title>esclkm</title>
			<description><![CDATA[<p>
	Why do you does not use callbacks for templates?</p>
]]></description>
			<pubDate>Thu, 08 Mar 2012 18:02:04 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6821&d=0#post33478]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[<p>
	Why not upload it to Downloads instead?</p>
<p>
	Another note: sed_cc() function is deprecated. Use htmlspecialchars() instead.</p>
]]></description>
			<pubDate>Thu, 08 Mar 2012 17:14:28 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6821&d=0#post33476]]></link>
		</item>
		<item>
			<title>Dave</title>
			<description><![CDATA[<p>Hi, so as <strong><a href="https://www.cotonti.com/users/urlkiller">urlkiller</a> </strong>asked me to post that in forums, here it is:</p>

<p><strong>setup</strong>:</p>

<pre class="brush:php;">
&lt;?PHP
/* ====================
[BEGIN_SED_EXTPLUGIN]
Code=wordcensor
Name=Word Censor
Description=neocrome.net
Version=0.9
Date=12-09-2007
Author=urlkiller
Copyright=
Notes=This plugin was coded in 12-09-2007, 23.02.2012 i took it together so people could use it.
SQL=
Auth_guests=RW
Lock_guests=RW
Auth_members=RW
Lock_members=RW
[END_SED_EXTPLUGIN]
==================== */

if ( !defined('SED_CODE') ) { die("Wrong URL."); }

?&gt;</pre>

<p><strong>wordcensor.forum.php</strong></p>

<pre class="brush:php;">
&lt;?PHP
/* ====================
[BEGIN_SED]
File=plugins/wordcensor/wordcensor.forum.php
Version=
Updated=
Type=Plugin
Author=urlkiller
Description=
[END_SED]

[BEGIN_SED_EXTPLUGIN]
Code=wordcensor
Part=forums
File=wordcensor.forum
Hooks=forums.posts.loop
Tags=
Order=10
[END_SED_EXTPLUGIN]
==================== */

// include word list only once ;)
require_once('inc/wordcensor.wordlist.php');

// overwrite the original output from forum posts...
$t-&gt;assign(array(
// the posts text itself
"FORUMS_POSTS_ROW_TEXT" =&gt; str_replace($wc_censor,$wc_replace,$row['fp_text']),
// the tile of the forums post
"FORUMS_POSTS_PAGETITLE" =&gt; str_replace($wc_censor,$wc_replace,$toptitle),
));
</pre>

<p><strong>wordcensor.page.php</strong>:</p>

<pre class="brush:php;gutter:false;toolbar:false;">
"PAGE_TEXT" =&gt; sed_parse(sed_cc(str_replace($wc_censor,$wc_replace,$pag['page_text']))), $cfg['parsebbcodepages'], $cfg['parsesmiliespages'], 1, 
// comments of a page "PAGE_COMMENTS_DISPLAY" =&gt; str_replace($wc_censor,$wc_replace,$comments_display),

// the page title itself "PAGE_TITLE" =&gt; str_replace($wc_censor,$wc_replace,$pag['page_fulltitle']),</pre>

<p><strong>wordcensor.comments.php</strong>:</p>

<pre class="brush:php;gutter:false;toolbar:false;">
"COMMENTS_ROW_TEXT" =&gt; str_replace($wc_censor,$wc_replace,$com_text),
</pre>

<p>works good on 0,6,21 except minichat thing however i think it can be replaced by bbcode <em>'pcre' (preg_replace)</em> i dunno if the part for the bbcode is correct but it works in the minichat</p>
]]></description>
			<pubDate>Thu, 08 Mar 2012 13:21:51 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6821&d=0#post33475]]></link>
		</item>
	</channel>
</rss>