[MOD] BBCode Spoiler


Subject: [MOD] BBCode Spoiler
Post by Xusqui
Code: [Download] [Hide]
  1. #  
  2. #-----[ OPEN ]-------------------------------------------------------  
  3. #  
  4. includes/bbcode.php  
  5.  
  6. #  
  7. #-----[ FIND ]-------------------------------------------------------  
  8. #  
  9. 'quick' => array(  
  10. 'nested' => true,  
  11. 'inurl' => true,  
  12. 'allow_empty' => false,  
  13. ),  
  14.  
  15. #  
  16. #-----[ AFTER ADD ]-------------------------------------------------------  
  17. #  
  18. 'spoiler' => array(  
  19. 'nested' => false,  
  20. 'inurl' => false,  
  21. 'allow_empty' => false,  
  22. ),  
  23. #  
  24. #-----[ FIND ]-------------------------------------------------------  
  25. #  
  26. // FLASH, VIDEO, REAL, QUICK, STREAM  
  27. if($tag === 'flash' || $tag === 'video' || $tag === 'ram' || $tag === 'quick' || $tag === 'stream')  
  28. {  
  29. if($this->is_sig)  
  30. {  
  31. return $error;  
  32. }  
  33. if(isset($item['params']['param']))  
  34. {  
  35. $content = $item['params']['param'];  
  36. }  
  37.  
  38. if(isset($item['params']['width']))  
  39. {  
  40. $width = $item['params']['width'];  
  41. if ((intval($width) > 10) && (intval($width) < 641))  
  42. {  
  43. $width = $width;  
  44. }  
  45. else  
  46. {  
  47. $width = '320';  
  48. }  
  49. }  
  50. else  
  51. {  
  52. $width = '320';  
  53. }  
  54.  
  55. if(isset($item['params']['height']))  
  56. {  
  57. $height = $item['params']['height'];  
  58. if ((intval($height) > 10) && (intval($height) < 481))  
  59. {  
  60. $height = $height;  
  61. }  
  62. else  
  63. {  
  64. $height = '240';  
  65. }  
  66. }  
  67. else  
  68. {  
  69. $height = '240';  
  70. }  
  71.  
  72. if ($tag === 'flash')  
  73. {  
  74. $html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' . $width . '" height="' . $height . '"><param name=movie value="' . $content . '"><param name=quality value=high><param name=scale value=noborder><param name=wmode value=transparent><param name=bgcolor value=#000000><embed src="' . $content . '" quality=high scale=noborder wmode=transparent bgcolor=#000000 width="' . $width . '" height="' . $height . '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object>';  
  75. }  
  76. elseif ($tag === 'video')  
  77. {  
  78. $html = '<div align="center"><embed src="' . $content . '" width="' . $width . '" height="' . $height . '"></embed></div>';  
  79. }  
  80. elseif ($tag === 'ram')  
  81. {  
  82. $html = '<div align="center"><embed src="' . $content . '" align="center" width="275" height="40" type="audio/x-pn-realaudio-plugin" console="cons" controls="ControlPanel" autostart="false"></embed></div>';  
  83. }  
  84. elseif ($tag === 'quick')  
  85. {  
  86. $html = '<object classid=clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" width="480" height="224" align="middle"><param name="controller" value="TRUE"><param name="type" value="video/quicktime"><param name="autoplay" value="true"><param name="target" value="myself"><param name="src" value="' . $content . '"><param name="pluginspage" value="http://www.apple.com/quicktime/download/indext.html"><param name="kioskmode" value="true"><embed src="' . $content . '" width="480" height="224" align="middle" kioskmode="true" controller="TRUE" target="myself" type="video/quicktime" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html"></embed></object>';  
  87. }  
  88. elseif ($tag === 'stream')  
  89. {  
  90. $html = '<object id="wmp" width="' . $width . '" height="' . $height . '" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"><param name="FileName" value="' . $content . '"><param name="ShowControls" value="1"><param name="ShowDisplay" value="0"><param name="ShowStatusBar" value="1"><param name="AutoSize" value="1"><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" src="' . $content . '" name=MediaPlayer2 showcontrols=1 showdisplay=0 showstatusbar=1 autosize=1 visible=1 animationatstart=0 transparentatstart=1 loop=0 height="70" width="300"></embed></object>';  
  91. }  
  92. return array(  
  93. 'valid' => true,  
  94. 'html' => $html  
  95. );  
  96. }  
  97. #  
  98. #-----[ AFTER ADD ]-------------------------------------------------------  
  99. #  
  100. // Spoiler  
  101. if($tag === 'spoiler')  
  102. {  
  103. if($this->is_sig)  
  104. {  
  105. return $error;  
  106. }  
  107. if($item['iteration'] > 1)  
  108. {  
  109. return $error;  
  110. }  
  111. $spoiler_id = substr(md5($content . mt_rand()), 0, 8);  
  112. $str = '<div class="spoiler">';  
  113. $str .= '<div class="spoiler-header" id="spoilerhdr_' . $spoiler_id . '" style="position: relative;">Spoiler: [ <a href="javascript:void(0)" onclick="ShowHide('spoiler_' . $spoiler_id . '', 'spoiler2_' . $spoiler_id . '', ''); ShowHide('spoilerhdr_' . $spoiler_id . '', 'spoilerhdr2_' . $spoiler_id . '', '')">Show</a> ]</div>';  
  114. $str .= '<div class="spoiler-header" id="spoilerhdr2_' . $spoiler_id . '" style="position: relative; display: none;">Spoiler: [ <a href="javascript:void(0)" onclick="ShowHide('spoiler_' . $spoiler_id . '', 'spoiler2_' . $spoiler_id . '', ''); ShowHide('spoilerhdr_' . $spoiler_id . '', 'spoilerhdr2_' . $spoiler_id . '', '')">Hide</a> ]</div>';  
  115. $str .= '<div class="spoiler-content" id="spoiler2_' . $spoiler_id . '" style="position: relative; display: none;">' . $html;  
  116. return array(  
  117. 'valid' => true,  
  118. 'start' => $str,  
  119. 'end' => '</div></div>'  
  120. );  
  121. }  
  122. #  
  123. #-----[ FIND ]-------------------------------------------------------  
  124. #  
  125. "[spoil]", "[/spoil]",  
  126.  
  127. #  
  128. #-----[ REPLACE WITH ]-------------------------------------------------------  
  129. #  
  130. "[spoiler]", "[/spoiler]",  
  131.  

Only BBCode Spoiler (not button)

Greets

Last edited by ThE KuKa on Tue 15 Aug, 2006 12:44; edited 1 time in total
Subject: Respuesta: [MOD] BBCode Spoiler (new button)
Post by Mitch

  • Copy this images in: imagesbbcb_mgimages
    spoilmi8 spoiler.gif - spoil1hc4 spoiler1.gif

  • OPEN templatesca_aphroditebbcb_mg.tpl

    FIND:
    Code: [Download] [Hide]
    1. <a href="javascript:BBCcode()" accesskey="c"><img border="0" src="{BBCB_MG_IMG_PATH}code.gif" name="code" type="image" onMouseOver="helpline('code')" alt="{L_BBCB_MG_CODE}" title="{L_BBCB_MG_CODE}" /></a> 


    BEFORE ADD:
    Code: [Download] [Hide]
    1. <a href="javascript:BBCspoilerbbes()" ><img border="0" src="{BBCB_MG_IMG_PATH}spoiler.gif" name="spoiler" type="image" onMouseOver="helpline('spoiler')" alt="Spoiler" title="Spoiler" /></a> 


  • OPEN languagelang_spanishbbcb_mg.js
    FIND:
    Code: [Download] [Hide]
    1. s_smiley_creator = 'Creador de Emoticono: [smiley=1]Texto[/smiley] insertar un Emoticono con texto'; 


    AFTER ADD:
    Code: [Download] [Hide]
    1. s_spoiler_help = 'Ocultar un Mensaje largo dentro del post: [spoiler]Mensaje[/spoiler]'; 


    FIND:
    Code: [Download] [Hide]
    1. var Code = 0; 


    AFTER ADD:
    Code: [Download] [Hide]
    1. var Spoilerbbes = 0; 

    FIND:
    Code: [Download] [Hide]
    1. '[code]','[/code]', 


    BEFORE ADD:
    Code: [Download] [Hide]
    1. '[spoiler]','[/spoiler]', 


    FIND:
    Code: [Download] [Hide]
    1. function BBCcode() 


    BEFORE ADD:
    Code: [Download] [Hide]
    1. function BBCspoilerbbes()  
    2. {  
    3. var txtarea = document.post.message;  
    4.  
    5. if ((clientVer >= 4) && is_ie && is_win)  
    6. {  
    7. theSelection = document.selection.createRange().text;  
    8. if (theSelection != '')  
    9. {  
    10. document.selection.createRange().text = "[spoiler]" + theSelection + "[/spoiler]";  
    11. document.post.message.focus();  
    12. return;  
    13. }  
    14. }  
    15. else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))  
    16. {  
    17. //mozWrap(txtarea, "[spoiler]", "[/spoiler]");  
    18. mozInsert(txtarea, "[spoiler]", "[/spoiler]");  
    19. return;  
    20. }  
    21. if (Spoilerbbes == 0)  
    22. {  
    23. ToAdd = "[spoiler]";  
    24. document.post.spoiler.src = bbcb_mg_img_path + "spoiler1.gif";  
    25. Spoilerbbes = 1;  
    26. }  
    27. else  
    28. {  
    29. ToAdd = "[/spoiler]";  
    30. document.post.spoiler.src = bbcb_mg_img_path + "spoiler.gif";  
    31. Spoilerbbes = 0;  
    32. }  
    33. PostWrite(ToAdd);  


BBCode Spoiler (new button)

Greets

Last edited by ThE KuKa on Tue 15 Aug, 2006 12:43; edited 2 times in total
Subject: Re: [MOD] BBCode Spoiler
Great work my friend! :wink:

Subject: Re: [MOD] BBCode Spoiler
Do u hae demo?

Subject: Re: [MOD] BBCode Spoiler
Mighty Gorgon wrote: [View Post]
Great work my friend! :wink:


Hello there. ;)
I was starting to write a new post to suggest, as I did some months ago with Bicet, the implementation of "Hide MOD" but I see you were faster than me. ;)

Does it work for all the styles?
Is it going to be part of next XS2 release?


Does it allow, as in my forum, to personalize the 'hide' message, as with the sintax

Hidden Message:
Sorry, but you must be registered and also post a reply to view this message.
?


Thanks and goodbye to everybody! ;)

Profile PM  
Subject: Respuesta: [MOD] BBCode Spoiler
okada1314 wrote: [View Post]
Do u hae demo?

Yes, this link (in Spanish):
http://www.phpbb-es.com/foro/respue...8314.html#28314

Greets. 8)

Subject: Re: [MOD] BBCode Spoiler
magma wrote: [View Post]
Hello there. ;)
I was starting to write a new post to suggest, as I did some months ago with Bicet, the implementation of "Hide MOD" but I see you were faster than me. ;)

Does it work for all the styles?
Is it going to be part of next XS2 release?

magma, I think it's quite a bit you are not entering phpBB XS site... :wink:

This mod has been added in 048 or even previous release... so it's already present in XS.

And by the way... the spoiler have been added too in the dev release... but without button... :wink:

Subject: Re: [MOD] BBCode Spoiler
Mighty Gorgon wrote: [View Post]
magma wrote: [View Post]
Hello there. ;)
I was starting to write a new post to suggest, as I did some months ago with Bicet, the implementation of "Hide MOD" but I see you were faster than me. ;)

Does it work for all the styles?
Is it going to be part of next XS2 release?

magma, I think it's quite a bit you are not entering phpBB XS site... :wink:

This mod has been added in 048 or even previous release... so it's already present in XS.

And by the way... the spoiler have been added too in the dev release... but without button... :wink:


Yes, but it doesn't display a link and a invisible DIV in place of the text to be hidden...

Example:

Hidden Message:
Sorry, but you must be registered and also post a reply to view this message.


but I see the secret... in this way the mod is unuseful! :?:

Profile PM  
Subject: Re: [MOD] BBCode Spoiler
I think that SPOILER and HIDE should be kept separated and could be combined to obtain the desired result. :wink:

Make some tests with both of them and let me know.


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.0653s (PHP: 31% SQL: 69%)
SQL queries: 10 - Debug Off - GZIP Enabled