Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks
Author Message
derek765
Regular
Regular



Joined: Sep 27, 2012
Posts: 99
Location: Okinawa, Japan

PostPosted: Thu Jan 03, 2013 10:20 am Reply with quote

Have recently read about the use of /* <![CDATA[ */ causing issues, and I have my shout box block being used in my Forums.

Now the problem is, I am browsing my site via Safari and noticed the Shout Box is showing on my home page, but not in the forums, and not really sure what the issue is there, only thing I could think of is the following code:

Code:


<script type="text/javascript">
/* <![CDATA[ */
var SBheight = '<?php echo "$ShoutMarqueeheight"; ?>';
var SBcontent = new String('<?php echo "$mid_content"; ?>');
/* ]]> */
</script>
<script type="text/javascript" src="shoutbox.js"></script>
<?php

$content = "$top_content\n";
$content .= "<div align=\"left\"><script type=\"text/javascript\">document.write(SBtxt);</script></div>\n";
$content .= "$bottom_content\n";

?>
 
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Thu Jan 03, 2013 10:26 am Reply with quote

Do you see that code when you view the source code when in Forums?
The chances are that this was made for a block file, which automatically executes any data assigned to $content, anywhere else, you may need to actually echo $content at the bottom of the file
 
View user's profile Send private message Send e-mail
derek765







PostPosted: Thu Jan 03, 2013 10:32 am Reply with quote

Nevermind, I guess the issue has to due with being a registered member to view the shout box in the forums.
 
derek765







PostPosted: Thu Jan 03, 2013 9:27 pm Reply with quote

Back to this topic, what is the proper fix for document.write in XHTML?
In this code, it has validation errors:
I've tried doing <\/script>, or putting the SBtxt in ' or ".
But doesn't fix it.

Code:


<script type=\"text/javascript\">document.write(SBtxt);</script>


In /blocks/block-Shout_Box.php
Line: 722-735

Code:


<script type="text/javascript">
/* <![CDATA[ */
var SBheight = '<?php echo "$ShoutMarqueeheight"; ?>';
var SBcontent = new String('<?php echo "$mid_content"; ?>');
/* ]]> */
</script>
<script type="text/javascript" src="shoutbox.js"></script>
<?php

$content = "$top_content\n";
$content .= "<div align=\"left\"><script type=\"text/javascript\">document.write(SBtxt);</script></div>\n";
$content .= "$bottom_content\n";

?>
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Thu Jan 03, 2013 9:56 pm Reply with quote

What are the errors you are getting?

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
derek765







PostPosted: Thu Jan 03, 2013 10:09 pm Reply with quote

XHTML documents may not use document.write() or document.writeln(), and it appears that this is used in this script. Use the innerHTML property instead.

and

This document contains 1 possibly problematic CDATA section. Using CDATA sections is not recommended due to poor browser support (even some newer browsers fail to properly support it) and due to other complications. AI Internet Solutions recommends avoiding CDATA sections if possible or commenting them out (for example, using "//<![CDATA[" and "//]]>" in a "script" element).
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©