Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [klasa] Formatowanie tekstu
MMP
post 7.10.2006, 18:21:51
Post #1





Grupa: Zarejestrowani
Postów: 31
Pomógł: 0
Dołączył: 2.06.2006

Ostrzeżenie: (0%)
-----


Chciałbym zaprezentować klase do formatowania tekstu
Przykłady użycia znajdują sie na w/w linku.

Zaprezentowałem tam formater BBCodów z phpBB, ale przenieść można praktycznie każdy system BBCodów.
Klasa bardzo ułatwia napisanie własnego systemu formatowania tekstu(do CMS, FW itp).

Zapraszam do ściagania i dzielenia się błędami biggrin.gif

I notka

Ten post edytował MMP 7.10.2006, 18:45:18
Go to the top of the page
+Quote Post
wijet
post 7.10.2006, 19:28:42
Post #2





Grupa: Zarejestrowani
Postów: 116
Pomógł: 0
Dołączył: 20.12.2005
Skąd: Łódź

Ostrzeżenie: (0%)
-----


Klikam na ściagnij i
Cytat
Information

You haven't selected an attachment to download or view.


coś nie tak robie? tongue.gif


--------------------
Go to the top of the page
+Quote Post
MMP
post 7.10.2006, 20:00:32
Post #3





Grupa: Zarejestrowani
Postów: 31
Pomógł: 0
Dołączył: 2.06.2006

Ostrzeżenie: (0%)
-----


Nie ma to jak się pierdzielnąć w adresie smile.gif
http://sambadamba.info/FormatText/download.php
Go to the top of the page
+Quote Post
SHiP
post 9.10.2006, 19:18:22
Post #4





Grupa: Zarejestrowani
Postów: 697
Pomógł: 47
Dołączył: 19.12.2003
Skąd: Lublin

Ostrzeżenie: (0%)
-----


Fajnie że mozna deklarować wlasną budowę jednak troche to jest ograniczone...
zamontowałem klase phpbb
Odpalilem zagnieżdżone quote w quote i skrypt sie zgubił...
Poza tym widzę ze nie pracujesz na trybie E_NOTICE ;]
Cytat
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 97
Notice: Undefined index: IgnoreAll in /home/hellson/public_html/FormatText.php on line 94
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined index: IgnoreAll in /home/hellson/public_html/FormatText.php on line 94
Notice: Undefined offset: 1 in /home/hellson/public_html/FormatText.php on line 116
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined offset: 2 in /home/hellson/public_html/FormatText.php on line 116
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined index: IgnoreAll in /home/hellson/public_html/FormatText.php on line 94
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined index: IgnoreAll in /home/hellson/public_html/FormatText.php on line 94
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined index: IgnoreAll in /home/hellson/public_html/FormatText.php on line 94
Notice: Undefined offset: 1 in /home/hellson/public_html/FormatText.php on line 116
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined offset: 2 in /home/hellson/public_html/FormatText.php on line 116
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined offset: 2 in /home/hellson/public_html/FormatText.php on line 116
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined index: IgnoreAll in /home/hellson/public_html/FormatText.php on line 94
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined index: IgnoreAll in /home/hellson/public_html/FormatText.php on line 94
Notice: Undefined offset: 1 in /home/hellson/public_html/FormatText.php on line 116
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined index: IgnoreAll in /home/hellson/public_html/FormatText.php on line 94
Notice: Undefined offset: 1 in /home/hellson/public_html/FormatText.php on line 116
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined offset: 3 in /home/hellson/public_html/FormatText.php on line 116
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 121
Notice: Undefined index: NoIgnore in /home/hellson/public_html/FormatText.php on line 97
Notice: Undefined offset: 6 in /home/hellson/public_html/FormatText.php on line 149
Notice: Undefined offset: 0 in /home/hellson/public_html/FormatText.php on line 42
Notice: Undefined offset: 0 in /home/hellson/public_html/FormatText.php on line 47
Notice: Undefined offset: 1 in /home/hellson/public_html/FormatText.php on line 42
Notice: Undefined offset: 1 in /home/hellson/public_html/FormatText.php on line 47


--------------------
Warsztat: Kubuntu, PhpStorm, Opera
Go to the top of the page
+Quote Post
MMP
post 15.10.2006, 10:34:53
Post #5





Grupa: Zarejestrowani
Postów: 31
Pomógł: 0
Dołączył: 2.06.2006

Ostrzeżenie: (0%)
-----


Cytat
Fajnie że mozna deklarować wlasną budowę jednak troche to jest ograniczone...

Jak ograniczeń nie widze, zaskocz mnie smile.gif

Poprawiłem błąd z gniazdami, na serwerze nowe v. Do przykładu dodałem tagi: url/img i przykład quote z parametrem
Go to the top of the page
+Quote Post
SHiP
post 15.10.2006, 12:25:26
Post #6





Grupa: Zarejestrowani
Postów: 697
Pomógł: 47
Dołączył: 19.12.2003
Skąd: Lublin

Ostrzeżenie: (0%)
-----


Cytat(MMP @ 15.10.2006, 11:34:53 ) *
Jak ograniczeń nie widze, zaskocz mnie smile.gif


Chodzi mi o chociażby możliwosć opcjonalnych parametrół tj. przynajmenij id i class
np. [b class=mojaklasacss]text[/b]


--------------------
Warsztat: Kubuntu, PhpStorm, Opera
Go to the top of the page
+Quote Post
MMP
post 15.10.2006, 14:10:08
Post #7





Grupa: Zarejestrowani
Postów: 31
Pomógł: 0
Dołączył: 2.06.2006

Ostrzeżenie: (0%)
-----


  1. <?php
  2. $this -> bbCode( 'bold', '[b([^]]*?)](.*?)[/b]', '<b$1>$2</b>' );
  3. ?>

Lub poprostu
  1. <?php
  2. $this -> bbCode( 'boldAtr', '[b (.*?)](.*?)[/b]', '<b $1>$2</b>' );
  3. ?>

:-)
Go to the top of the page
+Quote Post
SHiP
post 15.10.2006, 14:58:48
Post #8





Grupa: Zarejestrowani
Postów: 697
Pomógł: 47
Dołączył: 19.12.2003
Skąd: Lublin

Ostrzeżenie: (0%)
-----


Tylko wtedy nie mamy żadnej kontroli nad tym co uzytkownik wpisze a wygenerowany kod powinien być raczej xhtml valid...

Poza tym znalazłem bład(albo ja jestem za głupi)

Jesli do podanego przykładu dodamy na początku znacznik img to kod sie nie parsuje...
Kod
$sCode = '[img]http://serwisy.gazeta.pl/i/gazeta.gif[/img]';


Powodzenia w dalszej pracy smile.gif


--------------------
Warsztat: Kubuntu, PhpStorm, Opera
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 01:43