After not being able to find the answer to my question in any of the Coppermine/iFrame threads Iââ,¬â,,¢ve started this new threadââ,¬Â¦ if the answer has already been posted could someone point me? Thanks.
The two code snippets at links below by G6 and Thurnok work great and I have both in use. What Iââ,¬â,,¢m wanting to do now is combine both together so that the resizing feature in G6ââ,¬â,,¢s code will work in the Custom Page code by Thurnok.
The trouble is that one is PHP and the other is HTML and Iââ,¬â,,¢m not making any progress trying to blend the two together.
Thanks for any helpââ,¬Â¦ Ken
cpg code by G6 (http://www.tinyportal.net/index.php?topic=11744.0)
Thurnokââ,¬â,,¢s Custom Page (http://tpblocks.ccs-net.com/index.php?page=10)
<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="yes"
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)
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids] : document.getElementById(iframeids)
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="myframe" src="http://www.yoursitehere.com/coppermine/" marginwidth="0" marginheight="0" vspace="0" hspace="0" style="width: 100%; display: none;" frameborder="0" scrolling="no"></iframe>
try using this
http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
it requires u to add some parts to the index.template.php file
mainly the head part and the rest goes in the body itself and works awesomely
be sure to read the instructions....
Thanks Aku,
Not sure if I'm understanding the instructions correctly at Dynamicdrive, but it sounds like this script is being used to pull in an external page, although it dose talk about the need for the pages to be from the same domain. Actually, I know that my understanding is not up to speed on this script, so it will take some more reading, which I will do because this script sounds promising for some other stuff that is going on in my forum.
In any case, the 'Custom Page' (by Thurnok) PHP artice that I have in place now already gives all my forum members the ability to pull into the forum any webpage of their choice, so that part is OK as is.
The only issue is that page height varies so widely with web pages and thatââ,¬â,,¢s why Iââ,¬â,,¢m looking for a way to add an automatic resize feature like the one in G6ââ,¬â,,¢s code above.
Thanksââ,¬Â¦ Ken