/ Published in: XHTML
URL: http://nerdfiles.net/xhtml+rdfa/
Production status (seriously this time). See URL for output. Set for jQuery and Y! CSS Reset use.
Notes: Uses PHP. XHTML+XML mime-type. FF, Opera, Chrome, Safari, IE7+ compatible.
Warning: Servces"text/html" and "text/javascript" to IE (content negotiation). Breaks in IE6. So? Even Google gave up on that trash.
Expand |
Embed | Plain Text
<?php function is_ie() { $agent = ''; // old php user agent can be found here if (!empty($HTTP_USER_AGENT)) $agent = $HTTP_USER_AGENT; // newer versions of php do have useragent here. if (empty($agent) && !empty($_SERVER["HTTP_USER_AGENT"])) $agent = $_SERVER["HTTP_USER_AGENT"]; if (!empty($agent) && preg_match("/MSIE/si", $agent)) return true; return false; } if (is_ie() == 1) { //$xmldec .= "<?xml-stylesheet type="text/xsl" href="ie-xml-fix.xsl"?>\n"; // See here for the fix: http://www.echoofeden.com/digest/mit/2007/03/06/ie-xhtml-bug/ $script_include_close = "type=\"text/javascript\"></script>"; $sic = $script_include_close; $mime_type = "text/html"; $js_mine_type = "text/javascript"; header( 'Content-type: '.$mime_type.'; charset=utf-8' ); } else { $xmldec = "<?xml version="1.0" encoding="utf-8"?>\n"; $xmldec .= "<?xml-stylesheet type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset/reset-min.css"?>\n"; $script_include_close = "type=\"application/x-javascript\" />"; $sic = $script_include_close; $mime_type = "application/xhtml+xml"; $js_mine_type = "application/x-javascript"; header( 'Content-type: '.$mime_type.'; charset=utf-8' ); echo html_entity_decode( $xmldec ); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> <html version="XHTML+RDFa 1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/terms" xmlns:xhv="http://www.w3.org/1999/xhtml/vocab" xmlns:media="http://purl.org/media" xmlns:commerce="http://purl.org/commerce" xmlns:audio="http://purl.org/media/audio" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="<?=$mime_type?>; charset=utf-8" /> <!-- Caching Meta --> <meta http-equiv="expires" content="#" /> <meta http-equiv="cache-control" content="#" /> <!-- Site & Page URL Meta --> <base href="#" /> <link rel="canonical" href="#" /> <!-- Language Meta --> <meta name="content-language" content="#" /> <meta name="language" content="#" /> <!-- Production Meta --> <meta name="author" content="" /> <meta name="designer" content="" /> <meta name="copyright" content="Copyright. YYYY. All Rights Reserved." /> <!-- Site || Page Meta --> <meta name="keywords" content="" /> <meta name="description" content="" /> <!-- Search Engine Meta --> <meta name="robots" content="noydir,noodp,nosnippet" /> <meta name="googlebot" content="" /> <meta name="msnbot" content="" /> <meta name="slurp" content="" /> <!-- Style Resources --> <link rel="shortcut icon" type="image/png" href="icon.png" /> <?php if (is_ie() == 1) { ?> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset/reset-min.css" /> <?php } ?> <!-- JavaScript Resources --> <?php if (is_ie() == 1) { ?> <!--[if lt IE 8]> <script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" <?=$sic."\n"?> <![endif]--> <?php } ?><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" <?=$sic."\n"?> <script type="<?=$js_mine_type?>"> jQuery.noConflict(); jQuery(document).ready(function() { //... }); </script> </head> <body> <?php if (is_ie() == 1) { ?> <!--[if lt IE 7]> <div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative;'> <div style='position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;'><a href='#' onclick='javascript:this.parentNode.parentNode.style.display="none"; return false;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-cornerx.jpg' style='border: none;' alt='Close this notice'/></a></div> <div style='width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;'> <div style='width: 75px; float: left;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-warning.jpg' alt='Warning!'/></div> <div style='width: 275px; float: left; font-family: Arial, sans-serif;'> <div style='font-size: 14px; font-weight: bold; margin-top: 12px;'>You are using an outdated browser</div> <div style='font-size: 12px; margin-top: 6px; line-height: 12px;'>For a better experience using this site, please upgrade to a modern web browser.</div> </div> <div style='width: 75px; float: left;'><a href='http://www.firefox.com' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-firefox.jpg' style='border: none;' alt='Get Firefox 3.5'/></a></div> <div style='width: 75px; float: left;'><a href='http://www.browserforthebetter.com/download.html' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-ie8.jpg' style='border: none;' alt='Get Internet Explorer 8'/></a></div> <div style='width: 73px; float: left;'><a href='http://www.apple.com/safari/download/' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-safari.jpg' style='border: none;' alt='Get Safari 4'/></a></div> <div style='float: left;'><a href='http://www.google.com/chrome' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-chrome.jpg' style='border: none;' alt='Get Google Chrome'/></a></div> </div> </div> <![endif]--> <?php } ?> </body> </html>
You need to login to post a comment.
