[pLog-svn] r1818 - in plog/branches/plog-1.1-ben/class/summary: action dao view

ork at devel.plogworld.net ork at devel.plogworld.net
Tue Apr 12 10:49:05 GMT 2005


Author: ork
Date: 2005-04-12 10:49:04 +0000 (Tue, 12 Apr 2005)
New Revision: 1818

Modified:
   plog/branches/plog-1.1-ben/class/summary/action/summarydefaultaction.class.php
   plog/branches/plog-1.1-ben/class/summary/dao/summarystats.class.php
   plog/branches/plog-1.1-ben/class/summary/view/summarycachedview.class.php
Log:
changed includes


Modified: plog/branches/plog-1.1-ben/class/summary/action/summarydefaultaction.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/summary/action/summarydefaultaction.class.php	2005-04-11 21:22:24 UTC (rev 1817)
+++ plog/branches/plog-1.1-ben/class/summary/action/summarydefaultaction.class.php	2005-04-12 10:49:04 UTC (rev 1818)
@@ -2,9 +2,6 @@
 
 	include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
     include_once( PLOG_CLASS_PATH."class/summary/dao/summarystats.class.php" );
-    include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
-    include_once( PLOG_CLASS_PATH."class/logger/LogUtil.php" );
 
      /**
       * This is the one and only default action. It simply fetches all the most recent
@@ -28,6 +25,7 @@
          */
         function perform()
         {
+            include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
 			$this->_view = new SummaryCachedView( "index", Array( "summary" => "default" ));
 			if( $this->_view->isCached()) {
 				// if the view is already cached... move along! nothing to see here

Modified: plog/branches/plog-1.1-ben/class/summary/dao/summarystats.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/summary/dao/summarystats.class.php	2005-04-11 21:22:24 UTC (rev 1817)
+++ plog/branches/plog-1.1-ben/class/summary/dao/summarystats.class.php	2005-04-12 10:49:04 UTC (rev 1818)
@@ -1,12 +1,9 @@
 <?php
 
     include_once( PLOG_CLASS_PATH."class/dao/model.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
-	include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
-	include_once( PLOG_CLASS_PATH."class/dao/articlecommentstatus.class.php" );
-	include_once( PLOG_CLASS_PATH."class/dao/articlestatus.class.php" );
-	include_once( PLOG_CLASS_PATH."class/dao/blogstatus.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/articlecommentstatus.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/articlestatus.class.php" );
 	
 	/**
 	 * maximum number of items that will be shown per page in the summary
@@ -38,6 +35,8 @@
          */
         function getMostCommentedArticles( $maxPosts = 0, $ignoreTopic = "", $ignoreText = "" ,$date = 0)
         {
+            include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
+
 			$prefix = $this->getPrefix();
 			$query = " SELECT COUNT(*) as total_comments, a.* 
 					   FROM {$prefix}articles_comments AS c, {$prefix}articles AS a, {$prefix}articles_text t
@@ -84,26 +83,28 @@
          */
         function getMostReadArticles( $maxPosts = 0, $ignoreTopic = "", $ignoreText = "", $date = 0 )
         {
-					$query = " SELECT 
-                                   a.id as id, 
-                                   a.properties as properties, 
-                                   a.date as date, 
-                                   a.user_id as user_id,
-                                   a.blog_id as blog_id,
-                                   a.status as status,
-                                   a.num_reads as num_reads,
-                                   a.slug as slug,
-                                   t.article_id as article_id,
-                                   t.text as text,
-                                   t.topic as topic,
-                                   t.normalized_text as normalized_text,
-                                   t.normalized_topic as normalized_topic,
-                                   t.mangled_topic as mangled_topic
-                               FROM ".$this->getPrefix()."articles a, ".$this->getPrefix()."articles_text t 
-                               WHERE a.id = t.article_id 
-                                   AND status = ".POST_STATUS_PUBLISHED."
-							       AND TO_DAYS(NOW()) - TO_DAYS(date) < 7  ";
+             include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
 
+             $query = " SELECT 
+                 a.id as id, 
+                 a.properties as properties, 
+                 a.date as date, 
+                 a.user_id as user_id,
+                 a.blog_id as blog_id,
+                 a.status as status,
+                 a.num_reads as num_reads,
+                 a.slug as slug,
+                 t.article_id as article_id,
+                 t.text as text,
+                 t.topic as topic,
+                 t.normalized_text as normalized_text,
+                 t.normalized_topic as normalized_topic,
+                 t.mangled_topic as mangled_topic
+                 FROM ".$this->getPrefix()."articles a, ".$this->getPrefix()."articles_text t 
+                 WHERE a.id = t.article_id 
+                 AND status = ".POST_STATUS_PUBLISHED."
+                 AND TO_DAYS(NOW()) - TO_DAYS(date) < 7  ";
+
 			// ignore certain topics and/or certain texts
 			if( $ignoreTopic != "" )
 				$query .= " AND t.topic NOT LIKE '".Db::qstr( $ignoreTopic )."' ";
@@ -206,6 +207,7 @@
           */
          function getAllUsersPaged( $page, $itemsPerPage )
          {
+            include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
 			// calculate the limits...
 			if( $page > 0 ) {
 				$start = (($page - 1) * $itemsPerPage);

Modified: plog/branches/plog-1.1-ben/class/summary/view/summarycachedview.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/summary/view/summarycachedview.class.php	2005-04-11 21:22:24 UTC (rev 1817)
+++ plog/branches/plog-1.1-ben/class/summary/view/summarycachedview.class.php	2005-04-12 10:49:04 UTC (rev 1818)
@@ -1,10 +1,6 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/view/view.class.php" );
-    include_once( PLOG_CLASS_PATH."class/template/templateservice.class.php" );
-	include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
-	include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
-	include_once( PLOG_CLASS_PATH."class/net/http/httpcache.class.php" );	
 
 	/**
 	 * This class should extended SmartyView but SmartyView was designed to work with BlogInfo
@@ -31,6 +27,8 @@
         
         function generateTemplate()
         {
+            include_once( PLOG_CLASS_PATH."class/template/templateservice.class.php" );
+
             $templateService = new TemplateService();
             $this->_template = $templateService->customTemplate( $this->_templateName, "summary", true );
         }
@@ -63,6 +61,9 @@
 		
 		function sendUncachedOutput()
 		{
+	        include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
+	        include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
+
 		    $config =& Config::getConfig();
 			$this->_locale =& Locales::getLocale( $config->getValue("default_locale" ));
 			$this->_params->setValue( "version", new Version());
@@ -74,6 +75,9 @@
 
         function render()
         {
+	       include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
+	       include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
+
 			// set the view character set based on the default locale
             $config =& Config::getConfig();
             $locale =& Locales::getLocale( $config->getValue( "default_locale" ));			
@@ -83,6 +87,7 @@
 			
 			// check if support for conditional HTTP requests is enabled
 			if( $config->getValue( "template_http_cache_enabled" )) {
+	            include_once( PLOG_CLASS_PATH."class/net/http/httpcache.class.php" );	
 				// some debug information
 				$timestamp = $this->_template->getCreationTimestamp();
 				// and now send the correct headers
@@ -101,4 +106,4 @@
 			}
         }
     }
-?>
\ No newline at end of file
+?>




More information about the pLog-svn mailing list