Jump to content


Wrapper


76 replies to this topic

#46 koeniman

    Likes Etomite Forums!

  • Member
  • PipPip
  • 215 posts

Posted 19 August 2005 - 02:51 PM

Hi,

This wrapper snippet works great. The only problem i have is that jou have to set the height, or scrollbars appear (or not but then a part is missing)
Isn't there an other way to include? The onlything (sofar:-) i use it 4 is to include a poll/survey, since there is no snippet available for this.

You can see what i mean on My Webpage


...and Safari for ex. doesn't support iFrames

Greets
Koen

edit: link removed by dean

Edited by Dean, 19 August 2005 - 03:44 PM.


#47 Jelmer

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,173 posts

Posted 19 August 2005 - 03:34 PM

Koen, some people on this forum could be offended by the sort of poll you're showing on your site. I don't think it's a wise choice putting it here...

#48 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 19 August 2005 - 03:44 PM

I agree - link removed.

#49 koeniman

    Likes Etomite Forums!

  • Member
  • PipPip
  • 215 posts

Posted 19 August 2005 - 04:18 PM

Hey guys, prob. right but... it was for testing purposes.

so anyway, made it a bit less r&r and more heu ... (nerdisch? :-)
Here is the url: My Censored Webpage

Now that's seatled: Can anybody help me on this? Inlude diffrently or having wrapper to work without the iFrame (not supported by all browsers incl. Safari)

Greets
Koen

#50 mark301

    Etomite Forum Newbie

  • Member
  • 34 posts

Posted 19 August 2005 - 07:18 PM

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;


#51 elsinga

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 20 August 2005 - 07:03 PM

I use the Wrapper snippet on my site for a gallery, but the gallery (www.fotopic.net) is now injecting Google Ads into the page. This is plain ugly... and I'm currently working on converting that gallery to one on my own site (Coppermine), but that needs time... and I want result now. ;)

So, since the snipped is all PHP, I thought of replacing the googlesyndication.com hostname with a fake one and thus killing the ads. This didn;t work however... because the Wrapper snippet doesn't actually read the wrapped page to output it again but it only puts it in an IFrame.

Is there any way to alter the snippet to replace some text on the wrapped page to something else?

Edited by elsinga, 20 August 2005 - 07:05 PM.


#52 daveatwinterpegca

    Etomite Forum Newbie

  • Member
  • 16 posts

Posted 20 September 2005 - 02:43 AM

this wrapper works great yet creates a transparent border around everything. is there a way to get it to not add the extra space on the top bottom and side?

#53 M-a-d-m-a-n

    Etomite Forum Fan

  • Member
  • Pip
  • 58 posts

Posted 19 October 2005 - 07:30 AM

Hi guys, great work on the Wrapper, it works perfect (well, almost).

But when I want to link to this page: http://www.epitaph.com/toursevents/index.php?bid=56 it stops at the question mark, so I get a Page not Found. I tried using quotes and double quotes, but it doesn't seem to work.

I use this link to the Wrapper: [[Wrapper?wurl=http://www.epitaph.com/toursevents/index.php?bid=56&wname=Tourdates&wframe=0]]

Anyone?

#54 Jelmer

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,173 posts

Posted 19 October 2005 - 07:36 AM

The way the wrapper snippet is currently designed, it's not gonna fly.

You could try making your desired page the default URL inside the wrapper snippet. That should work!

Edit: @#$ typo :)

Edited by Jelmer, 19 October 2005 - 09:45 AM.


#55 M-a-d-m-a-n

    Etomite Forum Fan

  • Member
  • Pip
  • 58 posts

Posted 19 October 2005 - 09:08 AM

I get it.. Okay, thanks!!

#56 fern

    Etomite Forum Fan

  • Member
  • Pip
  • 89 posts

Posted 24 October 2005 - 04:29 PM

Is there a way to Wrapper a page that requires posting input from a form? So, say you've got a Paypal "buy now" or "add to cart" type button, and you'd like their very dull page to show up in your template? Is that possible? Would that make it insecure?

This is the normal code used to call Paypal.
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="$business">
<input type="image" src="https://www.paypal.com/en_US/i/btn/view_cart.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="display" value="1"></form>

could you just make it action="[[Wrapper?https://www.paypal.com/cgi-bin/webscr]]" or something similar?

#57 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 24 October 2005 - 04:50 PM

Is there a reason for not just putting the html code in a chunk?
That's what I did for the 'donate' button on some of the lowermosswood pages.

plus there's a Paypal snippet (that I haven't used) as an example for more complicated requirements - see http://www.etomite.com/index.php?showtopic=2690

Edited by mikef, 24 October 2005 - 04:59 PM.


#58 fern

    Etomite Forum Fan

  • Member
  • Pip
  • 89 posts

Posted 24 October 2005 - 05:21 PM

mikef, on Oct 24 2005, 12:50 PM, said:

Is there a reason for not just putting the html code in a chunk?
That's what I did for the 'donate' button on some of the lowermosswood pages.

plus there's a Paypal snippet (that I haven't used) as an example for more complicated requirements - see http://www.etomite.com/index.php?showtopic=2690

My code is in a chunk, I just edited the business name here. But, the reason I ask is to get the etomite look & feel around the Paypal shopping cart itself. The basic snippet does not do that. From what I can see, it puts the form into etomite (which yes a straight chunk would do), but not the resulting webpage.

I'm asking about wrapping the resulting webpage, not the form itself. Is that possible? While sending all the right variables to the paypal page?

Edited by fern, 24 October 2005 - 05:22 PM.


#59 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 24 October 2005 - 08:59 PM

The wrapper is just an iFrame - it cannot have page-specific variables in the call - you would need to wrap the paypal cart from the beginning... to the end

#60 jaredc

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,193 posts

Posted 25 October 2005 - 12:44 PM

One thing to be careful about however, is that most browsers will throw warnings if a secure page is encapsulated in a non-secure page (via frame, iframe etc.). This is a good thing really as it keeps pages with invisible frames from stealing your personal info. So results may vary.

I too am about to embark on a PayPal journey (if my client bites and signs the contract...). I'm looking for a solution to this too and think it will probably involve some long nights and creative solutions... and more custom snippetry.

#61 daveatwinterpegca

    Etomite Forum Newbie

  • Member
  • 16 posts

Posted 24 January 2006 - 10:01 PM

This is an excellent Snippet, however I have some issues with the auto resizing where it creates horizontal bars even though I do not want any - I'm a bit confused on how they seem to be appearing.

I would like to wrap a page with this snippet however am having an issue as the url I am using is a dynamically created URL that looks like this: http://www.site.com/day.php?day=January/24/2006 - and would change based on the servers day. How would I be able to wrap a page that uses this date addition?

Thank you

#62 lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 605 posts
  • Gender:Male

Posted 07 February 2006 - 08:30 PM

G'day,

You could use the DateTimePlus snippet to generate such a date format, or modify the format string in the DateTime snippet.

A date format string of "%F/%d/%Y" should do it.

Best Regards, Lloyd.

#63 daveatwinterpegca

    Etomite Forum Newbie

  • Member
  • 16 posts

Posted 07 February 2006 - 08:35 PM

lloyd_borrett, on Feb 7 2006, 03:30 PM, said:

G'day,

You could use the DateTimePlus snippet to generate such a date format, or modify the format string in the DateTime snippet.

A date format string of "%F/%d/%Y" should do it.

Best Regards, Lloyd.

I'm still not sure I understand - I'm not sure how I would be able to append the date/time to the end of the url I am looking to wrap ie:

[[wrapper?wurl=http://wrapped.com]][[DateTime info here?]]

Sorry for not being clear enough.

#64 lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 605 posts
  • Gender:Male

Posted 07 February 2006 - 09:04 PM

G'day,

Sorry, I haven't actually used the Wrapper snippet, so I don't know how it works.

I guess you could write a snippet that gets the correct date and passes it to the Wrapper snippet.

Or produce a customised version of the Wrapper snippet adding in the code you need. Something like this:

// get the Etomite server offset time in seconds
$server_offset_time = $etomite->config['server_offset_time'];
if (!$server_offset_time) {
  $server_offset_time = 0;
}

$timestamp = time() + $server_offset_time;

$dayURL = strftime("%F/%d/%Y", $timestamp);

And then pass that $dayURL value into where the Wrapper snippet gets its passed varaiables and thus make the url you need the default value for wurl.

Alternatively, if Etomite permits, and I'm not sure it does, you might try something like this in your template/content:

[!Wrapper?wurl=http://www.site.com/day.php?day=[!DateTimePlus?format=F/d/Y!]!]

Though I suspect that even if something like that were possible, you would probably still need to escape those extra ? characters in some way.

Have a play. Or maybe someone else will drop by with a nailed solution for you.

Best Regards, Lloyd.

#65 daveatwinterpegca

    Etomite Forum Newbie

  • Member
  • 16 posts

Posted 22 February 2006 - 05:32 PM

I still couldn't figure it out. I'm stumped. Wish I knew PHP.

Thanks for the attept..

lloyd_borrett, on Feb 7 2006, 04:04 PM, said:

G'day,

Sorry, I haven't actually used the Wrapper snippet, so I don't know how it works.

I guess you could write a snippet that gets the correct date and passes it to the Wrapper snippet.

Or produce a customised version of the Wrapper snippet adding in the code you need. Something like this:

// get the Etomite server offset time in seconds
$server_offset_time = $etomite->config['server_offset_time'];
if (!$server_offset_time) {
  $server_offset_time = 0;
}

$timestamp = time() + $server_offset_time;

$dayURL = strftime("%F/%d/%Y", $timestamp);

And then pass that $dayURL value into where the Wrapper snippet gets its passed varaiables and thus make the url you need the default value for wurl.

Alternatively, if Etomite permits, and I'm not sure it does, you might try something like this in your template/content:

[!Wrapper?wurl=http://www.site.com/day.php?day=[!DateTimePlus?format=F/d/Y!]!]

Though I suspect that even if something like that were possible, you would probably still need to escape those extra ? characters in some way.

Have a play. Or maybe someone else will drop by with a nailed solution for you.

Best Regards, Lloyd.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users