[pLog-svn] r4169 - in plog/branches/lifetype-1.1.2/class/summary: action view

oscar at devel.lifetype.net oscar at devel.lifetype.net
Mon Oct 23 10:13:38 GMT 2006


Author: oscar
Date: 2006-10-23 10:13:37 +0000 (Mon, 23 Oct 2006)
New Revision: 4169

Modified:
   plog/branches/lifetype-1.1.2/class/summary/action/summarydefaultaction.class.php
   plog/branches/lifetype-1.1.2/class/summary/view/summarybloglistview.class.php
   plog/branches/lifetype-1.1.2/class/summary/view/summarypostlistview.class.php
Log:
fixed issue 1091 (http://bugs.lifetype.net/view.php?id=1091) -- browsing summary.php in a site where there's no blogs is a bit silly but let's fix it anyway. Also having a SummaryRequestGenerator class will have its advantages in the future...


Modified: plog/branches/lifetype-1.1.2/class/summary/action/summarydefaultaction.class.php
===================================================================
--- plog/branches/lifetype-1.1.2/class/summary/action/summarydefaultaction.class.php	2006-10-23 06:47:24 UTC (rev 4168)
+++ plog/branches/lifetype-1.1.2/class/summary/action/summarydefaultaction.class.php	2006-10-23 10:13:37 UTC (rev 4169)
@@ -3,6 +3,7 @@
 	include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
     include_once( PLOG_CLASS_PATH."class/summary/dao/summarystatsconstants.class.php" );  
+	include_once( PLOG_CLASS_PATH."class/summary/net/summaryrequestgenerator.class.php" );      
 
      /**
       * This is the one and only default action. It simply fetches all the most recent
@@ -80,14 +81,9 @@
 			$this->_view->setValue( "step", $step );
 			$this->_view->setValue( "globalArticleCategoryId", $globalArticleCategoryId );
 		
-			// we just need a random blog so... we'll get one :)
+			// summary request generator
+			$this->_view->setValue( "url", new SummaryRequestGenerator());
 			
-			$allBlogs = $blogs->getAllBlogs( BLOG_STATUS_ACTIVE, ALL_BLOG_CATEGORIES, "", 1, 1);
-			$randomBlog = array_pop( $allBlogs );
-
-			$url = $randomBlog->getBlogRequestGenerator();
-			$this->_view->setValue( "url", $url );
-			
 			$this->setCommonData();
 
             return true;

Modified: plog/branches/lifetype-1.1.2/class/summary/view/summarybloglistview.class.php
===================================================================
--- plog/branches/lifetype-1.1.2/class/summary/view/summarybloglistview.class.php	2006-10-23 06:47:24 UTC (rev 4168)
+++ plog/branches/lifetype-1.1.2/class/summary/view/summarybloglistview.class.php	2006-10-23 10:13:37 UTC (rev 4169)
@@ -6,6 +6,7 @@
     include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
 	include_once( PLOG_CLASS_PATH."class/summary/dao/summarystats.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/blogcategories.class.php" ); 	
+	include_once( PLOG_CLASS_PATH."class/summary/net/summaryrequestgenerator.class.php" );    
 	
 	/**
 	 * shows a paged list of blogs
@@ -85,10 +86,8 @@
 			$this->setValue( "min", $min );
 			$this->setValue( "step", $step );
 
-			// we just need a random blog so... we'll get one :)
-			$randomBlog = array_pop( $blogs->getAllBlogs( BLOG_STATUS_ACTIVE, ALL_BLOG_CATEGORIES, "", 1, 1) );
-			$url = $randomBlog->getBlogRequestGenerator();
-			$this->setValue( "url", $url );			
+			// summary request generator
+			$this->setValue( "url", new SummaryRequestGenerator());			
 		
 			// let the parent view do its job
 			parent::render();

Modified: plog/branches/lifetype-1.1.2/class/summary/view/summarypostlistview.class.php
===================================================================
--- plog/branches/lifetype-1.1.2/class/summary/view/summarypostlistview.class.php	2006-10-23 06:47:24 UTC (rev 4168)
+++ plog/branches/lifetype-1.1.2/class/summary/view/summarypostlistview.class.php	2006-10-23 10:13:37 UTC (rev 4169)
@@ -6,6 +6,7 @@
     include_once( PLOG_CLASS_PATH."class/data/pager/pager.class.php" );
     include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
 	include_once( PLOG_CLASS_PATH."class/summary/dao/summarystats.class.php" );
+	include_once( PLOG_CLASS_PATH."class/summary/net/summaryrequestgenerator.class.php" );	
 	
 	/**
 	 * shows a paged list of blogs
@@ -87,12 +88,8 @@
 			$this->setValue( "min", $min );
 			$this->setValue( "step", $step );
 					
-			// we just need a random blog so... we'll get one :)
-			include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
-			$blogs = new Blogs();
-			$randomBlog = array_pop( $blogs->getAllBlogs( BLOG_STATUS_ACTIVE, ALL_BLOG_CATEGORIES, "", 1, 1) );
-			$url = $randomBlog->getBlogRequestGenerator();
-			$this->setValue( "url", $url );
+			// summary request generator
+			$this->setValue( "url", new SummaryRequestGenerator());
 			
 			// let the parent view do its job
 			parent::render();



More information about the pLog-svn mailing list