Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> bbcode
zaba12
post
Post #1





Grupa: Zarejestrowani
Postów: 223
Pomógł: 0
Dołączył: 29.08.2003
Skąd: Gliwice

Ostrzeżenie: (10%)
X----


ehh nie wiem juz co mam robic

Cytat
Parse error: syntax error, unexpected T_STRING in H:\n\functions.php on line 78



  1. <? function bbcode($text)
  2. {
  3. $str = " " . $text;
  4. $str = preg_replace("#(.*?)#si", "<b>1</b>", $str);
  5. $str = preg_replace("#(.*?)#si", "<i>1</i>", $str);
  6. $str = preg_replace("#(.*?)#si", "<u>1</u>", $str);
  7. $str = preg_replace("#[sm](.*?)[/sm]#si", "<small>1</small>", $str);
  8. $str = preg_replace("#[big](.*?)[/big]#si", "<big>1</big>", $str);
  9. $str = preg_replace("/[p](.*?)[/p]/si", "<p>1</p>", $str);
  10. $str = preg_replace("#[p=(http://)?(.*?)](.*?)[/p]#si", "<p align="2">3</p>", $str);
  11. $str = preg_replace("/
    (.*?)
    /si"
    , "<center>1</center>", $str);
  12. $str = preg_replace("#(.*?)#si", "<span style="color:2">3</span>", $str);
  13. $str = preg_replace("#(.*?)#si", "<span style="font-size:2">3</span>", $str);
  14. $str = preg_replace("#[img](.*?)[/img]#si", "<img src="1" border="0" alt="Obrazek" />", $str);
  15. $str = preg_replace("#[ftp_img](.*?)[/ftp_img]#si", "<img src="img/1" border="0" alt="Obrazek" />", $str);
  16. $str = preg_replace("#[hr=(d{1,2}|100)]#si", "<hr class="linia" width="1%">", $str);
  17. $str=str_replace('&nbsp;','&nbsp;',$str);
  18. // znaki specjalne
  19. $str = str_replace('&amp;plusmn;', '&plusmn;', $str);
  20. $str = str_replace('&amp;trade;', '&trade;', $str);
  21. $str = str_replace('&amp;bull;', '&bull;', $str);
  22. $str = str_replace('&amp;deg;', '&deg;', $str);
  23. $str = str_replace('&amp;copy;', '&copy;', $str);
  24. $str = str_replace('&amp;reg;', '&reg;', $str);
  25. $str = str_replace('&amp;hellip;', '&hellip;', $str);
  26.  
  27. // błędne kodowanie m.in. z phpmyadmina
  28. $str = str_replace('&amp;#261;', 'ą', $str);
  29. $str = str_replace('&amp;#263;', 'ć', $str);
  30. $str = str_replace('&amp;#281;', 'ę', $str);
  31. $str = str_replace('&amp;#322;', 'ł', $str);
  32. $str = str_replace('&amp;#347;', 'ś', $str);
  33. $str = str_replace('&amp;#378;', 'ź', $str);
  34. $str = str_replace('&amp;#380;', 'ż', $str);
  35.  
  36. // znaki specjalne z m$ word
  37. $str = str_replace('&amp;#177;', 'ą', $str);
  38. $str = str_replace('&amp;#8217;', ''', $str);
  39. $str = str_replace('&amp;#8222;', '"', $str);
  40. $str = str_replace('&amp;#8221;', '"', $str);
  41. $str = str_replace('&amp;#8220;', '"', $str);
  42. $str = str_replace('&amp;#8211;', '-', $str);
  43. $str = str_replace('&amp;#8230;', '&hellip;', $str);
  44. $str = preg_replace("#[code](.*?)[/code]#si", "<p class="kod"><u><b>Kod:</b></u><br/>1</p>", $str);
  45. $str = preg_replace("#[quote](.*?)[/quote]#si", "<p class="cytat"><u><b>Cytat:</b></u><br/>1</p>", $str);
  46. $str = preg_replace("#<p class="cytat"><u><b>Cytat (http://)?(.*?):</b></u><br/>(.*?)</p>#si", "<p class="cytat"><u><b>Cytat 2:</b></u><br/>3</p>", $str);
  47. $str = preg_replace("#([a-z0-9-_.]+?)@([w-]+.([w-.]+.)?[w]+)#i", "<a href="mailto:1@2">1@2</a>", $str);
  48. $str = preg_replace("#[email=([a-z0-9-_.]+?)@([w-]+.([w-.]+.)?[w]+)?(.*?)](.*?)[/email]#i", "<a href="mailto:1@2">5</a>", $str);
  49. $str = preg_replace("#(.*?)?(.*?)#si", "<A HREF="12" TARGET="_blank">12</A>", $str);
  50. $str = preg_replace("#(.*?)#si", "<A HREF="2" TARGET="_blank">3</A>", $str);
  51. $str = preg_replace("#[url2](.*?)?(.*?)[/url2]#si", "<A HREF="12">12</A>", $str);
  52. $str = preg_replace("#[url2=(.*?)?(.*?)](.*?)[/url2]#si", "<A HREF="2">3</A>", $str);
  53. $str = preg_replace("#([n ])www.([a-z0-9-]+).([a-z0-9-.~]+)((?:/[a-z0-9-.,?!%*_#:;~&$@/=+]*)?)#i", " <a href="http://www.2.34" target="_blank">www.2.34</a>", $str);
  54. $str = preg_replace("#([n ])([a-z0-9-_.]+?)@([w-]+.([w-.]+.)?[w]+)#i", "1<a href="java_script:mailto:mail('2','3');">2_(at)_3</a>", $str);
  55. $str = preg_replace_callback("#([n ])([a-z]+?)://([a-z0-9-.,?!%*_#:;~&$@/=+]+)#si", "bbcode_autolink", $str);
  56. $str=preg_replace_callback("#[php](.*?)[/php]#si", "bbcode_phpCode", $str);
  57. }
  58. ?>
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 21.08.2025 - 01:41