includes/pageprocess.php
changeset 592 27377179fe58
parent 571 66e14e61613e
child 593 4f9bec0d65c1
--- a/includes/pageprocess.php	Mon Jun 30 17:22:29 2008 -0400
+++ b/includes/pageprocess.php	Wed Jul 02 19:36:44 2008 -0400
@@ -157,8 +157,6 @@
     if ( !is_int($revision_id) )
       $revision_id = 0;
     
-    profiler_log("PageProcessor [{$namespace}:{$page_id}]: Ran initial checks");
-    
     $this->_setup( $page_id, $namespace, $revision_id );
   }
   
@@ -172,7 +170,7 @@
     global $db, $session, $paths, $template, $plugins; // Common objects
     global $lang;
     
-    profiler_log("PageProcessor [{$this->namespace}:{$this->page_id}]: Started send process");
+    profiler_log('PageProcessor: send() called');
     
     if ( !$this->perms->get_permissions('read') )
     {
@@ -190,7 +188,6 @@
       {
         // Page isn't whitelisted, behave as normal
         $this->err_access_denied();
-        profiler_log("PageProcessor [{$this->namespace}:{$this->page_id}]: Finished send process");
         return false;
       }
     }
@@ -237,7 +234,6 @@
           if ( $this->password != $password )
           {
             $this->err_wrong_password();
-            profiler_log("PageProcessor [{$this->namespace}:{$this->page_id}]: Finished send process");
             return false;
           }
         }
@@ -245,6 +241,7 @@
     }
     if ( $this->page_exists && $this->namespace != 'Special' && $this->namespace != 'Admin' && $do_stats )
     {
+      require_once(ENANO_ROOT.'/includes/stats.php');
       doStats($this->page_id, $this->namespace);
     }
     if ( $this->namespace == 'Special' || $this->namespace == 'Admin' )
@@ -265,9 +262,7 @@
       $func_name = "page_{$this->namespace}_{$this->page_id}";
       if ( function_exists($func_name) )
       {
-        profiler_log("PageProcessor [{$this->namespace}:{$this->page_id}]: Calling special/admin page");
         $result = @call_user_func($func_name);
-        profiler_log("PageProcessor [{$this->namespace}:{$this->page_id}]: Finished send process");
         return $result;
       }
       else
@@ -287,7 +282,6 @@
           echo "<h2>$title</h2>
                 <p>$message</p>";
         }
-        profiler_log("PageProcessor [{$this->namespace}:{$this->page_id}]: Finished send process");
         return false;
       }
     }
@@ -372,13 +366,11 @@
         $template->init_vars($this);
       }
       
-      // die($this->page_id);
+      $text = $this->fetch_text();
       
-      $text = $this->fetch_text();
       if ( $text == 'err_no_text_rows' )
       {
         $this->err_no_rows();
-        profiler_log("PageProcessor [{$this->namespace}:{$this->page_id}]: Finished send process");
         return false;
       }
       else
@@ -409,7 +401,6 @@
         }
       }
     }
-    profiler_log("PageProcessor [{$this->namespace}:{$this->page_id}]: Finished send process");
   }
   
   /**
@@ -1029,6 +1020,7 @@
     global $lang;
     
     $text = $this->fetch_text();
+    
     $text = preg_replace('/([\s]*)__NOBREADCRUMBS__([\s]*)/', '', $text);
     $text = preg_replace('/([\s]*)__NOTOC__([\s]*)/', '', $text);
     
@@ -1228,7 +1220,6 @@
     }
     else
     {
-      
       $q = $db->sql_query('SELECT t.page_text, t.char_tag, l.time_id FROM '.table_prefix."page_text AS t\n"
                         . "  LEFT JOIN " . table_prefix . "logs AS l\n"
                         . "    ON ( l.page_id = t.page_id AND l.namespace = t.namespace )\n"