Wrapper
#61
Posted 24 January 2006 - 10:01 PM
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
Posted 07 February 2006 - 08:30 PM
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
Posted 07 February 2006 - 08:35 PM
lloyd_borrett, on Feb 7 2006, 03:30 PM, said:
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
Posted 07 February 2006 - 09:04 PM
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
Posted 22 February 2006 - 05:32 PM
Thanks for the attept..
lloyd_borrett, on Feb 7 2006, 04:04 PM, said:
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
Posted 23 May 2007 - 11:00 AM
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
Posted 23 May 2007 - 01:21 PM
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
Posted 09 January 2009 - 09:02 AM
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.
#70
Posted 09 January 2009 - 11:51 PM
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.'&var2='.$two;//build the valiable names and snippet call values into a stringwhich 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
Posted 12 January 2009 - 08:34 AM
Ralph, on Jan 9 2009, 02:51 PM, 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....
#72
Posted 12 January 2009 - 01:47 PM
austrohack, on Jan 12 2009, 03:34 AM, said:
I don't know why....
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
Posted 24 February 2009 - 06:29 PM
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
Posted 24 February 2009 - 07:56 PM
#75
Posted 24 February 2009 - 08:32 PM
#76
Posted 24 February 2009 - 09:08 PM
Cris D., on Feb 24 2009, 08:32 PM, said:
This is great. Anonther resolved case of RTFM i guess,
Thanks guys, sorry for posting in wrong section.
Daedhel
#77
Posted 21 August 2011 - 05:43 AM
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











