Wrapper
#16
Posted 04 November 2004 - 08:57 PM
[This is an automatically created message]
#17
Posted 07 November 2004 - 10:50 PM
# 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 = "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 = "1"; // show 1, hide 0 iframe borders
# $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 = "<b>Etomite</b>";
$dshowname = "1";
$dwidth = "100%";
$dheight = "600";
$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($wauto)) {$wauto = $dauto; }
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 = 'onload="javascript:iFrameHeight()" ';
$wrapped .= '<script type="text/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 type="text/javascript">';
$wrapped .= "function blockError(){return true;}";
$wrapped .= "window.onerror = blockError;";
$wrapped .= "</script>";
$wrapped .= '<iframe id="blockrandom" ';
$wrapped .= ''.$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>';
}
$wrapped .= "</div>";
return $wrapped;
#18
Posted 15 November 2004 - 05:26 AM
#19
Posted 15 November 2004 - 05:32 AM
Is there something else that needs to be configured before it will wrap the external content? I am using the snippet 'straight out of the box' so to speak. I'm using version 6 final on Apache. and am getting the same output on both firefox 0.8 and IE 5.?
here is the code inserted into the page
Quote
and here is the link to the page in question
http://66.197.162.85/~entwoodn/index.php?id=69
#20
Posted 15 November 2004 - 10:04 PM
justme, on Nov 15 2004, 07:26 AM, said:
Check your snippet name
Make sure lcase and ucase matches
#21
Posted 15 November 2004 - 11:21 PM
pcwacht, on Nov 15 2004, 05:04 PM, said:
Make sure lcase and ucase matches
Don't I just hate/love when it's something so simple. Kinda like 'check the plug'.
thanx a lot.
#22
Posted 16 November 2004 - 08:51 PM
[ [Wrapper?url=www.speedstreet.org/forums/showthread.php?id=369] ]
Then it kicks me out to the main page. Am I to assume that it is because it refuses to parse anything beyond the question mark?
Is there a workaround?
#23
Posted 16 November 2004 - 11:41 PM
Quote
#24
Posted 17 November 2004 - 06:21 PM
Will give
url = www.speedstreet.org/forums/showthread.php
AND
id = 369
as variables to the snippet
while you need to pass the whole string
www.speedstreet.org/forums/showthread.php?id=369
to the variable url to the snippet
Maybe it works when you try
Wrapper?url='www.speedstreet.org/forums/showthread.php?id=369'
or simular
Wrapper?url="www.speedstreet.org/forums/showthread.php?id=369"
Dunnoh.
Good luck
John
#25
Posted 21 June 2005 - 03:21 PM
this is a really nice snippet and it works pretty well. My question: I use the wrapper to integrate links from my account at http://www.spurl.net/. Now I would like to open the link in a new browser window/tab. For now, I made a copy of my template with basetarget-blank in the head, but that would apply to the navigation, too...
Any ideas?
#26
Posted 11 August 2005 - 12:39 AM
Unfortunately, you must create a new page with the code:
[[Wrapper?wurl=...]] on it for EACH separate page you want pulled in.
What I'd like to do is have the content wrapped on the fly so when I click the link, it pulls the content into the iframe & presents it as a new page:
<a href="[[Wrapper...]]]">
In other words, return a url to the just-wrapped page without me having to create that url beforehand.
What if you have a page containing: [[Wrapper?wurl=<?php echo $myurl;?>]], and update $myurl from another snippet?
Any ideas on how to make this work?
#27
Posted 11 August 2005 - 11:04 PM
OK wait, no you can't use the php open tags and echo.
http://www.etomite.com/wiki/EtomiteDocumen...ets/Usage?v=7g6
You can have snippets call other snippets. you just send the snippet call in the output.
//do some stuff here $html = "[[Wrapper?wurl=" . $myurl . "]]"; return $html;
Edited by mrruben5, 11 August 2005 - 11:10 PM.
#28
Posted 11 August 2005 - 11:08 PM
Quote
I feel really dumb
#29
Posted 11 August 2005 - 11:12 PM
Look up
Edited by mrruben5, 11 August 2005 - 11:12 PM.
#30
Posted 11 August 2005 - 11:40 PM
See my fancy scripts here: <a href=[[Wrapit?myurl=assets/portfolio/QuestionnaireServlet.html]]>My Scripts</a>Where QuestionnaireServlet.html is a plain old html page containing the stuff I want wrapped.
The Wrapit snippet looks as you recommended:
//do some stuff here $html = "[[Wrapper?wurl=" . $myurl . "]]"; return $html;
This gets me a link containing:
http://mysite.com/%3Cscript%20language=.../a%3E%3C/div%3E
[the contents of the Wrapper snippet]. Of course, this link doesn't work (Bad request).
I think I'm missing a concept here somewhere...
Edited by mark301, 11 August 2005 - 11:48 PM.
#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
#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.com/wrapper.html?wurl=...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...
Edited by Jelmer, 12 August 2005 - 05:37 PM.
#34
Posted 12 August 2005 - 06:45 PM
Jelmer, I thank you...
...I think
#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/clubs_comp/?action=team...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?
Edited by clubvibe, 15 August 2005 - 12:21 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users










