PDA

View Full Version : My first hack - Invisible Spoilers


TīPau
05 Feb 2002, 22:24
To make a really invisible Spoiler, just open admin/functions.php

find:


global $regexcreated,$searcharray,$replacearray,$phpversionnum



directly after that, insert the following:


,$counter
and be carefull, that you leave the ; at the end.
Then find:

$bbcode = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>", $bbcode);

$bbcode=str_replace("\\'", "'", $bbcode);


directly after that, insert the following:

if($counter%2==0) {

$bbcode = preg_replace("/(\[)(sp)(])(\r\n)*([^\"]*)(\[\/sp\])/siU", "<normalfont>Spoiler:<br></normalfont><br><font color=\"#13486D\">\\5</font>", $bbcode);
}
else {
$bbcode = preg_replace("/(\[)(sp)(])(\r\n)*([^\"]*)(\[\/sp\])/siU", "<normalfont>Spoiler:<br></normalfont><br><font color=\"#1C5780\">\\5</font>", $bbcode);
}
$bbcode=str_replace("\\'", "'", $bbcode);


You are done. :) Save and upload the file.
Add the Spoiler with Spoiler in your posts.

smleg
06 Feb 2002, 00:45
I dont' understand what this does...

Demo perhaps?

Thanks

Steve

TīPau
06 Feb 2002, 01:29
You can write invisible text with this, to make Spoilers that you can only see, if you mark the text.
It just writes the text in the same color than the background color.
have a look at the images:
invisible (http://trekladies.de/bilder/invisible.gif)
visible (http://trekladies.de/bilder/visible.gif)

TīPau
06 Feb 2002, 14:39
First Bugfix just after one day ;)
Found out, that if you try to place other vbcode within the spoiler, it doesn`t work anymore. :(
This is how to fix it:

if($counter%2==0) {

$bbcode = preg_replace("/(\[)(sp)(])(\r\n)*(.*)(\[\/sp\])/siU", "<normalfont>Spoiler:</normalfont><br><font color=\"#13486D\">\\5</font>", $bbcode);
}
else {
$bbcode = preg_replace("/(\[)(sp)(])(\r\n)*(.*)(\[\/sp\])/siU", "<normalfont>Spoiler:</normalfont><br><font color=\"#1C5780\">\\5</font>", $bbcode);
}
Now you can use other codes and smilies within the Spoiler, but they will be displayed normaly. The spoiler text stays invisible.

Instead of the colors
<font color=\"#13486D\">
and
<font color=\"#1C5780\">
use
{ firstaltcolor }
and
{ secondaltcolor } without the spaces.

XiXora
06 Feb 2002, 15:30
you can add theses in BB code neway i think

TWTCommish
06 Feb 2002, 15:49
I've got a [spoiler] tag on my board. No hack required, really.

TīPau
06 Feb 2002, 16:19
:confused:
How did you give the spoiler text the same color, as the background color in all styles?
I have styles with black, gray and orange background colors and if I make the spoiler text black it is easy to read in the other styles with the gray and orange background color.
Mine works for all styles and gets the colors right, so that it is really invisible in all the styles.

TWTCommish
06 Feb 2002, 16:23
It's simple: you stick it in a box with it's own BG color. Watch (first post):

http://www.movieforums.net/showthread.php?threadid=1731

I've tried to implement a JS to highlight it automatically, but keep on running into problems.

TīPau
06 Feb 2002, 16:29
Saw it :)
But what about different styles? Does it always look the same, or is the color changed in different styles?

TWTCommish
06 Feb 2002, 16:31
Nope, looks the same. I don't use different styles anyway...but even if I did, the gray-on-gray would still work alright.

DemiNeo0101
20 Feb 2002, 22:11
You can also do this:

Add a new vb code-
In first box put: spoiler
In the second box put:
<font color="#FFFF66"><b>Warning</font> <font color="FFFFFF"> Spoiler Ahead!</b> :</font><font class=spoiler>{param}</font>
in description put:
The [spoiler] tag allows you to place text in your message that is unreadable, unless someone highlites it. This makes viewing the text a deliberate effort. This is for posting messages about movies or other things where you might not wish to give away plot points to those that haven't seen it yet.

Turn {Options} off, press ok.

Now open style, go to modify, fonts/colors/properties

and in the header instert, there should be a code like this:
<meta http-equiv="MSThemeCompatible" content="Yes">
<style type="text/css">

add this
.spoiler {color: black; background: black} directly after it, to make it look like this:
<meta http-equiv="MSThemeCompatible" content="Yes">
<style type="text/css">
.spoiler {color: black; background: black}
BODY {

I find that to be alot easyer :)

Shadowblazer
21 May 2002, 01:05
Heh, I see that you and I think alike T'Pau. I want my spoiler tag to use the colors of the style that the user is using, not a standard black on black (or whatever color). Thanks for the hack :)

JeffH
26 May 2002, 05:15
Can someone help me here? The instructions for doing T'Pau hack is way to vague and confusing to me. I'm new to any VB code, etc. and can't find any of the templates, code or what he is referring to.

Does anyone have a better Spoiler hack like a "Spoiler" VB code button such as the "Quote" button? How do you do this, there are no good details for it?

Thanks for any help, please list steps if replying on how it's done.

Regards,

Jeff

yzztik
19 Aug 2002, 17:11
Originally posted by Shadowblazer
Heh, I see that you and I think alike T'Pau. I want my spoiler tag to use the colors of the style that the user is using, not a standard black on black (or whatever color). Thanks for the hack :)

Whats the pararmeter I would enter in the css to use the default background for that post?

Dean C
19 Aug 2002, 22:27
best spoiler tag i ever saw was in that massive thread with loads of bbcodes in over at vbulletin.com :D

yzztik
20 Aug 2002, 00:03
YOu got the link by any chance? I searched there and I dont think I found it :S

Alien
29 Aug 2002, 08:32
Maybe these will help you out:

http://www.vbulletin.com/forum/showthread.php?threadid=24595

http://www.vbulletin.com/forum/showthread.php?threadid=16306

Xetox
25 Oct 2002, 22:53
The one I like best is TWTCommish but he don't seem to want to explain how he did it?

amykhar
04 Feb 2003, 15:43
The best spoiler hack was written by tubedog. It doesn't just create the same color text, it hides the message unless the user clicks on it.

Koutaru
01 May 2003, 01:02
I can safely conclude this works in 2.3

VERY nice :) This was exactly what I was looking for

GaleForce
01 May 2003, 01:47
You might like the [spoiler] tag better, but up to you. Not trying to sway you from this guys hard work, but I personally find the tag more usefull :)

ogden2k
02 Jun 2003, 19:39
02-20-02 at 06:11 PM DemiNeo0101 said this in Post #11 (http://www.vbulletin.org/forum/showthread.php?postid=221932#post221932)
You can also do this:

Add a new vb code-
In first box put: spoiler
In the second box put:
<font color="#FFFF66"><b>Warning</font> <font color="FFFFFF"> Spoiler Ahead!</b> :</font><font class=spoiler>{param}</font>
in description put:
The [spoiler] tag allows you to place text in your message that is unreadable, unless someone highlites it. This makes viewing the text a deliberate effort. This is for posting messages about movies or other things where you might not wish to give away plot points to those that haven't seen it yet.

Turn {Options} off, press ok.

Now open style, go to modify, fonts/colors/properties

and in the header instert, there should be a code like this:
<meta http-equiv="MSThemeCompatible" content="Yes">
<style type="text/css">

add this
.spoiler {color: black; background: black} directly after it, to make it look like this:
<meta http-equiv="MSThemeCompatible" content="Yes">
<style type="text/css">
.spoiler {color: black; background: black}
BODY {

I find that to be alot easyer :)

How do I add a button for that?

ogden2k
03 Jun 2003, 02:24
:ermm: :eek:

S.Shady
07 Jun 2003, 03:10
*- Edit -*

Very nice hack. I just may use it. but atm i don't meed it.

RandyP3
16 Oct 2003, 12:24
What I used is this:



Add:


.spoiler {color: {firstaltcolor}; background: {firstaltcolor}};

to Head Insert, just right before </style>

for instructions on how to add the vbcode, click on the attachment.

however, one down side of this is that your alternating tables must be of the same colour, if not, the tags on one table will look imbedded onto the forum, but on the other colour it'll show up oddly.

[for easy copying and pasting]

vB code tag: spoiler
vB code replacement: <b>Spoiler:</b> <font class=spoiler>{param}</font>
vB code example: Spoiler text
vB code explanation: [anything you want]
Use {options}?: No

bexie
04 Nov 2003, 02:35
Question!

If I have alternating table background colors, how can I use the simple hack that DemiNeo posted? Or will I need to use the original way that was posted?

Great hack! Extremely useful!
My board is a Harry Potter board, and with not everyone being uptodate on their reading, it's frustrating to hear, "YOU SPOILED IT FOR ME!" which is why this hack makes me happy. :) Thanks!

Cle
04 Mar 2005, 19:16
Somehow this spoiler code doesn't work for me. I use 2.3.5 and I can't find this code:

$bbcode = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>", $bbcode);

And I cannot blend it with the blackground color. I already tried {firstaltcolor} and {secondaltcolor}, but they appear as different colors

pimpery
05 Mar 2005, 01:48
Somehow this spoiler code doesn't work for me. I use 2.3.5 and I can't find this code:



And I cannot blend it with the blackground color. I already tried {firstaltcolor} and {secondaltcolor}, but they appear as different colors
http://www.vbulletin.org/forum/showthread.php?goto=newpost&t=76405
---better spoiler tags, backward compatability patch for non-js users just added.