Guest User

Untitled

a guest
Jan 17th, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.84 KB | None | 0 0
  1. ## all applicable files before proceeding.
  2. ##
  3. ##
  4.  
  5. #
  6. #---------[ 1. OPEN ]-----------------------------------------------------------
  7. #
  8.  
  9. /include/search_idx.php
  10.  
  11. #
  12. #---------[ 2. FIND ]-----------------------------------------------------------
  13. #
  14.  
  15. // Remove BBCode
  16. $text = preg_replace('%\[/?(b|u|s|ins|del|em|i|h|colou?r|quote|code|img|url|email|list|topic|post|forum|user)(?:\=[^\]]*)?\]%', ' ', $text);
  17.  
  18. #
  19. #---------[ 3. REPLACE WITH ]---------------------------------------------------
  20. #
  21.  
  22. // Remove BBCode // MODIFIED ||SPOILER
  23. $text = preg_replace('%\[/?(spoiler|b|u|s|ins|del|em|i|h|colou?r|quote|code|img|url|email|list|topic|post|forum|user)(?:\=[^\]]*)?\]%', ' ', $text);
  24.  
  25. #
  26. #---------[ 4. SAVE ]-----------------------------------------------------------
  27. #
  28.  
  29. /include/search_idx.php[/code]
  30.  
  31. #
  32. #---------[ 5. OPEN ]-----------------------------------------------------------
  33. #
  34.  
  35. /include/parser.php
  36.  
  37. #
  38. #---------[ 6. FIND ]----------------------------------------------------------
  39. #
  40.  
  41. if (preg_match('%\[/?(?:quote|code|list|h)\b[^\]]*\]%i', $text))
  42. $errors[] = $lang_profile['Signature quote/code/list/h'];
  43.  
  44. #
  45. #---------[ 7. REPLACE WITH ]--------------------------------------------------
  46. #
  47.  
  48. // MODIFIED ||SPOILER
  49. if (preg_match('%\[/?(?:spoiler|quote|code|list|h)\b[^\]]*\]%i', $text))
  50. $errors[] = $lang_profile['Signature quote/code/list/h'];
  51.  
  52. #
  53. #---------[ 8. FIND ]----------------------------------------------------------
  54. #
  55.  
  56. // Remove empty tags
  57. while (!is_null($new_text = preg_replace('%\[(b|u|s|ins|del|em|i|h|colou?r|quote|img|url|email|list|topic|post|forum|user)(?:\=[^\]]*)?\]\s*\[/\1\]%', '', $text)))
  58.  
  59. #
  60. #---------[ 9. REPLACE WITH ]--------------------------------------------------
  61. #
  62.  
  63. // Remove empty tags // MODIFIED ||SPOILER
  64. while (!is_null($new_text = preg_replace('%\[(spoiler|b|u|s|ins|del|em|i|h|colou?r|quote|img|url|email|list|topic|post|forum|user)(?:\=[^\]]*)?\]\s*\[/\1\]%', '', $text)))
  65.  
  66. #
  67. #---------[ 10. FIND ]----------------------------------------------------------
  68. #
  69.  
  70. // List of all the tags
  71. $tags = array('quote', 'code', 'b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'img', 'list', '*', 'h', 'topic', 'post', 'forum', 'user');
  72.  
  73. #
  74. #---------[ 11. REPLACE WITH ]--------------------------------------------------
  75. #
  76.  
  77. // List of all the tags // MODIFIED ||SPOILER
  78. $tags = array('spoiler', 'quote', 'code', 'b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'img', 'list', '*', 'h', 'topic', 'post', 'forum', 'user');
  79.  
  80. #
  81. #---------[ 12. FIND ]----------------------------------------------------------
  82. #
  83.  
  84. // Tags we can nest and the depth they can be nested to
  85. $tags_nested = array('quote' => $pun_config['o_quote_depth'], 'list' => 5, '*' => 5);
  86.  
  87. #
  88. #---------[ 13. REPLACE WITH ]--------------------------------------------------
  89. #
  90.  
  91. // Tags we can nest and the depth they can be nested to // MODIFIED ||SPOILER
  92. $tags_nested = array('quote' => $pun_config['o_quote_depth'], 'list' => 5, '*' => 5, 'spoiler' => 5);
  93.  
  94. #
  95. #---------[ 14. FIND ]----------------------------------------------------------
  96. #
  97.  
  98. // Block tags, block tags can only go within another block tag, they cannot be in a normal tag
  99. $tags_block = array('quote', 'code', 'list', 'h', '*');
  100.  
  101. #
  102. #---------[ 15. REPLACE WITH ]--------------------------------------------------
  103. #
  104.  
  105. // Block tags, block tags can only go within another block tag, they cannot be in a normal tag // MODIFIED ||SPOILER
  106. $tags_block = array('quote', 'code', 'list', 'h', '*', 'spoiler');
  107.  
  108. #
  109. #---------[ 16. FIND ]----------------------------------------------------------
  110. #
  111.  
  112. $pattern[] = '%\[h\](.*?)\[/h\]%ms';
  113.  
  114.  
  115. #
  116. #---------[ 17. AFTER, ADD ]----------------------------------------------------------
  117. #
  118.  
  119. $pattern[] = '%\[spoiler\](.*?)\[/spoiler\]%ms'; // SPOILER
  120.  
  121. #
  122. #---------[ 18. FIND ]-------------------------------------------------------------
  123. #
  124.  
  125. $replace[] = '</p><h5>$1</h5><p>';
  126.  
  127. #
  128. #---------[ 19. AFTER, ADD ]----------------------------------------------------------
  129. #
  130.  
  131. $replace[] = '<div class="spoiler"><p class="teaser">Spoiler</p><div class="contenu">$1</div></div>'; // SPOILER
  132.  
  133. #
  134. #---------[ 20. SAVE ]----------------------------------------------------------
  135. #
  136.  
  137. /include/parser.php[/code]
  138.  
  139. #
  140. #---------[ 21. OPEN ]----------------------------------------------------
  141. #
  142.  
  143. /style/yourstyle.css
  144.  
  145. #
  146. #---------[ 22. ADD ]-----------------------------------------------------------
  147. #
  148. .spoiler {
  149. margin: 0 0 5px 0;
  150. padding: 0;
  151. width: 50%;
  152. }
  153.  
  154. .teaser {
  155. margin: 1px;
  156. padding: 3px 10px;
  157. cursor: pointer;
  158. position: relative;
  159. color: #ffffff;
  160. background-color: #ff0000;
  161. }
  162.  
  163. .contenu {
  164. padding: 5px 10px;
  165. background-color: #fafafa;
  166. }
  167.  
  168. #
  169. #---------[ 23. SAVE ]----------------------------------------------------------
  170. #
  171.  
  172. /style/yourstyle.css
  173.  
  174. #
  175. #---------[ 24. OPEN ]----------------------------------------------------
  176. #
  177.  
  178. /include/template/main.tpl
  179.  
  180. #
  181. #---------[ 25. FIND ]-----------------------------------------------------------
  182. #
  183.  
  184. <head>
  185.  
  186. #
  187. #---------[ 26. AFTER, ADD ]-----------------------------------------------------------
  188. #
  189.  
  190. <!-- ADD JQUERY -->
  191. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  192. <!-- END ADD -->
  193.  
  194. #
  195. #---------[ 27. ADD (AT THE END) ]-----------------------------------------------------------
  196. #
  197.  
  198. <script> // ADD || SPOILER
  199. $(document).ready(function() {
  200. jQuery(".contenu").hide();
  201. jQuery(".teaser").click(function()
  202. {
  203. jQuery(this).next(".contenu").slideToggle(500);
  204. });
  205. });
  206. </script>
  207.  
  208. #
  209. #---------[ 28. SAVE ]----------------------------------------------------------
  210. #
  211.  
  212. /include/template/main.tpl
  213.  
  214. #
  215. #---------[ END ]----------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment