Hier ist die Funktion, die den BBCode formtiert...
Code: Alles auswählen
function AGCode($string) {
$string=eregi_replace("\\[img\\](http://[^\\[]+)\\[/img\\]","<img src=\"\\1\" border=0>",$string);
$string=eregi_replace("\\[b\\]([^\\[]*)\\[/b\\]","<b>\\1</b>",$string);
$string=eregi_replace("\\[i\\]([^\\[]*)\\[/i\\]","<i>\\1</i>",$string);
$string=eregi_replace("\\[u\\]([^\\[]*)\\[/u\\]","<u>\\1</u>",$string);
$string=eregi_replace("\\[email\\]([^\\[]*)\\[/email\\]","<a href=\"mailto:\\1\">\\1</a>",$string);
$string=eregi_replace("\\[url\\]www.([^\\[]*)\\[/url\\]","<a href=\"http://www.\\1\" target=\"_blank\">\\1</a>",$string);
$string=eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"_blank\">\\1</a>",$string);
$string=eregi_replace("\\[url=http://([^\\[]+)\\]([^\\[]*)\\[/url\\]","<a href=\"http://\\1\" target=\"_blank\">\\2</a>",$string);
$string=eregi_replace("\\[strike\\]([^\\[]*)\\[/strike\\]","<strike>\\1</strike>",$string);
$string=eregi_replace("\\[color=$VARS[text_color]\\]([^\\[]*)\\[/color\\]","<font color=$VARS[text_color]>\\1</font>",$string);
$string=eregi_replace("\\[color=darkred\\]([^\\[]*)\\[/color\\]","<font color=#800000>\\1</font>",$string);
$string=eregi_replace("\\[color=#800000\\]([^\\[]*)\\[/color\\]","<font color=#800000>\\1</font>",$string);
$string=eregi_replace("\\[color=red\\]([^\\[]*)\\[/color\\]","<font color=#FF0000>\\1</font>",$string);
$string=eregi_replace("\\[color=#FF0000\\]([^\\[]*)\\[/color\\]","<font color=#FF0000>\\1</font>",$string);
$string=eregi_replace("\\[color=orange\\]([^\\[]*)\\[/color\\]","<font color=#FF8040>\\1</font>",$string);
$string=eregi_replace("\\[color=#8080C0\\]([^\\[]*)\\[/color\\]","<font color=#8080C0>\\1</font>",$string);
$string=eregi_replace("\\[color=brown\\]([^\\[]*)\\[/color\\]","<font color=#804000>\\1</font>",$string);
$string=eregi_replace("\\[color=#804000\\]([^\\[]*)\\[/color\\]","<font color=#8080C0>\\1</font>",$string);
$string=eregi_replace("\\[color=yellow\\]([^\\[]*)\\[/color\\]","<font color=#FFFF00>\\1</font>",$string);
$string=eregi_replace("\\[color=#FFFF00\\]([^\\[]*)\\[/color\\]","<font color=#8080C0>\\1</font>",$string);
$string=eregi_replace("\\[color=green\\]([^\\[]*)\\[/color\\]","<font color=#008000>\\1</font>",$string);
$string=eregi_replace("\\[color=#008000\\]([^\\[]*)\\[/color\\]","<font color=#8080C0>\\1</font>",$string);
$string=eregi_replace("\\[color=olive\\]([^\\[]*)\\[/color\\]","<font color=#808000>\\1</font>",$string);
$string=eregi_replace("\\[color=#808000\\]([^\\[]*)\\[/color\\]","<font color=#8080C0>\\1</font>",$string);
$string=eregi_replace("\\[color=cyan\\]([^\\[]*)\\[/color\\]","<font color=#00FFFF>\\1</font>",$string);
$string=eregi_replace("\\[color=#00FFFF\\]([^\\[]*)\\[/color\\]","<font color=#8080C0>\\1</font>",$string);
$string=eregi_replace("\\[color=blue\\]([^\\[]*)\\[/color\\]","<font color=#0000FF>\\1</font>",$string);
$string=eregi_replace("\\[color=#0000FF\\]([^\\[]*)\\[/color\\]","<font color=#8080C0>\\1</font>",$string);
$string=eregi_replace("\\[color=darkblue\\]([^\\[]*)\\[/color\\]","<font color=#0000A0>\\1</font>",$string);
$string=eregi_replace("\\[color=#0000A0\\]([^\\[]*)\\[/color\\]","<font color=#8080C0>\\1</font>",$string);
$string=eregi_replace("\\[color=indigo\\]([^\\[]*)\\[/color\\]","<font color=#4B0082>\\1</font>",$string);
$string=eregi_replace("\\[color=#4B0082\\]([^\\[]*)\\[/color\\]","<font color=#8080C0>\\1</font>",$string);
$string=eregi_replace("\\[color=violet\\]([^\\[]*)\\[/color\\]","<font color=#8080C0>\\1</font>",$string);
$string=eregi_replace("\\[color=#8080C0\\]([^\\[]*)\\[/color\\]","<font color=#8080C0>\\1</font>",$string);
$string=eregi_replace("\\[color=white\\]([^\\[]*)\\[/color\\]","<font color=#FFFFFF>\\1</font>",$string);
$string=eregi_replace("\\[color=#FFFFFF\\]([^\\[]*)\\[/color\\]","<font color=#FFFFFF>\\1</font>",$string);
$string=eregi_replace("\\[color=black\\]([^\\[]*)\\[/color\\]","<font color=#000000>\\1</font>",$string);
$string=eregi_replace("\\[color=#000000\\]([^\\[]*)\\[/color\\]","<font color=#000000>\\1</font>",$string);
$string=eregi_replace("\\[color=#000044\\]([^\\[]*)\\[/color\\]","<font color=#000044>\\1</font>",$string);
$string=eregi_replace("\\[color=#7B7BA7\\]([^\\[]*)\\[/color\\]","<font color=#7B7BA7>\\1</font>",$string);
$string=eregi_replace("\\[size=6\\]([^\\[]*)\\[/size\\]","<span style=font-size:6px>\\1</span>",$string);
$string=eregi_replace("\\[size=7\\]([^\\[]*)\\[/size\\]","<span style=font-size:7px>\\1</span>",$string);
$string=eregi_replace("\\[size=8\\]([^\\[]*)\\[/size\\]","<span style=font-size:8px>\\1</span>",$string);
$string=eregi_replace("\\[size=9\\]([^\\[]*)\\[/size\\]","<span style=font-size:9px>\\1</span>",$string);
$string=eregi_replace("\\[size=10\\]([^\\[]*)\\[/size\\]","<span style=font-size:10px>\\1</span>",$string);
$string=eregi_replace("\\[size=11\\]([^\\[]*)\\[/size\\]","<span style=font-size:11px>\\1</span>",$string);
$string=eregi_replace("\\[size=12\\]([^\\[]*)\\[/size\\]","<span style=font-size:12px>\\1</span>",$string);
$string=eregi_replace("\\[size=13\\]([^\\[]*)\\[/size\\]","<span style=font-size:13px>\\1</span>",$string);
$string=eregi_replace("\\[size=14\\]([^\\[]*)\\[/size\\]","<span style=font-size:14px>\\1</span>",$string);
$string=eregi_replace("\\[size=15\\]([^\\[]*)\\[/size\\]","<span style=font-size:15px>\\1</span>",$string);
$string=eregi_replace("\\[size=16\\]([^\\[]*)\\[/size\\]","<span style=font-size:16px>\\1</span>",$string);
$string=eregi_replace("\\[size=17\\]([^\\[]*)\\[/size\\]","<span style=font-size:17px>\\1</span>",$string);
$string=eregi_replace("\\[size=18\\]([^\\[]*)\\[/size\\]","<span style=font-size:18px>\\1</span>",$string);
$string=eregi_replace("\\[size=19\\]([^\\[]*)\\[/size\\]","<span style=font-size:19px>\\1</span>",$string);
$string=eregi_replace("\\[size=20\\]([^\\[]*)\\[/size\\]","<span style=font-size:20px>\\1</span>",$string);
$string=eregi_replace("\\[size=21\\]([^\\[]*)\\[/size\\]","<span style=font-size:21px>\\1</span>",$string);
$string=eregi_replace("\\[size=22\\]([^\\[]*)\\[/size\\]","<span style=font-size:22px>\\1</span>",$string);
$string=eregi_replace("\\[size=23\\]([^\\[]*)\\[/size\\]","<span style=font-size:23px>\\1</span>",$string);
$string=eregi_replace("\\[size=24\\]([^\\[]*)\\[/size\\]","<span style=font-size:24px>\\1</span>",$string);
$string=eregi_replace("\\[size=25\\]([^\\[]*)\\[/size\\]","<span style=font-size:25px>\\1</span>",$string);
$string=eregi_replace("\\[align=center\\]([^\\[]*)\\[/align\\]","<div align=center>\\1</div>",$string);
$string=eregi_replace("\\[align=right\\]([^\\[]*)\\[/align\\]","<div align=right>\\1</div>",$string);
$string=eregi_replace("\\[align=left\\]([^\\[]*)\\[/align\\]","<div align=left>\\1</div>",$string);
$string=eregi_replace("\\[align=justify\\]([^\\[]*)\\[/align\\]","<div align=justify>\\1</div>",$string);
return $string;
}
hier könnte der Fehler liegen oder in der Funktion, die die "Bad Words" sucht. Bin ratlos