[pLog-svn] r5896 - plog/branches/lifetype-1.2/class/dao

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Mon Sep 3 18:10:17 EDT 2007


Author: jondaley
Date: 2007-09-03 18:10:17 -0400 (Mon, 03 Sep 2007)
New Revision: 5896

Modified:
   plog/branches/lifetype-1.2/class/dao/articles.class.php
Log:
no change, just cleaner code

Modified: plog/branches/lifetype-1.2/class/dao/articles.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/articles.class.php	2007-09-03 20:44:57 UTC (rev 5895)
+++ plog/branches/lifetype-1.2/class/dao/articles.class.php	2007-09-03 22:10:17 UTC (rev 5896)
@@ -623,14 +623,12 @@
             $numPostsPerDayQuery = "SELECT date
                                     FROM {$prefix}articles 
                                     WHERE status = 1 
-                                    AND blog_id = $blogId";
+                                    AND blog_id = $blogId
+                                    AND MONTH(FROM_UNIXTIME(UNIX_TIMESTAMP(date) + $SecondsDiff)) = $month 
+                                    AND YEAR(FROM_UNIXTIME(UNIX_TIMESTAMP(date) + $SecondsDiff)) = $year";
+
             if( !$blogSettings->getValue( "show_future_posts_in_calendar" )) {
-                $numPostsPerDayQuery .= " AND MONTH(FROM_UNIXTIME(UNIX_TIMESTAMP(date) + $SecondsDiff)) = $month ";
-                $numPostsPerDayQuery .= " AND YEAR(FROM_UNIXTIME(UNIX_TIMESTAMP(date) + $SecondsDiff)) = $year ";
                 $numPostsPerDayQuery .= " AND date <= NOW()";
-            } else {
-                $numPostsPerDayQuery .= " AND MONTH(FROM_UNIXTIME(UNIX_TIMESTAMP(date) + $SecondsDiff)) = $month ";
-                $numPostsPerDayQuery .= " AND YEAR(FROM_UNIXTIME(UNIX_TIMESTAMP(date) + $SecondsDiff)) = $year ";
             }
 
             $result = $this->Execute( $numPostsPerDayQuery );



More information about the pLog-svn mailing list