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
Satch
New Member
New Member


Joined: Mar 05, 2006
Posts: 16

PostPosted: Sat Oct 14, 2006 7:26 pm Reply with quote Back to top

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&nbsp;and&nbsp;Bye"); }
    if(eregi("http\:\/\/", $file)) { die("Hi&nbsp;and&nbsp;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
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 4887

PostPosted: Sat Oct 14, 2006 7:41 pm Reply with quote Back to top

I would suggest following the changes from the installation instructions, rather than replacing your modules.php file.
View user's profile Send private message
Satch
New Member
New Member


Joined: Mar 05, 2006
Posts: 16

PostPosted: Sun Oct 15, 2006 6:27 am Reply with quote Back to top

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
View user's profile Send private message
gregexp
The Mouse Is Extension Of Arm


Joined: Feb 21, 2006
Posts: 1472
Location: In front of a screen....HELP! lol

PostPosted: Sun Oct 15, 2006 8:01 am Reply with quote Back to top

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.
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 4887

PostPosted: Sun Oct 15, 2006 8:20 am Reply with quote Back to top

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


Joined: Mar 05, 2006
Posts: 16

PostPosted: Sun Oct 15, 2006 9:01 am Reply with quote Back to top

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
View user's profile Send private message
gregexp
The Mouse Is Extension Of Arm


Joined: Feb 21, 2006
Posts: 1472
Location: In front of a screen....HELP! lol

PostPosted: Sun Oct 15, 2006 6:50 pm Reply with quote Back to top

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.
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
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-2008 by Raven
Proud to be listed at Lobo Links Web Directory

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 Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

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

zerosum