Jump to content

Loading a PHP page within a Nuke Module


N30Cr0n

Recommended Posts

hi, i have a website built on PHP Nuke 7.9, and its working very well. I am trying to create a module that will enable me to display Archive results and link to the full story.

for instance, this is my folder structure of the module;

modules
> MatchArchives
|||> admin
|||> images
|||> language
|||> 01032006_1.php
|||> 01032006_2.php
|||> 01032006_3.php
|||> 01032006_4.php
|||> copyright.php
|||> index.php

now, here is the code from my index.php;

[code]<?php

if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
    die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "- Clan Match Archives";

/**********************************/
/* Configuration                  */
/*                                */
/* $index = 0; (right side off)   */
/**********************************/
$index = 0;
$subject = "$sitename Clan Match Archives";
/**********************************/

include("header.php");
$cookie[0] = intval($cookie[0]);
if ($cookie[1] != "") {
    $row = $db->sql_fetchrow($db->sql_query("SELECT name, username, user_email FROM ".$user_prefix."_users WHERE user_id='$cookie[0]'"));
    if ($row['name'] != "") {
    $sender_name = $row['name'];
    } else {
    $sender_name = $row['username'];
    }
    $sender_email = $row['user_email'];
}

$archives = "
    <center><font class=\"title\"><b>$sitename: Clan Matche Archives</b></font>
    <br><br><font class=\"content\">Welcome to the Archives for all previous Clan Matchs (both Major and Training) for any games we play online. Browse through the [SG] MainFrame and see how we faired. The Result are only a Summary, and are listed in date order, latest first. Clicking 'Full Stats' will open a seperate page for that Match only.</font><br><br>
    </center>
    <font class=\"title\">March 2006</font><br>
    <img src=images/arrow.gif height=9 width=9> <font class=\"content\">Match Results for <font class=\"matches\"><b>01/03/2006</b></font>, Game: <font class=\"matches\"><b>HALO 2</b></font>, Winner: <font class=\"matches\"><b>Smokin Gunz [SG] Evolution</b></font> - <a href=\"modules.php?name=$module_name&page=01032006_4.php\">Full Stats</a></font><br>
    <img src=images/arrow.gif height=9 width=9> <font class=\"content\">Match Results for <font class=\"matches\"><b>01/03/2006</b></font>, Game: <font class=\"matches\"><b>HALO 2</b></font>, Winner: <font class=\"matches\"><b>Smokin Gunz [SG] Evolution</b></font> - <a href=\"modules.php?name=$module_name&page=01032006_3.php\">Full Stats</a></font><br>
    <img src=images/arrow.gif height=9 width=9> <font class=\"content\">Match Results for <font class=\"matches\"><b>01/03/2006</b></font>, Game: <font class=\"matches\"><b>HALO 2</b></font>, Winner: <font class=\"matches\"><b>| TE4M REJEX |</b></font> - <a href=\"modules.php?name=$module_name&page=01032006_2.php\">Full Stats</a></font><br>
    <img src=images/arrow.gif height=9 width=9> <font class=\"content\">Match Results for <font class=\"matches\"><b>01/03/2006</b></font>, Game: <font class=\"matches\"><b>HALO 2</b></font>, Winner: <font class=\"matches\"><b>| TE4M REJEX |</b></font> - <a href=\"modules.php?name=$module_name&page=01032006_1.php\">Full Stats</a></font><br><br>
    <font class=\"title\">February 2006</font><br>
    <font class=\"content\">No Matches This Month</font><br><br>
    <font class=\"title\">January 2006</font><br>
    <font class=\"content\">No Matches This Month</font><br><br>
";

OpenTable();
    echo "$archives";
CloseTable();

include("footer.php");

?>[/code]

what this displays is a sort of summary page, with links to each match results full stats. now, the hyperlinks i have in place;

[code]<a href=\"modules.php?name=$module_name&page=01032006_4.php\">[/code]

in theory should openup a new window, but it doesn't. what i want it to do, is just to have it all displyed on the same page, without opening any new windows, or changing the design of the page.

i have tried to use an include on my index.php, along the lines of;

[code]include ("modules/MatchArchives/01032006_4.php");[/code]

but all that does is straight away display the data from the file 01032006_4.php instead of the correct data specified in $archives

can anyone help, or have any idea what i'm getting at?

thanks in advance
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.