I want to call this address into the frontpage of the forums... http://www.grumpyoldmen.us/WebSpectator/index.php
I thought I found something about Iframes but I am not sure if that is the best was to go about it. I just want to show the stats whether by article or whatever...
an iFrame will work, but not all browsers like iFrames. You may need to size the frame. I've put some of my iFrames in tables.
Have a look at this site regarding iFrames.
http://www.w3schools.com/tags/tag_iframe.asp
I use this site quite a lot :up:
u also may wana take a look at this code by thurnok
http://www.tinyportal.net/index.php?topic=7159.0
it allows u to set a default page to load in an article or in a block in ur front page. And also your members can choose to define their own pages if they wish :up:
Thanks guys! I got it to work but cannot seem to get the height changed no matter what I set it to.
<iframe
src ="/WebSpectator/index.php"
width ="100%">
height ="100%">
</iframe>
Any idea what I am doing wrong?
The problem with setting a height to a percentage in an article or block is that the block is trying to size itself according to the content that is going to be placed into it. At the time the block/article is about to be displayed, it will not know the full (or 100% in this case) height of the page you want to load "into" the iframe.
Therefore, there are two things you can do. First, you can set the height to an actual pixel value instead of a percentage, or you can add some javascript code (I believe there is already a nice javascript snippet on www.dynamicdrive.com) to autosize the IFrame for you according to the size of the page you are loading into it.
Ok, Thurnok, that appears to be what I would like to do. Where would I make the edits? The script in question is here... http://www.dynamicdrive.com/dynamicindex17/iframessi.htm
Can I call it directly from the block or will I have to hardcode it into the theme? If it needs hard coded, which file? I am using Cityscape.
Thank you for your input so far. :up:
Also, this looks a bit more simplistic.... maybe this one would be better? http://www.dynamicdrive.com/dynamicindex17/ajaxincludes.htm
To be honest, I haven't looked at either of them. I simply remembered one being on the dynamicdrive site from past reference.
I'd say try the non-iframe one (the second one) first to see if that works well in an article/block. If not, try the first one instead. Should be able to put the javascript code into the block, but you might need to make a php block and use echo statements for implementing the javascript depending on your overall script and what you want to do with it.
No matter what I do with this I cannot make it work properly. I call the page into the block in the center but the height will not adjust. I follow the instructions, I have also tried to echo it, but I get parse errors when I put in the edit. It says to put the main file in the "head" section but I cannot make it work when I do. The only way it will show at all is with the Iframe command in a block but I cannot get it bigger...
Grumpy. The way I call custom pages in is I use the custom action mod from smf. All you will have to do is create a custom action in the admin panel and put the Iframe with the address of what you want to display . It that simple thats why i use it.
Edit: Silly me I didnt see you wanted it on the frontpage. Sorry.
Why not just php include?
Quote from: IchBinâ„¢ on May 19, 2007, 03:57:29 AM
Why not just php include?
Ummm cuz I am a code noob... I did finally get the Iframe situated to work properly. For some reason the box looses the code sometimes when you go back to make edits. Now that you mentioned that though Ich, I am going to try that. I will see if I can learn the php include statement better than the Iframe one... :uglystupid2: :2funny:
And thanks to everyone! You got me pointed in the right direction. :up:
Hrm.. didn't pay much attention to the URL you posted, was going on the assumption you just wanted to pull in a web page from somewhere else. So Grumpy, is this an index.php file on the same server as the one you want to put it into the iframe? If so, just trash the iframe and use a php article with an include statement like Ich points out.
include '/path/to/file/thefile.php';
Yea, that is a much easier way to do it guys... Thanks again. 8)