[wp-cvs] wordpress/wp-includes classes.php, 1.8, 1.9 functions.php, 1.144, 1.145

Ryan Boren rboren at users.sourceforge.net
Tue Aug 24 01:24:51 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24471/wp-includes

Modified Files:
	classes.php functions.php 
Log Message:
Add is_year(), is_month(), is_day(), is_time().

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.144
retrieving revision 1.145
diff -C2 -d -r1.144 -r1.145
*** functions.php	23 Aug 2004 23:28:14 -0000	1.144
--- functions.php	24 Aug 2004 01:24:48 -0000	1.145
***************
*** 1603,1606 ****
--- 1603,1630 ----
  }
  
+ function is_year () {
+     global $wp_query;
+ 
+     return $wp_query->is_year;
+ }
+ 
+ function is_month () {
+     global $wp_query;
+ 
+     return $wp_query->is_month;
+ }
+ 
+ function is_day () {
+     global $wp_query;
+ 
+     return $wp_query->is_day;
+ }
+ 
+ function is_time () {
+     global $wp_query;
+ 
+     return $wp_query->is_time;
+ }
+ 
  function is_author () {
      global $wp_query;

Index: classes.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/classes.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** classes.php	16 Aug 2004 22:50:06 -0000	1.8
--- classes.php	24 Aug 2004 01:24:48 -0000	1.9
***************
*** 13,16 ****
--- 13,20 ----
      var $is_archive = false;
      var $is_date = false;
+     var $is_year = false;
+     var $is_month = false;
+     var $is_day = false;
+     var $is_time = false;
      var $is_author = false;
      var $is_category = false;
***************
*** 23,26 ****
--- 27,34 ----
          $this->is_archive = false;
          $this->is_date = false;
+ 	$this->is_year = false;
+ 	$this->is_month = false;
+ 	$this->is_day = false;
+ 	$this->is_time = false;
          $this->is_author = false;
          $this->is_category = false;
***************
*** 50,81 ****
          }
  
!         if ('' != $qv['m']) {
              $this->is_date = true;
          }
  
-         if ('' != $qv['hour']) {
-             $this->is_date = true;            
-         }
- 
          if ('' != $qv['minute']) {
              $this->is_date = true;
          }
  
!         if ('' != $qv['second']) {
!             $this->is_date = true;
          }
  
!         if ('' != $qv['year']) {
              $this->is_date = true;
          }
  
          if ('' != $qv['monthnum']) {
              $this->is_date = true;
          }
  
!         if ('' != $qv['day']) {
              $this->is_date = true;
          }
  
          if ('' != $qv['w']) {
              $this->is_date = true;
--- 58,111 ----
          }
  
!         if ('' != $qv['second']) {
!             $this->is_time = true;
              $this->is_date = true;
          }
  
          if ('' != $qv['minute']) {
+             $this->is_time = true;
              $this->is_date = true;
          }
  
!         if ('' != $qv['hour']) {
!   	    $this->is_time = true;
! 	    $this->is_date = true;
          }
  
!         if ('' != $qv['day']) {
! 	  if (! $this->is_date) {
! 	    $this->is_day = true;
              $this->is_date = true;
+ 	  }
          }
  
          if ('' != $qv['monthnum']) {
+ 	  if (! $this->is_date) {
+ 	    $this->is_month = true;
              $this->is_date = true;
+ 	  }
          }
  
!         if ('' != $qv['year']) {
! 	  if (! $this->is_date) {
! 	    $this->is_year = true;
              $this->is_date = true;
+ 	  }
          }
  
+         if ('' != $qv['m']) {
+             $this->is_date = true;
+ 
+             if (strlen($qv['m']) > 9) {
+ 	      $this->is_time = true;
+ 	    } else if (strlen($qv['m']) > 7) {
+ 	      $this->is_day = true;
+ 	    } else if (strlen($qv['m']) > 5) {
+ 	      $this->is_month = true;
+ 	    } else {
+ 	      $this->is_year = true;
+ 	    }
+ 	}
+ 
          if ('' != $qv['w']) {
              $this->is_date = true;




More information about the cvs mailing list