";
$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);
}
$page_popup = "";
$return = $buffer;
return $return;
}
// UBB functie
function ubb($bericht) {
// Code
$GLOBALS['phphighlite'] = array("dummy");
$bericht = preg_replace("_<\?(.*?)\?>_ise","phphighlite_replace(' \\1 ?>')",$bericht);
// HTML wegwerken
$bericht = htmlspecialchars($bericht);
// Enters maken
$bericht = nl2br($bericht);
// URLs met tags maken
$bericht = preg_replace("#\[url\](http|ftp)(.+?)\[/url\]#is","\\1\\2",$bericht);
$bericht = preg_replace("#\[url\](mailto:)(.+?)\[/url]#is","\\2",$bericht);
$bericht = preg_replace("#\[mail\](.+?)\[/mail\]#is","\\1",$bericht);
$bericht = preg_replace("#\[url\](.+?)\[/url\]#is","\\1",$bericht);
$bericht = preg_replace("#\[url=(http|ftp|mailto)(.+?)\](.+?)\[/url\]#is","\\3",$bericht);
$bericht = preg_replace("#\[url=(.+?)\](.+?)\[/url\]#is","\\2",$bericht);
// Automatisch URLs
$bericht = eregi_replace("(^|[ \n\r\t])((http(s?)://)(www\.)?([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*)*)","\\1\\2", $bericht);
$bericht = eregi_replace("(^|[ \n\r\t])((ftp://)(www\.)?([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*)*)","\\1\\2", $bericht);
$bericht = eregi_replace("([a-z_-][a-z0-9\._-]*@[a-z0-9_-]+(\.[a-z0-9_-]+)+)","\\1", $bericht);
$bericht = eregi_replace("(^|[ \n\r\t])(www\.([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*)*)","\\1\\2", $bericht);
$bericht = eregi_replace("(^|[ \n\r\t])(ftp\.([a-z0-9_-]+(\.[a-z0-9_-]+)+)(/[^/ \n\r]*)*)","\\1\\2", $bericht);
// Cursief
$bericht = preg_replace("#\[i\](.+?)\[/i\]#is","\\1",$bericht);
// Onderstreept
$bericht = preg_replace("#\[u\](.+?)\[/u\]#is","\\1",$bericht);
// Vetgedrukt
$bericht = preg_replace("#\[b\](.+?)\[/b\]#is","\\1",$bericht);
// Doorstreept
$bericht = preg_replace("#\[s\](.+?)\[/s\]#is","\\1",$bericht);
// Quote
$bericht = preg_replace("#\[quote\](.+?)\[/quote\]#is","
",$bericht);
$bericht = preg_replace("#\[quote=(.+?)\](.+?)\[/quote\]#is","",$bericht);
// Plaatjes
$bericht = preg_replace("#\[img\](http)(.+?)\[/img\]#is","",$bericht);
$bericht = preg_replace("#\[img\](.+?)\[/img\]#is","",$bericht);
// Kleur
$bericht = preg_replace("#\[color=(.+?)\](.+?)\[/color\]#is","\\2",$bericht);
// Grootte
$bericht = preg_replace("#\[size=(.+?)\](.+?)\[/size\]#is","\\2",$bericht);
// Code
$bericht = preg_replace("_\[code\]([0-9])\[/code\]_ise", "phphighlite('\\1')", $bericht);
return $bericht;
}
?>