Fixed the code for correct use of entry.php

master
pecesama 2008-01-07 07:43:43 +00:00
parent fdfc498647
commit bd78f3c752
12 changed files with 30 additions and 41 deletions

View File

@ -11,10 +11,8 @@ if(!defined('entry')) define('entry',true);
=========================== */ =========================== */
include("../classes/user.class.php");
include("../classes/functions.php");
require_once("../classes/configuration.class.php");
require_once('../entry.php'); require_once('../entry.php');
global $user, $conf, $tumble;
if ($user->isAdmin()) { if ($user->isAdmin()) {

View File

@ -12,8 +12,9 @@ if(!defined('entry'))define('entry', true);
=========================== */ =========================== */
?> ?>
<?php <?php
include("../classes/user.class.php");
require_once('../entry.php'); require_once('../entry.php');
global $user;
if ($user->isAdmin()) { if ($user->isAdmin()) {
if ($_GET["action"]) { if ($_GET["action"]) {

View File

@ -13,6 +13,7 @@ if(!defined('entry')) define('entry',true);
?> ?>
<?php <?php
require_once('../entry.php'); require_once('../entry.php');
global $user, $conf, $tumble;
$comment = new comments(); $comment = new comments();
$template = new plantillas("admin"); $template = new plantillas("admin");

View File

@ -14,8 +14,6 @@ if(!defined('entry')) define('entry', true);
<?php <?php
require('../entry.php'); require('../entry.php');
global $user, $conf, $tumble; global $user, $conf, $tumble;
$template = new plantillas("admin");
$user= new User(); $user= new User();
if ($user->isAdmin()) { if ($user->isAdmin()) {

View File

@ -12,11 +12,8 @@ if(!defined('entry')) define('entry',true);
=========================== */ =========================== */
?> ?>
<?php <?php
include("../classes/functions.php");
include("../classes/user.class.php");
include("../classes/gelato.class.php");
require_once("../classes/configuration.class.php");
require_once('../entry.php'); require_once('../entry.php');
global $user, $conf, $tumble;
if ($user->isAdmin()) { if ($user->isAdmin()) {

View File

@ -11,11 +11,8 @@ if(!defined('entry')) define('entry',true);
=========================== */ =========================== */
include("../classes/functions.php");
include("../classes/user.class.php");
include("../classes/gelato.class.php");
require_once("../classes/configuration.class.php");
require_once('../entry.php'); require_once('../entry.php');
global $user, $conf, $tumble;
if ($user->isAdmin()) { if ($user->isAdmin()) {

View File

@ -14,7 +14,6 @@ if(!defined('entry')) define('entry', true);
<?php <?php
require('../entry.php'); require('../entry.php');
global $user, $conf, $tumble; global $user, $conf, $tumble;
$template = new plantillas("admin");
$user = new user(); $user = new user();
$conf = new configuration(); $conf = new configuration();

View File

@ -11,6 +11,7 @@
* login.php * login.php
* update.php * update.php
* rss.php * rss.php
* admin/bm.php
* admin/index.php * admin/index.php
* admin/close.php * admin/close.php
* admin/ajax.php * admin/ajax.php
@ -18,9 +19,9 @@
* admin/options.php * admin/options.php
* admin/admin.php * admin/admin.php
* admin/comments.php * admin/comments.php
* admin/users.php * admin/user.php
* classes/imgsize.php
* admin/feeds.php * admin/feeds.php
* classes/imgsize.php
*/ */
@ -49,9 +50,11 @@ require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'streams.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php'); require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'lang.functions.php'); require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'lang.functions.php');
// Globals to be used throughout the application
$user = new user(); $user = new user();
$conf = new configuration();
$tumble = new gelato(); $tumble = new gelato();
$conf = new configuration();
$db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
session_start(); session_start();

View File

@ -15,7 +15,7 @@ if(!defined('entry'))define('entry', true);
// Received a valid request, better start setting globals we'll need throughout the app in entry.php // Received a valid request, better start setting globals we'll need throughout the app in entry.php
require_once('entry.php'); require_once('entry.php');
global $user, $tumble, $conf, $db; global $user, $tumble, $conf;
$template = new plantillas($conf->template); $template = new plantillas($conf->template);
// My approach to MVC // My approach to MVC

View File

@ -11,12 +11,12 @@ if(!defined('entry'))define('entry', true);
=========================== */ =========================== */
$configFile = dirname(__FILE__).DIRECTORY_SEPARATOR."config.php"; require('entry.php');
global $user, $conf, $tumble;
include('classes/functions.php');
include('classes/install.class.php'); include('classes/install.class.php');
$install = new Install(); $install = new Install();
$install->data = $_POST; $install->data = $_POST;
$install->check_form(); $install->check_form();

10
rss.php
View File

@ -13,11 +13,11 @@ if(!defined('entry')) define('entry',true);
?> ?>
<?php <?php
header("Content-type: text/xml; charset=utf-8"); header("Content-type: text/xml; charset=utf-8");
require(dirname(__FILE__)."/config.php");
include("classes/configuration.class.php");
$isFeed = true; $isFeed = true;
$conf = new configuration();
require('entry.php');
global $conf, $tumble;
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?> ?>
@ -36,8 +36,6 @@ if(!defined('entry')) define('entry',true);
<?php <?php
include("classes/gelato.class.php");
$tumble = new gelato();
$rs = $tumble->getPosts("20"); $rs = $tumble->getPosts("20");
if ($tumble->contarRegistros()>0) { if ($tumble->contarRegistros()>0) {

View File

@ -13,7 +13,8 @@ if(!defined('entry')) define('entry',true);
?> ?>
<?php <?php
$configFile = dirname(__FILE__).DIRECTORY_SEPARATOR."config.php"; require('entry.php');
global $configFile, $db;
if (!file_exists($configFile)) { if (!file_exists($configFile)) {
$mensaje = " $mensaje = "
@ -25,10 +26,6 @@ if (!file_exists($configFile)) {
require($configFile); require($configFile);
} }
require_once('classes/mysql_connection.class.php');
$db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
$sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('shorten_links', '0');"; $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('shorten_links', '0');";
$db->ejecutarConsulta($sqlStr); $db->ejecutarConsulta($sqlStr);