omzetten
$GLOBALS['phphighlite'] = array("dummy");
$string = preg_replace("_\[code\](.*?)\[/code\]_ise", "phphighlite_replace('\\1')", $string);
// html
if($html == "1")
{
$string=htmlentities($string, ENT_QUOTES);
}
else
{
$string=htmlspecialchars($string);
}
if($gescheld == "1") {
$text = str_replace("bulletstar", "*SPAM*", $text);
$text = str_replace("BULLETSTAR", "*SPAM*", $text);
$text = str_replace(".net", "*SPAM*", $text);
$text = str_replace("real", "*SPAM*", $text);
$text = str_replace("REAL", "*SPAM*", $text);
$text = str_replace("http://www.members.lycos.nl", "*SPAM*", $text);
$text = str_replace("lycos", "*SPAM*", $text);
$text = str_replace("funpic.org", "*SPAM*", $text);
$text = str_replace("hosting-complete", "*SPAM*", $text);
$text = str_replace("http://figthers.fi.funpic.org/NL/", "*SPAM*", $text);
}
$string = str_replace(">", ">", $string);
$string = str_replace("<", "<", $string);
$string = str_replace(""", "\"", $string);
$string = str_replace("<", "<", $string);
$string = str_replace("&", "&", $string);
// smilies
if($smilies == "1") {
$search = array(
":(",
":)" ,
":-)" ,
":D",
":d",
";)",
":P",
":p",
":S",
":s",
"(b)",
":@",
"(8)",
"(-)",
"(!)",
":|",
"(?)",
":$",
"(b)",
"(c)",
"(e)",
"(n)",
"(v)",
"(r)",
"(l)",
"(k)",
"(slot)",
"(h)");
$replace = array(
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
);
$string = str_replace($search, $replace, $string);
}
// bb codes
// bb codes
$search = array(
"#\[center\](.*?)\[\/center\]#si",
"#\[s\](.*?)\[\/s\]#si",
"#\[u\](.*?)\[\/u\]#si",
"#\[i\](.*?)\[\/i\]#si",
"#\[b\](.*?)\[\/b\]#si",
"#\[c\](.*?)\[\/c\]#si",
"#\[quote\](.*?)\[\/quote\]#si",
"#\[font color=(.*?)\](.*?)\[/font\]#si",
"#\[size=(.*?)\](.*?)\[/size\]#si",
"#\[align=(.*?)\](.*?)\[/align]#si",
"#\[li\](.*?)\[/li\]#si"
);
$replace = array(
"
\\1",
"\\1",
"\\1",
"\\1",
"\\1",
"\\1",
"Quote:
\\1
",
"\\1\\2",
"\\1",
"\\3",
"\\2",
"\\2",
"\\2
",
"\\1"
);
$string = preg_replace($search, $replace, $string);
$string = str_replace("[img]","",$string);
// str bb codes
$search = array(
"[gesloten]",
"[GESLOTEN]",
"[quote]",
"[/quote]"
);
$replace = array(
" Topic Gesloten",
" Topic Gesloten",
"Quote:
",
"
"
);
$string = str_replace($search, $replace, $string);
// auto url + email
$string = eregi_replace("([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})", "\\1", $string);
$string = nl2br($string);
// [code] -> weer omzetten
$string = preg_replace("_\[code\]([0-9])\[/code\]_ise", "phphighlite('\\1')", $string);
// return
return $string;
}
// ###################### Start img_check #######################
function img_check($string) {
$string = trim($string);
if(preg_match("/^(ht|f)tp:\/\/([a-z0-9-]+(\.[a-z0-9-]+)*\.[a-z0-9]{1,4})(\/[\w%~!*().\'[:space:]-]+)+\.(jpe?g|png|gif|bmp)(\?[=&+\w%@:\/.~!*()\'-]*)?$/ix", $string)) {
return "";
} else {
return " Error: ongeldige afbeelding source!";
}
}
###################### Start phphighlite #######################
function phphighlite_replace($code) {
$code = trim(str_replace("\\\"", "\"", $code));
$code = str_replace(">", ">", $code);
$code = str_replace("<", "<", $code);
$code = str_replace(""", "\"", $code);
$code = str_replace("<", "<", $code);
$code = str_replace("&", "&", $code);
$code = str_replace('$', '\$', $code);
$code = str_replace("€ ", "€", $code);
if(empty($code)) {
return "[code] [/code]";
} else {
array_push($GLOBALS['phphighlite'], $code);
return "[code]".(count($GLOBALS['phphighlite'])-1)."[/code]";
}
}
function phphighlite($id, $fixed=1) {
$code = $GLOBALS['phphighlite'][$id];
$splitted = explode("\n", $code);
$grootte = count($splitted)+1;
if(!strpos($code,"") && 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);
}
$page_popup = "";
// popup
if(isset($GLOBALS['phphighlite_tabel']) && isset($GLOBALS['phphighlite_id'])) {
GLOBAL $page;
if(isset($page)) {
$page_popup = "&page=".$page;
}
$code = $buffer;
$extra = " | | | ";
} else {
$extra = "";
$GLOBALS['phphighlite_id'] = 0;
}
$return = "\n\n\n\n\n\n";
for($i=1; $i<$grootte; $i++) {
echo "";
$return .= $i." \n";
}
$return .= " | \n\n | \n |
";
return $return;
}
function phphighliteappart($code) {
$splitted = explode("\n", $code);
$grootte = count($splitted)+1;
if(!strpos($code,"") && 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);
}
$return = "\n\n\n\n\n\n";
for($i=1; $i<$grootte; $i++) {
$return .= $i." \n";
}
$return .= " | \n\n | \n |
";
return $return;
}
?>
function knoppen()
{
?>
echo "
";
}
function smilietoevoegen() {
?>
}
?>