Upgraded
|
#21
17-04-2012
well, that would be very helpful BO - I have a php file, and I can let you have that - you will see by looking at the page source in any page with a spoiler tag in it that the " is being turned into a different encoding.
[html]
<div align="center">
<div style="margin: 5px 20px 20px; width: 90%;">
<div style="text-align: left; padding: 4px; background: #72B73A; repeat-x scroll 0% 0% transparent; border: 1px solid #2C6302; -moz-border-radius:5px; color:#ffffff; text-shadow:0 -1px #4B7926; font-weight:bold; ">
Spoiler <input type="button" 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'; }" style="width: 45px; font-size: 10px; margin: 0px; padding: 0px;font-family: Tahoma" value="Show"></div><div><div style="border-right: 1px solid #000000; border-width: 0px 1px 1px; border-style: none solid solid; border-color: #000000; padding: 4px; -moz-border-radius:5px; display: none; text-align: left">
gah gah gah<br />
</div>
</div>
</div>
</div>
[/html]
and so of course it is breaking the javascript.... I think it is another file which is affecting it. I am just not sure which one.
[html]
<div align="center">
<div style="margin: 5px 20px 20px; width: 90%;">
<div style="text-align: left; padding: 4px; background: #72B73A; repeat-x scroll 0% 0% transparent; border: 1px solid #2C6302; -moz-border-radius:5px; color:#ffffff; text-shadow:0 -1px #4B7926; font-weight:bold; ">
Spoiler <input type="button" 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'; }" style="width: 45px; font-size: 10px; margin: 0px; padding: 0px;font-family: Tahoma" value="Show"></div><div><div style="border-right: 1px solid #000000; border-width: 0px 1px 1px; border-style: none solid solid; border-color: #000000; padding: 4px; -moz-border-radius:5px; display: none; text-align: left">
gah gah gah<br />
</div>
</div>
</div>
</div>
[/html]
and so of course it is breaking the javascript.... I think it is another file which is affecting it. I am just not sure which one.
PHP Code:
// Assign pattern and replace values.
$pattern = array("#\[spoiler=(?:"|\"|')?(.*?)[\"']?(?:"|\"|')?\](.*?)\[\/spoiler\](\r\n?|\n?)#si", "#\[spoiler\](.*?)\[\/spoiler\](\r\n?|\n?)#si");
$replace = array("<div><div class=\"spoiler_header\">$1 <a href=\"javascript:void(0);\" onclick=\"javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';}\">(Click to View)</a></div><div class=\"spoiler_body\" style=\"display: none;\">$2</div></div>", "<div><div class=\"spoiler_header\">Spoiler <a href=\"javascript:void(0);\" onclick=\"javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';}\">(Click to View)</a></div><div class=\"spoiler_body\" style=\"display: none;\">$1</div></div>");
while(preg_match($pattern[0], $message) or preg_match($pattern[1], $message))
{
$message = preg_replace($pattern, $replace, $message);
}
$find = array(
"#<div class=\"spoiler_body\">(\r\n?|\n?)#",
"#(\r\n?|\n?)</div>#"
);
$replace = array(
"<div class=\"spoiler_body\">",
"</div>"
);
$message = preg_replace($find, $replace, $message);
return $message;
}
The site don't jive? PRESS F5
#22
17-04-2012
Ok, this looks a bit more complex than anything I've ever dealt with, regex-wise, but that may be due to the fact that this stuff is trying to alter code in a specific 'language format' such as .php, .js or .html.
It'll take me a little while to get into it, but I'll do what I can
It'll take me a little while to get into it, but I'll do what I can
#24
09-05-2012
The site don't jive? PRESS F5
#25
09-05-2012
GREAT! I need to go fix one of my uploads right away now
ETA: Yup, 'Infoplus' now works again, too Thank you, Lee
ETA: Yup, 'Infoplus' now works again, too Thank you, Lee
#27
09-05-2012
Yes, I *can* imagine... I feel the same way about accepting your regexp thingy, and then NOT coming up with a viable solution...
But anyway, in my opinion YOU didn't let anyone down. I feel that the people who broke functionality in the update of the underlying forum software, are the ones to blame. THEY let us down!
But anyway, in my opinion YOU didn't let anyone down. I feel that the people who broke functionality in the update of the underlying forum software, are the ones to blame. THEY let us down!
#29
09-05-2012
Yay! I could almost hear you singing with delight! And in tune too! Just been to check the spoiler on the Brixham and it's back!
Karen Lorraine, proud to be a member of LeeFish since Jan 2012.