Boa... also ich bin jetzt zwar soweit, dass ich meine Codes für BB-Code einpflegen konnte, und das Forum problos BB-Code akzeptiert in der Theorie.
Aber die Rückkonversion. Also ne Dokumentation wär echt toll gewesen ._.
Und irr' ich mich, oder funktioniert settings iwie nich wirklich?
Zumindest bei mir bleibt er bei den Hardcoded defaults :/
//edit: (04:09)
Gut, andere Richtung geht jetzt auch... x.X
//edit: (04:34)
Quick'n'Dirty-Diffs:
Markup.php
136a137,139
>
> $text = preg_replace( '/\[url=(.+?)\](?s)(.*?)\[\/url\]/i' , '[URL=\\1]\\2[/URL]', $text);
> $text = preg_replace( '/\[url\](?s)(.*?)\[\/url\]/i' , '[URL=\\1]\\1[/URL]', $text);
156a160,168
>
> # BB-Code by PMedia
> # Quick'n'Dirty
> $text = preg_replace( '/\[img\](?s)(.*?)\[\/img\]/i' , '\\1', $text);
>
> $text = preg_replace( '/\[b\](?s)(.*?)\[\/b\]/i' , '<b>\\1</b>', $text);
> $text = preg_replace( '/\[i\](?s)(.*?)\[\/i\]/i' , '<i>\\1</i>', $text);
> $text = preg_replace( '/\[u\](?s)(.*?)\[\/u\]/i' , '<span style="text-decoration: underline;">\\1</span>', $text);
> $text = preg_replace( '/\[s\](?s)(.*?)\[\/s\]/i' , '<span style="text-decoration: line-through;">\\1</span>', $text);
UnMarkup.php
88a89,98
>
> # BB-Code by PMedia
> # Quick'n'Dirty
> $text = preg_replace( '/\<img src\=\"(?s)(.*?)\" alt=\"\"\>/i' , '\\1', $text);
> $text = preg_replace( '/\<a href\=\"(?s)(.*?)\"\>(?s)(.*?)\<\/a\>/i' , '[url=\\1]\\2[/url]', $text);
>
> $text = preg_replace( '/\<b\>(?s)(.*?)\<\/b\>/i' , '[b]\\1[/b]', $text);
> $text = preg_replace( '/\<i\>(?s)(.*?)\<\/i\>/i' , '[i]\\1[/i]', $text);
> $text = preg_replace( '/\<span style\=\"text\-decoration\: underline\;\"\>(?s)(.*?)\<\/span\>/i' , '[u]\\1[/u]', $text);
> $text = preg_replace( '/\<span style\=\"text\-decoration\: line\-through\;\"\>(?s)(.*?)\<\/span\>/i' , '[s]\\1[/s]', $text);
Hab mich jetzt nicht allzusehr mit dem Code (und vor allem den Code-Blöcken *hust*) auseinandergesetzt. Aber so wie's jetzt ist störts zumindest keine anderen Subsysteme, wie mir scheint...
In diesem Code macht es absolut keinen Spaß, sich zurechtfinden zu wollen ._.
Tut mir leid, aber auf mich wirkt es doll unstrukturiert, auch wenn das Ergebnis (mehr oder minder) zufriedenstellend wirkt.
Ja, man mag sagen "dann machs doch besser". Aber... hm.