Here's my XHTML 1.1 valid version, with 2 modifications:
-I commented out the following 2 lines as I don't need them & didn't want to fix them:
// check for http:// in url
/*if (!(eregi("http://", $wurl) || (eregi("https://",$wurl)))) {
$wurl = "http://".$wurl;
}*/
//$wrapped .= "onLoad='".$xload."' ";
Here's the goods:
#
# Wrapper - Etomite v0.6
#
# Adapted for Etomite by: John Maats - john-at-pn.nl
# Upgraded to XHTML 1.1 compliance by Mark301
#
# Usage:
# Set defaults and use [ [Wrapper] ] inside your content
#
# or call it with variables (example):
# [ [wrapper?wurl=http://etomite.com&wname=Etomite] ]
#
# Variable list:
# $wurl = "http://etomite.com"; // What would you like to show?
# $wname = "<b>Etomite</b>"; // Name to show
# $wshowname = "1"; // show the name? 1 yes, 0 no
# $wwidth = "100%"; // width , recommended 100%
# $wheight = "600"; // height, recommended 600
# $wscroll = "auto"; // auto, yes or no scrollbars visible
# $wauto = "1"; // auto resize 1 yes, 0 no
# $wframe = "thin black inset"; // css styling for the border
# $wlink = "1"; // show direct link 1 yes, 0 no
# $wwtext = "Click here"; // Text for direct link
#
# If variable is not set, snippet will choose following defaults
// your defaults, oh Master!
$durl = "http://etomite.com";
$dname = "";
$dshowname = "1";
$dwidth = "100%";
$dheight = "600px";
$dscroll = "auto";
$dauto = "1";
$dframe = "1";
$dlink = "1";
$dwtext = "Click here to open in new window!";
// No need to change stuff underneath...
// set defaults...
$wrapped ="";
if (!isset($wurl)) {$wurl = $durl; }
if(isset($_SESSION['wrapthisurl'])){$wurl=$_SESSION['wrapthisurl'];}
if (!isset($wheight)) {$wheight = $dheight; }
if (!isset($wwidth)) {$wwidth = $dwidth; }
if (!isset($wscroll)) {$wscroll = $dscroll; }
if (!isset($wframe)) {$wframe = $dframe; }
if (!isset($wname)) {$wname = $dname; }
if (!isset($wshowname)) {$wshowname = $dshowname; }
if (!isset($wlink)) {$wlink = $dlink; }
if (!isset($wwtext)) {$wwtext = $dwtext; }
// check for http:// in url
/*if (!(eregi("http://", $wurl) || (eregi("https://",$wurl)))) {
$wurl = "http://".$wurl;
}*/
// need resize?
if ($wauto == "1"){
$xload = "iFrameHeight()";
$wrapped .= "<script type='text/javascript'>\n";
$wrapped .= "function iFrameHeight() {";
$wrapped .= " var h = 0;";
$wrapped .= " if(document.getElementById && !(document.all))";
$wrapped .= " {";
$wrapped .= " h = document.getElementById('blockrandom').contentDocument.height;";
$wrapped .= " document.getElementById('blockrandom').style.height = h + 60 + 'px';";
$wrapped .= " }";
$wrapped .= " else if(document.all)";
$wrapped .= " {";
$wrapped .= " h = document.frames('blockrandom').document.body.scrollHeight;";
$wrapped .= " document.all.blockrandom.style.height = h + 20 + 'px';";
$wrapped .= " }";
$wrapped .= "}";
$wrapped .= "</script>\n";
} else {
$xload = "";
}
$wrapped .= "<script type='text/javascript'>\n";
$wrapped .= "function blockError(){return true;}";
$wrapped .= "window.onerror = blockError;";
$wrapped .= "</script>\n";
$wrapped .= "<object class='blockrandom' type='text/html' ";
//$wrapped .= "onLoad='".$xload."' ";
$wrapped .= "data='".$wurl."' ";
$wrapped .= "style='width:" . $wwidth . "; height:" . $wheight . "; vertical-align:top; overflow:".$wscroll."; border:" . $wframe . ";'>\nSorry, your Browser does NOT SUPPORT IFRAME.<br/>\nYou may want to Upgrade your Browser.<br/>\n<a href='".$wurl."' {{targetBlank}}>Click Here to see the page that was supposed to load.</a>\n</object>\n";
$wrapped .= "<div style='text-align:center;'>\n";
// need to show name?
if ($wshowname == "1") {
$wrapped .= $wname;
}
$wrapped .= "<br/>\n";
// need to show link?
if ($wlink == "1") {
$wrapped .= "<a href='".$wurl."' {{targetBlank}}>[".$wwtext."]</a>\n</div>\n";
}
return $wrapped;