PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
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 Back to top

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: 16987
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
Agent001Fox
Hangin' Around


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

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

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!
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: 16987
Location: Kansas

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

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

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

View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Agent001Fox
Hangin' Around


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

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

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.
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: 16987
Location: Kansas

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

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Agent001Fox
Hangin' Around


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

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

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?
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: 16987
Location: Kansas

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

Does stats/index.php require gamestats/index.php? If not, then make stats/index.php its own module as I said above.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Agent001Fox
Hangin' Around


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

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

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:
Only registered users can see links on this board!
Get registered or login to the forums!


In the leftside meny you find a link Stats spelserver.
This link goes to /modules/stats/index.php

The
Only registered users can see links on this board!
Get registered or login to the forums!
includes the code stated in the topic.
What that code does is it opens in a new window the
Only registered users can see links on this board!
Get registered or login to the forums!
. This is another webserver!!
Now... I'm alright with that, exept that I want to open
Only registered users can see links on this board!
Get registered or login to the forums!
in the same window, so something in the
Only registered users can see links on this board!
Get registered or login to the forums!
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
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: 16987
Location: Kansas

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

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Agent001Fox
Hangin' Around


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

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

Don't know how to do that... Confused
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2499

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

This is way simple but it might work for you:
Only registered users can see links on this board!
Get registered or login to the forums!

A little cleaner then an iframe. But thats an option too.
View user's profile Send private message
Agent001Fox
Hangin' Around


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

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

sixonetonoffun: I chanched the URL in index.php to the htm file, but got errors trying to open the module.
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2499

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

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.
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum