Location: PHPKode > projects > PHP-PROXIMA > proximaXP790/modules.php
<?php
/************************************************************************/
/* PHP-PROXIMA                                                          */
/* Copyright (c) 2003-2004 by Roberto Beltrame                          */
/* mail:(hide@address.com)                                     */
/* http://www.php-proxima.com                                           */
/* <title>Proxima</title>                                               */
/************************************************************************/
/* based on:                                                            */
/* PHP-NUKE: Advanced Content Management System                         */
/* ============================================                         */
/* Copyright (c) 2005 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.       */
/************************************************************************/

define('MODULE_FILE', true);
require_once("mainfile.php");

$module = 1;
$query = "SELECT * 
          FROM ".$prefix."_webpages 
		  WHERE ((page_title = '$name'))";
$result = $db->sql_query($query);
unset($query);
$webpage = $db->sql_fetchrow($result);
$name = trim($webpage['page_title']);
if (isset($name)) {
if (eregi("http\:\/\/", $name)) {
	die("Hi&nbsp;and&nbsp;Bye");
    }
    global $nukeuser, $db, $prefix;
    $nukeuser = base64_decode($user);
    $row = $db->sql_fetchrow($db->sql_query("SELECT page_status, viewfrom FROM ".$prefix."_webpages WHERE page_title='$name'"));
    $mod_active = intval($row['page_status']);
    $view = intval($row['viewfrom']);
    if (($mod_active == 1) OR ($mod_active == 0 AND is_admin($admin))) {
		if (!isset($mop)) { $mop="modload"; }
		if (!isset($file)) { $file="index"; }
		if (ereg("\.\.",$name) || ereg("\.\.",$file) || ereg("\.\.",$mop)) {
		    echo "You are so cool...";
		} else {
				$modpath = "";
		    if ($view == 0) {
		$modpath .= "modules/$name/".$file.".php";
	    		if (file_exists($modpath)) {
			    	include($modpath);
	    		} else {
			    	die ("Sorry, such file doesn't exist...");
				}
		    }
		    if ($view == 1 AND is_user($user) AND is_group($user, $name) OR is_admin($admin)) {
		$modpath .= "modules/$name/".$file.".php";
	    		if (file_exists($modpath)) {
			    	include($modpath);
	    		} else {
			    	die ("Sorry, such file doesn't exist...");
				}
		    } elseif ($view == 1 AND !is_user($user) || !is_admin($admin)) {
				$pagetitle = "- "._ACCESSDENIED."";
				include("header.php");
				title("$sitename: "._ACCESSDENIED."");
				OpenTable();
				echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
				    .""._MODULEUSERS."";
		$result2 = $db->sql_query("SELECT viewto FROM ".$prefix."_webpages WHERE page_title='$name'"); 
		$row2 = $db->sql_fetchrow($result2); 
	    if ($row2[mod_group != 0]) { 
		$result3 = $db->sql_query("SELECT name FROM ".$prefix."_groups WHERE id='$row2[mod_group]'"); 
		$row3 = $db->sql_fetchrow($result3); 
		echo ""._ADDITIONALYGRP.": <b>$row3[name]</b><br><br>";
				}
				echo ""._GOBACK."";
				CloseTable();
				include("footer.php");
				die();
		    }
		    if ($view == 2 AND is_admin($admin)) {
		$modpath .= "modules/$name/".$file.".php";
	    		if (file_exists($modpath)) {
			    	include($modpath);
	    		} else {
			    	die ("Sorry, such file doesn't exist...");
				}
		    } 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");
				die();
		    }
		    if ($view == 3 AND paid()) {
				$modpath .= "modules/$name/$file.php";
	    		if (file_exists($modpath)) {
			    	include($modpath);
	    		} else {
			    	die ("Sorry, such file doesn't exist...");
				}
		    } else {
				$pagetitle = "- "._ACCESSDENIED."";
				include("header.php");
				title("$sitename: "._ACCESSDENIED."");
				OpenTable();
				echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
				    .""._MODULESSUBSCRIBER."";
				if ($subscription_url != "") {
					echo "<br>"._SUBHERE."";
				}
				echo "<br><br>"._GOBACK."";
				CloseTable();
				include("footer.php");
				die();
		    }
		}
    } else {
		include("header.php");
		OpenTable();
		echo "<center>"._MODULENOTACTIVE."<br><br>"
		    .""._GOBACK."</center>";
		CloseTable();
		include("footer.php");
    }
} else {
    die ("Sorry, you can't access this file directly...");
}

?>
Return current item: PHP-PROXIMA