Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2012, 11:02:01 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155448 Posts in 21704 Topics by 7731 Members
Latest Member: zvaigzdzius
* Home Help Search Login Register
Pages: [1] 2 3 4   Go Down
Print
Author Topic: New Wrapper Hack!  (Read 18111 times)
federico

Offline Offline

Posts: 3


« on: July 08, 2005, 05:49:57 PM »

I hacked the Wrapper to fit automatically the height od the wrapped page. I test it on IE and it works fine both on height and width. I use it to include Phorum in my WebsiteBaker , but i tried successfully Phpbb and EasyForum2.5
Please test it in another browser and let me know. Bye. federico Pitto
http://federicopitto.fe.funpic.org/download/wrapper.htm


edit:
I'm starting my site using the Simple template. Content table of this template don't have any predefined width so it can stretch freely. I'm new to website baker but I'e realised that not all the templates have this setting.....
Look at theese screens.

« Last Edit: August 04, 2005, 09:57:05 PM by federico » Logged
fienieg
Guest
« Reply #1 on: July 08, 2005, 06:24:47 PM »

Can we see it in action some were Huh
Logged
Godsbassman

Offline Offline

Posts: 17


« Reply #2 on: July 08, 2005, 10:52:16 PM »

Screenshots are too small. Could you please post larger ones?
Logged

If we build it, He will come ...
federico

Offline Offline

Posts: 3


« Reply #3 on: July 08, 2005, 11:55:37 PM »

resized the screens. However there is really few things to see. The content frame automatically fit the eheight of the wrapped page. As i said i don't know if it works out of Explorer. Let me know.
The Simple template works fine. Winter is terrific, as you could expect. however his is something...
My site isn't ready, no demo.
QUICK INSTALL
Backup your view.php in modules/wrapper folder and change it with the one in my hacked archive. really i changed only that file...
Logged
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #4 on: July 25, 2005, 02:19:05 PM »

Works like a charm on IE6, it stretches nicely along with the script. On FireFox it doesn't do anything, but it doesn't mess up things either, so that's allright. I am working on a client site, and use a non-WSB gallery script in a wrapper, and you can see that it works: http://www.rondvaartijmuiden.nl/cms/pages/fotogalerij.php

Cool, very welcome hack! If you can get it to work on FF it would be more than cool smiley
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #5 on: August 01, 2005, 04:38:17 PM »

Damn! I fooled around with the files and now the wrapper hack doesn't work anymore, and I didn't keep a copy. Stupid... I have to have the modified view.php again, but the link above doesn't work anymore? Can someone offer the file again? It's a very cool hack smiley
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
federico

Offline Offline

Posts: 3


« Reply #6 on: August 04, 2005, 09:57:41 PM »

 :?now the link should work again! smiley
Logged
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #7 on: August 04, 2005, 10:45:16 PM »

Thank you!!!  grin
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #8 on: August 11, 2005, 02:12:33 PM »

Today I noticed that with the hacked wrapper module it's impossible to have more than 1 wrapper on the same page. It only shows the first one on the published page, and there is a script error. With the original wrapper it's no problem. Would it be possible to modify the wrapper hack to show more than one wrapper on the same page?
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
valerie

Offline Offline

Posts: 156


WWW
« Reply #9 on: August 13, 2005, 04:23:36 AM »

Any ideas on getting it to work in Firefox would also be greatly appreciated. This is a great hack.
Logged

http://www.robcomm.net
--editing and proofreading for American English
--print and web publication management
--graphic and web design, including original photography
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #10 on: January 08, 2006, 11:05:36 PM »

Any ideas on getting it to work in Firefox would also be greatly appreciated. This is a great hack.

I found a ready to use cross browser solution here: http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm

I slightly modified it for WB use, but left the Dynamic Code copyright stuff in.

Just change the code in the standard view.php in the wrapper module for the code listed here (WB 2.6, but probably in all versions the same):

Code:
<?php

// $Id: view.php 106 2005-09-15 19:15:43Z stefan $

/*

 WebsiteBaker Project <http://www.websitebaker.org/>
 Copyright (C) 2004-2005, Ryan Djurovich

 WebsiteBaker is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 WebsiteBaker is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with websitebaker; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/

// Get url
$get_settings $database->query("SELECT url,height FROM ".TABLE_PREFIX."mod_wrapper WHERE section_id = '$section_id'");
$fetch_settings $get_settings->fetchRow();
$url = ($fetch_settings['url']);

?>

<script type="text/javascript">

/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["content"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 40 : 0 //increase number "40" to increase height in px to add to iframe in FireFox 1.0+ browsers, to get rid of the scrollbars that might appear

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

</script>
<iframe id="content" src="<?php echo $url?>" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none>
Your browser does not support iframes. Click the link below to open the page that should have been visible here.<br />
<a href="<?php echo $url?>" target="_blank"><?php echo $url?></a>
</iframe>
« Last Edit: January 08, 2006, 11:07:59 PM by Argos » Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
valerie

Offline Offline

Posts: 156


WWW
« Reply #11 on: January 21, 2006, 06:27:11 AM »

Wow--so far this works fantastic! I've also used the dynamic drive ajax wrapper...http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm but this seems to really do the trick.  Thanks so much!!!  grin
Logged

http://www.robcomm.net
--editing and proofreading for American English
--print and web publication management
--graphic and web design, including original photography
oneross

Offline Offline

Posts: 1


« Reply #12 on: June 01, 2006, 04:13:08 PM »

Hello all.  I discovered WebsiteBaker about a week ago and am already in the process of transferring all my sites over (I had been using a heavily modified version of pmWiki, which I still love, but it's over the heads of most of my clients).

I'm trying to play with this hack to get a quick solution up (in the long run I'll probably use the non-iframe solution, but this too has it's place).  I'm still a javascript newbie and could use some help disecting the issue I'm having.

I got the following from FireBug (which if you haven't discovered yet I highly recommend; http://www.joehewitt.com/software/firebug/):

[small][Exception... "'Permission denied to get property HTMLDocument.body' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THR EW_STRING)" location: "<unknown>" data: no][/small]

I'm using FF 1.5.0.3.  Thanks.
Logged
Melekimalakaka

Offline Offline

Posts: 12



« Reply #13 on: June 02, 2006, 05:19:27 PM »

I'm using Opera 9 Beta & IExplorer.

On IExplorer works perfect, no problem, but with Opera doesn't work, it make the iframe very very very small.
Logged
virgil

Offline Offline

Posts: 177



« Reply #14 on: June 04, 2006, 08:58:43 AM »

Hi to all

I tried to use the new wrapper hack...
what I got ist just a iframe of maybe the right height but
the captured site was also cut horizontally somewhere after
some 100-150px, the rest belo was blank... huh

Mostprobably I do something wrong... but what?... huh



I have a couple of items:


1.) the link to federico's download is broken, so I used the one Argos posted

2.) In Argos script stays

Quote
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:

do I have to put something somewhere in to have it working?



3.) I found here:  http://guymal.com/mycode/100_percent_iframe/   the following:

Quote

QUESTION

Source CodeIframe with 100% Height

Ever wonder how to create an iframe that fills the entire height (and width) of a page?
You probably tried writing something like:
<iframe width=100% height=100%></iframe>
and expected the iframe to fill up whatever it could.
The width=100% does what you expected and fills up the entire width of the page,
but the height just stays about 200px


ANSWER
Here's some easy JavaScript to do exactly this:


Put this in the head of your page:
Code:
<script language="JavaScript">
<!--
function resize_iframe()
{
  //resize the iframe according to the size of the
  //window (all these should be on the same line)
  document.getElementById("glu").height=
document.body.offsetHeight-
document.getElementById("glu").offsetTop-26;
}

// this will resize the iframe every
// time you change the size of the window.
window.onresize=resize_iframe;

//Instead of using this you can use:
// <BODY onresize="resize_iframe()">


//-->
</script>

And inside your page's body create the iframe tag:

Code:
<iframe id='glu' width=100% onload='resize_iframe()'>
</iframe>

As the demo worked vertically and horizontally like a charm,
I wonder if somebody of you code cracks could modify to fit in WB... rolleyes

4.) How can I, using the ORIGINAL wrapper module, tell the system
I want to use an iframe with height=100% ?(of course of the parent)

As I use a template with tables...(yes... I know! rolleyes) with the content's
cell height set to 100% this could be a possible workaround for me undecided

...When I put in 100% the system returns to 400px huh

THX for your answers
Cheers
Virgil
Quote
Logged

Virgil - the pre-baked-stuff baker -   wink)
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #15 on: June 04, 2006, 02:31:03 PM »

The script I posted should be copied completely and unaltered as view.php, that's all. Don't mess around with it to try to get it working if it is not workign now, because the script is 100% correct and I use it on all my WB-sites. If you have problems, the cause must be something else. Can you show us the URL of your site with he faulty wrapper page?
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
virgil

Offline Offline

Posts: 177



« Reply #16 on: June 05, 2006, 07:53:39 AM »

@Argos


Quote
The script I posted should be copied completely and unaltered as view.php, that's all. Don't mess around with it...

I just renamed your file to view.php and replaced the original one of the wrapper module... that's all.

Quote
Can you show us the URL of your site with he faulty wrapper page?

Here we go...   
http://www.schueler-club.ch/pages/wrapper-hack-argos.php


The wrapped site is the one of the forum... but it does the same to every other page.
The result is both wrong but different in IE and FF... look at it, please. undecided


I also played around with other templates (simple, round)...
with the same results!   sad


Greatful for Help
Cheers
Virgil

« Last Edit: June 05, 2006, 08:45:51 PM by virgil » Logged

Virgil - the pre-baked-stuff baker -   wink)
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #17 on: June 06, 2006, 01:37:50 PM »

I noticed your iframe has id "content", but it is placed within a TD with class "content" as well. Maybe that's the problem. Try renaming the TD or the iframe.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
virgil

Offline Offline

Posts: 177



« Reply #18 on: June 06, 2006, 02:23:03 PM »

...Try renaming the TD or the iframe.

I did (rename the TD) it dindn't help...
don't know where to rename the iframe...but, as I told you
Quote
I also played around with other templates (simple, round)...
with the same results!


and now I also tried Matthia's all_css-template here:
http://www.schueler-club.ch/pages/wrapper-hack-argos-2.php
...with the same result.

Any other ideas?

Cheers
Virgil
Logged

Virgil - the pre-baked-stuff baker -   wink)
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #19 on: June 06, 2006, 03:18:51 PM »

Maybe it's not possible to include a forum this way? Did you try it with another site to see how it looks?
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
virgil

Offline Offline

Posts: 177



« Reply #20 on: June 06, 2006, 03:40:27 PM »

Maybe it's not possible to include a forum this way? Did you try it with another site to see how it looks?

Yes I did... it looks completly the same! See here again:
http://www.schueler-club.ch/pages/wrapper-hack-argos-2.php

this is a absolutely dummy html page without any dynamich content or fancy stuff...

More ideas?
Cheers
Virgil
Logged

Virgil - the pre-baked-stuff baker -   wink)
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #21 on: June 06, 2006, 04:11:44 PM »

I noticed the pages with the iframe have a javascript error... Maybe try to deinstall the wrapper module and reinstal again, using the edited view.php to replace the standard file in the zip file.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
virgil

Offline Offline

Posts: 177



« Reply #22 on: June 06, 2006, 04:51:52 PM »

Quote
Maybe try to deinstall the wrapper module and reinstal again, using the edited view.php to replace the standard file in the zip file.

Sorry... no way!!!  angry

But... I DID IT !!!!  grin ... at least for MY purpose  wink

my former posting:
http://forum.websitebaker.org/index.php/topic,1166.msg21372.html#msg21372

Quote
... 4.) How can I, using the ORIGINAL wrapper module, tell the system
I want to use an iframe with height=100% ?(of course of the parent)

As I use a template with tables...(yes... I know! ) with the content's
cell height set to 100% this could be a possible workaround for me ...

just this way:

*******************************************************
<?php

[...]

// Get url
$get_settings = $database->query("SELECT url,height FROM ".TABLE_PREFIX."mod_wrapper WHERE section_id = '$section_id'");
$fetch_settings = $get_settings->fetchRow();
$url = ($fetch_settings['url']);

?>
<iframe src="<?php echo $url; ?>" width="100%" height="100%" frameborder="0" scrolling="auto">
Your browser does not support inline frames.<br />
Click on the link below to visit the website that was meant to be shown here...<br />
<a href="<?php echo $url; ?>" target="_blank"><?php echo $url; ?></a>
</iframe>
*******************************************************

Here the (temporary) result:
http://www.schueler-club.ch/pages/next-wrapper-hack-page.php


This might be of helb to others...  grin

Cheers
Virgil
Logged

Virgil - the pre-baked-stuff baker -   wink)
virgil

Offline Offline

Posts: 177



« Reply #23 on: June 07, 2006, 02:27:35 PM »

Hello all

despite having found a workaround for my problem,
I'm not quite happy with the limitations involved... undecided

how can I alter the original wrapper module so I can
enter the height of the desired iframe in both either
px or % ? ... huh

This would give much more flexibelity  wink

Thank you.

Cheers
Virgil
Logged

Virgil - the pre-baked-stuff baker -   wink)
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #24 on: June 07, 2006, 02:30:18 PM »

how can I alter the original wrapper module so I can
enter the height of the desired iframe in both either
px or % ? ... huh

That is already a function you can use in the admin interface... There is a field to enter the desired height smiley
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Pages: [1] 2 3 4   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!