Seite 1 von 1

Frage zur Darstellung im Frame

Verfasst: 23.02.2006 21:53
von snakepilsken
Hi,

ich habe via scrolling="no" die Schieberegler abgeschaltet und möchte erreichen dass das Frame trotz abgeschalteter Regler immer komplett dargestellt wird.

Wie kann ich das erreichen ?

Gruß
Dietmar

Verfasst: 23.02.2006 21:58
von miccom
gar nicht, weil du das nicht an an alle auflösungen anpassen kannst! verzichte auf frames, das ist der beste weg.

Verfasst: 23.02.2006 22:05
von snakepilsken
Und wie bekomme ich dann denn Inhalt des einen Templates in das andere rein wenn diese besagte Anzeige garnicht installiert ist im Forum ?

Es muss doch ne andere Möglichkeit geben, das sich das Frame vergössert wenn der Inhalt grösser wird ?

Hilft mir das nicht weiter ?
Wenn ja wie geht das
Setting the Template dynamically
Let's start with the basic PHP-Code contained in the Example shipping with this Package. It looks like


<?php

require_once('utserverdisplay.inc.php');

$server = new UTServerDisplay;

$server->Show();

?>
Between the Instantiation of the UTServerDisplay Object and the Call to the Show() Function is the Place, where you want to write your additional Code to control the Output that is generated in the Show() Function.
The first Thing we do is changing the Template that is used. There are two Ways to tell UTServerDisplay the Template Code. The first one (discussed earlier in this Document) is by saving the Template into a simple Textfile and giving UTServerDisplay the local Path to that File on the Server. You've seen in Section sub:Your-Template how to set the Path to the default Templatefile. If you rather want to set this Path from PHP, there's this little Function for you:


$server->SetTemplatePath('another_one.tpl');
Call that before the Show() Function is used and this different Template is used, regardless of what the default Path in config.inc.php is. Remember if you're going to use an absolute Path: this is on the Webservers local Harddisk, so if you have the Template in the Path /my/templates/... relative to your Document-Root on the Webserver, the real absolute Path is something like

/home/userfoo/www/my/templates/...
or whatever the Structure is on your Server. Use something like

<?php echo getcwd(); ?>
in a little Testscript on your Webserver to get to know the Path to your current Working Directory.
The second Possibility for telling UTServerDisplay the Template is doing it directly. Using the Function SetTemplate() you can hand some HTML-Code over to the Object, that is used in later Calls to Show() when rendering the Information to your Website. Example:


$server->SetTemplate('<b><%hostname%></b>: <%maptitle%>');
Well, that's it about the Templates and PHP.

Verfasst: 23.02.2006 23:09
von miccom
gib uns mal einen link zu deinem forum

Verfasst: 24.02.2006 19:37
von snakepilsken
Ich habe was gefunden um das iframe dynamisch zu machen und es funktioniert so gar wunderbar.

Code: Alles auswählen

<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[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>
<script type="text/javascript" src="/phpwcms_template/inc_js/dropdown.js"></script>
<link rel="shortcut icon" href="favicon.ico" >

und das ist der Code für mein iframe

Code: Alles auswählen

<iframe scrolling="no" frameborder="0" style="overflow: visible; width: 100%; display: none;" hspace="0" vspace="0" marginheight="0" marginwidth="0" src="die Seite die in dem Frame angezeigt werden soll" id="myframe"></iframe>