Author |
Message |
Satch
New Member


Joined: Mar 05, 2006
Posts: 16
|
Posted:
Sat Oct 14, 2006 7:26 pm |
|
Hello,
I was going to upload the modules.php from nsn groups but decided to look at it first. It seems quite different from the original. I'm not sure if I should overwrite it. I could take out sections from the nsn version and put in the one on the server but I don't know what sections I should take out.
Here's the original:
Code:
<?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. */
/* */
/************************************************************************/
/* Additional security checking code 2003 by chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
define('MODULE_FILE', true);
require_once("mainfile.php");
if (isset($name) && $name == $_REQUEST['name']) {
$name = addslashes(trim($name));
$modstring = strtolower($_SERVER['QUERY_STRING']);
if (stripos_clone($name, "..") OR ((stripos_clone($modstring,"&file=nickpage") || stripos_clone($modstring,"&user=")) AND ($name=="Private_Messages" OR $name=="Forums" OR $name=="Members_List"))) header("Location: index.php");
global $nukeuser, $db, $prefix, $user;
if (is_user($user)) {
$nukeuser = base64_decode($user);
$nukeuser = addslashes($nukeuser);
} else {
$nukeuser = "";
}
$result = $db->sql_query("SELECT active, view FROM ".$prefix."_modules WHERE title='".addslashes($name)."'");
list($mod_active, $view) = $db->sql_fetchrow($result);
$mod_active = intval($mod_active);
$view = intval($view);
if (($mod_active == 1) OR ($mod_active == 0 AND is_admin($admin))) {
if (!isset($mop) OR $mop != $_REQUEST['mop']) $mop="modload";
if (!isset($file) OR $file != $_REQUEST['file']) $file="index";
if (stripos_clone($file,"..") OR stripos_clone($mop,"..")) die("You are so cool...");
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/modules/$name/".$file.".php")) {
$modpath = "themes/$ThemeSel/";
} else {
$modpath = "";
}
if ($view == 0) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "<br><center>Sorry, such file doesn't exist...</center><br>";
CloseTable();
include("footer.php");
}
} elseif ($view == 1 AND (is_user($user) OR is_group($user, $name)) OR is_admin($admin)) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "<br><center>Sorry, such file doesn't exist...</center><br>";
CloseTable();
include("footer.php");
}
} elseif ($view == 1 AND !is_user($user) AND !is_admin($admin)) {
$pagetitle = "- "._ACCESSDENIED;
include("header.php");
title($sitename.": "._ACCESSDENIED);
OpenTable();
echo "<center><strong>"._RESTRICTEDAREA."</strong><br><br>"._MODULEUSERS;
$result2 = $db->sql_query("SELECT mod_group FROM ".$prefix."_modules WHERE title='".addslashes($name)."'");
list($mod_group) = $db->sql_fetchrow($result2);
if ($mod_group != 0) {
$result3 = $db->sql_query("SELECT name FROM ".$prefix."_groups WHERE id='".intval($mod_group)."'");
$row3 = $db->sql_fetchrow($result3);
echo _ADDITIONALYGRP.": <b>".$row3['name']."</b><br><br>";
}
echo _GOBACK;
CloseTable();
include("footer.php");
} elseif ($view == 2 AND is_admin($admin)) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "<br><center>Sorry, such file doesn't exist...</center><br>";
CloseTable();
include("footer.php");
}
} elseif ($view == 2 AND !is_admin($admin)) {
$pagetitle = "- "._ACCESSDENIED;
include("header.php");
title($sitename.": "._ACCESSDENIED);
OpenTable();
echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"._MODULESADMINS.""._GOBACK;
CloseTable();
include("footer.php");
} elseif ($view == 3 AND paid()) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "<br><center>Sorry, such file doesn't exist...</center><br>";
CloseTable();
include("footer.php");
}
} else {
$pagetitle = "- "._ACCESSDENIED."";
include("header.php");
title($sitename.": "._ACCESSDENIED."");
OpenTable();
echo "<center><strong>"._RESTRICTEDAREA."</strong><br><br>"._MODULESSUBSCRIBER;
if (!empty($subscription_url)) echo "<br>"._SUBHERE;
echo "<br><br>"._GOBACK;
CloseTable();
include("footer.php");
}
} else {
include("header.php");
OpenTable();
echo "<center>"._MODULENOTACTIVE."<br><br>"._GOBACK."</center>";
CloseTable();
include("footer.php");
}
} else {
header("Location: index.php");
exit;
}
?>
|
Here's the version that came with nsn groups:
Code:
<?php
/********************************************************/
/* NSN Groups */
/* By: NukeScripts Network (webmaster@nukescripts.net) */
/* http://www.nukescripts.net */
/* Copyright © 2000-2005 by NukeScripts Network */
/********************************************************/
define('MODULE_FILE', true);
require_once("mainfile.php");
$module = 1;
$name = trim($name);
if(isset($name)) {
if(eregi("http\:\/\/", $name)) { die("Hi and Bye"); }
if(eregi("http\:\/\/", $file)) { die("Hi and Bye"); }
$modstring = strtolower($_SERVER['QUERY_STRING']);
if(stripos_clone($modstring,"&user=") AND ($name=="Private_Messages" || $name=="Forums" || $name=="Members_List")) header("Location: index.php");
global $nukeuser, $db, $prefix;
$nukeuser = base64_decode($user);
$nukeuser = addslashes($nukeuser);
$result = $db->sql_query("SELECT * FROM `".$prefix."_modules` WHERE `title`='$name'");
$row = $db->sql_fetchrow($result);
$mod_active = intval($row['active']);
$view = intval($row['view']);
$groups = $row['groups'];
if(($mod_active == 1) OR is_admin($admin)) {
if(!isset($mop)) { $mop="modload"; }
if(!isset($file)) { $file="index"; }
if(ereg("\.\.",$name) || ereg("\.\.",$file) || ereg("\.\.",$mop)) {
$pagetitle = "- "._SOCOOL;
include("header.php");
OpenTable();
echo "<center><b>"._SOCOOL."</b></center><br>";
echo "<center>"._GOBACK."</center>";
CloseTable();
include("footer.php");
die();
} else {
$ThemeSel = get_theme();
if(file_exists("themes/$ThemeSel/modules/".$name."/".$file.".php")) {
$modpath = "themes/$ThemeSel/";
} else {
$modpath = "";
}
$modpath .= "modules/".$name."/".$file.".php";
if(file_exists($modpath)) {
if($view == 0) {
include($modpath);
} elseif($view == 1 AND (is_user($user) OR is_group($user, $name) OR is_admin($admin))) {
include($modpath);
} elseif($view == 2 AND is_admin($admin)) {
include($modpath);
} elseif($view == 3 AND paid()) {
include($modpath);
} elseif($view > 3 AND in_groups($groups)) {
include($modpath);
} else {
$pagetitle = "- "._RESTRICTEDAREA;
include("header.php");
OpenTable();
echo "<center><b>"._RESTRICTEDAREA."</b></center><br>";
echo "<center>"._GOBACK."</center>";
CloseTable();
include("footer.php");
die();
}
} else {
$pagetitle = "- "._FILENOTFOUND;
include("header.php");
OpenTable();
echo "<center><b>"._FILENOTFOUND."</b></center><br>";
echo "<center>"._GOBACK."</center>";
CloseTable();
include("footer.php");
die ();
}
}
} else {
$pagetitle = "- "._MODULENOTACTIVE;
include("header.php");
OpenTable();
echo "<center>"._MODULENOTACTIVE."</center><br>";
echo "<center>"._GOBACK."</center>";
CloseTable();
include("footer.php");
die ();
}
} else {
$pagetitle = "- "._MODULENOTFOUND;
include("header.php");
OpenTable();
echo "<center>"._MODULENOTFOUND."</center><br>";
echo "<center>"._GOBACK."</center>";
CloseTable();
include("footer.php");
die ();
}
if(!function_exists("stripos_clone")) {
function stripos_clone($haystack, $needle, $offset=0) {
return strpos(strtoupper($haystack), strtoupper($needle), $offset);
}
}
?>
|
I appreciate any help.
Thanks,
Satch |
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Sat Oct 14, 2006 7:41 pm |
|
I would suggest following the changes from the installation instructions, rather than replacing your modules.php file. |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Satch

|
Posted:
Sun Oct 15, 2006 6:27 am |
|
The modules.php file came in the html folder which indicates that I should should replace mine. Also, there are no instructions on what code I should replace in the one on the server so it would seem I should replace it except that there's about 31 lines of code difference. That could make a difference.
Satch |
|
|
|
 |
gregexp
The Mouse Is Extension Of Arm

Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol
|
Posted:
Sun Oct 15, 2006 8:01 am |
|
I would say this, the nsn coded module seems to be more optimized and more efficient then your current mainfile, rename your old mainfile to mainfileold.php
Then upload the nsn one, Lots of edits would need to be made. In my testing, it works regardless. |
_________________ For those who stand shall NEVER fall and those who fall shall RISE once more!! |
|
 |
 |
kguske

|
Posted:
Sun Oct 15, 2006 8:20 am |
|
What PHP-Nuke version / distribution are you using? Where did you get the NSN Groups download? If I remember correctly, later versions of NSN Groups did not have modified files, but instructions on how to modify. |
|
|
|
 |
Satch

|
Posted:
Sun Oct 15, 2006 9:01 am |
|
Thanks for your replies.
Quote: | What PHP-Nuke version / distribution are you using? |
7.4 with chatserv patch 3.1
Quote: | Where did you get the NSN Groups download? |
nukescripts.net
Quote: | later versions of NSN Groups did not have modified files, but instructions on how to modify |
It had files to upload to the server and instructions to modify the current ones like mainfile.php but not modules.php
Satch |
|
|
|
 |
gregexp

|
Posted:
Sun Oct 15, 2006 6:50 pm |
|
Sorry I meant modules.php.
I may be wrong and kguske would know better then I, but I believe the more uptodate version would be nsn's version and I cant see any conflicts it would have. But thats why I mentioned to rename it, so that you could quickly undo any damage you might have done. |
|
|
|
 |
|