IPB

Bienvenue invité ( Connexion | Inscription )

[ En ligne ] · Standard · Linéaire+

> Ch'ti Bug ..., avec les invites javascript

Guepi
post 13/10/2002 15:55
Message #1


Troll
*****

Groupe : Membres
Messages : 4,831
Inscrit le : 23/06/2002 23:00
Lieu : Ronchin, Nord, France
Membre no. 75



Lors d'un clic sur le bouton spoiler user posted image, l'invite de Spoiler apparaît.

Bon normal ça ...

Maintenant, en cliquant sur Annuler, eh bien j'ai le texte
CODE
[spoiler][/spoiler]
qui apparaît en haut de la fenêtre ! blink.gif


--------------------
Le racisme est un crime, pas une opinion !
Extrait d'un tag sur un mur...
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topicStart Poll
Réponse(s)
Guepi
post 13/10/2002 16:11
Message #2


Troll
*****

Groupe : Membres
Messages : 4,831
Inscrit le : 23/06/2002 23:00
Lieu : Ronchin, Nord, France
Membre no. 75



Eh bien justement c'est en cherchant ce truc ( les spoilers ), que je suis tombé dessus !

Maintenant, j'ai trouvé ça :
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


--------------------
Le racisme est un crime, pas une opinion !
Extrait d'un tag sur un mur...
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic
Guepi   Ch'ti Bug ...   13/10/2002 15:55
Peter Pan   Tu sais le fonctionnement de ce bouton Spoiler est...   13/10/2002 16:00
Guepi   Eh bien justement c'est en cherchant ce truc (...   13/10/2002 16:11
Peter Pan   Je vais regarder ça. En tout et pour tout, voilÃ...   13/10/2002 16:17
Peter Pan  

C...   13/10/2002 16:23
Peter Pan     13/10/2002 16:36
Guepi  
  13/10/2002 17:41
Peter Pan   Malheureusement ça on n'y peut rien, ce sont ...   13/10/2002 18:23
Guepi   bon pô grave !   13/10/2002 19:39
Laskov   on va pas se casser le cul du moment qu'il n...   13/10/2002 20:13


Reply to this topicTopic OptionsStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :
 

Version bas débit Nous sommes le : : 07/07/2025 5:37