login  Naam:   Wachtwoord: 
Registreer je!
 Forum

[opgelost]bb-code toepassen

Offline webbiexl - 02/06/2005 08:35 (laatste wijziging 02/06/2005 09:47)
Avatar van webbiexlPHP interesse hey ik heb een ubb script en die wil ik toepassen op elke pagina van de site, maar wat ik ook doe hij werkt niet

dus mijn vraag is hoe moet je een ubb toepassen zodat ie werkt met mn nieuwsscript, pmsysteem en mijn forum?

*problem solved, thnx geer

5 antwoorden

Gesponsorde links
Offline Geerios - 02/06/2005 08:47 (laatste wijziging 02/06/2005 08:51)
Avatar van Geerios Onbekend Hebben alle berichten de zelfde variable?
Zo nee? Welke variabele heb je dan?

EDIT: Maar voor het weergeven
Offline webbiexl - 02/06/2005 08:51 (laatste wijziging 02/06/2005 09:36)
Avatar van webbiexl PHP interesse in mijn textvak wordt $bericht geladen en alle tags smilies (dingen in de bb) beginnen daar ook mee

EDIT:
bericht vanuit de database opgeroepen

  1. <tr class="rij1">
  2. <td colspan="2">
  3. <?php echo"$bericht"; ?>
  4. </td>
  5. </tr>


ubb
  1. <?php
  2.  
  3. $Smilies = array();
  4. $Smilies[":)"] = "images/smilies/01.gif";
  5. $Smilies[":("] = "images/smilies/02.gif";
  6. $Smilies[";)"] = "images/smilies/03.gif";
  7. $Smilies[":))"] = "images/smilies/04.gif";
  8. $Smilies[";;)"] = "images/smilies/05.gif";
  9. $Smilies["(?)"] = "images/smilies/06.gif";
  10. $Smilies["(H)"] = "images/smilies/07.gif";
  11. $Smilies[":$"] = "images/smilies/08.gif";
  12. $Smilies[":P"] = "images/smilies/09.gif";
  13. $Smilies["(K)"] = "images/smilies/10.gif";
  14. $Smilies[":O"] = "images/smilies/11.gif";
  15. $Smilies[":@"] = "images/smilies/12.gif";
  16. $Smilies[":>"] = "images/smilies/13.gif";
  17. $Smilies["(C)"] = "images/smilies/14.gif";
  18. $Smilies[":S"] = "images/smilies/15.gif";
  19. $Smilies["(6)"] = "images/smilies/16.gif";
  20. $Smilies[":'("] = "images/smilies/17.gif";
  21. $Smilies[":D"] = "images/smilies/18.gif";
  22. $Smilies[":|"] = "images/smilies/19.gif";
  23. $Smilies["/:)"] = "images/smilies/20.gif";
  24. $Smilies["(A)"] = "images/smilies/21.gif";
  25. $Smilies["B)"] = "images/smilies/22.gif";
  26. $Smilies["(S)"] = "images/smilies/23.gif";
  27. $Smilies["(Z)"] = "images/smilies/24.gif";
  28. $Smilies["8("] = "images/smilies/25.gif";
  29. $Smilies[":{"] = "images/smilies/26.gif";
  30. $Smilies["(M)"] = "images/smilies/27.gif";
  31. $Smilies["(N)"] = "images/smilies/28.gif";
  32. $Smilies["(CL)"] = "images/smilies/29.gif";
  33. $Smilies["(L)"] = "images/smilies/30.gif";
  34. $Smilies[":(("] = "images/smilies/31.gif";
  35. $Smilies["(D)"] = "images/smilies/32.gif";
  36. $Smilies["(HM)"] = "images/smilies/33.gif";
  37. $Smilies["(AU)"] = "images/smilies/34.gif";
  38. $Smilies["(AP)"] = "images/smilies/35.gif";
  39. $Smilies["(PI)"] = "images/smilies/36.gif";
  40. $Smilies["(CO)"] = "images/smilies/37.gif";
  41. $Smilies["(MO)"] = "images/smilies/38.gif";
  42. $Smilies["(CH)"] = "images/smilies/39.gif";
  43. $Smilies["(F)"] = "images/smilies/40.gif";
  44. $Smilies["(LC)"] = "images/smilies/41.gif";
  45. $Smilies["(AF)"] = "images/smilies/42.gif";
  46. $Smilies["(PU)"] = "images/smilies/43.gif";
  47. $Smilies["(CC)"] = "images/smilies/44.gif";
  48. $Smilies["(LA)"] = "images/smilies/45.gif";
  49. $Smilies["(SK)"] = "images/smilies/46.gif";
  50. $Smilies["(GR)"] = "images/smilies/47.gif";
  51. $Smilies["(AL)"] = "images/smilies/48.gif";
  52. $Smilies["(LO)"] = "images/smilies/49.gif";
  53. $Smilies["(KI)"] = "images/smilies/50.gif";
  54. $Smilies["(P)"] = "images/smilies/51.gif";
  55. $Smilies["(HP)"] = "images/smilies/52.gif";
  56. $Smilies["($)"] = "images/smilies/53.gif";
  57. $Smilies["(8)"] = "images/smilies/54.gif";
  58. $Smilies["(PI)"] = "images/smilies/55.gif";
  59. $Smilies["(B)"] = "images/smilies/56.gif";
  60. $Smilies["(V)"] = "images/smilies/57.gif";
  61. $Smilies["(X)"] = "images/smilies/58.gif";
  62. $Smilies["(PA)"] = "images/smilies/59.gif";
  63. $Smilies["(HU)"] = "images/smilies/60.gif";
  64. $Smilies["(1)"] = "images/smilies/61.gif";
  65. $Smilies["(2)"] = "images/smilies/62.gif";
  66. $Smilies["(3)"] = "images/smilies/63.gif";
  67. $Smilies["(%)"] = "images/smilies/64.gif";
  68.  
  69.  
  70. function dehtmlspecialchars($bericht) {
  71. $bericht = str_replace("&quot;",'"',$bericht);
  72. $bericht = str_replace("&lt;",'<',$bericht);
  73. $bericht = str_replace("&gt;",'>',$bericht);
  74. $bericht = str_replace("&#039;","'",$bericht);
  75. $bericht = str_replace("&amp;",'&',$bericht);
  76. return $bericht;
  77. }
  78.  
  79. function Opmaak($bericht) {
  80.  
  81. global $Smilies;
  82. while(list($code,$plaatje) = each($Smilies)) {
  83. $bericht = str_replace($code,"<img alt='Smilie' src='$plaatje'/>",$bericht);
  84. $bericht = str_replace(strtoupper($code),"<img alt='Smilie' src='$plaatje'/>",$bericht);
  85. $bericht = str_replace(strtolower($code),"<img alt='Smilie' src='$plaatje'/>",$bericht);
  86. }
  87. reset($Smilies);
  88.  
  89. $bericht = eregi_replace("\[b\]","<b>",$bericht);
  90. $bericht = eregi_replace("\[/b\]","</b>",$bericht);
  91. $bericht = eregi_replace("\[i\]","<i>",$bericht);
  92. $bericht = eregi_replace("\[/i\]","</i>",$bericht);
  93. $bericht = eregi_replace("\[u\]","<u>",$bericht);
  94. $bericht = eregi_replace("\[/u\]","</u>",$bericht);
  95. $bericht = eregi_replace("\[s\]","<s>",$bericht);
  96. $bericht = eregi_replace("\[/s\]","</s>",$bericht);
  97. $bericht = eregi_replace("\[sup\]","<sup>",$bericht);
  98. $bericht = eregi_replace("\[/sup\]","</sup>",$bericht);
  99. $bericht = eregi_replace("\[sub\]","<sub>",$bericht);
  100. $bericht = eregi_replace("\[/sub\]","</sub>",$bericht);
  101. $bericht = preg_replace("/(\[email\])(.*)(\[\/email\])/U","<a href=\"mailto:\\2\"><u>\\2</u></a>", $bericht);
  102. $bericht = preg_replace("/(\[img\])http:\/\/(.*)(\[\/img\])/U","<img border=0 src='http://\\2'>", $bericht);
  103. $bericht = eregi_replace("\[url\][[:space:]]*(http://)?([^\\[]*)[[:space:]]*\[/url\]", "<a href=\"http://\\2\" target=\"_blank\"><u>http://\\2</u></a>", $bericht);
  104. $bericht = eregi_replace("\[list\]","<ul>",$bericht);
  105. $bericht = eregi_replace("\[/list\]","</ul>",$bericht);
  106. $bericht = str_replace("[*]","<li>",$bericht);
  107. $bericht = preg_replace("/\\[url=(http\:\/\/)?([^\\[]*)\\][[:space:]]*([^\\[]*)[[:space:]]*\\[\/url\\]/e", "URL('$2','$3')", $bericht);
  108. $bericht = eregi_replace("\\[php=([^]]+)\\]", "<a href='http://www.php.net/\\1' target='_blank'><u>\\1 (PHP Manual)</u></a>", $bericht);
  109. $bericht = eregi_replace("\\[google=([^]]+)\\]", "<a href='http://www.google.nl/search?q=\\1' target='_blank'><u>\\1 (Google)</u></a>", $bericht);
  110.  
  111. return $bericht;
  112. }
  113.  
  114. ?>
Offline Geerios - 02/06/2005 08:58 (laatste wijziging 02/06/2005 08:58)
Avatar van Geerios Onbekend Als je het nou zo doe:
  1. <?
  2. function ubb($variable) {
  3. ////hier je ubb dingetjes bv:
  4. $variable = str_replace(":p","<img src=plaatje.gif>",$variable);
  5. return $variable;
  6. }
  7. ?>
En dan zo neer zetten:
  1. <? echo function($bericht); ?>
Offline webbiexl - 02/06/2005 08:59 (laatste wijziging 02/06/2005 09:00)
Avatar van webbiexl PHP interesse ga t even proberen
moeten ze allemaal onderelkaar smilies styletags etc
Offline webbiexl - 02/06/2005 09:34 (laatste wijziging 02/06/2005 09:53)
Avatar van webbiexl PHP interesse nukrijg overal errors
parse error on line 80

*opgelost

vinTage edit, opgelost...owja ......hoe dan ??
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.249s