PDA

View Full Version : xhtml 1.1 compliance


blackhawk_996
10-28-2005, 08:59 PM
I got into this topic on the main subdreamer site and abcohen sent me this way. I've been working with subdreamer off and on for quite a while as a site builder/optimizer/designer/etc... lol and have seen the shift of more people trying to code their sites in xhtml. I have even started using subdreamer light personally on my own site for testing. And thus why I first looked into this mainly. One of the biggest problems with xhtml is that it's suggested that XHTML delivered as text/html is broken and XHTML delivered as text/xml is very risky. Authors who wish to use XHTML should deliver their markup as application/xhtml+xml. But the way subdreamer is initially coded this isn't possible no matter how well written your skin may be. All because of the information tied to this section of the index.
// ################### SET LOCALE TIME AND HEADER INFORMATION ##################
Again this only applies if trying to use xhtml. Thanks to the use of a few if, elseif statements all you need to do is find this piece of code written in the index page.
header("Content-Type: text/html; charset=$languageinfo[2]");
And replace it with this.
if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validato r")) {
header("Content-type: application/xhtml+xml; charset=$languageinfo[2]");
}
elseif ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
header("Content-type: application/xhtml+xml; charset=$languageinfo[2]");
}
else {
header("Content-type: text/html; charset=$languageinfo[2]");
}
Doing this still allows your code to validate with the correct mime type, but also degrades down to text/html to still allow IE users to view your site. Before I post to much more though I would like someone to chime in with exactly how much code can be posted here. I don't want to upset anyone by putting out to much of the source.

abcohen
10-28-2005, 09:18 PM
dude its your thread... post away... if people have errors they'll post back.. you might want to state that this is for Subdreamer Lite.

blackhawk_996
10-28-2005, 10:50 PM
Actually this piece is the same for both versions as I'm running it on my own light version and a few others full versions in the past. I just wanted to make sure about posting code though I know vb.org got upset when I first started making skins and hacks over there about posting to much.

abcohen
10-28-2005, 11:51 PM
the .org community welcomes and support growth and development... we just dont want people posting full version of files or all the source to plugins that require sale or pro purchase.

blackhawk_996
10-29-2005, 01:42 AM
Okay that's what I wanted to make sure of.

blackhawk_996
11-02-2005, 03:25 AM
More index changes to help meet compliance.

Find:
echo '<table width="100%" border="0" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td style="border: 4px solid #FF0000; font-size: 12px; color: #000000;" align="center"><b>Website in Offline Mode</b></td>
</tr>
</table>';

Replace with:
echo '<table style="background-color:#FFFFFF; border:0px" cellpadding="5" cellspacing="0">
<tr>
<td style="border: 4px solid #FF0000; font-size: 12px; color: #000000;" align="center"><b>Website in Offline Mode</b></td>
</tr>
</table>';

Find:
$mainsettings['skinheader'] = iif(strlen($sdurl), '<base href="' . $sdurl . '">') . '
<script type="text/javascript" src="includes/javascript/skin_functions.js"></script>
<script language="JavaScript" src="includes/javascript/hovermenu/menu.js"></script>';

Replace with:
$mainsettings['skinheader'] = iif(strlen($sdurl), '<base href="' . $sdurl . '" />') . '
<script type="text/javascript" src="includes/javascript/skin_functions.js"></script>
<script type="text/javascript" src="includes/javascript/hovermenu/menu.js"></script>';

thomas
11-02-2005, 04:13 AM
i found that i had session problems implementing the compliance when i went to validate the page.

also, in mozilla the pages wouldnt work because of the non compliance of the above sessions?? worked fine in IE

blackhawk_996
11-02-2005, 04:58 AM
If you were using the skin I generated it's because of some errors in the first submitted files, sorry about that. I just uploaded a correct version with a full set of install directions. Aside from that skin what type of session problem were you having exactly? None of the code i've changed should have any effect on session as long as your using valid xhtml. If session id remain a problem you can always use .htaccess to remove it from the url string.

php_flag session.use_trans_sid off

The users session id should stay on the server and as long as they are using cookies they shouldn't have a broken session. This solution being for the light version of subdreamer, as I remember the pro version SEO urls are already rewritten to remove them.