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.


All times are GMT. The time now is 01:37 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.00987 seconds
  • Memory Usage 1,737KB
  • 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
  • (7)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete