[pLog-svn] r3349 - in plog/trunk/class/summary: action dao

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sat May 6 13:51:06 GMT 2006


Author: oscar
Date: 2006-05-06 13:51:06 +0000 (Sat, 06 May 2006)
New Revision: 3349

Modified:
   plog/trunk/class/summary/action/summaryaction.class.php
   plog/trunk/class/summary/dao/summarystats.class.php
Log:
added support for showing/not showing an entire blog in the summary, and cleaned up a couple of warning messages


Modified: plog/trunk/class/summary/action/summaryaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summaryaction.class.php	2006-05-06 13:34:43 UTC (rev 3348)
+++ plog/trunk/class/summary/action/summaryaction.class.php	2006-05-06 13:51:06 UTC (rev 3349)
@@ -51,7 +51,7 @@
 		        }
 				elseif ( $this->_config->getValue( "use_http_accept_language_detection", HTTP_ACCEPT_LANGUAGE_DETECTION) == 1 )
 				{
-					$localeCode =& $this->_matchHttpAcceptLanguages( $serverVars['HTTP_ACCEPT_LANGUAGE'] );
+					$localeCode = $this->_matchHttpAcceptLanguages( $serverVars['HTTP_ACCEPT_LANGUAGE'] );
 				}
 		    }
 		    
@@ -93,7 +93,7 @@
         function _matchHttpAcceptLanguages(&$httpAcceptLanguage)
         {
 			$acceptedLanguages = explode( ',', $httpAcceptLanguage );
-			$availableLanguages =& Locales::getAvailableLocales();
+			$availableLanguages = Locales::getAvailableLocales();
 			$primaryLanguageMatch = '';
 
 			// we iterate through the array of languages sent by the UA and test every single 

Modified: plog/trunk/class/summary/dao/summarystats.class.php
===================================================================
--- plog/trunk/class/summary/dao/summarystats.class.php	2006-05-06 13:34:43 UTC (rev 3348)
+++ plog/trunk/class/summary/dao/summarystats.class.php	2006-05-06 13:51:06 UTC (rev 3349)
@@ -81,6 +81,7 @@
 							AND a.date <= ".$this->_now."
 							AND a.in_summary_page = '1'
 							AND a.num_nonspam_comments > 0
+							AND b.show_in_summary = '1'
 					  ORDER BY a.num_nonspam_comments DESC
 					  LIMIT 0, $max";
 
@@ -123,6 +124,7 @@
 				 AND b.status = ".BLOG_STATUS_ACTIVE."
                  AND a.date <= ".$this->_now." AND a.date > ".$this->_sevenDaysAgo."
 				 AND in_summary_page = '1'
+				 AND b.show_in_summary = '1'
 				 ORDER BY a.num_reads DESC";
 
             if( $maxPosts > 0 )
@@ -158,8 +160,11 @@
          function getRecentBlogs( $maxBlogs = 0 )
          {
 			include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
-         	$query = "SELECT * FROM ".$this->getPrefix()."blogs WHERE status = ".BLOG_STATUS_ACTIVE." 
-                          ORDER BY id DESC";
+         	$query = "SELECT * 
+			          FROM ".$this->getPrefix()."blogs 
+					  WHERE status = ".BLOG_STATUS_ACTIVE." 
+					  AND b.show_in_summary = '1'
+					  ORDER BY id DESC";
 
             if( $maxBlogs > 0 )
             	$query .= " LIMIT 0,".$maxBlogs;
@@ -203,7 +208,9 @@
                       INNER JOIN {$prefix}blogs AS b 
                       ON b.id = a.blog_id AND b.status = ".BLOG_STATUS_ACTIVE."
                       WHERE a.date >= ".$this->_sevenDaysAgo." AND a.date <= ".$this->_now." 
-					  AND in_summary_page = '1' GROUP BY a.id
+					  AND in_summary_page = '1' 
+					  AND b.show_in_summary = '1'
+					  GROUP BY a.id
                       ORDER BY rank DESC";
 
             if( $maxBlogs > 0 )
@@ -255,6 +262,7 @@
 					        AND a.blog_id = b.id
 					        AND b.status = ".BLOG_STATUS_ACTIVE."
 					        AND a.status = ".POST_STATUS_PUBLISHED."
+							AND b.show_in_summary = '1'
 							AND a.in_summary_page = '1'";
 
 			if($globaArticleCategoryId != ALL_GLOBAL_ARTICLE_CATEGORIES)
@@ -315,7 +323,8 @@
 					        AND a.blog_id = b.id
 					        AND b.status = ".BLOG_STATUS_ACTIVE."
 					        AND a.status = ".POST_STATUS_PUBLISHED."
-							AND a.in_summary_page = '1'";
+							AND a.in_summary_page = '1'
+							AND b.show_in_summary = '1'";
 
 			if($globaArticleCategoryId != ALL_GLOBAL_ARTICLE_CATEGORIES)
 				$query .= " AND a.global_category_id = '".Db::qstr($globaArticleCategoryId)."'";				
@@ -354,6 +363,7 @@
 					        AND a.blog_id = b.id
 					        AND b.status = ".BLOG_STATUS_ACTIVE."
 					        AND a.status = ".POST_STATUS_PUBLISHED."
+							AND b.show_in_summary = '1'
 							AND a.in_summary_page = '1'";
 
 			if($globaArticleCategoryId != ALL_GLOBAL_ARTICLE_CATEGORIES)



More information about the pLog-svn mailing list