Jump to content


Wrapper


76 replies to this topic

#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.


#66 smartie

    Etomite Forum Newbie

  • Member
  • 11 posts

Posted 23 May 2007 - 11:00 AM

I had searched two days long for a solution, tried ShowDoc and GrabPage.

My problem: Wrap a PHP Guestbook into Etomite. (http://www.dasepp.de/php2.htm)

I used wrapper before with the Molio-Template without left or right menues or other stuff. But now, the guestbook should include in a template with ListMenu left. But the guestbook was always on top of the page (under the header) and the menue was under the guestbook. Any changes in the code of the guestbook aren't working.

Because I'm too stupid (no php skills) to include GrabPage in the guestbook, I give the wrapper a last chance. In the final webpage code I saw a non-closed div container. I found this in the code of the snippet-code.

old
...
$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;

new:
...
$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>";

// need to show name?
if ($wshowname == "1") {
  $wrapped .= $wname;
}
$wrapped .= "<br>";
// need to show link?
if ($wlink == "1") {
  $wrapped .= "<div align='center'>";
  $wrapped .= "<a href='".$wurl."' target='_blank'>[".$wwtext."]</a></div>";
}
return $wrapped;

I think, this is useful for people with the same problem.

#67 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 23 May 2007 - 01:21 PM

@smartie

Your fix definitely addresses several potential issues which could arise through the use of the original code... Thanks for the patch... I'm sure members will find this information helpful...

#68 austrohack

    Etomite Forum Newbie

  • Member
  • 28 posts

Posted 09 January 2009 - 09:02 AM

Hi! I've a problem with that snippet:

The auto-resize works perfect when i call the Snippet with an page, that lies on the same server, but when i call it with an external link, the auto-resize doesn't work. It only shows me a window with the height of about 50px.

Link to the version with internal link: http://www.gesund-sc...co.at/shop.html

Link to version with external link: http://metatron-kristallhaus.de.server662-...m/produkte.html

For testing i used the same Template, exactly same Snippet-Code and same CSS.

Can anybody help me?

Edited by austrohack, 09 January 2009 - 10:04 AM.


#69 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 09 January 2009 - 01:51 PM

View Postaustrohack, on Jan 9 2009, 04:02 AM, said:

Can anybody help me?

Looks like the cart code is using echo which would explain why that code is displaying above the Etomite rendered page...

#70 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 09 January 2009 - 11:51 PM

I've just read this thread from start to finish and wanted to clear up the use of the questiojn mark "?" in urls being passed in the snippet call.

When a snippet call contains a "?", etomite reads it as the start of snippet parameters being passed to the snippet code. 2 instances of a "?" and the second is ignored [best guess].

To pass a url with additional '?', use the html entity "& # 6 3 ; ", (no spaces)
or you can use key-value pairs to pass additional url parameters and re-compile them within the snippet
example:
[wrapper?wurl=http://mysite.com& # 6 3;&one=1234&two=abcd]

In the snippet, these variables can be re-compiled by appending the variables to the passed url:
$wurl=isset($wurl) ? $wurl : "no url set";//collect the url from the snippet call

$wurl=$wurl.'var1='.$one.'&amp;var2='.$two;//build the valiable names and snippet call values into a string
which would be parsed as
http://mysite.com?va...=1234&var2=abcd

This would allow you to set diffent values for 'var1' and 'var2' for different snippet calls.

[Edited to get html characters to show.]

Edited by Cris D., 09 January 2009 - 11:56 PM.


#71 austrohack

    Etomite Forum Newbie

  • Member
  • 28 posts

Posted 12 January 2009 - 08:34 AM

View PostRalph, on Jan 9 2009, 02:51 PM, said:

Looks like the cart code is using echo which would explain why that code is displaying above the Etomite rendered page...

I've also tried to use another normal html-page instead of the shop. It's the same: External pages doesn't scale right, internal pages uses autoscale correctly.

I don't know why.... :huh:

#72 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 12 January 2009 - 01:47 PM

View Postaustrohack, on Jan 12 2009, 03:34 AM, said:

I've also tried to use another normal html-page instead of the shop. It's the same: External pages doesn't scale right, internal pages uses autoscale correctly.

I don't know why.... :huh:

I think I recall seeing this a couple years ago... Don't recall the culprit but for some reason the possibility of styling conflicts comes to mind due to the way Etomite works...

#73 Daedhel

    Etomite Forum Newbie

  • Member
  • 7 posts

Posted 24 February 2009 - 06:29 PM

Hi guys!

I want to call the Wrapper snippet to display another php page: http://www.mywebsite...enpage.php?i=58

and here is the snippet call:

[[wrapper?wurl=http://www.wrapped-website.com']]

the problem is, if I wrap the php page, i will get an error :

[[wrapper?wurl=http://www.mywebsite.com/chosenpage.php?i=58]]

because the question second mark is conflicting with the snippet.

I have tried to "quote" the wrapped url with " " an ' ' characters, but it din't work. I don't know php programming language, i'm not a programmer.

What should I do?

Thanks,
Daedhel

#74 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 24 February 2009 - 07:56 PM

IIRC, this is a known bug with the wrapper snippet...

#75 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 24 February 2009 - 08:32 PM

Have you tried the html character resolution from the post above?

#76 Daedhel

    Etomite Forum Newbie

  • Member
  • 7 posts

Posted 24 February 2009 - 09:08 PM

View PostCris D., on Feb 24 2009, 08:32 PM, said:

Have you tried the html character resolution from the post above?


This is great. Anonther resolved case of RTFM i guess, ;)

Thanks guys, sorry for posting in wrong section.

Daedhel

#77 LePrince

    Etomite Forum Fan

  • Member
  • Pip
  • 115 posts

Posted 21 August 2011 - 05:43 AM

Hi community, long time no see, but i'm still an eto-fan.
The link for the wrapper-snippet seems to lead nowhere. Is it not recommended anymore?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users