You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 44 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Embedding a html file in a block? [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Griever92
Private
Private


Joined: Dec 02, 2004
Posts: 37


PostPosted: Tue Feb 01, 2005 11:39 am Reply with quoteBack to top

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.

_________________
Image
Find all posts by Griever92View user's profileSend private messageSend e-mail
Lukin
Nuke Cadet
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9


PostPosted: Tue Feb 01, 2005 12:25 pm Reply with quoteBack to top

try this

Code:

<?php include 'file.html'; ?>
Find all posts by LukinView user's profileSend private message
Griever92
Private
Private


Joined: Dec 02, 2004
Posts: 37


PostPosted: Thu Feb 03, 2005 9:41 am Reply with quoteBack to top

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?

_________________
Image
Find all posts by Griever92View user's profileSend private messageSend e-mail
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12397


PostPosted: Thu Feb 03, 2005 10:32 am Reply with quoteBack to top

Include does not work that way. You cannot include into a variable.

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Lukin
Nuke Cadet
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9


PostPosted: Thu Feb 03, 2005 2:23 pm Reply with quoteBack to top

try readfile: http://us3.php.net/manual/en/function.readfile.php
Find all posts by LukinView user's profileSend private message
Griever92
Private
Private


Joined: Dec 02, 2004
Posts: 37


PostPosted: Thu Feb 03, 2005 2:51 pm Reply with quoteBack to top

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);

?>


?

_________________
Image
Find all posts by Griever92View user's profileSend private messageSend e-mail
Lukin
Nuke Cadet
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9


PostPosted: Thu Feb 03, 2005 5:53 pm Reply with quoteBack to top

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
Find all posts by LukinView user's profileSend private message
Griever92
Private
Private


Joined: Dec 02, 2004
Posts: 37


PostPosted: Sun Feb 06, 2005 12:06 am Reply with quoteBack to top

ok, i believe i followed instructions correctly, but something is not displaying properly...

Image

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?

_________________
Image
Find all posts by Griever92View user's profileSend private messageSend e-mail
Lukin
Nuke Cadet
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9


PostPosted: Mon Feb 07, 2005 11:56 am Reply with quoteBack to top

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'));
Find all posts by LukinView user's profileSend private message
Griever92
Private
Private


Joined: Dec 02, 2004
Posts: 37


PostPosted: Mon Feb 07, 2005 3:21 pm Reply with quoteBack to top

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?

_________________
Image
Find all posts by Griever92View user's profileSend private messageSend e-mail
Lukin
Nuke Cadet
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9


PostPosted: Tue Feb 08, 2005 10:18 am Reply with quoteBack to top

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
Find all posts by LukinView user's profileSend private message
Griever92
Private
Private


Joined: Dec 02, 2004
Posts: 37


PostPosted: Tue Feb 08, 2005 1:43 pm Reply with quoteBack to top

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

_________________
Image
Find all posts by Griever92View user's profileSend private messageSend e-mail
Lukin
Nuke Cadet
Nuke Cadet


Joined: Jan 28, 2005
Posts: 9


PostPosted: Tue Feb 08, 2005 6:38 pm Reply with quoteBack to top

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. ======== -->
Find all posts by LukinView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.270 Seconds - 227 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::