Browse Source

Fixed the code for correct use of entry.php

pecesama 16 years ago
parent
commit
bd78f3c752
12 changed files with 30 additions and 41 deletions
  1. 1 3
      admin/admin.php
  2. 4 3
      admin/ajax.php
  3. 1 0
      admin/comments.php
  4. 0 2
      admin/feeds.php
  5. 1 4
      admin/options.php
  6. 1 4
      admin/settings.php
  7. 0 1
      admin/user.php
  8. 8 5
      entry.php
  9. 1 1
      index.php
  10. 5 5
      install.php
  11. 5 7
      rss.php
  12. 3 6
      update.php

+ 1 - 3
admin/admin.php View File

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

+ 4 - 3
admin/ajax.php View File

@@ -11,9 +11,10 @@ if(!defined('entry'))define('entry', true);
11 11
 
12 12
   =========================== */
13 13
 ?>
14
-<?php	
15
-	include("../classes/user.class.php");
16
-	require_once('../entry.php');	
14
+<?php
15
+	require_once('../entry.php');
16
+	global $user;
17
+	
17 18
 	if ($user->isAdmin()) {
18 19
 		if ($_GET["action"]) {
19 20
 			

+ 1 - 0
admin/comments.php View File

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

+ 0 - 2
admin/feeds.php View File

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

+ 1 - 4
admin/options.php View File

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

+ 1 - 4
admin/settings.php View File

@@ -11,11 +11,8 @@ if(!defined('entry')) define('entry',true);
11 11
 
12 12
   =========================== */
13 13
 
14
-include("../classes/functions.php");
15
-include("../classes/user.class.php");
16
-include("../classes/gelato.class.php");
17
-require_once("../classes/configuration.class.php");
18 14
 require_once('../entry.php');
15
+global $user, $conf, $tumble;
19 16
 
20 17
 if ($user->isAdmin()) {
21 18
 	

+ 0 - 1
admin/user.php View File

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

+ 8 - 5
entry.php View File

@@ -11,6 +11,7 @@
11 11
  * login.php
12 12
  * update.php
13 13
  * rss.php
14
+ * admin/bm.php
14 15
  * admin/index.php
15 16
  * admin/close.php
16 17
  * admin/ajax.php
@@ -18,9 +19,9 @@
18 19
  * admin/options.php
19 20
  * admin/admin.php
20 21
  * admin/comments.php
21
- * admin/users.php
22
- * classes/imgsize.php 
23
- * admin/feeds.php
22
+ * admin/user.php
23
+ * admin/feeds.php 
24
+ * classes/imgsize.php
24 25
  */
25 26
 
26 27
  
@@ -48,10 +49,12 @@ require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'mysql_connection.class
48 49
 require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'streams.class.php');
49 50
 require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php');
50 51
 require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'lang.functions.php');
51
-        
52
+
53
+// Globals to be used throughout the application
52 54
 $user = new user();
53
-$conf = new configuration();
54 55
 $tumble = new gelato();
56
+$conf = new configuration();
57
+$db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
55 58
 
56 59
 
57 60
 session_start();

+ 1 - 1
index.php View File

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

+ 5 - 5
install.php View File

@@ -11,12 +11,12 @@ if(!defined('entry'))define('entry', true);
11 11
 
12 12
   =========================== */
13 13
 
14
-$configFile = dirname(__FILE__).DIRECTORY_SEPARATOR."config.php";
14
+require('entry.php');
15
+global $user, $conf, $tumble;
15 16
 
16
-include('classes/functions.php');
17
-include('classes/install.class.php');
18
- 
17
+include('classes/install.class.php'); 
19 18
 $install = new Install(); 
19
+
20 20
 $install->data = $_POST;
21 21
 $install->check_form();
22 22
 
@@ -200,4 +200,4 @@ $install->check_form();
200 200
 	
201 201
 </div>
202 202
 </body>
203
-</html>
203
+</html>

+ 5 - 7
rss.php View File

@@ -12,12 +12,12 @@ if(!defined('entry')) define('entry',true);
12 12
   =========================== */
13 13
 ?>
14 14
 <?php
15
-	header("Content-type: text/xml; charset=utf-8");	
16
-	
17
-	require(dirname(__FILE__)."/config.php");
18
-	include("classes/configuration.class.php");
15
+	header("Content-type: text/xml; charset=utf-8");
19 16
 	$isFeed = true;
20
-	$conf = new configuration();
17
+	
18
+	require('entry.php');
19
+	global $conf, $tumble;
20
+	
21 21
 	
22 22
 	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
23 23
 ?>
@@ -36,8 +36,6 @@ if(!defined('entry')) define('entry',true);
36 36
 
37 37
 
38 38
 <?php
39
-	include("classes/gelato.class.php");
40
-	$tumble = new gelato();
41 39
 	$rs = $tumble->getPosts("20");
42 40
 	if ($tumble->contarRegistros()>0) {		
43 41
 

+ 3 - 6
update.php View File

@@ -13,7 +13,8 @@ if(!defined('entry')) define('entry',true);
13 13
 ?>
14 14
 <?php
15 15
 
16
-$configFile = dirname(__FILE__).DIRECTORY_SEPARATOR."config.php";
16
+require('entry.php');
17
+global $configFile, $db;
17 18
 	
18 19
 if (!file_exists($configFile)) {
19 20
 	$mensaje = "
@@ -23,11 +24,7 @@ if (!file_exists($configFile)) {
23 24
 	die($mensaje);
24 25
 } else {
25 26
 	require($configFile);
26
-} 
27
-
28
-require_once('classes/mysql_connection.class.php'); 
29
-
30
-$db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
27
+}
31 28
 
32 29
 $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('shorten_links', '0');";
33 30