The BoardMod Project
 The Project | News | Downloads | Mods | FAQ | Templates | Chat | Forum
BoardMod Support Forum
[ Home | Help | Search | Login | Register ]  

19.05.13 at 18:53:19, Welcome, Guest. Please Login or Register

Choose Language:
Pages: 1 
Spoiler Tag V1.5 for YaBB 2.4 (Read 10941 times)
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



15.04.09 at 04:10:11  
Spoiler Tag V1.5


Description:
This Mod will allow users to hide parts of their message. Usually used on film and games threads for not giving away the storyline.

Screenshots:
...

...

...

Zip Package:
SpoilerTag_V1_5.mod
SpoilerTag_German_DU_Patch.mod
yabbfiles/ModImages/SpoilerTag/spoiler.gif
yabbfiles/ModImages/SpoilerTag/spoiler1.gif

Files to edit:
Admin/ModList.pl
Languages/English/InstantMessage.lng
Languages/English/Main.lng
Languages/English/Post.lng
Sources/InstantMessage.pl
Sources/MyCenter.pl
Sources/Post.pl
Sources/Printpage.pl
Sources/YaBBC.pl

ubbc.js
yabbc.js

default.css
yabb21.css

Installation:

Before installing, copy 'ubbc.js' and 'yabbc.js' from your yabbfiles directory, and 'default.css' and 'yabb21.css' from yabbfiles/Templates/Forum, into your cgi-bin/yabbdirectory/ - Be sure to re-upload them back to their correct directory after.

Modify YaBB files using BoardMod or manually.
Load modified files to your server.  

Mod History:
1.0 - Original version - 30th July 2008
1.1 - Added to Instant Messages - 31st July 2008
1.2 - Added to Live Preview, Print Page and also added description function - 12th August 2008
1.3 - Updated for YaBB 2.3 - 14th October 2008
1.4 - Updated for YaBB 2.3.1 Forum Software - 5th January 2009
1.5 - Updated for YaBB 2.4 - 15th April 2009
« Last Edit: 15.04.09 at 04:30:06 by Derek Barnstorm »  
IP Logged
 

SpoilerTag_V1_5.zip (7 KB | 263 )
MeisterGigi
Hacker Wannabe
**
Offline

Germany/Austria, Nieder-Österreich, Austria
Posts: 74



Reply #1 - 21.07.09 at 22:39:01  
Working fine, thanks very much!
 
IP Logged
 
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #2 - 22.07.09 at 00:02:12  
You're very welcome MeisterGigi!
 
IP Logged
 
Fairchild
Bloody Novice
*
Offline

Posts: 5



Reply #3 - 14.01.10 at 08:21:21  
Hi there Derek,
Could you please explain more on how to edit these files (below) manually in order to install this spoiler module?
Admin/ModList.pl
Languages/English/InstantMessage.lng
Languages/English/Main.lng
Languages/English/Post.lng
Sources/InstantMessage.pl
Sources/MyCenter.pl
Sources/Post.pl
Sources/Printpage.pl
Sources/YaBBC.pl

Thanks so much indeed
 
IP Logged
 
mick
Hacker Expert
****
Offline

Dorsten, Nordrhein-Westfalen, Germany
Posts: 344



Reply #4 - 14.01.10 at 11:30:17  
Hi Fairchild,

open the mod-File with an text-editor-Program and
you see, what you have to do.

Greetings
Mick
 
IP Logged
 
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #5 - 14.01.10 at 16:09:56  
Hi,

Also see this for installing Mods manually:

http://www.boardmod.org/faq.php#4
 
IP Logged
 
Fairchild
Bloody Novice
*
Offline

Posts: 5



Reply #6 - 15.01.10 at 03:08:47  
Hi,
Thanks so much Mick, Derek...I almost there...I've got this error message what I tried to install the spoiler tag...here are the error messages:

Step 1 ... failed - ERR(2): Could not find file to edit (C:\Documents and
Settings\Mahacon\Desktop\bm256\Mods\YaBB_2.4\cgi-bin\yabb2\Languages\German_Du\I
nstantMessage.lng)

Step 2 ... failed - ERR(2): Could not find file to edit (C:\Documents and
Settings\Mahacon\Desktop\bm256\Mods\YaBB_2.4\cgi-bin\yabb2\Languages\German_Du\M
ain.lng)

Step 3 ... failed - ERR(2): Could not find file to edit (C:\Documents and
Settings\Mahacon\Desktop\bm256\Mods\YaBB_2.4\cgi-bin\yabb2\Languages\German_Du\P
ost.lng)

Where am I doing wrong? Sad
 
IP Logged
 
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #7 - 15.01.10 at 03:15:02  
Hi,

It looks like you're trying to install the German_Du language patch. Unless you need it, ignore that file and just install the 'SpoilerTag_V1_5.mod'.

 
IP Logged
 
Fairchild
Bloody Novice
*
Offline

Posts: 5



Reply #8 - 15.01.10 at 07:14:14  
Yess!! I did it thanks to you! Thank you so much for this wonderful spoiler. It's working like a charm! God bless you!! Cheesy
 
IP Logged
 
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #9 - 15.01.10 at 16:10:10  
You're welcome. I'm glad you got it working!
 
IP Logged
 
Fairchild
Bloody Novice
*
Offline

Posts: 5



Reply #10 - 16.01.10 at 04:08:37  
Hi again,
I was just wondering...how come mine has no that 'long box shaped'?

...
 
IP Logged
 
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #11 - 16.01.10 at 16:28:15  
You need to add this to your style sheet:

Code:
.spoiler {
font-size: 12px;
font-weight: normal;
font-style: normal;
font-family: Verdana, Helvetica, Arial, Sans-Serif;
color: #304B58;
border: 1px inset;
width: 90%;
padding: 4px;
}
 
IP Logged
 
Fairchild
Bloody Novice
*
Offline

Posts: 5



Reply #12 - 16.01.10 at 17:57:42  
Greeeaaatt! It's working! I can't thank you enough. God bless! Cheesy
 
IP Logged
 
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #13 - 16.01.10 at 18:19:14  
You're very welcome!
 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #14 - 07.05.10 at 16:53:52  
Thanks, used parts of your mod for my old YaBB - our spoiler mod was a little buggy, yours is very nice Wink . Oh, Chrome doesn't seem to care about the CSS style, Firefox, IE and Opera work well.
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #15 - 07.05.10 at 19:37:54  
Valtiel wrote on 07.05.10 at 16:53:52:
Thanks, used parts of your mod for my old YaBB - our spoiler mod was a little buggy, yours is very nice Wink . Oh, Chrome doesn't seem to care about the CSS style, Firefox, IE and Opera work well.

Okay, thanks!

I'll have to check it out in Chrome and try to get it fixed in the future.

It's not actually XHTML valid either - I keep meaning to come back to this one and giving it a rewrite - I'll try to get it done in the next update...
« Last Edit: 07.05.10 at 19:56:33 by Derek Barnstorm »  
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #16 - 10.05.10 at 16:27:05  
Hm, we have a problem with the tag. Some spoilers can't be opened. It seems to be totally randomly. For example on one page all spoiler buttons work, on the next only the first one. Or the first three work and the others don't. Any idea?

[Edit]:
Problem seems to appear only with Firefox.
« Last Edit: 10.05.10 at 18:22:37 by Valtiel »  
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #17 - 10.05.10 at 20:02:45  
Err, I'm not too sure why that is happening, sorry. I've just been testing and can't get it to act like you describe.

Are there any errors on the page? Can you give me a link to a thread where it is happening - you can PM it to me if you don't want to post links up...
 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #18 - 10.05.10 at 20:20:27  
I can.

Here it doesn't work

On the next page they work

But you have to test with Firefox, don't forget Wink

WTF... now the one in the first link works. As I said... purely random.

And now it doesn't work again.
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #19 - 10.05.10 at 21:12:03  
Strange... I've just clicked on those links quite a few times in FireFox 3.6.3 on both my PC and Mac, and the spoiler worked every time. I really don't know what to suggest at the minute... sorry!

Have any of your members been noticing it too, or is it just you?

I want to get another Mod finished over the next few days, but if you can give me a little time I'll try to get this working in a better way and hopefully that will fix things.

Sorry again if that's not much help right now, but I will come back to it...
 
IP Logged
 
Jeff
Moderator
*****
Offline

, Netherlands
Posts: 2552



Reply #20 - 10.05.10 at 21:52:42  
Works for me too in Firefox 3.6.3. Does they clear the cache or hold STRG (CTRL) + F5 Button to refresh the site? Wink
 
IP Logged
 

greetings
Jeff
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #21 - 11.05.10 at 16:37:48  
@ Derek:
My whole team has the errors, too - but just like me only with Firefox.

@ Jeff:
Yes, that's not the reason Smiley
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #22 - 11.05.10 at 17:04:36  
Okay, yeah... It's just happened to me once too.

I haven't got a simple fix right now I'm afraid, but I'll try to sort it out once I've finished something else I'm working on...
 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #23 - 11.05.10 at 17:10:27  
It can only be a problem with the JavaScript code in YaBBC.pl. Unfortunately I don't really understand JavaScript. Did you write that code by yourself, or did you take it from some website oder something?
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #24 - 11.05.10 at 22:05:57  
I'm afraid I didn't write the JS from scratch, no (that's one reason why I wanted to change it). I looked up the best way of doing a spoiler a couple of years ago, and this seemed the most common and reliable way - this method actually seems to be quite widely used.

I still have no idea why it is happening though and I can't get it to happen on my test board. I can only think that it's playing up with another division or a bit of javascript on your page.

Can you try this (without modifying it) - Just replace yours with this from the first to last division:

Code:
<div class="message"><div><b>$spoiler_txt{'01'}:</b><input type="button" class="button" value="$spoiler_txt{'02'}" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.value = '$spoiler_txt{'03'}'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = '$spoiler_txt{'02'}'; }" /></div><div class="spoiler"><div style="display: none;">$1</div></div></div> 


I'm not really hopeful that it will work though, all I've really done is make it xhtml valid.
 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #25 - 12.05.10 at 16:46:27  
Sorry, doesn't change anything. It really may be that the JavaScript interferes with some other JavaScript on my forum, but why randomly? The used JavaScripts are all loaded permanently.

I deactivated all other JavaScripts on my forum, but the error remains. Seems it has nothing to do with other JavaScripts.
« Last Edit: 12.05.10 at 17:08:54 by Valtiel »  
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #26 - 12.05.10 at 18:50:47  
Sorry, I have no idea. This is the error in FireFox:

Quote:
Error: this.parentNode.parentNode.getElementsByTagName("div")[1] is undefined
Source File: http://www.diplompsychopath.de/cgi-bin/yabb3/YaBB.pl?board=finalfantasy;action=d...
Line: 1

So I'm thinking it has to do with the doctype declaration on your page (though I can't recreate it).

Undecided
 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #27 - 12.05.10 at 19:13:11  
Where do you get this error? My firefox doesn't show any error.
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #28 - 12.05.10 at 19:19:38  
Tools => Error Console
 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #29 - 12.05.10 at 19:22:13  
Yes, I see... hm. My doctype is

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 



other's don't seem to work with YaBB 1.
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #30 - 12.05.10 at 19:27:37  
Valtiel wrote on 12.05.10 at 19:22:13:
Yes, I see... hm. My doctype is

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 



other's don't seem to work with YaBB 1.

I'm stuck what to suggest then. I have tried changing the doctype myself, but as I say, I can't recreate it.

I'm not 100% sure that is the problem, but have got a feeling that it must be.

Sorry again that I've not been able to help...
 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #31 - 12.05.10 at 19:31:38  
But if it is the problem, why not always? Most spoiler buttons work... that's the really weird thing.
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #32 - 12.05.10 at 19:48:58  
I tested some more. It has something to do with the content of the spoiler.

For example a post with 4 spoilers. None of them works. If I remove one special spoiler, the other 3 work.

Please try the following on your board, if possible:

Code:

[spoiler]wirklich [url=http://www.youtube.com/watch?v=Yn4r_XJw-Eg&feature=related]ALLES[/url] verstecken kann.[/spoiler]


It's just how one of my mods posted the spoiler. It doesn't work and it makes all other spoilers in the same post not work, too.
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #33 - 12.05.10 at 20:01:58  
From a quick test I haven't noticed a problem. I have tested the spoiler with all YaBB tags and haven't ever had any issues - it should work with all content.

Can you post up the whole line that you are using from YaBBC.pl...
 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #34 - 12.05.10 at 20:04:23  
Hm, if I edit the post and click on "Preview", the spoiler works. After posting, it doesn't.

The line is like your original, I just hardcoded the button text and added a line break:

Code:
    $message =~ s~\[spoiler\](.+?)\[/spoiler\]~<div class="message"><div><input type="button" class="button" value="Spoiler zeigen" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.value = 'Spoiler schließen'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Spoiler öffnen'; }" /></div><br><div class="spoiler"><div style="display: none;">$1</div></div></div></div>~isg; 



 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #35 - 12.05.10 at 20:10:38  
You do have an ending division tag that shouldn't be there, and also a break tag from somewhere. I don't think it will help, but it's worth a shot anyway... try this:

Code:
$message =~ s~\[spoiler\](.+?)\[/spoiler\]~<div class="message"><div><input type="button" class="button" value="Spoiler zeigen" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.value = 'Spoiler schließen'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Spoiler öffnen'; }" /></div><div class="spoiler"><div style="display: none;">$1</div></div></div>~isg; 



 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #36 - 12.05.10 at 20:21:49  
The break tag isn't from somewhere Wink

Valtiel wrote on 12.05.10 at 20:04:23:
The line is like your original, I just hardcoded the button text and added a line break:


Anyway, it doesn't change anything.
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #37 - 12.05.10 at 20:28:23  
Valtiel wrote on 12.05.10 at 20:21:49:
The break tag isn't from somewhere Wink

Valtiel wrote on 12.05.10 at 20:04:23:
The line is like your original, I just hardcoded the button text and added a line break:

Oops! I didn't see that.

I really don't know then. I've been testing and testing and can't get it to behave like that on my 2.4 board...

Huh

 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #38 - 12.05.10 at 20:31:09  
I think I will figure it out. It has something to do with the <div> tags, it seems, just testing around a little bit.
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #39 - 12.05.10 at 20:34:57  
Okay. If you do figure it out, I'll be interested to know what it is...
 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #40 - 12.05.10 at 21:06:04  
Hm, it's really difficult...

Here is what we have by now:

  • The error only appears with Firefox
  • When clicking "Preview", the spoiler works. After posting, it doesn't
  • It could have something to do with the spoiler's content


I need a coffee now  Roll Eyes  Grin

If I remove the url=... stuff, the spoiler works. But that doesn't really help me.
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #41 - 13.05.10 at 01:01:35  
It could have something to do with YaBB 1 (which I haven't tested it on). Have you tried it on a 2.4 board?
 
IP Logged
 
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #42 - 13.05.10 at 07:57:04  
No, I have no YaBB 2 to test. But I don't think it has something to do with it as the JavaScript should work in every environment - it's not even made especially for YaBB Wink .
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Valtiel
Hacker God
*****
Offline

, Bayern, Germany
Posts: 873



Reply #43 - 13.05.10 at 09:30:42  
I found a workaround now. If i use <span> instead of <div>, it seems to work.
 
IP Logged
 

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Simple
Hacker Wannabe
**
Offline

Midlands, UK, United Kingdom
Posts: 58



Reply #44 - 15.03.13 at 18:25:22  
installed no probs thank you  Smiley
 
IP Logged
 
Imp_In_Training
Hacker God
*****
Offline

Aberdeen, Maryland, USA
Posts: 608



Reply #45 - 16.03.13 at 22:04:22  
I had to make some minor modifications, but I did get this working with 2.5 rather easily.
 
IP Logged
 
Imp_In_Training
Hacker God
*****
Offline

Aberdeen, Maryland, USA
Posts: 608



Reply #46 - 20.03.13 at 17:14:28  
Seems my underline tag is not working on any templates now ... so there may be a small problem I need to work through.
 
IP Logged
 
Derek Barnstorm
Hacker God
*****
Offline

Warwickshire, United Kingdom
Posts: 1112



Reply #47 - 20.03.13 at 17:19:23  
Hi,

Nothing to do with this mod. It was missed out in 2.5.2 - add this to your style sheet:

Code:
.u, .under {
text-decoration:underline;
}

You can find the other bug fixes for 2.5.2 here:

http://www.boardmod.org/yabb2/YaBB.pl?num=1352996180
 
IP Logged
 
Imp_In_Training
Hacker God
*****
Offline

Aberdeen, Maryland, USA
Posts: 608



Reply #48 - 21.03.13 at 17:29:37  
Thanks bud.  Thought I was going crazy for a while there.
 
IP Logged
 
Pages: 1 
© 2000-2012 by - All rights reserved.

Project website hosting proudly sponsored and provided by UK2 Hosting
 The Project | News | Downloads | Mods | FAQ | Templates | Chat | Forum