...

View Full Version : A phpbb forum in a Iframe (HELP)



jeffreybouva
01-09-2008, 07:04 PM
Hello guys!
i want to put a phpbb forum (cwalk.nl) to see what i mean.
I want to load this forum in to a i frame (www.cwalk.nl/forum2/cwalknl/forum/)

as you can see , that doesn't work.
i tried to say the height is about 4000 * then the forum will fitt perfect BUT
if you go all the way down and click on a link and you get a page that's shorter you got a problem.
because your screen won't go up , so you will see a black page and you have to scroll up to see the forum.

and that doens't work verry well.

so pleaze help me.

how can i make sure it always fit's




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Naamloos document</title>
<style type="text/css">
<!--
body {
background-color: #161616;
}
-->
</style></head>
</head>
<body>
<table width="1024" height="68" border="0" cellpadding="0" cellspacing="0" id="Table_01">
<tr>
<td><a href="http://www.cwalk.nl/"
onmouseover="image1.src='images/mousover_01.gif';"
onmouseout="image1.src='images/index_01.gif';"> <img src="images/index_01.gif" alt="portal" name="image1" width="107" height="68" border="0" id="image1" /></a></td>
<td><a href="http://www.cwalk.nl/forum"
onmouseover="image2.src='images/mousover_02.gif';"
onmouseout="image2.src='images/index_02.gif';"><img src="images/index_02.gif" alt="forum" name="image2" width="87" height="68" border="0" id="image2" /></a></td>
<td><a href="http://www.cwalk.nl/koth"
onmouseover="image3.src='images/mousover_03.gif';"
onmouseout="image3.src='images/index_03.gif';"> <img src="images/index_03.gif" alt="koth" name="image3" width="72" height="68" border="0" id="image3" /></a></td>
<td><a href="http://www.cwalk.nl/tv"
onmouseover="image4.src='images/mousover_04.gif';"
onmouseout="image4.src='images/index_04.gif';"><img src="images/index_04.gif" alt="tv" name="image4" width="48" height="68" border="0" id="image4" /></a></td>
<td><img src="images/index_05.gif" alt="balk" width="710" height="68" align="baseline" /></td>
</tr>
</table>
<iframe src="http://www.cwalk.nl/forum/index.php" frameborder="0" scrolling="no" width="100&#37;" style="height: 100%" ></iframe>
</body>
</html>

_Aerospace_Eng_
01-09-2008, 07:33 PM
As long as the forum is hosted on the same server as the page with the iframe then you can use javascript.

http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm

jeffreybouva
01-10-2008, 10:18 PM
i did what the script said but it still doesn't work
see
www.cwalk.nl/forum2/cwalknl/forum/
more help needed !

_Aerospace_Eng_
01-11-2008, 12:46 AM
You didn't use the script I pointed you to.

jeffreybouva
01-11-2008, 12:51 AM
yes i did.
I copyed the script into my head
and i took the iframe of the example

See this is my script now !


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Naamloos document</title>
<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=["myframe"]

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

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

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>
<style type="text/css">
<!--
body {
background-color: #161616;
}
-->
</style></head>
</head>
<body>
<table width="1024" height="68" border="0" cellpadding="0" cellspacing="0" id="Table_01">
<tr>
<td><a href="http://www.cwalk.nl/"
onmouseover="image1.src='images/mousover_01.gif';"
onmouseout="image1.src='images/index_01.gif';"> <img src="images/index_01.gif" alt="portal" name="image1" width="107" height="68" border="0" id="image1" /></a></td>
<td><a href="http://www.cwalk.nl/forum"
onmouseover="image2.src='images/mousover_02.gif';"
onmouseout="image2.src='images/index_02.gif';"><img src="images/index_02.gif" alt="forum" name="image2" width="87" height="68" border="0" id="image2" /></a></td>
<td><a href="http://www.cwalk.nl/koth"
onmouseover="image3.src='images/mousover_03.gif';"
onmouseout="image3.src='images/index_03.gif';"> <img src="images/index_03.gif" alt="koth" name="image3" width="72" height="68" border="0" id="image3" /></a></td>
<td><a href="http://www.cwalk.nl/tv"
onmouseover="image4.src='images/mousover_04.gif';"
onmouseout="image4.src='images/index_04.gif';"><img src="images/index_04.gif" alt="tv" name="image4" width="48" height="68" border="0" id="image4" /></a></td>
<td><img src="images/index_05.gif" alt="balk" width="710" height="68" align="baseline" /></td>
</tr>
</table>
<iframe id="myframe" src="http://www.cwalk.nl/forum/index.php" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>
</body>
</html>

_Aerospace_Eng_
01-11-2008, 01:14 AM
Please update your previous code with your new code on the server.

jeffreybouva
01-13-2008, 04:35 PM
how do you mean ?

i did

_Aerospace_Eng_
01-13-2008, 06:51 PM
This is what you have on your site now

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Naamloos document</title>
<style type="text/css">
<!--
body {
background-color: #161616;
}
-->
</style></head>
<script type="text/javascript">
/*************************************************************************
This code is from Dynamic Web Coding at http://www.dyn-web.com/
See Terms of Use at http://www.dyn-web.com/bus/terms.html
regarding conditions under which you may use this code.
This notice must be retained in the code as is!
*************************************************************************/

function getDocHeight(doc) {
var docHt = 0, sh, oh;
if (doc.height) docHt = doc.height;
else if (doc.body) {
if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
if (sh && oh) docHt = Math.max(sh, oh);
}
return docHt;
}

function setIframeHeight(iframeName) {
var iframeWin = window.frames[iframeName];
var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
if ( iframeEl && iframeWin ) {
iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous
var docHt = getDocHeight(iframeWin.document);
// need to add to height to be sure it will all show
if (docHt) iframeEl.style.height = docHt + 30 + "px";
}
}

function loadIframe(iframeName, url) {
if ( window.frames[iframeName] ) {
window.frames[iframeName].location = url;
return false;
}
else return true;
}
</script>
</head>
<body>
<table width="1024" height="68" border="0" cellpadding="0" cellspacing="0" id="Table_01">
<tr>
<td><a href="http://www.cwalk.nl/"
onmouseover="image1.src='images/mousover_01.gif';"
onmouseout="image1.src='images/index_01.gif';"> <img src="images/index_01.gif" alt="portal" name="image1" width="107" height="68" border="0" id="image1" /></a></td>

<td><a href="http://www.cwalk.nl/forum"
onmouseover="image2.src='images/mousover_02.gif';"
onmouseout="image2.src='images/index_02.gif';"><img src="images/index_02.gif" alt="forum" name="image2" width="87" height="68" border="0" id="image2" /></a></td>
<td><a href="http://www.cwalk.nl/koth"
onmouseover="image3.src='images/mousover_03.gif';"
onmouseout="image3.src='images/index_03.gif';"> <img src="images/index_03.gif" alt="koth" name="image3" width="72" height="68" border="0" id="image3" /></a></td>
<td><a href="http://www.cwalk.nl/tv"
onmouseover="image4.src='images/mousover_04.gif';"
onmouseout="image4.src='images/index_04.gif';"><img src="images/index_04.gif" alt="tv" name="image4" width="48" height="68" border="0" id="image4" /></a></td>
<td><img src="images/index_05.gif" alt="balk" width="710" height="68" align="baseline" /></td>
</tr>
</table>
<iframe src="http://www.cwalk.nl/forum/index.php" frameborder="0" scrolling="no" width="100&#37;" style="height: 100%" ></iframe>
</body>
</html>

Its not the code you just posted.

jeffreybouva
01-13-2008, 08:32 PM
OMG sorry your right .
and it works . thank you very much !!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum