UBB Parser

Gestart doorErik34 reacties69 weergaven

35 berichten · pagina 1 van 3

Erik

Lid · Topicstarter

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hey,
Als ik mijn UBB parser op een string zet, weergeeft ie niks.
Hoe kan dit?
Weggehaald.
Gr,
Erik
0
Erik

Lid · Topicstarter

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Weet niemand het? sadley
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Of niemand wil het zeggen. pompom
Waarom heb je ob_start() enzo?

edit:
zet error reporting eens gewoon op E_ALL; er gaat een wereld voor je open.. clown
0
Erik

Lid · Topicstarter

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dit zijn de errors:

Notice: Undefined variable: buffer in on line 145

Notice: Undefined variable: buffer in on line 146

Warning: preg_replace() [function.preg-replace]: Compilation failed: missing terminating ] for character class at offset 22 in on line 47
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Dus weet je meteen dat dit niet klopt:
$tekst = preg_replace("/
(.+?)
/is", code(1), $tekst);

Maar nog een keertje: Waarom heb je ob_start() enzo?
0
Erik

Lid · Topicstarter

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Stond in zon script. emo
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Ja je moet niet alles klakkeloos overnemen. cry
Al die $ov variabelen kloppen ook niet, die bestaan niet eens (of je moet ze al global hebben gemaakt?).
0
Erik

Lid · Topicstarter

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heb ik gedaan, maar hoe kan ik t fixen?
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
$tekst = preg_replace("/
(.+?)
/is", code(1), $tekst);
zo?
of anders zo denk
$tekst = preg_replace("/
(.+?)
/ise", "code(1)", $tekst);
0
Erik

Lid · Topicstarter

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Yeaaah, hij werkt. smile
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Nice. emo
0
Erik

Lid · Topicstarter

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Alleen t code gedeelte doet t niet. sadleyecho Quebbiez!;
? ?>
Forum » Mededelingen » UBB Test smileUBB Test smile2009-06-26 15:49:08
id="code">
0
1
2
3
4
5
?php echo Quebbiez!; ?
0
1
2
3
4
5
?php echo Quebbiez!; ?
Dat weergeeft hij.
De code is:

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] code[COLOR= #007700]([/COLOR][COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700])
{[/COLOR]
    
    [COLOR= #0000BB]$tekst[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<br>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$tekst[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<br />"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$tekst[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"&gt;"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$tekst[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"&lt;"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700]);[/COLOR]
    
    [COLOR= #0000BB]$tekst[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700]);[/COLOR]
    
    [COLOR= #0000BB]$buffer[/COLOR] [COLOR= #007700]=[/COLOR] FALSE[COLOR= #007700];[/COLOR]
    
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/strpos"]strpos[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<?php[/COLOR][COLOR= #007700]) ||[/COLOR] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #DD0000]<?php[/COLOR][COLOR= #007700])
    {[/COLOR]
        
        [COLOR= #0000BB]$code[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]<?php [/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] ?>[/COLOR][COLOR= #007700];[/COLOR]
        
        [COLOR= #0000BB]$tags[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];
    
    }[/COLOR]
    
    [URL="http://www.php.net/highlight_string"]highlight_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$code[/COLOR][COLOR= #007700]);[/COLOR]
    
    [COLOR= #0000BB]$a[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"<br />"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$b[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"n"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700]);[/COLOR]
    
    [COLOR= #0000BB]$a2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$a[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$b2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$b[/COLOR][COLOR= #007700]);[/COLOR]
    
    [COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$a2[/COLOR] [COLOR= #007700]+[/COLOR] [COLOR= #0000BB]$b2[/COLOR][COLOR= #007700];[/COLOR]
    
    [COLOR= #0000BB]$return[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]<div id="code">[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$return[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<div id="regels">[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]$data[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++)
    {[/COLOR]
        
        [COLOR= #0000BB]$return[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
    
    }[/COLOR]
    [COLOR= #0000BB]$return[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$return[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<div id="veld">[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$return[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #0000BB]$tekst[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$return[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];[/COLOR]
    
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tags[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
    {[/COLOR]
        
        [COLOR= #0000BB]$opening[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strpos"]strpos[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$buffer[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<?php[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$sluiting[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strpos"]strpos[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$buffer[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]?>[/COLOR][COLOR= #007700]);[/COLOR]
        
        [COLOR= #0000BB]$return[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$return[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$opening[/COLOR][COLOR= #007700]) .[/COLOR] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$return[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$opening[/COLOR][COLOR= #007700]+[/COLOR][COLOR= #0000BB]5[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$sluiting[/COLOR][COLOR= #007700]-([/COLOR][COLOR= #0000BB]$opening[/COLOR][COLOR= #007700]+[/COLOR][COLOR= #0000BB]5[/COLOR][COLOR= #007700])) .[/COLOR] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$return[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$sluiting[/COLOR][COLOR= #007700]+[/COLOR][COLOR= #0000BB]5[/COLOR][COLOR= #007700]);
    
    }[/COLOR]
    
    [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$return[/COLOR][COLOR= #007700];

}[/COLOR]
?>
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Even wat debugwerk en je weet waar t fout zit, dat kun je zelf ook prima lijkt me zo. emo
0
Erik

Lid · Topicstarter

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lijkt me niet zo. emok Snap nooit hoe je moet debuggen enzo. emo
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Je weet wat je als output wilt hebben en je weet wat je input is, dan ga je je hele script doorwandelen tot je ziet waar het fout gaat, dat pas je aan en dan is het opgelost..

Ik ben weg nu, kijk er morgen wel ff naar als het je niet lukt. emo
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren