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),
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 - which way is better, such plugin or simply bbcode (pcre) i did dig in google but still not sure
my goal is to block (preg_replace) all bad words and illegal links @ my site
@Trustmaster: i did like u suggested
wordcensor.setup.php
<?PHP
defined( 'COT_CODE' ) or die ( 'Wrong URL' );
?>
|
wordcensor.forum.php
<?PHP
defined( 'COT_CODE' ) or die ( 'Wrong URL' );
require_once cot_incfile( 'wordcensor' , 'plug' );
$t ->assign( array (
"FORUMS_POSTS_ROW_TEXT" => str_replace ( $wc_censor , $wc_replace , $row [ 'fp_text' ]),
"FORUMS_POSTS_PAGETITLE" => str_replace ( $wc_censor , $wc_replace , $toptitle ),
));
?>
|
wordcensor.functions.php
<?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]);
}
}
?>
|
wordlist.php
<?PHP
$wc_censor = array (
'word' ,
'word2'
'www.link.com'
'www.link2.com'
);
$wc_replace = array (
' CENZORED ' ,
' CENZORED_different_way ' ,
' FORBIDDEN LINK '
' ALSO FORBIDDEN' ,
);
?>
|