BBCode auswertung

  • Ich habe ein BBCode system erstellt, es funktioniert auch, fast.
    Das Problem: Die BBCodes werden falsch ersetzt:

    Code
    //hier die BBCodes einfügen
    $ersetzen = array("[b]","[/b]","[i]", "[/i]", "[u]", "[/u]", "[cid]", "[cid-label]", "[/cid-label]", "[/cid]", "[google]", "[google-label]", "[/google-label]", "[/google]" );
    $ersatz = array("[b]","[/b]","[i]", "[/i]", "<u>", "</u>", "[url='index.php?id=', '']", "", "[/url]", "[url='http://www.google.de/search?hl=de&q=', '']", "", "[/url]", );
    if(count($ersetzen)==count($ersatz)){
    $count = count($ersatz);
    for($i = 0 ; $i < count($count) ; $i++)
    $contenttext = eregi_replace($ersetzen[$i],$ersatz[$i],$contenttext);


    Hier mal der Link zur Seite:
    http://virtualmarctek.ath.cx/vmtekcms/index.php?content=4

  • nimm das hier:

    Code
    $ersetzen = array("[b]","[/b]","[i]", "[/i]", "[u]", "[/u]", "[cid]", "[cid-label]", "[/cid-label]", "[/cid]", "[google]", "[google-label]", "[/google-label]", "[/google]" ); 
    $ersatz = array("[b]","[/b]","[i]", "[/i]", "<u>", "</u>", "[url='index.php?id=', '']", "[/url]", "[url='http://www.google.de/search?hl=de&q=', '']", "[/url]");
    $contenttext = str_replace($ersetzen,$ersatz,$contenttext);

    Something big is coming. And there will be pirates and ninjas and unicorns...