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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,046
  • Total Topics: 21,335
  • Online today: 232
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 131
  • Total: 131

Very strange behaviour

Started by mebymyself, October 13, 2006, 05:14:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mebymyself

Hello,

I am creating gaming clan web site based on smf 1.1 RC3 + TP 0.9.5

To show clan stats I have a php file that works fine as standalone
Here is sample

I've created a PHP article with simple include:

include('AAO_Page.php');


But it shows only table headers - no data!
Here the article

Can somebody explain me how it possible?

Thank you in advance

Michael

akulion

do 1 thing

put it in an iframe in the article like so:

create normal article: (not PHP article!)

put this exact code in it:


<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.wow-aao.com/AAO_Page.php" marginwidth="0" marginheight="0" vspace="0" hspace="0" style="width: 100%; display: none;" frameborder="0" scrolling="no"></iframe>


no changes needed :up:

mebymyself

#2
That worked!

But somehow it doesn't show up on the front page :(
I double checked the settings: it says
Show on front page:  Yes 

CORRECTION!!!

It worked only in editor
when i view the article using front end - the code is displayed

akulion

i havent played around with articles too much  - so not uptodate with the settings too much lol

but u can also use the above code in a centered SCRIPT block if you want :up:

mebymyself

OK,

turning off WYSTWYG editor did the trick.

But now I see another problem:
php include was show the page with inherited theme
when I use iframe it shows white background /no formating

How can i correct that?

akulion

oh for that IF you have the php file on your own server then just go to it open it up and to its body tag add background info like this

<body link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" text="#FFFFFF" bgcolor="#000000">

FFFFFF = white
000000 = black
that will set the properties for link color, visited link color, active link color, text color and page background color

mebymyself

unfortunatelly modifying the php file is not an opthion becouse i want to use user- defined theme.

So the question returns to the beginning:
why include doesn't work correctly? 

akulion

lol back to square 1

well eventhough i think its the same thing (no php guru here lol) but u could try it this way:

include './AAO_Page.php';

mebymyself


akulion

if the code isnt too big in the PHP file itself

u could try putting that in an article directly


This website is proudly hosted on Crocweb Cloud Website Hosting.