vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   My first hack - Invisible Spoilers (https://vborg.vbsupport.ru/showthread.php?t=34819)

T?Pau 02-04-2002 10:00 PM

To make a really invisible Spoiler, just open admin/functions.php

find:

Code:

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

directly after that, insert the following:

Code:

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

$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:
Code:

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 [sp]Spoiler[/sp] in your posts.

smleg 02-05-2002 10:45 PM

I dont' understand what this does...

Demo perhaps?

Thanks

Steve

T?Pau 02-05-2002 11:29 PM

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
visible

T?Pau 02-06-2002 12:39 PM

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:
Code:

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
Code:

<font color=\"#13486D\">
and
<font color=\"#1C5780\">

use
Code:

{ firstaltcolor }
and
{ secondaltcolor } without the spaces.


XiXora 02-06-2002 01:30 PM

you can add theses in BB code neway i think

TWTCommish 02-06-2002 01:49 PM

I've got a [spoiler] tag on my board. No hack required, really.

T?Pau 02-06-2002 02:19 PM

: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 02-06-2002 02:23 PM

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 02-06-2002 02:29 PM

Saw it :)
But what about different styles? Does it always look the same, or is the color changed in different styles?

TWTCommish 02-06-2002 02:31 PM

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 02-20-2002 08:11 PM

You can also do this:

Add a new vb code-
In first box put:
Code:

spoiler
In the second box put:
Code:

<font color="#FFFF66"><b>Warning</font> <font color="FFFFFF"> Spoiler Ahead!</b> :</font><font class=spoiler>{param}</font>
in description put:
Code:

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:
PHP Code:

<meta http-equiv="MSThemeCompatible" content="Yes">
<
style type="text/css"

add this
PHP Code:

.spoiler    {colorblackbackgroundblack

directly after it, to make it look like this:
PHP Code:

<meta http-equiv="MSThemeCompatible" content="Yes">
<
style type="text/css">
.
spoiler    {colorblackbackgroundblack}
BODY 

I find that to be alot easyer :)

Shadowblazer 05-20-2002 11:05 PM

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 05-26-2002 03:15 AM

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 08-19-2002 03:11 PM

Quote:

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 08-19-2002 08:27 PM

best spoiler tag i ever saw was in that massive thread with loads of bbcodes in over at vbulletin.com :D

yzztik 08-19-2002 10:03 PM

YOu got the link by any chance? I searched there and I dont think I found it :S

Alien 08-29-2002 06:32 AM

Maybe these will help you out:

http://www.vbulletin.com/forum/showt...threadid=24595

http://www.vbulletin.com/forum/showt...threadid=16306

Xetox 10-25-2002 08:53 PM

The one I like best is TWTCommish but he don't seem to want to explain how he did it?

amykhar 02-04-2003 01:43 PM

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 04-30-2003 11:02 PM

I can safely conclude this works in 2.3

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

GaleForce 04-30-2003 11:47 PM

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 06-02-2003 05:39 PM

Quote:

02-20-02 at 06:11 PM DemiNeo0101 said this in Post #11
You can also do this:

Add a new vb code-
In first box put:
Code:

spoiler
In the second box put:
Code:

<font color="#FFFF66"><b>Warning</font> <font color="FFFFFF"> Spoiler Ahead!</b> :</font><font class=spoiler>{param}</font>
in description put:
Code:

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:
PHP Code:

<meta http-equiv="MSThemeCompatible" content="Yes">
<
style type="text/css"

add this
PHP Code:

.spoiler    {colorblackbackgroundblack

directly after it, to make it look like this:
PHP Code:

<meta http-equiv="MSThemeCompatible" content="Yes">
<
style type="text/css">
.
spoiler    {colorblackbackgroundblack}
BODY 

I find that to be alot easyer :)

How do I add a button for that?

ogden2k 06-03-2003 12:24 AM

:ermm: :eek:

S.Shady 06-07-2003 01:10 AM

*- Edit -*

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

RandyP3 10-16-2003 10:24 AM

What I used is this:



Add:

PHP Code:

.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]Spoiler text[/spoiler]
vB code explanation: [anything you want]
Use {options}?: No

bexie 11-04-2003 12:35 AM

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 03-04-2005 05:16 PM

Somehow this spoiler code doesn't work for me. I use 2.3.5 and I can't find this code:

Quote:

$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 03-04-2005 11:48 PM

Quote:

Originally Posted by Cle
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

https://vborg.vbsupport.ru/showthrea...ewpost&t=76405
---better spoiler tags, backward compatability patch for non-js users just added.


All times are GMT. The time now is 02:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01199 seconds
  • Memory Usage 1,817KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (13)bbcode_code_printable
  • (7)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete