Advertisement
naruto0150

BbCode part-4

Feb 15th, 2014
721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 7.42 KB | None | 0 0
  1. <script language="javascript">
  2. var msg=document.getElementsByName("dpro");
  3. for(var i=0;i<msg.length;i++){
  4. var txt=document.getElementsByName("dpro")[i].innerHTML;
  5. txt=txt.replace(/\[file]/ig,'<div class="file">Attached File:</div><div class="wcode" style="padding-left:10px" name="codes">');
  6. txt=txt.replace(/\[\/file]/ig,'</div>');
  7. txt=txt.replace(/\[media]\<a href="(.+?)">(.+?)\<\/a>(.+?)\[\/media]/ig,'<div class="file">Download $2 (<a href="$1" target="_blank">Tải xuống</a>)<span style="float:right">$3</span></div><div class="wcode" name="codes"><center><embed name="flashplayer" src="http://player.longtailvideo.com/player.swf" flashvars="file=http://danphuong.org/$1&amp;autostart=true&amp;image=http://photo.ssc.vn/images/272loading.gif&amp;backcolor=0x000000&amp;frontcolor=0xCCCCCC&amp;lightcolor=0x557722" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="450" width="100%"></embed></center></div>');
  8. txt=txt.replace(/\[media=(.+?)](.+?)\[\/media]/ig,'<div class="file">Download $2 (<a href="$1" target="_blank">Tải xuống</a>)</div><div class="wcode" name="codes"><center><embed name="flashplayer" src="http://player.longtailvideo.com/player.swf" flashvars="file=$1&amp;autostart=true&amp;image=http://photo.ssc.vn/images/272loading.gif&amp;backcolor=0x000000&amp;frontcolor=0xCCCCCC&amp;lightcolor=0x557722" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="450" width="100%"></embed></center></div>');
  9. document.getElementsByName("dpro")[i].innerHTML=txt;
  10. }
  11. </script>
  12. <script language="javascript">
  13. var msg=document.getElementsByName("dpro");
  14. for(var i=0;i<msg.length;i++){
  15. var oldtext=document.getElementsByName("dpro")[i].innerHTML;
  16. var newtext=oldtext.replace(/(^|[\n ])([\w]+?:\/\/[^ ,\"\n\r\t<]*)/ig,'$1<a href="$2" target="_blank">$2</a>');
  17. newtext=newtext.replace(/\[img\](.+?)\[\/img\]/ig,'<a href="$1" target="_blank" title="View Original Image"><img src="$1" alt=":get-topic(NARUTOCLAN.TK):" style="max-width:100%"/></a>'); document.getElementsByName("dpro")[i].innerHTML=newtext;
  18. }
  19. </script>
  20. <script language="javascript">
  21. var msg=document.getElementsByName("dpro");
  22. for(var i=0;i<msg.length;i++){
  23. var txt=document.getElementsByName("dpro")[i].innerHTML;
  24. txt=txt.replace(/\[youtube=(.+?)\]/ig,'<div name="video"><embed type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="100%" height="400px" src="$1&vq=large"/></div>');
  25. txt=txt.replace(/\[PHP\]/ig,'<pre class="quote1">PHP:<hr/><code name="codes" class="code">');
  26. txt=txt.replace(/\[\/PHP\]/ig, "</code></pre>");
  27. txt=txt.replace(/\[left\]/ig,'<div align="left">');
  28. txt=txt.replace(/\[\/left\]/ig, "</div>");
  29. txt=txt.replace(/\[center\]/ig,'<center>');
  30. txt=txt.replace(/\[\/center\]/ig, "</center>");
  31. txt=txt.replace(/\[right\]/ig,'<div align="right">');
  32. txt=txt.replace(/\[\/right\]/ig, "</div>");
  33. txt=txt.replace(/\[email\](.+?)\[\/email\]/ig, '<a href="mailto:$1">$1</a>');
  34. txt=txt.replace(/\[search=(.+?)\]/ig,'<a href="http://www.google.com/search?sitesearch=narutoclan.tk&q=$1">$1</a>');
  35. txt=txt.replace(/\[fsearch=(.+?)\]/ig,'<a href="site_18.xhtml?get-search=$1">$1</a>');
  36. txt=txt.replace(/\[size=(.+?)\]/ig,'<font size="$1">');
  37. txt=txt.replace(/\[\/size\]/ig, "</font>");
  38. txt=txt.replace(/\[input=(.+?)\]/ig,'<span name="codes"><input type="$1" size="20%" value="');
  39. txt=txt.replace(/\[\/input\]/ig,'"></input></span>');
  40. txt=txt.replace(/\[text\]/ig,'<textarea rows="5" name="codes">');
  41. txt=txt.replace(/\[youtube\](.+?)\[\/youtube\]/ig,'<embed type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="100%" height="400px" src="http://youtube.com/v/$1&vq=large"/>');
  42. txt=txt.replace(/\[\/text\]/ig, "</textarea>");
  43. txt=txt.replace(/\[form\]/ig,'<form method="get" action="site_0.xhtml">');
  44. txt=txt.replace(/\[\/form\]/ig, "</form>");
  45. txt=txt.replace(/\[option\]/ig, "<option>");
  46. txt=txt.replace(/\[\/option\]/ig, "</option>");
  47. txt=txt.replace(/\[select\]/ig, "<select>");
  48. txt=txt.replace(/\[\/select\]/ig, "</select>");
  49. txt=txt.replace(/\[indent\]/ig,'<div style="padding-left:10px">');
  50. txt=txt.replace(/\[you\]/ig, ':user:');
  51. txt=txt.replace(/\[\/indent\]/ig, "</div>");
  52. txt=txt.replace(/\[xt\]/ig,'<span style="display:scroll;position:relative;top:-10px">');
  53. txt=txt.replace(/\[xb\]/ig,'<span style="display:scroll;position:relative;bottom:-6px">');
  54. txt=txt.replace(/\[\/x\]/ig, "</span>");
  55. txt=txt.replace(/\[OL\]/ig,'<div id="mf_content" style="padding:0px 10px 0px"><ol>');
  56. txt=txt.replace(/\[\/OL\]/ig, "</ol></div>");
  57. txt=txt.replace(/\[LI\]/ig, "<li>");
  58. txt=txt.replace(/\[\/LI\]/ig, "</li>");
  59. txt=txt.replace(/\[xp\]/ig,'<div style="padding-top:8px;padding-bottom:8px"><hr style="border-top:1px solid #aaaaaa"/></div>');
  60. txt=txt.replace(/\[cb\]/ig, '<span class="cb">');
  61. txt=txt.replace(/\[\/cb\]/ig, '</span>');
  62. txt=txt.replace(/\[TD\]/ig, '<td class="box" style="padding:2px">');
  63. txt=txt.replace(/\[\/TD\]/ig, '</td>');
  64. txt=txt.replace(/\[table\]/ig, '<table width="100%">');
  65. txt=txt.replace(/\[\/table\]/ig, '</table>');
  66. txt=txt.replace(/\[TR\]/ig, '<tr>');
  67. txt=txt.replace(/\[\/TR\]/ig, '</tr>');
  68. txt=txt.replace(/\[B\]/ig, '<b>');
  69. txt=txt.replace(/\[\/B\]/ig, '</b>');
  70. txt=txt.replace(/\[U\]/ig, '<u>');
  71. txt=txt.replace(/\[\/U\]/ig, '</u>');
  72. txt=txt.replace(/\[I\]/ig, '<i>');
  73. txt=txt.replace(/\[\/I\]/ig, '</i>');
  74. txt=txt.replace(/\[TD=(.+?)\]/ig,'<td width="$1" class="box" style="padding:2px">');
  75. txt=txt.replace(/\[FONT=(.+?)\]/ig,'<span style="font-family:$1">');
  76. txt=txt.replace(/\[\/FONT\]/ig, '</span>');
  77. txt=txt.replace(/\[COLOR=(.+?)\]/g,'<font color="$1">');
  78. txt=txt.replace(/\[\/COLOR\]/g, '</font>');
  79. txt=txt.replace(/\[FLASH\](.+?)\[\/FLASH\]/ig, '<object width="100%" height="400"><param name="movie" value="$1" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed width="100%" height="400" src="$1" quality="high" wmode="transparent" type="application/x-shockwave-flash"></embed></object>');
  80. txt=txt.replace(/\[SPOI(.+?)\]/ig, '<style>.spoil$1 nav{display:none} .spoil$1:hover nav{display:block} .spoil$1:hover .linkxem{display:none}</style><div class="spoil$1"><span class="linkxem" style="color:red"><b>Content</b></span><nav>');
  81. txt=txt.replace(/\[\/SPOI\]/ig, '</nav></div>');
  82. txt=txt.replace(/5/ig,'::v');
  83. txt=txt.replace(/\<a href="\'(.+?)'\"(.+?)>/g,'<a href="$1" target="_blank">');
  84. txt=txt.replace(/\[LIST\]/ig, '<div style="padding-left:10px">');
  85. txt=txt.replace(/\[\/LIST\]/ig, '</div>');
  86. txt=txt.replace(/\[\*]/ig, '• ');
  87. txt=txt.replace(/\[URL='(.+?)'\]/g,'<a href="$1" target="_blank">');
  88. txt=txt.replace(/\[\/URL\]/ig, '</a>');
  89. txt=txt.replace(/\[ATTACH=full\](.+?)\[\/ATTACH\]/ig, '<a href="http://c.gocmobile.net/attachments/$1/" target="_blank" title="View Original Image"><img src="http://c.gocmobile.net/attachments/$1/" alt=":get-topic(NARUTOCLANS.TK):"/></a>');
  90. document.getElementsByName("dpro")[i].innerHTML=txt;
  91. }
  92. </script>
  93. <script language="javascript">
  94. var msg=document.getElementsByName('video');
  95. for(var i=0;i<msg.length;i++){
  96. var txt=document.getElementsByName('video')[i].innerHTML;
  97. txt=txt.replace(/watch/ig,'');
  98. txt=txt.replace(/v=/ig,'v/');
  99. txt=txt.replace('?','');
  100. document.getElementsByName('video')[i].innerHTML=txt;
  101. }
  102. </script>
  103. <script type="text/javascript"> function spoi(newItem){ var item=document.getElementById(newItem); if(item.style.display=='none'){item.style.display='block';} else {item.style.display='none';}} </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement