Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Agent001Fox
Hangin' Around



Joined: Dec 17, 2003
Posts: 29
Location: Stockholm - Sweden

PostPosted: Wed Mar 31, 2004 1:36 am Reply with quote

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

?>
 
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Mar 31, 2004 3:03 am Reply with quote

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.
 
View user's profile Send private message
Agent001Fox







PostPosted: Wed Mar 31, 2004 4:28 am Reply with quote

I took away:
Code:
</SCRIPT> 


<HTML><BODY onLoad="WinOpen()">
</BODY></HTML>

Don't know if it was that you ment... probably not... Sad

Anyway that didn't work.

Sleep tight!
 
Raven







PostPosted: Wed Mar 31, 2004 7:53 am Reply with quote

Take away
Code:
<HTML><BODY> 

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function WinOpen() {
open("/stats/index.php","Window1");
}
//-->
</SCRIPT>

<HTML><BODY onLoad="WinOpen()">
</BODY></HTML>

 
Agent001Fox







PostPosted: Wed Mar 31, 2004 9:02 am Reply with quote

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.
 
Raven







PostPosted: Wed Mar 31, 2004 10:29 am Reply with quote

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.
 
Agent001Fox







PostPosted: Wed Mar 31, 2004 11:27 pm Reply with quote

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?
 
Raven







PostPosted: Wed Mar 31, 2004 11:29 pm Reply with quote

Does stats/index.php require gamestats/index.php? If not, then make stats/index.php its own module as I said above.
 
Agent001Fox







PostPosted: Thu Apr 01, 2004 12:54 am Reply with quote

Yes it does.

Gonna try to explain it in a better way.. this would have been much easier if it was in swedish... Wink

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
 
Raven







PostPosted: Thu Apr 01, 2004 2:40 am Reply with quote

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.
 
Agent001Fox







PostPosted: Thu Apr 01, 2004 2:47 am Reply with quote

Don't know how to do that... Confused
 
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Sat Apr 03, 2004 11:56 pm Reply with quote

This is way simple but it might work for you:
http://www.netflake.com/modules.php?op=modload&name=Downloads&file=index&req=getit&lid=8
A little cleaner then an iframe. But thats an option too.
 
View user's profile Send private message
Agent001Fox







PostPosted: Sun Apr 04, 2004 3:58 am Reply with quote

sixonetonoffun: I chanched the URL in index.php to the htm file, but got errors trying to open the module.
 
sixonetonoffun







PostPosted: Sun Apr 04, 2004 1:24 pm Reply with quote

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.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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 ©