Nieuw lid |
|
<?php
function italic($code) {
$code = "<i>".$code."</i>";
return $code;
}
function bold($code) {
$code = "<b>".$code."</b>";
return $code;
}
function underlined($code) {
$code = "<u>".$code."</u>";
return $code;
}
function kleuren($code) {
$code = str_replace("&", "&", $code);
$code = str_replace("<", "<", $code);
$code = str_replace(">", ">", $code);
$code = str_replace(" <?", "<?", $code);
$code = str_replace("<br>", "", $code);
$code = str_replace("<br />", "", $code);
$code = str_replace("" ", "\"", $code);
$code = str_replace(""", "\"", $code);
if (!strpos($code,"<?") and substr($code,0,2)!="<?") {
$code="<?".trim($code)."?>";
$addedtags=1;
}
ob_start();
$oldlevel=error_reporting(0);
highlight_string($code);
error_reporting($oldlevel);
$buffer = ob_get_contents();
ob_end_clean();
if(!empty($addedtags)) {
$openingpos = strpos($buffer,'<?');
$closingpos = strrpos($buffer, '?');
$buffer = substr($buffer, 0, $openingpos).substr($buffer, $openingpos+5, $closingpos-($openingpos+5)).substr($buffer, $closingpos+5);
}
// Van hier
// Tot hier
return $buffer;
}
function ubb_code($bericht) {
$kleur1 = "#EAF0FA";
$kleur2 = "#F7F7F7";
$borderkleur = "#D3D3D3";
$bericht = htmlspecialchars("$bericht");
$bericht = stripslashes($bericht);
$bericht = nl2br("$bericht");
$bericht = preg_replace('_\[code\](.*?)\[/code\]_ise', "[phptable] kleuren(' \\1 ') [/phptable]", $bericht);
$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("[small]", "<small>", $bericht);
$bericht = str_replace("[/small]", "</small>", $bericht);
$bericht = str_replace("[Quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font color=\"#000000\">", $bericht);
$bericht = str_replace("[/Quote]", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[php]", "[phptable][php]", $bericht);
$bericht = str_replace("[/php]", "[/php][/phptable]", $bericht);
$bericht = str_replace("[phptable]", "<table width=\"100%\" bgcolor=\"$kleur2\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td>", $bericht);
$bericht = str_replace("[/phptable]", "</td></tr></table>", $bericht);
$bericht = str_replace("[table]", "<table>", $bericht);
$bericht = str_replace("[/table]", "</table>", $bericht);
$bericht = str_replace("[tr]", "<tr>", $bericht);
$bericht = str_replace("[/tr]", "</tr>", $bericht);
$bericht = str_replace("[td]", "<td>", $bericht);
$bericht = str_replace("[/td]", "</td>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
//$bericht = eregi_replace("http://[^[:space:]]+","<a href=\"\\0\" target=\"_blank\">\\0</a>",$bericht);
$bericht = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "<a href=\"mailto:\\1@\\2\\3\">\\1@\\2\\3</a>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\" target=_blank>\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" target=_blank>\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\" target=_blank>", $bericht);
$bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" target=\"_blank\">\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
$bericht = str_replace("http://http://", "http://", $bericht);
$bericht = str_replace("fuck","***",$bericht);
$bericht = str_replace("shit","***",$bericht);
$bericht = str_replace("kanker","***",$bericht);
$bericht = str_replace("hoer","***",$bericht);
$bericht = str_replace("slet","***",$bericht);
$bericht = str_replace("kankerhoer","***",$bericht);
$bericht = str_replace("tering","***",$bericht);
$bericht = str_replace("fack","***",$bericht);
$bericht = str_replace("f*ck","***",$bericht);
$bericht = str_replace("kankerteef","***",$bericht);
$bericht = str_replace("kut","***",$bericht);
$bericht = str_replace("joden","***",$bericht);
$bericht = str_replace("pik","***",$bericht);
$bericht = str_replace("eikel","***",$bericht);
$bericht = str_replace("erotiek","***",$bericht);
$bericht = str_replace("loser","***",$bericht);
// de smilies moet je zelf maar ff doen :P
return $bericht;
}
?>
<?php function italic($code) { $code = "<i>".$code."</i>"; return $code; } function bold($code) { $code = "<b>".$code."</b>"; return $code; } function underlined($code) { $code = "<u>".$code."</u>"; return $code; } function kleuren($code) { $code="<?".trim($code)."?>"; $addedtags=1; } $openingpos = strpos($buffer,'<?'); $closingpos = strrpos($buffer, '?'); $buffer = substr($buffer, 0, $openingpos).substr($buffer, $openingpos+5, $closingpos-($openingpos+5)).substr($buffer, $closingpos+5); } // Van hier // Tot hier return $buffer; } function ubb_code($bericht) { $kleur1 = "#EAF0FA"; $kleur2 = "#F7F7F7"; $borderkleur = "#D3D3D3"; $bericht = nl2br("$bericht"); $bericht = preg_replace('_\[code\](.*?)\[/code\]_ise', "[phptable] kleuren(' \\1 ') [/phptable]", $bericht); $bericht = str_replace("[center]", "<center>", $bericht); $bericht = str_replace("[/center]", "</center>", $bericht); $bericht = str_replace("[small]", "<small>", $bericht); $bericht = str_replace("[/small]", "</small>", $bericht); $bericht = str_replace("[Quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font color=\"#000000\">", $bericht); $bericht = str_replace("[/Quote]", "</font></td></tr></table>", $bericht); $bericht = str_replace("[php]", "[phptable][php]", $bericht); $bericht = str_replace("[/php]", "[/php][/phptable]", $bericht); $bericht = str_replace("[phptable]", "<table width=\"100%\" bgcolor=\"$kleur2\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td>", $bericht); $bericht = str_replace("[/phptable]", "</td></tr></table>", $bericht); $bericht = str_replace("[table]", "<table>", $bericht); $bericht = str_replace("[/table]", "</table>", $bericht); //$bericht = eregi_replace("http://[^[:space:]]+","<a href=\"\\0\" target=\"_blank\">\\0</a>",$bericht); $bericht = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "<a href=\"mailto:\\1@\\2\\3\">\\1@\\2\\3</a>", $bericht); $bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht); $bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht); $bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht); $bericht = str_replace("[img]","<img src=\"http://",$bericht); $bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\" target=_blank>\\1", $bericht); $bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" target=_blank>\\1", $bericht); $bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\" target=_blank>", $bericht); $bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" target=\"_blank\">\\1", $bericht); $bericht = str_replace("http://http://", "http://", $bericht); // de smilies moet je zelf maar ff doen :P return $bericht; } ?>
asjeblieft |