Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   spoiler tag to tbdv 2008 (http://www.bvlist.com/showthread.php?t=8702)

ndbj 29th December 2012 07:58

spoiler tag to tbdv 2008
 
Hi people
anyone with the spoiler tag mod for old tbdev source that could share with us?

thanks in advance.

rabtb 2nd January 2013 17:38

add to global.php

Code:

        //[spoiler]Text[/spoiler]
    $s = preg_replace("/\[spoiler\]\s*((\s|.)+?)\s*\[\/spoiler\]\s*/i",
    "Spoiler:
\\1
", $s);


ndbj 3rd January 2013 02:28

thanks for helping.
however, that code is showing spoilers like quotes.

do i need to put something in my default.css?
i would like that spoiler could work with those plus/minus.gifs to show/hide content.

rabtb 3rd January 2013 02:48

ahh sorry add this to css

Code:

.spoiler {

font-family: "arial";

font-size: 10px;

color: #000000;

background-color: #000000;

}

no show/hide ul need to add that urself

joeroberts 3rd January 2013 03:03

PHP Code:

$s preg_replace("/\[spoiler\]\s*((\s|.)+?)\s*\[\/spoiler\]\s*/i",
    
"<div class=\"shout\"><div class=\"shout\"><a href=\"#\" onclick=\"n = this.parentNode.parentNode.lastChild; if(n.style.display == 'none') { n.style.display = 'block'; } else {    n.style.display = 'none';    } return false;\">Spoiler (click to show/hide)</a></div><div class=\"spoiler\" style=\"display: none;\">\\1</div></div>"$s); 


ndbj 3rd January 2013 03:34

Many thanks to both.

@rabtb: joeroberts code is a clever way to show/hide spoiler content.
you should try it.

@joeroberts: I only changed but i would like also to add those small icons (minus/plus) before the spoiler link.
my knowledge at java sucks, can you help me on how to add those pics in that function?


Bump: this one here
http://www.bvlist.com/mods-themes/865-spoiler-tag.html
was almost installed with success in my old source.
the function at global.php - ok
the default.css - ok
creation and upload to server of jquery-1.1.1.pack.js - ok
upload of minus/plus.gifs - ok

the only thing i couldn't do was this code here
Quote:


when i put this at my inc/bittorrent.php it gives me error of header already sent...
any guess to solve this?

wMan 19th July 2013 22:41

Code:


$(document).ready( function()
{   
$('div.news-head')  .click(function()
{     
$(this).toggleClass('unfolded');     
$(this).next('div.news-body').slideToggle('fast');  }); }); 

better to read now


All times are GMT +2. The time now is 17:20.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.