[pLog-svn] r6121 - plog/branches/lifetype-1.2/class/data

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Tue Dec 18 23:37:09 EST 2007


Author: jondaley
Date: 2007-12-18 23:37:08 -0500 (Tue, 18 Dec 2007)
New Revision: 6121

Modified:
   plog/branches/lifetype-1.2/class/data/plogcalendar.class.php
Log:
make calendar not display links that are really old or way in the future.  Search engines like to just read all the empty months.  As the comment says, this should probably be smarter - either a preference or dynamically decide what the right value is

Modified: plog/branches/lifetype-1.2/class/data/plogcalendar.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/data/plogcalendar.class.php	2007-12-17 22:12:10 UTC (rev 6120)
+++ plog/branches/lifetype-1.2/class/data/plogcalendar.class.php	2007-12-19 04:37:08 UTC (rev 6121)
@@ -8,7 +8,14 @@
     lt_include( PLOG_CLASS_PATH."class/locale/locales.class.php" );
     lt_include( PLOG_CLASS_PATH."class/net/requestgenerator.class.php" );
 
-   /**    
+// artificially define min and maximum years - maybe it'd be better to query
+// for min and max post dates?  // max is easy enough, but min is 0 a lot of the
+// time, since draft posts are labelled with a 0 (which arguably shouldn't be the
+// case anyway)
+define("MIN_YEAR", 1980);
+define("MAX_YEAR", 2030);
+
+    /**    
     * \ingroup Data
     *
     * A derived class is required to reimplement some methods from the parent
@@ -20,7 +27,7 @@
     */
     class PlogCalendar extends Calendar 
 	{
-
+        
         var $_dayPosts;
         var $_blogInfo;
         var $rg;
@@ -67,6 +74,9 @@
          */
         function getCalendarLink( $month, $year )
         {
+            if($year < MIN_YEAR || $year >= MAX_YEAR)
+                return "";
+
             if( $month < 10 ) $month = "0".$month;
             $date = "$year$month";
 



More information about the pLog-svn mailing list