<?php
?
include(\"bbcode.php\");
function cenzoruj($tekst)
{
$tekst = bb2html($tekst); // obsluga BBCode
$tekst = substr($tekst,0
,1000
); // max limit dlugosci tekstu $tekst = nl2br($tekst); // wstawia <br /> w miejsce entera $tekst = eregi_replace(\"(<br />{2,100})|(<br>{2,100})\",\"<br />\",$tekst); // zamienia wiecej niz 2 entery na 1 $tekst = wordwrap($tekst, 50, \" \", 1); // kroi dlugie wyrazy
$cenzor = \"<span style=\"color:red\\"><b>(!)</b></span>\";
$wrong = array (\"pamparam\"); // zdefiniuj ocenzurowane slowa
return $tekst;
}
?>
Okej, temat skonczyony.. dziala w takim przypadku:
<?
include(\"bbcode.php\");
function cenzoruj($tekst)
{
$tekst = bb2html($tekst); // obsluga BBCode
$tekst = substr($tekst,0
,1000
); // max limit dlugosci tekstu $tekst = str_replace(\"r\",\"\",$tekst); // usuwa znak konca wiersza $tekst = eregi_replace(\"(n{2,100})\",\"n\",$tekst); // zamienia wiecej niz 2 nowe linie na 1 $tekst = nl2br($tekst); // wstawia <br /> w miejsce entera $tekst = wordwrap($tekst, 50, \" \", 1); // kroi dlugie wyrazy
$cenzor = \"<span style=\"color:red\\"><b>(!)</b></span>\";
$wrong = array (\"pamparam\"); // zdefiniuj ocenzurowane slowa for($i=0; $i<count
($wrong); $i++) $tekst=eregi_replace($wrong[$i], $cenzor, $tekst);
return $tekst;
}
?>
I tyle :-)