| Author |
Message |
Griever92
Private


Joined: Dec 02, 2004
Posts: 37
|
Posted:
Tue Feb 01, 2005 11:39 am |
  |
I was wondering if it's possible to embed an html file in a block. what i mean is, is it possible in the $content area for a block, could i place the code
| Code: |
| <embed src="file.html"> |
would it then display the html file inside the block?
if i'm aiming the wrong way towards this, any help would be appreciated. |
_________________
 |
|
    |
 |
Lukin
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9
|
Posted:
Tue Feb 01, 2005 12:25 pm |
  |
try this
| Code: |
<?php include 'file.html'; ?>
|
|
|
|
   |
 |
Griever92
Private


Joined: Dec 02, 2004
Posts: 37
|
Posted:
Thu Feb 03, 2005 9:41 am |
  |
so, it should look like...
| Code: |
<?php
if (eregi("block-POL.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "include 'pol.html'";
?> |
is this right? |
_________________
 |
|
    |
 |
Evaders99
Site Admin


Joined: Aug 17, 2003
Posts: 12397
|
Posted:
Thu Feb 03, 2005 10:32 am |
  |
|
     |
 |
Lukin
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9
|
Posted:
Thu Feb 03, 2005 2:23 pm |
  |
|
   |
 |
Griever92
Private


Joined: Dec 02, 2004
Posts: 37
|
Posted:
Thu Feb 03, 2005 2:51 pm |
  |
ok, so now it should look like...
| Code: |
<?php
if (eregi("block-POL.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header ("Content-Type: text/html");
header ("Content-Length: " . filesize(pol.html));
header ("Content-Disposition: attachment; filename=pol.html");
readfile(pol.html);
?> |
? |
_________________
 |
|
    |
 |
Lukin
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9
|
Posted:
Thu Feb 03, 2005 5:53 pm |
  |
how about
| Code: |
$content = readfile('pol.html');
|
readfile returns a string with the contents of the file.. you need to tell it where to go... usually into $content ... or 'echo' it |
|
|
   |
 |
Griever92
Private


Joined: Dec 02, 2004
Posts: 37
|
Posted:
Sun Feb 06, 2005 12:06 am |
  |
ok, i believe i followed instructions correctly, but something is not displaying properly...
and here's the code to the block...
| Code: |
<?php
if (eregi("block-POL.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = readfile('pol.html');
?> |
any idea why the source is not appearing inside the Block, but outside? also, where does that "444" in the block area come from? |
_________________
 |
|
    |
 |
Lukin
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9
|
Posted:
Mon Feb 07, 2005 11:56 am |
  |
ok, I didnt realize that this was your own block. In that case, the $content doesn't do anything for you. You need to echo the contents of the file ...
so instead of
| Code: |
| $content = readfile('pol.html'); |
try this
| Code: |
| echo(readfile('pol.html')); |
|
|
|
   |
 |
Griever92
Private


Joined: Dec 02, 2004
Posts: 37
|
Posted:
Mon Feb 07, 2005 3:21 pm |
  |
i changed the $content to echo, but it still appears outside the block area, although the 444 did disappear, it was replaced with "There isn't content right now for this block."
i've noticed i some files, a OpenTable() and CloseTable() tag, would this be of any use for this application? |
_________________
 |
|
    |
 |
Lukin
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9
|
Posted:
Tue Feb 08, 2005 10:18 am |
  |
ok sorry about the runaround.. i am kinda new here
anyway.. i did some testing and this works
| Code: |
<?php
if (eregi("block-POL.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content .= "HELLO WORLD <br><br>";
$content .= file_get_contents('blocks/pol.html');
?>
|
notice that you need the relative path to the file pol.html |
|
|
   |
 |
Griever92
Private


Joined: Dec 02, 2004
Posts: 37
|
Posted:
Tue Feb 08, 2005 1:43 pm |
  |
it still only displays the text, but fortunately, the source of the html file has stopped appearing outside the block... now it does'nt appear at all.
if it helps, the source for the html file is below:
| Code: |
<html>
<head>
<title>PlayOnline Community Tool</title>
</head>
<body>
<!-- ================== PlayOnline Community Site Tool ================= -->
<script language="Javascript" src="http://www.playonline.com/communityus/comTool/ff11/comTool.js">
</script>
<script language="Javascript">
<!-- comTool('31808'); //-->
</script>
<!-- ======== Copyright (c) 2003 SQUARE-ENIX CO.LTD. All Rights Reserved. ======== -->
</body>
</html> |
|
_________________
 |
|
    |
 |
Lukin
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9
|
Posted:
Tue Feb 08, 2005 6:38 pm |
  |
OK well, you cant have all those html tags (html, head, body) etc because the block is not a stand-alone page.
Also, why not just copy & past the html into the block?
It might work if you slim down the html file to the following:
| Code: |
<!-- ================== PlayOnline Community Site Tool ================= -->
<script language="Javascript" src="http://www.playonline.com/communityus/comTool/ff11/comTool.js">
</script>
<script language="Javascript">
<!-- comTool('31808'); //-->
</script>
<!-- ======== Copyright (c) 2003 SQUARE-ENIX CO.LTD. All Rights Reserved. ======== -->
|
|
|
|
   |
 |
|
|