Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
lonk
Regular
Regular


Joined: Aug 04, 2006
Posts: 64

PostPosted: Fri Nov 09, 2007 7:28 pm Reply with quote

hello,
I have been reading on how to include htm into a block but what i need to do is include an htm file. this file would is output from a log parser. It outputs it in htm. I made a roster module from the main file it outputs but it also outputs a class stats htm page. I would like to show that in a block. I need it to pull from modules/Roster


the roster is here Only registered users can see links on this board! Get registered or login!

Also is there an easy way to make the java sort function on these pages work?
Everything i have tried so far just does not work.

Thanks
Lonk
 
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Fri Nov 09, 2007 8:20 pm Reply with quote

I would take the code from that Roster module and refactor it into a block. Essentially you need to turn the echo statements into assignments to $content.

_________________
Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module 
View user's profile Send private message
lonk
PostPosted: Sat Nov 10, 2007 10:01 am Reply with quote

the log parser we use processes the files and then upload them to our website in one step.

it outputs two files one is the roster and one is class stats. both are htm files.

here is the index file for the module

Code:
<?php


if (!eregi("modules.php", $PHP_SELF)) {
   die ("You can't access this file directly...");

}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
$index = 0;
OpenTable();
include("Faux_Pas_Roster.htm");
CloseTable();
include("footer.php");

?>


I am not sure what you mean by echo statements. can you give me alittle more detail.
 
Gremmie
PostPosted: Sat Nov 10, 2007 11:24 am Reply with quote

Oh, I understand better now. Thanks for clarifying. You could save the following in a file called, for example, block-Roster.php and save it under your blocks directory:

Code:


<?php

if ( !defined('BLOCK_FILE') ) {
    header("Location: ../index.php");
    die();
}

$content = file_get_contents('Faux_Pas_Roster.htm');

?>


However it looks like the contents of your file contain HTML, HEAD, and BODY tags. The above might work but it will make your site non-compliant. You may have to post-process the file to remove that stuff (if you care about compliance).
 
lonk
PostPosted: Tue Nov 13, 2007 2:45 am Reply with quote

This worked for the Block. Only registered users can see links on this board! Get registered or login! lower left side. Thank you for your help. any idea how to get the java sort function working in the roster module?

Here is the code for the htm that the parser outputs. It would be nice to be able to sort it by name, class, or level.

well it will not allow me to add the code to the forums. if you would like to look at it let me know and i can email it to you or is there a way to post htm to the forums?


Lonk
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous 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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©