Archive for myfreeforum.org Before posting please check the "stickies" in the support forums.
Please ask questions in real English and not "txt". You will get a better response.
Please do not ask support questions via PMs.
 


       myfreeforum.org Forum Index -> Web page/template Editing
Lavathing9

Spoiler Alt Code

http://narutorpcenter.myfastforum.org

Sometime a few months ago one of our custom BBCodes stopped working.  It was a spoiler alt code, which I think I found somewhere on HOWTODOIT or here.  Anyways, when [spoiler2][/spoiler2] is used, it shows up like normal, however when you click "Show", nothing happens.  I need a fresh set of eyes to look at the code and potentially lead me to where the problem is occurring.

Start
Code:
<div style="padding: 3px; background-color: #FFFFFF; border: 1px solid #d8d8d8; font-size: 1em;"><div style="text-transform: uppercase; border-bottom: 1px solid #CCCCCC; margin-bottom: 3px; font-size: 0.8em; font-weight: bold; display: block;"><span 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.innerHTML = '<b>Spoiler: </b><a href='#' onClick='return false;'>hide</a>'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerHTML = '<b>Spoiler: </b>'; <a href='#' onClick='return false;'>show</a>'; }" /><b>Spoiler: </b><a href="#" onClick="return false;">Show</a></div><div class="quotecontent"><div style="display: none;">


End
Code:
</div></div></div>


Thanks!
myff admin

You must give the (myfree/myfast/myfine)forum.org link/address of your forum. A link should be given to the problem if at all possible. Do this whether you think it is important or not. DO NO GIVE YOUR OWN DOMAIN LINK IT MUST BE THE NAME YOU CREATED HERE.

A link to a post on your forum where that spoiler is being used would obviously help.
Lavathing9

myff admin wrote:
You must give the (myfree/myfast/myfine)forum.org link/address of your forum. A link should be given to the problem if at all possible. Do this whether you think it is important or not. DO NO GIVE YOUR OWN DOMAIN LINK IT MUST BE THE NAME YOU CREATED HERE.

A link to a post on your forum where that spoiler is being used would obviously help.


Umm, the link is, and has been, in the opening post.  At the top...

EDIT:  Here is a specific thread for reference though:

http://narutorpcenter.com/sutra455994.php#455994
myff admin

I see a link to your forum, but unless I'm blind I can't see a link to a post where you are trying to use the spoiler.
Lavathing9

myff admin wrote:
I see a link to your forum, but unless I'm blind I can't see a link to a post where you are trying to use the spoiler.


Oh, I thought when you said:

Quote:
You must give the (myfree/myfast/myfine)forum.org link/address of your forum. A link should be given to the problem if at all possible. Do this whether you think it is important or not. DO NO GIVE YOUR OWN DOMAIN LINK IT MUST BE THE NAME YOU CREATED HERE.


You meant a link to the forum, but I edited in a link to a specific thread.

Here it is again:  http://narutorpcenter.com/sutra455994.php#455994
myff admin

Well is does say even there "a link to the problem should be given".

Code:

Timestamp: 26/03/12 15:49:25
Error: illegal character
Source File: http://narutorpcenter.com/sutra455994.php#455994
Line: 1, Column: 269
Source Code:
if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') {  this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerHTML = '<b>Spoiler: </b><a href='#' onClick='return false;'>hide</a>'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerHTML = '<b>Spoiler: </b>'; <a href='#' onClick='return false;'>show</a>'; }


is what my javascript error console says, and the relevant bit of the code is:

Code:

<span 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.innerHTML = '<b>Spoiler: </b><a href='#' onClick='return false;'>hide</a>'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerHTML = '<b>Spoiler: </b>'; <a href='#' onClick='return false;'>show</a>'; }" /><b>Spoiler: </b><a href="#" onClick="return false;">Show</a></div><div class="quotecontent"><div style="display: none;">for myff support</div></div></div>


At which point I confess I can't see the error, and I'm in the middle of some stuff that I can't stop doing for long, namely the quarterly paperwork. So I will hope Nick comes along with the answer and/or take another look later.
Nick(NR)

Do all the other bbcode buttons do what their supposed to? if no read on...

http://howtodoit.myfreeforum.org/...?component=content&topicid=80

in the posting_body.tpl has the addbbcode## number been altered as that would interfere if the number is already in use?
myff admin

Thing is Nick, it is generating the spoiler code in the post. But the code generated produces a javascript error.
Nick(NR)

then that leaves the bbcode.tpl having been altered, but that file isn't editable to the user, so would the addbbcode numbers being wrong generate incorrect javascript as it doesn't know which to show on the page?
myff admin

I think the only question here,  is what is the actual error in that javascript?
myff admin

A spoiler

Spoiler:

test



The other recommendation would be to look a the page source here with a working spoiler and use that code.
myff admin

Our definition is start

Code:

<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr><td><span style="font-size: 11px;"><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler:</b> <input type="button" value="Show" style="background-color: transparent;height:20px;width:45px;font-size:10px;margin:0px;padding:0px;" 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.innerText = '';this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><p><div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset; border: #D1D7DC; border-style: solid; border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px"><div  style="display: none;">


end

Code:

</div></p></div></div></span></td></tr></table>
Lavathing9

Admin, that is the regular [.spoiler][./spoiler] tag, that has been working fine.  However, the code in question is our custom [.spoiler2][./spoiler2].  I got the code for it from HTDI or here at some point, I don't exactly remember.  It worked fine for awhile, but just in the past months it has not been allowing us to "Show" the spoiler.

I edited the topic to show the other spoiler tags that we have, and are currently working  http://narutorpcenter.com/sutra455994.php#455994
myff admin

and I still can't actually spot the error in the javascript. But both chrome and firefox are saying that your javascript has an error.

       myfreeforum.org Forum Index -> Web page/template Editing
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum