| | | | |
| | |
| PHP Code Flüsterer Registriert seit: 21.08.2005 Beiträge: 4682 PHP-Kenntnisse: Fortgeschritten | |
| | |
| Moderator Registriert seit: 03.09.2004
Beiträge: 11.798
PHP-Kenntnisse: Fortgeschritten ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | preg_replace_all
__________________ robo47.net - Blog, Codeschnipsel und mehr | |
| |
| | |
| Gast
Beiträge: n/a
| Hi also das Problem ist jetzt folgendes: Also der Code Bereich wird jetzt total verschachtelt mit den anderen Code Bereichen! Also das sieht ganz furchtabr aus, ich habe euch den Code angehängt wer das mal sehen möchte muss sich auf www.gfx-welt.de anmelden und unter Php/mysql Tutorial sich das ganze anschaun! [code]<?php function php_string($inhalt) { $block1 = "<blockquote><font size='2' face='Courier New'>Code:</font> <table cellspacing='0' cellpadding='0' border='0'><tr><td><div class='scrollen'>"; $inhalt = stripslashes($inhalt); $block2 = "</div></td></tr></table></blockquote>"; ob_start(); highlight_string($inhalt); $inhalt = ob_get_contents(); ob_end_clean(); return $block1; return $inhalt; return $block2; } $inhalt = preg_replace("/\[url=(.+?)\](.+?)\[\/url\]/is","<a href=\\1>\\2</a>",$inhalt); $inhalt = preg_replace("/\[color=(.+?)\](.+?)\[\/color\]/is","<font color=\\1>\\2</font>",$inhalt); $inhalt = preg_replace("/\[size=(.+?)\](.+?)\[\/size\]/is","<font size=\\1>\\2</font>",$inhalt); $inhalt = preg_replace("/\[u\](.+?)\[\/u\]/is","<u>\\1</u>",$inhalt); $inhalt = preg_replace("/\[i\](.+?)\[\/i\]/is","\\1",$inhalt); $inhalt = preg_replace("/\[b\](.+?)\[\/b\]/is","\\1",$inhalt); $inhalt = preg_replace("/\[quote\](.+?)\[\/quote\]/is","<blockquote><font size='2' face='Courier New'>Quote:</font><hr color='#000000' height='1'>\\1<hr color='#000000' height='1'></blockquote>", $inhalt); // $inhalt = preg_replace("/\[code\](.+?)\[\/code\]/is","<blockquote><font size='2' face='Courier New'>Code:</font> <table cellspacing='0' cellpadding='0' border='0'><tr><td><div class='scrollen'>\\1</div></td></tr></table></blockquote>", $inhalt); $inhalt = preg_replace("/\ Code: (.*)\[\/code\]/esiU", "php_string('$1')", $inhalt);
$inhalt = eregi_replace("\\[img]([^\\[]*)\\[/img\\]","<img src=\"\\1\">",$inhalt);
$inhalt = eregi_replace("\\[img height=([^\\[]*)\\ width=([^\\[]*)\\]([^\\[]*)\\[/img\\]","<img src=\"\\3\" height=\"\\1\" width=\"\\2\">",$inhalt);
$inhalt = eregi_replace("\\[img height=([^\\[]*)\\ width=([^\\[]*)\\]([^\\[]*)\\[/img\\]","<img src=\"\\3\" height=\"\\1\" width=\"\\2\">",$inhalt);
$inhalt = eregi_replace("\\[img=([^\\[]*)\\x([^\\[]*)\\]([^\\[]*)\\[/img\\]","<img src=\"\\3\" height=\"\\1\" width=\"\\2\">",$inhalt);
$inhalt = eregi_replace("\\[img width=([^\\[]*)\\ height=([^\\[]*)\\]([^\\[]*)\\[/img\\]","<img src=\"\\3\" width=\"\\1\" height=\"\\2\">",$inhalt);
$inhalt = eregi_replace("\\[flash=([^\\[]*)\\,([^\\[]*)\\]([^\\[]*)\\[/flash\\]","<object classid=\"clsid: D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\\1 height=\\2><param name=movie value=\\3><param name=play value=true><param name=loop value=true><param name=quality value=high><embed src=\\3 width=\\1 height=\\2 play=true loop=true quality=high></embed></object>",$inhalt);
$inhalt = eregi_replace("\\[align=([^\\[]*)\\]([^\\[]*)\\[/align\\]","<p align=\"\\1\">\\2</p>",$inhalt);
$inhalt = preg_replace("/\[font=(.+?)\](.+?)\[\/font\]/is","<font face=\\1>\\2</font>",$inhalt);
$inhalt = str_replace(":D", '[img]wbb/images/gfxwelt/smilies/biggrin.gif[/img]', $inhalt);
$inhalt = str_replace(":O", '[img]wbb/images/gfxwelt/smilies/redface.gif[/img]', $inhalt);
$inhalt = str_replace("?(", '[img]wbb/images/gfxwelt/smilies/confused.gif[/img]', $inhalt);
$inhalt = str_replace("8)", '[img]wbb/images/gfxwelt/smilies/cool.gif[/img]', $inhalt);
$inhalt = str_replace(";(", '[img]wbb/images/gfxwelt/smilies/crying.gif[/img]', $inhalt);
$inhalt = str_replace("8o", '[img]wbb/images/gfxwelt/smilies/eek.gif[/img]', $inhalt);
$inhalt = str_replace(":]", '[img]wbb/images/gfxwelt/smilies/pleased.gif[/img]', $inhalt);
$inhalt = str_replace(":(", '[img]wbb/images/gfxwelt/smilies/frown.gif[/img]', $inhalt);
$inhalt = str_replace(":))", '[img]wbb/images/gfxwelt/smilies/happy.gif[/img]', $inhalt);
$inhalt = str_replace("X(", '[img]wbb/images/gfxwelt/smilies/mad.gif[/img]', $inhalt);
$inhalt = str_replace(":)", '[img]wbb/images/gfxwelt/smilies/smile.gif[/img]', $inhalt);
$inhalt = str_replace(":P", '[img]wbb/images/gfxwelt/smilies/tongue.gif[/img]', $inhalt);
$inhalt = str_replace(":zwinker:", '[img]wbb/images/gfxwelt/smilies/wink.gif[/img]', $inhalt);
$inhalt = str_replace(":rolleyes:", '[img]wbb/images/gfxwelt/smilies/rolleyes.gif[/img]', $inhalt);
$inhalt = str_replace(":baby:", '[img]wbb/images/gfxwelt/smilies/baby.gif[/img]', $inhalt);
$inhalt = str_replace(":evil:", '[img]wbb/images/gfxwelt/smilies/evil.gif[/img]', $inhalt);
$inhalt = str_replace(":tongue:", '[img]wbb/images/gfxwelt/smilies/tongue2.gif[/img]', $inhalt);
?>
|
| | ||
| Erfahrener Benutzer Registriert seit: 18.09.2003
Beiträge: 13.598
PHP-Kenntnisse: Fortgeschritten ![]() | Zitat:
| |
| |
| Themen-Optionen | |
| Thema bewerten | |
|
|
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Dateien im loginpflichtigen Bereich verschlüsseln | Timer | PHP Tipps 2008 | 1 | 28.07.2008 23:07 |
| Bereich um einen float left und float right Bereich | andrew22 | HTML, Usability und Barrierefreiheit | 8 | 27.02.2007 18:27 |
| Kooperationspartner im Bereich Internet-Marketing gesucht | wiretheless | Trash | 0 | 22.05.2006 19:37 |
| 3zeiliges div Seitenlayout - 3. Bereich zu tief | HStev | HTML, Usability und Barrierefreiheit | 7 | 21.04.2006 16:13 |
| Daten aus Pw-Geschütztem bereich auslesen | PHP-Fortgeschrittene | 2 | 26.08.2005 15:27 | |
| Login Bereich | PHP Tipps 2005-2 | 12 | 15.08.2005 23:27 | |
| Newsposting aus gesondertem Bereich | Beitragsarchiv | 5 | 04.08.2005 18:13 | |
| wie erstelle ich eine Festen Bereich (Navigation) | PHP Tipps 2005-2 | 9 | 30.06.2005 16:01 | |
| Passwortgeschützter Bereich | Matthiasnet | PHP Tipps 2005-2 | 1 | 26.06.2005 12:25 |
| [Erledigt] Zugriff auf Dateien im passwortgeschützten Bereich | PHP Tipps 2005 | 15 | 16.03.2005 17:50 | |
| Dokumenten Download im geschützten Bereich | imported_dirk | PHP Tipps 2005 | 3 | 10.02.2005 21:32 |
| Suche Programmierer/ Agenturen, Bereich Gesundheitswesen | Beitragsarchiv | 0 | 16.12.2004 07:30 | |
| Content bereich aus Mysql mit php code einbinden | Datenbanken | 0 | 28.11.2004 16:06 | |
| PHP und Mysql für Internen Bereich | Beitragsarchiv | 3 | 27.10.2004 10:53 | |
| Sicherer Bereich mit .htaccess + phpskript auf einem Server | PHP Tipps 2004 | 2 | 23.07.2004 18:25 | |
| Besucher kamen über folgende Suchanfragen bei Google auf diese Seite |
| php code bereich, php quellcode blockquote, php code courier new, wie sehe ich den wbb image bereich ein, blockquotes wbb, highlight_string font courier, preg_replace font, wbb blockquote code |

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.