TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 18, 2024, 04:14:34 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 112
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 39
  • Total: 40
  • @rjen

Article Problem (php)

Started by steinar, February 22, 2007, 07:29:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

5thmsstech

That does make the page show up but not correctly. it doesnt stay in the article.
any other suggestions would be great i will continue to poke and hope.

5thmsstech

I think im getting the jist of this. i was hoping i could use an external program to create a page and publish it to the site then paste the pages html into an article and wahhla it would magicly work.
HA silly me. allthough this sort of works the postion of the images on the page is wrong and not knowing
how to actually write html or php i guess i will have to come up with a new plan.
I do appreciate your help and any further suggestions you may have.

JPDeni

Others have had success using the iframe tag to do basically what you have described. I've never used it myself, but if you do a search for IFRAME, you'll find all sorts of info on it.

5thmsstech

thanks i will try that search

Ken.

Hopefully I'm understanding your question correctly and the answer's from JPDeni as well...
Anyways, I do lots of articles that contain either the raw HTML, or that pull in HTML web pages using an iFrame.

Hereââ,¬â,,¢s how: 

For raw/strait HTML in your article;
First I build the article in an HTML editor, MS FrontPage in my case.
Next the code is just copied into the article and thatââ,¬â,,¢s it except for your links, they must be the full path to any images or whatever external content. (F/P wants to shorten them up so I have to manually insert the full path)
Most times I save the article code as a ââ,¬Ëœtemplateââ,¬â,,¢ page on the HTML part of my site.

As an iFrame;
Basically the same way for building the content, except you donââ,¬â,,¢t have to worry about the links, if they show on the HTML page then you are good on that part.
To pull the page into the iFrame I use the ââ,¬Ëœauto-resizingââ,¬â,,¢ code belowââ,¬Â¦ there is a place at the end of the code where you insert the link to your HTML page. You can also add content before and after the iFrame code, I usually put in links back to my forum's front page.

<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:

//This is the 'no scroll' version of my HTML page iframe, adapted the code from TinyPortal & DD for use here... ken
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.YOUR_PAGE.COM" marginwidth="0" marginheight="0" vspace="0" hspace="0" style="width: 100%; display: none;" frameborder="0" scrolling="no"></iframe>


" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

5thmsstech

Thankyou so much that looks like exactly what i was looking for. I am going to go try it.
Like my dad always said its not what you know its who you know. LOL
SMF, tiny Portal and the help of the communities have me looking like a webmaster
of they only knew.

5thmsstech

Well its allmost working. I now have the page showing up but its a very slow load and ends up with a scroll bar
below is the script for the iframe and here is a CLICKY to the page.
Quote<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://5thgaming.com/forums/test1.html" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>

Ken.

Just tried a look with three different browsers;
IE7 = slow, but no scroll bars
FF & K-Meleon = slow & scroll bars for both.

I'm not too sure as to what your problem might be, but here's where I would start:

On the height, a couple of times Iââ,¬â,,¢ve had to add some extra space to the bottom of my iframe content by going to the bottom and hitting the return key a couple of timesââ,¬Â¦ but other than playing with that part a little Iââ,¬â,,¢ve never had a problem with the height.

Your left & right side blocks seem kind of wide, reducing width for them might help on the horizontal scroll bar and to go along with that check the width of the iframe contentââ,¬Â¦ the auto-resize feature only takes care of the height.
In the code below you can see that it's set for 100% on the horizontal, you might be able to play around with that value and improve your situation, but I've never had to change that on any of mine.
<iframe id="myframe" src="http://www.YOURPAGE.com" marginwidth="0" marginheight="0" vspace="0" hspace="0" style="width: 100%; display: none;" frameborder="0" scrolling="no"></iframe>

Alsoââ,¬Â¦ when I go to full screen on my 17inch f/p in both FF & K-M the horizontal bar goes away and I notice that there is lots of blank space on each side of your iframe content, maybe you could cut out some of the blank space and make the width better.

For the slow loading part, iframesââ,¬â,,¢ can be slightly slower than a regular page when loading and the more content the slower it gets of course.
You can check a couple of mine to compare with yours if you likeââ,¬Â¦ HERE & HERE.

Hope this helpsââ,¬Â¦ Ken
Ps: The two links go to pages on two different sites.
PPs: I just remembered something, while setting up my Coppermine I was having problems with both width & heigth and once the width problem was solved the heigth was cured as well.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

5thmsstech

Thanks I will Continue playing with it. I'm gonna start from scratch delete the page and try building a new one etc.
Gonna cleanup my directories and move smf/tp to the root of my site this weekend.
Probably one of those things that will just work all of a sudden and leave ya wondering why.  lol
I try and keep the site so those running 1024 and up wont have to scroll left right.
I'm on 22 in wide running 1650.
Again thanks for taking the time to help me its greatly appreciated. I will let you know when i get it working and what the problem was.