Wrapper
#31
Posted 12 August 2005 - 06:18 AM
What you need to do is go into your manager, and then to the Resources section
Choose add a New Snippet.
Paste the Snippet code into the big white box, and give it a name at the top (Wrapper)
Then edit the document you want the wrapper snippet on, and type in the editor [[Wrapper?wurl=http://www.mylinkgoeshere.com]]
And that should be it :D
#32
Posted 12 August 2005 - 01:40 PM
I'd like Wrapper to use a generic wrapping page template and return a url to that template wrapping my document, like this:
<a href="[[Wrapper?wurl=http://mypage.com\1.htm]]"></a> should return me something like this<a href="http://mypage.com\wrapper.htm?url=1.htm"></a> <a href="[[Wrapper?wurl=http://mypage.com\2.htm]]"></a> should return me something like this<a href="http://mypage.com\wrapper.htm?url=2.htm"></a>
If I could use PHP in a page, the wrapping template would be something like this:
[[Wrapper?wurl=<?php $_GET['url']?>]]
#33
Posted 12 August 2005 - 04:32 PM
- A page with only [[Wrapper]] on it (e.g. wrapper.html)
- A slightly modified Wrapper snippet that gets it's $wurl like this:
$wurl = isset($wurl) ? $wurl : "http://www.mydefaultsite.com";
- Links to the page like this: http://www.yoursite....rapthispage.com
Didn't test it, but it should work.
Edit: Hmm with register_globals set to "off" this won't work of course. You could use this PHP instead:
$wurl = $_GET['wurl'];
if ($wurl == "") { $wurl = "http://www.mydefaultsite.com"; }Please note that this code doesn't check for potential security hazards. It'll include allmost everything into your site...
This post has been edited by Jelmer: 12 August 2005 - 05:37 PM
#35 Guest_clubvibe_*
Posted 15 August 2005 - 12:17 PM
Here is the code:
# With most gratitude to Jason Murphy (Jason407) for making the Mambo original;)
#
# Wrapper - Etomite v0.6
#
# Adapted for Etomite by: John Maats - john-at-pn.nl
#
# 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 = "0"; Â Â Â Â Â Â Â Â Â Â Â // show the name? 1 yes, 0 no
#  $wwidth   = "700";           // 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   = "1";            // show 1, hide 0 iframe borders
#  $wlink   = "0";            // 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   = "<b>Etomite</b>";
$dshowname = "0";
$dwidth   = "710";
$dheight  = "600";
$dscroll  = "auto";
$dauto   = "0";
$dframe   = "0";
$dlink   = "0";
$dwtext   = "";
// No need to change stuff underneath...
// set defaults...
$wrapped ="";
if (!isset($wurl)) {$wurl = $durl; }
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                          ********SOMEWHERE HERE ????***********
                                           ********SOMEWHERE HERE ????***********
if (!(eregi("http://", $wurl) || (eregi("https://",$wurl)))) { Â Â ********SOMEWHERE HERE ????***********
  $wurl = "http://".$wurl;                         ********SOMEWHERE HERE ????***********
}
// need resize?
if ($wauto == "1"){
  $xload = "iFrameHeight()";
  $wrapped .= "<script language=\"Javascript\">";
  $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>";
} else {
  $xload = "";
}
$wrapped .= "<script language=\"Javascript\">";
$wrapped .= "function blockError(){return true;}";
$wrapped .= "window.onerror = blockError;";
$wrapped .= "</script>";
$wrapped .= "<IFRAME id=\"blockrandom\"";
$wrapped .= "onload=\"".$xload."\"";
$wrapped .= "SRC=\"".$wurl."\"";
$wrapped .= "width=\"".$wwidth."\" height=\"".$wheight."\" align=top scrolling=".$wscroll." frameborder=".$wframe.">Sorry, your Browser does NOT SUPPORT IFRAME.<br>You may want to Upgrade your Browser.<br><a href=\"".$wurl."\" target=\"_blank\">Click Here to see the page that was supposed to load.</a>".$wurl."</IFRAME>";
$wrapped .= "<div align=\"center\">";
// need to show name?
if ($wshowname == "1") {
  $wrapped .= $wname;
}
$wrapped .= "<br>";
// need to show link?
if ($wlink == "1") {
  $wrapped .= "<a href=\"".$wurl."\" target=\"_blank\">[".$wwtext."]</a></div>";
}
return $wrapped;now where do i have to put his:
$wurl = $_GET['wurl'];
if ($wurl == "") { $wurl = "http://www.mydefaultsite.com"; }pardon my noob skills...
i'll explain why i want to use it:
i would like to use this url= http://www.knvb.nl/c...amDescription=9
with the wrapper. but it won't allow me to. As far as I understood this little Jelmer hack should do the trick, isn't it?
This post has been edited by clubvibe: 15 August 2005 - 12:21 PM
#37 Guest_clubvibe_*
Posted 15 August 2005 - 12:48 PM
(...)
$dlink = "0";
$dwtext = "";
$wurl = $_GET['wurl'];
if ($wurl == "") { $wurl = "http://www.google.com"; }
// No need to change stuff underneath...
// set defaults...set it as above every wrapper element turns in to the default (google) page.
so
[[wrapper?wurl=http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=Zoetermeer,%20FC&NotationDescription=Mannen%20beker%20reserve%20zondag%20poule&LevelDescription=Groep%207&CompetitionType=B1600&ClassLevel=27&RegionCode=KNVB-DISTRICT-WEST2&Pool=10&TeamDescription&wname=FCZ 9 Uitslagen]]
and also
[[wrapper?wurl=http://www.zoetermeer9.nl/fczoetermeer/statistieken.php&wname=Statistieken]]
become google.com
(it doens't matter if i set the url between " ")
become google
#38
Posted 15 August 2005 - 01:01 PM
This mod is used to make links to a single file with the URL to wrap included. I think you don't need it...
#39 Guest_clubvibe_*
Posted 15 August 2005 - 01:12 PM
[[wrapper?wurl=http://www.zoetermeer9.nl/fczoetermeer/statistieken.php&wname=Statistieken]]
but this one won't:
[[wrapper?wurl=http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=Zoetermeer,%20FC&NotationDescription=Mannen%20beker%20reserve%20zondag%20poule&LevelDescription=Groep%207&CompetitionType=B1600&ClassLevel=27&RegionCode=KNVB-DISTRICT-WEST2&Pool=10&TeamDescription&wname=FCZ 9 Uitslagen]]
page not found is the result (in a browser this url works just fine)
I tought your code was the answer to this problem.
and in a certain way it is. i experimented a bit and if i change the deafult page (i had google remember) in to this url : http://www.knvb.nl/c...TeamDescription
the wapper works.... but still all my pages ar this default page.
(check at http://www.zoetermeer9.nl/site)
This post has been edited by clubvibe: 15 August 2005 - 01:13 PM
#41 Guest_clubvibe_*
Posted 15 August 2005 - 08:38 PM
----let me check----
As i tought everything work fine, but i can only use one KNVB site..
this is very weird... if I set the knvb site to the default it loads, but if I set it as a variable it won't work :S
Isn't there any solution?
I figured out why wrapper fails.. in the url: www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=Zoetermeer,%20FC&NotationDescription=Mannen%20beker%20reserve%20zondag%20poule&LevelDescription=Groep%207&CompetitionType=B1600&ClassLevel=27&RegionCode=KNVB-DISTRICT-WEST2&Pool=10&TeamDescription
wrapper tries to read the questionmark (for more variables) isn't there anywhy to get round the questionmark? like a code that ignores the questionmark in the wurl? or only apply to 1 question mark (the first one) in the whole wrapper-request?
This post has been edited by clubvibe: 15 August 2005 - 09:00 PM
#43 Guest_clubvibe_*
Posted 15 August 2005 - 09:16 PM
just for the record, the manual code:
<script language="Javascript">
function blockError(){return true;}
window.onerror = blockError;
</script><iframe align="top" src="http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=Zoetermeer,%20FC&NotationDescription=Mannen%20beker%20reserve%20zondag%20poule&LevelDescription=Groep%207&CompetitionType=B1600&ClassLevel=27&RegionCode=KNVB-DISTRICT-WEST2&Pool=10&TeamDescription" frameborder="no" width="600" height="600" />
This post has been edited by clubvibe: 15 August 2005 - 09:19 PM
#44
Posted 15 August 2005 - 10:42 PM
Since my site is almost finished I'm currently trying to make it XHTML1.1 compliant. I'll all work out, but the Wrapper snippet is a nightmare.
One of the things is dat it doesn't recognize the <iframe > tag nor any of it's attributes src, id etc etc. What's wrong with this code?
If anyone has made the entire snippet XHTML1.1 compliant I'd love to have it.
Regards.
Edit: Never mind, I threw out everything I didn't need, validates now...
This post has been edited by Jelmer: 15 August 2005 - 10:51 PM
#45
Posted 16 August 2005 - 01:46 AM
<object type="text/html" data="pagetobeiframed.htm">Sorry, your browser does not support Object elements. Please use the link above to open it in a separate window</object>

Sign In
Register
Help
MultiQuote