Author |
Message |
Agent001Fox
Hangin' Around
![](modules/Forums/images/avatars/d9d7a1ac403246bee30ec.jpg)
Joined: Dec 17, 2003
Posts: 29
Location: Stockholm - Sweden
|
Posted:
Wed Mar 31, 2004 1:36 am |
|
What do I have to change so the module opens in the same window?
Code:<HTML><BODY>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function WinOpen() {
open("/stats/index.php","Window1");
}
//-->
</SCRIPT>
<HTML><BODY onLoad="WinOpen()">
</BODY></HTML>
<?php
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
require_once("mainfile.php");
$_SERVER['PHP_SELF'] = "modules.php";
$sql = "SELECT main_module from ".$prefix."_main";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$name = $row[main_module];
$home = 1;
if ($httpref==1) {
$referer = $_SERVER["HTTP_REFERER"];
$referer = check_html($referer, nohtml);
if ($referer=="" OR eregi("^unknown", $referer) OR substr("$referer",0,strlen($nukeurl))==$nukeurl OR eregi("^bookmark",$referer)) {
} else {
$sql = "INSERT INTO ".$prefix."_referer VALUES (NULL, '$referer')";
$result = $db->sql_query($sql);
}
$sql = "SELECT * FROM ".$prefix."_referer";
$result = $db->sql_query($sql);
$numrows = $db->sql_numrows($result);
if($numrows>=$httprefmax) {
$sql = "DELETE FROM ".$prefix."_referer";
$result = $db->sql_query($sql);
}
}
if (!isset($mop)) { $mop="modload"; }
if (!isset($mod_file)) { $mod_file="index"; }
if (ereg("\.\.",$name) || ereg("\.\.",$file) || ereg("\.\.",$mod_file) || ereg("\.\.",$mop)) {
echo "You are so cool...";
} else {
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
include("themes/$ThemeSel/module.php");
if (is_active("$default_module") AND file_exists("modules/$default_module/$mod_file.php")) {
$name = $default_module;
}
}
if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php")) {
$modpath = "themes/$ThemeSel/";
}
$modpath .= "modules/$name/$mod_file.php";
if (file_exists($modpath)) {
include($modpath);
} else {
$index = 1;
include("header.php");
OpenTable();
if (is_admin($admin)) {
echo "<center><font class=\"\"><b>"._HOMEPROBLEM."</b></font><br><br>[ <a href=\"admin.php?op=modules\">"._ADDAHOME."</a> ]</center>";
} else {
echo "<center>"._HOMEPROBLEMUSER."</center>";
}
CloseTable();
include("footer.php");
}
}
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Wed Mar 31, 2004 3:03 am |
|
I haven't tested this as I'm on my way to bed but I would try getting rid of everything in front of the <? tag. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Agent001Fox
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Mar 31, 2004 4:28 am |
|
I took away:
Code:</SCRIPT>
<HTML><BODY onLoad="WinOpen()">
</BODY></HTML>
|
Don't know if it was that you ment... probably not...
Anyway that didn't work.
Sleep tight! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Mar 31, 2004 7:53 am |
|
Take awayCode:<HTML><BODY>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function WinOpen() {
open("/stats/index.php","Window1");
}
//-->
</SCRIPT>
<HTML><BODY onLoad="WinOpen()">
</BODY></HTML>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Agent001Fox
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Mar 31, 2004 9:02 am |
|
But if I take away open("/stats/index.php" then it won't open the index.php file... at all.
It's that file I want to open in the same window. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Mar 31, 2004 10:29 am |
|
OK, I should have asked mor questions in the beginning. Why not just make stats a module? In other words, move stats/index.php to the modules folder. Then activate the module in nuke admin. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Agent001Fox
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Mar 31, 2004 11:27 pm |
|
Well... the thing is that the code above is in modules/gamestats/index.php. And the file I want to open is stats/index.php.
Perhaps there is a better way to open a php/htm file trough modules? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Mar 31, 2004 11:29 pm |
|
Does stats/index.php require gamestats/index.php? If not, then make stats/index.php its own module as I said above. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Agent001Fox
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Apr 01, 2004 12:54 am |
|
Yes it does.
Gonna try to explain it in a better way.. this would have been much easier if it was in swedish...
First of all my webpage:
http://www.swedis.se/
In the leftside meny you find a link Stats spelserver.
This link goes to /modules/stats/index.php
The http://www.swedis.se/modules/stats/index.php includes the code stated in the topic.
What that code does is it opens in a new window the http://217.215.6.88/stats/index.php . This is another webserver!!
Now... I'm alright with that, exept that I want to open http://217.215.6.88/stats/index.php in the same window, so something in the http://www.swedis.se/modules/stats/index.php should be changed to do so.
I know this is a little confusing, because both directories are named almost the same, that's why I wrote different directories above, so it wouldn't be so much confusion.
But if there is another way to this (for example another script) I will be happy to implement that instead.
I only want to be able to create a module that opens a file in another directory/webserver.
Hope you understand my issue better... ![Razz](modules/Forums/images/smiles/icon_razz.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Apr 01, 2004 2:40 am |
|
You should still build them both as modules so that they are called by modules.php?name=stats or whatever. Then they should open in the same window just like any nuke block. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Agent001Fox
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Apr 01, 2004 2:47 am |
|
Don't know how to do that... ![Confused](modules/Forums/images/smiles/icon_confused.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
Spouse Contemplates Divorce
![](modules/Forums/images/avatars/d1ecfa674c890aee2698b.jpg)
Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Sat Apr 03, 2004 11:56 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Agent001Fox
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Apr 04, 2004 3:58 am |
|
sixonetonoffun: I chanched the URL in index.php to the htm file, but got errors trying to open the module. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Apr 04, 2004 1:24 pm |
|
It requires fopen to be on and doesn't give a user agent so if it gives errors it probably won't work for you. Sorry without seeing the error message thats about all I can add. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|