[PHP] UBBChicken 1.0 - UBB Class

Gestart doorSebastiaanh25 reacties50 weergaven

26 berichten · pagina 1 van 2

Sebastiaanh

Lid · Topicstarter

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hi,
Bij deze release ik de eerste versie van mijn UBB parser UBBChicken. Ik heb deze gemaakt omdat ik net uit het ziekenhuis kwam, heb er een tijdje in gelegen (niet heel lang gelukkig), en ik verveelde me, dus tjah, ik dacht: waarom ook niet. winkEr kunnen hier en daar wat fouten in zitten, en de code zal niet de allerbeste zijn, want ik ben namelijk nieuw met classes. yummie
Hij is trouwens nog niet compleet, maar de basis is er. smile
Bekende bugs:
- Tot nu toe geen

Updates:
- Was vergeten, nu added.
- Htmlentities veranderd naar htmlspecialchars

Suggesties:
- Geen, die zijn altijd welkom!

De class:
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/**
UBBChicken - UBB Parser
By Sebastiaan H
**/[/COLOR]

[URL="http://www.php.net/Class"]Class[/URL] UBBChicken [COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] Parse[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]){[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] self[COLOR= #007700]::[/COLOR]Layout[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] self[COLOR= #007700]::[/COLOR]YouTube[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] self[COLOR= #007700]::[/COLOR]Links[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] self[COLOR= #007700]::[/COLOR]Quote[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700];
    }[/COLOR]
    
    [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] Layout[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]){[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[s](.+?)[/s]#is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"<s>\1</s>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[i](.+?)[/i]#is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"<i>\1</i>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[b](.+?)[/b]#is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"<b>\1</b>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[u](.+?)[/u]#is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"<u>\1</u>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[color=(.+?)](.+?)[/color]#is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"<font color=\1>\2</font>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[marquee](.+?)[/marquee]#is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"<marquee>\1</marquee>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700];
    }[/COLOR]
    
    [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] Links[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]){[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[url=(.+?)](.+?)[/url]#is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"<a href=\1>\2</a>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[mail](.+?)[/mail]#is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"<a href=mailto:\1>E-Mail</a>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700];
    }[/COLOR]
    
    [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] YouTube[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]){[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[youtube](.+?)[/youtube]#is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"<iframe src=http://www.youtube.com/embed/\1 width=350 height=300 frameborder=0 allowfullscreen></iframe>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700];
    }[/COLOR]
    
    [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] Quote[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]){[/COLOR]
        [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#[QUOTE](.+?)[/quote]#is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"<fieldset><legend><b>\1 schreef:</b></legend>\2</fieldset>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700];
    }
    
}[/COLOR]
?>
Mvg,
Sebastiaanh
0
Sebastiaanh

Lid · Topicstarter

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sevvlor schreef:
http://www.one2xs.com/threads/33423 en deze lijken erg op elkaar emo
Maargoed, verder ziet het er netjes uit.
Valt wel mee. emo
toevoeging op 9 mei 2012, 22:02:05:
En als je niet gelooft dat ie zelf gemaakt is moet je het aan Raoul vragen, ik had hem nog gevraagd wat er fout was aan mn code, want hij werkte niet echt. emo
0
Berichten
69
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Best mooi! Alleen je bent de vergeten.

En trouwens ook de Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt..
0
Sebastiaanh

Lid · Topicstarter

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Epichotel schreef:
Best mooi! Alleen je bent de vergeten.
Oja, zal ik er even inzetten.

toevoeging op 9 mei 2012, 22:06:43:
Done
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Sebastiaanh schreef:
Eerdere citaten tonen
Sevvlor schreef:
http://www.one2xs.com/threads/33423 en deze lijken erg op elkaar emo
Maargoed, verder ziet het er netjes uit.

Valt wel mee. emo
toevoeging op 9 mei 2012, 22:02:05:
En als je niet gelooft dat ie zelf gemaakt is moet je het aan Raoul vragen, ik had hem nog gevraagd wat er fout was aan mn code, want hij werkte niet echt. emo
ik geloof je 100% hoor, je hoeft je echt niet te bewijzen.
0
Sebastiaanh

Lid · Topicstarter

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oke. smileNee was alleen maar even ter bevestiging snap je yummie
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ik mis spoilers cry
0
Sebastiaanh

Lid · Topicstarter

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Raaoul schreef:
Ik mis spoilers cry
Die komen er ook aan. clown
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ik mis een smiley parser sadley
0
Sebastiaanh

Lid · Topicstarter

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Joah komt nog. yummie
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nice begin, ik zou alleen htmlentities vervangen door htmlspecialchars smile
Heeft met tekens zoals ? en ƒ te maken ;p
0
Sebastiaanh

Lid · Topicstarter

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedankt, zal ik doen.
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik denk dat je met meerdere spoilers op 1 pagina ook problemen krijgt.
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Antonn schreef:
Ik denk dat je met meerdere spoilers op 1 pagina ook problemen krijgt.
Zoals dit bedoel je?
Afbeelding
En dat is nog niet eens de helft 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