<?php

/**************************************************************************/
/* Module Gbook MX v2.0 Copyright (c) 2004 by Víctor Simental             */
/* $Revision 30/01/2004 - $Id common.php - v4.1.3    EPX $                */ 
/* @URI: http://www.phpwebmasters.com                                     */ 
/* ============================================                           */
/* Based in Gbook MX v4.1.0 Copyright (c) 2003 by                         */
/* Víctor Simental - http://gbookmx.sourceforge.net                       */
/* ============================================                           */
/* GbookMX is Based in the Gbook v1.0 for PHP Nuke Copyright (c) 2003 by  */
/* http://www.PHP-Mania.com.ar                                            */
/* Programed and Design By Víctor Simental and German Cúevas              */
/* vicmx@phpwebmasters.com                                                */
/*                                                                        */
/* 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.         */
/**************************************************************************/

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}
if(!@file_exists("modules/$module_name/copyright.php"))
	  die("<h1>Your Gbook MX its an copy ilegal<br> <b>DO NOT REMOVE THE COPYRIGHT. YOU'RE NOT ALLOWED TO REMOVE NOR EDIT THIS.!!!!</b></h1>");
require("modules/$module_name/includes/settings.php");
require_once("modules/$module_name/includes/class.sql.php");


if(isset($idioma)){
setcookie("nuevo_idioma", $idioma,time()+31536000);
include("modules/$module_name/language/lang-".$idioma.".php");
}
elseif(isset($nuevo_idioma)){
include("modules/$module_name/language/lang-".$nuevo_idioma.".php");
}
else{
include("modules/$module_name/language/lang-".$countrylang.".php");
}
require("modules/$module_name/config.php");
$mysql = new database($dbhost, $dbuser, $dbpass, $dbname, false);
if(!$mysql->dbconnect) {
    die(""._NOCONNECTION."");
}
   //Check the IP'S
   $ipaban = realip();
   $ipresult = $mysql->sql_query("SELECT ip FROM ".$prefix."_gbook_banip WHERE ip='$ipaban'");
       	if($ipresult) {
        	if($mysql->sql_fetch_row($ipresult)) {
	echo "<p>"._ENTRYDENIED."</p>";
	exit(""._MESSAGEBAN."");
           }
	}
	
?>