Browse Source

Fixed the code for correct use of entry.php

pecesama 17 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
 
11
 
12
   =========================== */
12
   =========================== */
13
 
13
 
14
-include("../classes/user.class.php");
15
-include("../classes/functions.php");
16
-require_once("../classes/configuration.class.php");
17
 require_once('../entry.php');
14
 require_once('../entry.php');
15
+global $user, $conf, $tumble;
18
 
16
 
19
 if ($user->isAdmin()) {
17
 if ($user->isAdmin()) {
20
 	
18
 	

+ 4 - 3
admin/ajax.php View File

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
 	if ($user->isAdmin()) {
18
 	if ($user->isAdmin()) {
18
 		if ($_GET["action"]) {
19
 		if ($_GET["action"]) {
19
 			
20
 			

+ 1 - 0
admin/comments.php View File

13
 ?>
13
 ?>
14
 <?php
14
 <?php
15
 require_once('../entry.php');
15
 require_once('../entry.php');
16
+global $user, $conf, $tumble;
16
 
17
 
17
 $comment = new comments();
18
 $comment = new comments();
18
 $template = new plantillas("admin");
19
 $template = new plantillas("admin");

+ 0 - 2
admin/feeds.php View File

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

+ 1 - 4
admin/options.php View File

12
   =========================== */
12
   =========================== */
13
 ?>
13
 ?>
14
 <?php
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
 require_once('../entry.php');
15
 require_once('../entry.php');
16
+global $user, $conf, $tumble;
20
 
17
 
21
 if ($user->isAdmin()) {
18
 if ($user->isAdmin()) {
22
 	
19
 	

+ 1 - 4
admin/settings.php View File

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
 require_once('../entry.php');
14
 require_once('../entry.php');
15
+global $user, $conf, $tumble;
19
 
16
 
20
 if ($user->isAdmin()) {
17
 if ($user->isAdmin()) {
21
 	
18
 	

+ 0 - 1
admin/user.php View File

14
 <?php
14
 <?php
15
 require('../entry.php');
15
 require('../entry.php');
16
 global $user, $conf, $tumble;
16
 global $user, $conf, $tumble;
17
-$template = new plantillas("admin");
18
 
17
 
19
 $user = new user();
18
 $user = new user();
20
 $conf = new configuration();
19
 $conf = new configuration();

+ 8 - 5
entry.php View File

11
  * login.php
11
  * login.php
12
  * update.php
12
  * update.php
13
  * rss.php
13
  * rss.php
14
+ * admin/bm.php
14
  * admin/index.php
15
  * admin/index.php
15
  * admin/close.php
16
  * admin/close.php
16
  * admin/ajax.php
17
  * admin/ajax.php
18
  * admin/options.php
19
  * admin/options.php
19
  * admin/admin.php
20
  * admin/admin.php
20
  * admin/comments.php
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
 require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'streams.class.php');
49
 require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'streams.class.php');
49
 require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php');
50
 require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php');
50
 require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'lang.functions.php');
51
 require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'lang.functions.php');
51
-        
52
+
53
+// Globals to be used throughout the application
52
 $user = new user();
54
 $user = new user();
53
-$conf = new configuration();
54
 $tumble = new gelato();
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
 session_start();
60
 session_start();

+ 1 - 1
index.php View File

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

+ 5 - 5
install.php View File

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
 $install = new Install(); 
18
 $install = new Install(); 
19
+
20
 $install->data = $_POST;
20
 $install->data = $_POST;
21
 $install->check_form();
21
 $install->check_form();
22
 
22
 
200
 	
200
 	
201
 </div>
201
 </div>
202
 </body>
202
 </body>
203
-</html>
203
+</html>

+ 5 - 7
rss.php View File

12
   =========================== */
12
   =========================== */
13
 ?>
13
 ?>
14
 <?php
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
 	$isFeed = true;
16
 	$isFeed = true;
20
-	$conf = new configuration();
17
+	
18
+	require('entry.php');
19
+	global $conf, $tumble;
20
+	
21
 	
21
 	
22
 	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
22
 	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
23
 ?>
23
 ?>
36
 
36
 
37
 
37
 
38
 <?php
38
 <?php
39
-	include("classes/gelato.class.php");
40
-	$tumble = new gelato();
41
 	$rs = $tumble->getPosts("20");
39
 	$rs = $tumble->getPosts("20");
42
 	if ($tumble->contarRegistros()>0) {		
40
 	if ($tumble->contarRegistros()>0) {		
43
 
41
 

+ 3 - 6
update.php View File

13
 ?>
13
 ?>
14
 <?php
14
 <?php
15
 
15
 
16
-$configFile = dirname(__FILE__).DIRECTORY_SEPARATOR."config.php";
16
+require('entry.php');
17
+global $configFile, $db;
17
 	
18
 	
18
 if (!file_exists($configFile)) {
19
 if (!file_exists($configFile)) {
19
 	$mensaje = "
20
 	$mensaje = "
23
 	die($mensaje);
24
 	die($mensaje);
24
 } else {
25
 } else {
25
 	require($configFile);
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
 $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('shorten_links', '0');";
29
 $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('shorten_links', '0');";
33
 		
30