php.de

Zurück   php.de > Webentwicklung > PHP-Fortgeschrittene

PHP-Fortgeschrittene Arbeiten mit PHP ohne Einschränkungen

Antwort
 
LinkBack Themen-Optionen Thema bewerten
Alt 17.09.2004, 13:00  
Gast
 
Beiträge: n/a
Standard bbcode - Classe

Hallo,

hat jemand von Euch schon einmal mit dieser Classe hier gearbeitet ?

http://www.christian-seiler.de/projekte/php/bbcode/

Und dafür schon die jeweiligen

$bbcode->addCode(...);

geschrieben ?

Bye
  Mit Zitat antworten
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 17.09.2004, 20:05  
Gast
 
Beiträge: n/a
Standard

Hallo,

ich brauche wohl etwas unterstützung ... bei der
classe bin ich mit den Definitionen schon soweit :

PHP-Code:
            $this->classBBcode->addParser ('htmlspecialchars', array ('block''inline''link'));
            
$this->classBBcode->addParser ('nl2br', array ('block''inline''link'));

            
$this->classBBcode->addCode ('b''simple_replace'null, array ('[b]''[/b]'),
                  
'inline', array ('block''inline''link'), array ());
            
$this->classBBcode->addCode ('i''simple_replace'null, array ('[i]''[/i]'),
                  
'inline', array ('block''inline''link'), array ());
            
$this->classBBcode->addCode ('u''simple_replace'null, array ('<u>''</u>'),
                  
'inline', array ('block''inline''link'), array ());

            
$this->classBBcode->addCode ('url''usecontent''do_bbcode_url', array ('default'),
                  
'link', array ('block''inline'), array ('link'));

            
$this->classBBcode->addCode ('quote''usecontent''do_bbcode_url', array ('default'),
                  
'link', array ('block''inline'), array ('link'));


            
$this->classBBcode->addCode(
                                   
'img',
                                   
'simple_replace',
                                   
null,
                                   array(
'[img]','[/img]'),
                                   
'inline',
                                    array(
'block','inline'),
                                    array()
                                    );
            
$this->classBBcode->addCode(
                                   
'quote',
                                   
'simple_replace',
                                   
null,
                                   array(
'<P CLASS="f2 c3 b" style="display:inline">Zitat:
</P><P CLASS="f2 c3 b4">'
,'</P>'),
                                   
'inline',
                                    array(
'block','inline'),
                                    array()
                                    );
            
$this->classBBcode->addCode(
                                   
'code',
                                   
'simple_replace',
                                   
null,
                                   array(
'<P CLASS="f2 c3 b" style="display:inline">Code:
</P><P CLASS="f2 c3 b4">'
,'</P>'),
                                   
'inline',
                                    array(
'block','inline'),
                                    array()
                                    );
            
$this->classBBcode->addCode(
                                   
'php',
                                   
'simple_replace',
                                   
null,
                                   array(
'<P CLASS="f2 c3 b" style="display:inline">PHP-Code:
</P><P CLASS="f2 c3 b4">'
,'</P>'),
                                   
'inline',
                                    array(
'block','inline'),
                                    array()
                                    ); 
Nur das mit dem namen in dem [ ] tag bring ich nicht hin ! zB.
bei der [ url ] könnte mir evtl. jemand ein beispiel dafür geben dann
könnte ich mich da bestimmt weiter durch schlagen ... da mir
noch folgende fehlen :

- url="url"
- liste
- liste (geordnet)
- quote="name"
- farbe
- schrift

eben alles mit diesem thema so wie ich das sehen !?

Danke !
Grüße
South
*kopfrauch*
  Mit Zitat antworten
Alt 17.09.2004, 20:20  
Gast
 
Beiträge: n/a
Standard

PHP-Code:
    function &bbcode($para)    {
        
$search = array(
        
"/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4)(.*)(\[\/url\])/siU",
        
"/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
        
"/(\[)(url)(\])(www\.)([^\"]*)(\[\/url\])/siU",
        
"/(\[)(url)(\])([^\"']*)(\[\/url\])/siU",
        
"/(\[)(email)(\])([^\"']*)(\[\/email\])/siU",
        
"/(\[)(email)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/email\])/siU",
        
"/(\[)(color)(=\#)([^\W]*)(\])(.*)(\[\/color\])/siU",
        
"/(\[)(size)(=)([^\W]*)(\])(.*)(\[\/size\])/siU",
        
"/(\[)(style)(=)([^\W]*)(\])(.*)(\[\/style\])/siU",
        
"/(\[)(b)(\])(\r\n)*(.*)(\[\/b\])/siU",
        
"/(\[)(u)(\])(\r\n)*(.*)(\[\/u\])/siU",
        
"/(\[)(i)(\])(\r\n)*(.*)(\[\/i\])/siU",
        
"/(\[)(quote)(\])(\r\n)*(.*)(\[\/quote\])/siU",
        
"/(\[)(code)(\])(\r\n)*(.*)(\[\/code\])/siU",
        
"/(\[)(pre)(\])(\r\n)*(.*)(\[\/pre\])/siU",
        
"/(\[)(img)(\])(?!javascript:)(\r\n)*([^\"']*)(\[\/img\])/siU",
        
"/about:/si");
        
        
$replace = array(
        
"<a href=\"http://www.\\6\" target=\"_blank\">\\8</a>",
        
"<a href=\"\\5\" target=\"_blank\">\\7</a>",
        
"<a href=\"http://www.\\5\" target=\"_blank\">\\5</a>",
        
"<a href=\"\\4\" target=\"_blank\">\\4</a>",
        
"<a href=\"mailto:\\4\" target=\"_blank\">\\4</a>",
        
"<a href=\"mailto:\\5\" target=\"_blank\">\\7</a>",
        
"<span style=\"color:\\4;\">\\6</span>",
        
"<span style=\"font-size:\\4\">\\6</font>",
        
"<span style=\"font-family:\\4\">\\6</font>",
        
"[b]\\5[/b]",
        
"<u>\\5</u>",
        
"[i]\\5[/i]",
        
"<blockquote>Zitat:
<hr>
\\5<hr></blockquote>"
,
        
"<blockquote>Code:
<hr>
\\5<hr></blockquote>"
,
        
"<pre>Code:
\\5</pre>"
,
        
"<img src=\"\\5\" border=\"0\">",
        
"about: ");
        return 
preg_replace($search$replace$para);
    } 
  Mit Zitat antworten
Alt 17.09.2004, 20:58  
Gast
 
Beiträge: n/a
Standard

hmmm .... *mal drüber grübeln*
  Mit Zitat antworten
Alt 18.09.2004, 17:30  
Gast
 
Beiträge: n/a
Standard

Hi,

jetzt bin ich schon so weit aber so recht will das nicht funktionieren da
zB. wenn ich farbe und größe angebe geht nur das äußere der beiden
bbcodes ...


PHP-Code:
$this->classBBcode->addParser ('htmlspecialchars', array ('block','listitem''inline''link'));
$this->classBBcode->addParser ('bbcode_striplastlinebreak''listitem');

$this->classBBcode->addParser ('nl2br', array ('block','listitem''inline''link'));
$this->classBBcode->addParser ('bbcode_stripcontents', array ('list'));

$this->classBBcode->addCode ('list''simple_replace'null, array ('<ul style="list-style-type : box">''[/list]'),
                 
'list', array ('block''listitem'), array ());
$this->classBBcode->addCode ('*''simple_replace'null, array ('[*]'"\n"),
                  
'listitem', array ('list'), array ());
$this->classBBcode->setCodeFlag ('*''no_close_tag'true);

#            $this->classBBcode->addParser ('htmlspecialchars', array ('block', 'inline', 'link'));
#            $this->classBBcode->addParser ('nl2br', array ('block', 'inline', 'link'));

            
$this->classBBcode->addCode ('b''simple_replace'null, array ('[b]''[/b]'),
                  
'inline', array ('block''inline''link'), array ());
            
$this->classBBcode->addCode ('i''simple_replace'null, array ('[i]''[/i]'),
                  
'inline', array ('block''inline''link'), array ());
            
$this->classBBcode->addCode ('u''simple_replace'null, array ('<u>''</u>'),
                  
'inline', array ('block''inline''link'), array ());

            
$this->classBBcode->addCode ('url''usecontent?''do_bbcode_url', array ('default'),
                  
'link', array ('block''inline'), array ('link'));

            
$this->classBBcode->addCode ('color''usecontent''do_bbcode_color', array ('default'),
                  
'block', array ('block''inline' ,'link' ,'listitem'), array ());
            
$this->classBBcode->addCode ('size''usecontent''do_bbcode_size', array ('default'),
                  
'block', array ('block''inline' ,'link' ,'listitem'), array ());


            
$this->classBBcode->addCode(
                                   
'img',
                                   
'simple_replace',
                                   
null,
                                   array(
'[img]','[/img]'),
                                   
'inline',
                                    array(
'block','inline'),
                                    array()
                                    );
            
$this->classBBcode->addCode(
                                   
'quote',
                                   
'simple_replace',
                                   
null,
                                   array(
'<P CLASS="f2 c3 b" style="display:inline">Zitat:
</P><P CLASS="f2 c3 b4" >'
,'</P>'),
                                   
'inline',
                                    array(
'block','inline'),
                                    array()
                                    );
            
$this->classBBcode->addCode(
                                   
'code',
                                   
'simple_replace',
                                   
null,
                                   array(
'<P CLASS="f2 c3 b" style="display:inline">Code:
</P><P CLASS="f2 c3 b4">'
,'</P>'),
                                   
'inline',
                                    array(
'block','inline'),
                                    array()
                                    );
            
$this->classBBcode->addCode(
                                   
'php',
                                   
'simple_replace',
                                   
null,
                                   array(
'<P CLASS="f2 c3 b" style="display:inline">PHP-Code:
</P><P CLASS="f2 c3 b4">'
,'</P>'),
                                   
'inline',
                                    array(
'block','inline'),
                                    array()
                                    );

            
$text $this->classBBcode->parse ($text);
            return 
$text
hmm weis aber leider nicht weiter jemand einen Denkanstoss oder
sieht einen Fehler den ich mache ... die classe die ich verwende ist die
im ersten Post angegebene ...

Danke ...
  Mit Zitat antworten
Antwort


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
BBCode - Tag verschachteln, Problem mit Reihenfolge. horstenpeter PHP Tipps 2006 4 21.08.2006 12:33
BBCode - ähnliche Markup-Language für Redaktionssystem horstenpeter PHP Tipps 2006 3 17.08.2006 18:44
BBCode mit eregi_replace(); ändert nur letztes Vorkommen Blank PHP Tipps 2006 6 12.04.2006 14:58
BBCode Parser Mutatos PHP Tipps 2006 1 05.01.2006 12:19
BBCode Realisierung - Code Andun PHP-Fortgeschrittene 10 18.12.2005 21:09
[Erledigt] Problem mit BBCode PHP Tipps 2007 6 30.11.2005 17:26
img resize (thumbnails) mit bbcode PHP-Fortgeschrittene 5 01.10.2005 01:30
[Erledigt] [RegExp] Thema BBCode und XHTML 1.1 PHP-Fortgeschrittene 2 18.09.2005 13:57
Wie mache ich in einem TXT Editor BBCode und smilies rein? PHP Tipps 2005-2 2 03.09.2005 23:04
BBCode umwandeln GSJLink PHP Tipps 2005-2 7 13.08.2005 16:29
bbcode verachtet anderen bbcode phpfortgeschrittener PHP Tipps 2005-2 7 04.08.2005 00:42
BBCode - Listen und Tabellen inu PHP Tipps 2005 11 22.03.2005 10:37
BBCode und htmlspecialchars PHP Tipps 2005 5 21.02.2005 20:10
inhalt in bbcode [code][/code] highlighten lassen, wie? PHP Tipps 2004 5 28.10.2004 21:53
Hilfe bei BBcode PHP Tipps 2004 6 29.06.2004 23:10

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
php bbcode, bbcode php, php bbcode url, php bbcode to html, bbcode url php, php bbcode class, php html to bbcode, bbcode to html php, bbcode.php, bbcode class php, url bbcode php, $bbcode->addcode font, bbcodes php, bbcode in php, bbcode mit php, php bb code to html, bb code php, bbcode für php, php url bbcode, php bbcodes url

Alle Zeitangaben in WEZ +1. Es ist jetzt 04:52 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.