Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Konwerter BBcode --> HTML, Jak takue cacuszko napisać w PHP
Adam11
post
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 15.01.2011

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


Witam Wszystkich (IMG:style_emoticons/default/smile.gif)

Mam pytanko jak zacząć pisanie skryptu PHP, a dokładniej takie cacko chciałbym wykonać :

http://www.bbcode-to-html.com

Początek mam taki:

  1. <?php
  2. require_once "maincore.php";
  3. require_once THEMES."templates/header.php";
  4.  
  5. if (iMEMBER) {
  6.  
  7. nio i tu skrypt cały
  8.  
  9. ///// trochę przycisków :
  10.  
  11. <td align='center'><textarea name='comment_message' rows='6' class='textbox' style='width:400px'></textarea><br>
  12. <input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onClick=\"addText('comment_message', '', '');\">
  13. <input type='button' value='i' class='button' style='font-style:italic;width:25px;' onClick=\"addText('comment_message', '', '');\">
  14. <input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onClick=\"addText('comment_message', '', '');\">
  15. <input type='button' value='url' class='button' style='width:30px;' onClick=\"addText('comment_message', '', '');\">
  16. <input type='button' value='mail' class='button' style='width:35px;' onClick=\"addText('comment_message', '[mail]', '[/mail]');\">
  17. <input type='button' value='img' class='button' style='width:30px;' onClick=\"addText('comment_message', '');\">
  18. <input type='button' value='center' class='button' style='width:45px;' onClick=\"addText('comment_message', '
    ', '
    ');\">
  19. <input type='button' value='small' class='button' style='width:40px;' onClick=\"addText('comment_message', '[small]', '[/small]');\">
  20. <input type='button' value='code' class='button' style='width:40px;' onClick=\"addText('comment_message', '<!--c1--><div class='codetop'>Kod</div><div class='codemain'><!--ec1-->', '<!--c2--></div><!--ec2-->');\">
  21. <input type='button' value='quote' class='button' style='width:45px;' onClick=\"addText('comment_message', '<!--quoteo--><div class='quotetop'>Cytat</div><div class='quotemain'><!--quotec-->', '<!--QuoteEnd--></div><!--QuoteEEnd-->');\">
  22.  
  23.  
  24.  
  25. } else {
  26. echo "<br><br><br><br><center><span style='font-size: 16pt'><span style='color: lime'>Jesteś? niezalogowany, brak dostępu</span></span></center><br><br><br><br>";
  27. }
  28.  
  29. require_once THEMES."templates/footer.php";
  30. ?>


Ale pewnie jakąś funkcję trzeba dać tylko nie umiem zrobić.

Bym był bardzo wdzięczny za pomoc.

Ten post edytował Adam11 2.05.2011, 15:07:04
Go to the top of the page
+Quote Post
nekomata
post
Post #2





Grupa: Zarejestrowani
Postów: 314
Pomógł: 44
Dołączył: 12.11.2010
Skąd: UK

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


Po pierwsze... to ile dobrze mi się wydaje to w html'u do określenia "właściwości" używasz znaku "(cudzysłów) a ty użyłeś '(apostrof)
Najprościej byłoby używać str_replace albo preg_replace chociaż takie coś jest podatne na XSS.. poleciłbym ci używać klasy wookieb'a link masz tutaj Temat: klasa Zaawansowany parser bbcode php5
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 22.08.2025 - 19:56