Bon normal ça ...
Maintenant, en cliquant sur Annuler, eh bien j'ai le texte
CODE |
[spoiler][/spoiler] |
CODE |
[spoiler][/spoiler] |
CODE |
================================================================================ ========================= [Spoiler] Tags by primetime This adds the [spoiler] tags to your forum. It hides text from the user unless the user actively clicks on the "Click for Spoiler" text to view the hidden text. The javascript code is from http://www.dynamicdrive.com (Contractible Headers) and I just modified it for use on the forums. (I do not claim the javascript code to be mine) Usage: Any thing between [spoiler] [/spoiler] tags will be hidden Use this however you like, but I will not be held responsible for what you do with it. (i.e. Always back up files you modify!!!) Update: 05/22/02 - Tweaked the script a bit :) ================================================================================ ========================= 1) Login to the AdminCP and edit your templates. Go to: Skins & Templates ---> Manage Board Wrappers ---> Edit 2) Add the following to after the "<%JAVASCRIPT%>" tag: <script> <!-- /* Contractible Headers Script- © Dynamic Drive (www.dynamicdrive.com) For full source code, 100's more DHTML scripts, and TOS, Visit http://www.dynamicdrive.com */ var ns6=document.getElementById&&!document.all?1:0 var head="display:''" var folder='' function expandit(curobj){ folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style if (folder.display=="none") folder.display="" else folder.display="none" } //--> </script> 3) Save this board wrapper. (Note, it would be best if this wrapper is used by all your board templates. Because the if this javascript code isn't in the template, the user will not be able to see the hidden text when they try to click on the "Click for Spoiler" link.) 4) Get the "post_parser.php" from the "sources\lib" directory of your Invision Board installation. 5) Add the following lines after "$txt = preg_replace( "#\[s\](.+?)\[/s\]#is", "<s></s>", $txt );" (without quotes): // Start [spoiler] tags $txt = preg_replace( "#\[spoiler\](.+?)\[/spoiler\]#ies" , "\$this->spoiler_attr('')", $txt ); // End [spoiler] tags 6) Find the line, "$txt = preg_replace( "#</ul>#", "\[/LIST\]" , $txt );" (w/o quotes) and add this line after it: // Start [spoiler] tags unconvert $txt = preg_replace( "#\r<h4 style=\"cursor:hand\" onClick=\"expandit\(this\)\">Click for Spoiler:</h4>\r<span style=\"display:none\" style=&\{head\};>(.+?)</span>\r#" , "\[spoiler\]\[/spoiler\]", $txt); // End [spoiler] tags unconvert 7) Add these lines before the last "}" at the end of the file: /**************************************************/ // spoiler_attr: // [spoiler] tags // By: primetime /**************************************************/ function spoiler_attr($IN) { $spoiler = "\r<h4 style=\"cursor:hand\" onClick=\"expandit(this)\">Click for Spoiler:</h4>\r"; $spoiler .= "<span style=\"display:none\" style=&{head};>$IN</span>\r\n"; return "$spoiler"; } 7) Save and upload "post_parser.php" back to the "sources\lib" directory of your Invision Board installation. 8) Enjoy :D |
CODE |
function ibSpoil() { var write = ''; var text = getText(); if (text && isUrl(text)) { url = text; text = ''; } write = prompt('Entrez le spoiler :',write) || ''; var code = ((text) ? text + ' ' : '') + '[spoiler]' + write + '[/spoiler]'; insertCode(code); } |
Spoiler (Sélectionner pour lire) : |
Bon, c'est mieux là hein ? |
Spoiler (Sélectionner pour lire) : |
C'est clair, c'est mieux !!!! :-) |
CODE |
<\!-- spoilerKillit --> |