Geht leider nicht
Habe folgendes versucht in der class_parse :
// ajfsp umwandlung-start
function ajfsp($name, $hash, $size) {
$mbsize = number_format(round(($size / 1024) / 1024, 2), 2, ',', '.');
return '<a href="ajfsp://file|'.$name.'|'.$hash.'|'.$size.'/">'.$name.'</a> ('.$mbsize.' MB)';
}
// ajfsp umwandlung-ende
function prepareimages() {
global $allowdynimg;
if ($allowdynimg == 1) $this->imgsearch = "/\[img]([^\"]+)\[\/img\]/siU";
else $this->imgsearch = "/\[img]([^\"\?\&]+\.(gif|jpg|jpeg|bmp|png))\[\/img\]/siU";
if ($this->showimages == 1) $this->imgreplace = "<img src=\"\\1\" alt=\"\" border=\"0\" class=\"resizeImage\" />";
else $this->imgreplace = "<a href=\"\\1\" target=\"_blank\">\\1</a>";
if ($allowdynimg == 1) $this->imgsearch2 = "/\[img]([^\"]+)\[\/img\]/esiU";
else $this->imgsearch2 = "/\[img]([^\"\?\&]+\.(gif|jpg|jpeg|bmp|png))\[\/img\]/esiU";
$this->imgreplace2 = "'$this->breakChar[img]$this->breakChar' . \$this->insertBreakChar('\\1') . '$this->breakChar[/img]$this->breakChar'";
}
function censor($post) {
if (count($this->censorsearch) == 0 || count($this->censorreplace) == 0) {
reset($this->censorwords);
while (list($key, $censor) = each($this->censorwords)) {
$censor = wbb_trim($censor);
if (!$censor) continue;
if (preg_match("/\{([^=]+)=([^=]*)\}/si", $censor, $exp)) {
$this->censorsearch[] = "/(^|\s|\]|>|\")(".$this->preg_quote($exp[1]).")(([,\.]{1}[\s[\"<$]+)|\s|\[
|\"|<|$)/i";
$this->censorreplace[] = "\\1".$exp[2]."\\3";
}
elseif (preg_match("/\{([^=]+)\}/si", $censor, $exp)) {
$this->censorsearch[] = "/(^|\s|\]|>|\")(".$this->preg_quote($exp[1]).")(([,\.]{1}[\s[\"<$]+)|\s|\[
|\"|<|$)/i";
$this->censorreplace[] = "\\1".str_repeat($this->censorcover, wbb_strlen($exp[1]))."\\3";
}
elseif (preg_match("/([^=]+)=([^=]*)/si", $censor, $exp)) {
$this->censorsearch[] = "/".$this->preg_quote($exp[1])."/i";
$this->censorreplace[] = $exp[2];
}
else {
$this->censorsearch[] = "/".$this->preg_quote($censor)."/i";
$this->censorreplace[] = str_repeat($this->censorcover, wbb_strlen($censor));
}
}
}
if (count($this->censorsearch) > 0 && count($this->censorreplace) > 0) return preg_replace($this->censorsearch, $this->censorreplace, $post);
else return $post;
}
function doparse($post, $allowsmilies, $allowhtml, $allowbbcode, $allowimages) {
// censorship
if ($this->docensor == 1) $post = $this->censor($post);
// cache code
if ($this->usecode == 1 && $allowbbcode == 1) {
$this->tempsave['php'] = array();
$this->tempsave['code'] = array();
$this->index['php'] = -1;
$this->index['code'] = -1;
$post = preg_replace("/(\[(php|code)\])(.*)(\[\/\\2\])/seiU", "\$this->cachecode('\\3','\\2')", $post);
}
// avoid bbcode wrapping
if ($allowbbcode == 1) {
if ($this->done['bbcode'] != 1) $this->getbbcode();
$post = preg_replace($this->search, $this->replace2, $post);
if ($allowimages != 0) $post = preg_replace($this->imgsearch2, $this->imgreplace2, $post);
}
// cache smilies
if ($allowsmilies == 1) {
if ($this->done['smilies'] != 1) $this->getsmilies();
$post = preg_replace($this->smilie_search, $this->smilie_replace, $post);
}
// wrap text
$post = $this->textwrap($post);
// remove break chars
if ($allowbbcode == 1) {
$post = str_replace($this->breakChar, '', $post);
}
// remove tab
$post = str_replace("\t", " ", $post);
// html
if ($allowhtml == 0) {
$post = htmlconverter($post);
$post = nl2br($post);
}
else $post = preg_replace("/<([\/]?)script([^>]*)>/i", "<\\1script\\2>", $post);
// bbcodes
if ($allowbbcode == 1) {
if ($this->done['bbcode'] != 1) $this->getbbcode();
$post = preg_replace($this->search, $this->replace, $post);
}
else {
$post = preg_replace("/java script:/i", "java script:", $post);
$post = preg_replace("/vb script:/i", "vb script:", $post);
}
// AJ
$post = preg_replace('`ajfsp://file\|([^"]+?)\|([0-9A-Fa-f]{32})\|(\d+)/?`e','$this
->ajfsp(\'\\1\', \'\\2\', \'\\3\')', $post);
// images
if ($allowimages != 0) $post = preg_replace($this->imgsearch, $this->imgreplace, $post);
// replace smilies
if ($allowsmilies == 1) $post = preg_replace($this->smilie_search2, $this->smilie_replace2, $post);
// insert code
if ($this->usecode == 1 && $allowbbcode == 1 && ($this->index['php'] != -1 || $this->index['code'] != -1)) $post = $this->replacecode($post);
return $post;
}
function textwrap($text) {
if ($text && wbb_strlen($text) > $this->wrapwidth) {
$text = preg_replace("/([^\n\r$this->breakChar ]{".$this->wrapwidth."})/i", " \\1\n", $text);
return $text;
}
else return $text;
}