login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > PHP > UBB & Smilies > Lux UBB Script

Lux UBB Script

Auteur: Toppe - 04 januari 2005 - 19:58 - Gekeurd door: Dennisvb - Hits: 8271 - Aantal punten: 2.08 (19 stemmen)




Leuk UBB script door mij gemaakt,

Spreekt wel voor zich

Code:
  1. <?php
  2.  
  3. /* UBB SCRIPT © TOPPE! */
  4. /* VERSION V1 BETA */
  5.  
  6. function strip($input){
  7. $return = stripslashes(htmlspecialchars($input));
  8. return $return;
  9. }
  10.  
  11. function lengte($input, $lengte){
  12. if(strlen($input) > $lengte){
  13. $input = substr($input,0,17)."...";
  14. } else {
  15. $input = $input;
  16. }
  17. return $input;
  18. }
  19.  
  20. function highlight($input){
  21. highlight_string($input)l;
  22. $input = ob_get_contents();
  23. return strip($input);
  24. }
  25.  
  26. function opmaak($input){
  27. $input = preg_replace('![b](.*?)[/b]!', "<b>\\1</b>", $input);
  28. $input = preg_replace('![u](.*?)[/u]!', "<u>\\1</u>", $input);
  29. $input = preg_replace('![i](.*?)[/i]!', "<i>\\1</i>", $input);
  30. $input = preg_replace('![s](.*?)[/s]!', "<s>\\1</s>", $input);
  31.  
  32. $input = str_replace("[quote]", "<blockquote class=\"quote\">", $input);
  33. $input = str_replace("[/quote]", "</blockquote>", $input);
  34. $input = preg_replace('![quote=((w)*?)]!', "<blockquote class=\"quote\"><i>Quote van: \\1</i><br><br>", $input);
  35. $input = preg_replace ("#\[code\](.*)\[/code\]#", "highlight('\\1')", $input);
  36. $input = preg_replace("!javascript:!i", "", $string);
  37. $input = preg_replace("!script!i", "", $string);
  38. $input = preg_replace("#[size=([-+]?[1-2]?[0-9])](.*?)[/size]#si", "<font size='\\1'>\\2</font>", $input);
  39. $input = preg_replace("#[color=(#[0-9A-F]{6}|[a-z-]+)](.*?)[/color]#si", "<font color='\\1'>\\2</font>", $input);
  40. $input = eregi_replace("[url][[:space:]]*(http://)?([^[]*)[[:space:]]*[/url]", "<a href=\"http://\\2/\" target="_blank">\\2</a>", $input);
  41. $input = eregi_replace("[url=([^[]*)]([^[]*)[/url]","<a href=\"\\1\" target=_blank>\\2</a>",$input);
  42. $input = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"\\2\" target=_blank>", $input);
  43. $input = eregi_replace("(\[img=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"\\2\" target=_blank><img src=\"\\2\" border=\"0\"></a>", $input);
  44. $input = eregi_replace("(^|[>[:space:]\n])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])([<[:space:]\n]|$)", "\\1<a href=\"\\2://\\3\\4\" target=\"_blank\">\\2://\\3\\4</a>\\5", $input);
  45. $input = eregi_replace("([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})", "<a href=\"mailto:\\1\">\\1</a>", $input);
  46. $input = eregi_replace("(^|[>[:space:]\n])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])([<[:space:]\n]|$)", "\\1<a href=\\2://\\3\\4 target=_blank>\\2://\\3\\4</a>\\5", $input);
  47. $input = eregi_replace("([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})", "<a href=\"mailto:\\1\">\\1</a>", $input);
  48.  
  49. $input = str_replace("[list]", "<ul>", $input);
  50. $input = str_replace("[ulist]", "<ul>", $input);
  51. $input = str_replace("[*]", "<li>", $input);
  52. $input = str_replace("[li]", "<li>", $input);
  53. $input = str_replace("[/list]", "</ul>", $input);
  54. $input = str_replace("[/li]", "</ol>", $input);
  55. $input = str_replace("[/ulist]", "</ul>", $input);
  56. $input = str_replace("[/listo]", "</ol>", $input);
  57. $input = preg_replace("/[list=([a1])]/si", "<ol type=\"\\1\">", $input);
  58.  
  59. $input = str_replace("kanker", "***", $input);
  60. $input = str_replace("hoer", "***", $input);
  61. $input = str_replace("slet", "***", $input);
  62. $input = str_replace("pijpen", "***", $input);
  63.  
  64. $input = str_replace("1", "2", $input); //Voor smilies, Vervang 1 door je snel code en vervang 2 door het URL
  65.  
  66. return strip($input);
  67. }
  68. ?>
Download code! Download code (.txt)

 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (7)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.031s