[pLog-svn] r3306 - plog/trunk/class/dao

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Sun Apr 30 12:00:22 GMT 2006


Author: jondaley
Date: 2006-04-30 12:00:21 +0000 (Sun, 30 Apr 2006)
New Revision: 3306

Modified:
   plog/trunk/class/dao/articles.class.php
Log:
fixes http://bugs.lifetype.net/view.php?id=798, where future posts were being shown in the next article links, even though show_future_posts was false.

Modified: plog/trunk/class/dao/articles.class.php
===================================================================
--- plog/trunk/class/dao/articles.class.php	2006-04-30 11:44:43 UTC (rev 3305)
+++ plog/trunk/class/dao/articles.class.php	2006-04-30 12:00:21 UTC (rev 3306)
@@ -150,6 +150,8 @@
         function getBlogNextArticle( $article )
         {
             include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
+            $blogInfo = $article->getBlogInfo();
+            $blogSettings = $blogInfo->getSettings();
 
 			// we need to keep the timestamp in mind
 			$date = $article->getDateObject();
@@ -159,9 +161,10 @@
 			$query = "SELECT * FROM ".$this->getPrefix()."articles
 			          WHERE blog_id = ".$article->getBlogId()." AND
 					        date > '".$articleCorrectedDate."' AND
-							status = ".POST_STATUS_PUBLISHED."
-					  ORDER BY DATE ASC
-					  LIMIT 0,1";
+							status = ".POST_STATUS_PUBLISHED;
+            if(!$blogSettings->getValue("show_future_posts_in_calendar"))
+                $query .= " AND date <= NOW()";
+            $query .= " ORDER BY DATE ASC LIMIT 0,1";
 
 			$article = $this->_getBlogArticleFromQuery( $query, false );
 			



More information about the pLog-svn mailing list