[wp-cvs] wordpress/wp-includes classes.php, 1.2, 1.3 functions.php, 1.134, 1.135 template-functions-comment.php, 1.26, 1.27 template-functions-general.php, 1.38, 1.39

Ryan Boren rboren at users.sourceforge.net
Wed Jul 28 02:43:57 UTC 2004


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

Modified Files:
	classes.php functions.php template-functions-comment.php 
	template-functions-general.php 
Log Message:
Support timestamp permalinks.  Make wider use of is_single().  Bug 0000194.

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.134
retrieving revision 1.135
diff -C2 -d -r1.134 -r1.135
*** functions.php	27 Jul 2004 23:37:45 -0000	1.134
--- functions.php	28 Jul 2004 02:43:54 -0000	1.135
***************
*** 1249,1253 ****
  
          $post = 0;
!         if (strstr($struct, '%postname%') || strstr($struct, '%post_id%')) {
                  $post = 1;
                  $trackbackmatch = $match . $trackbackregex;
--- 1249,1254 ----
  
          $post = 0;
!         if (strstr($struct, '%postname%') || strstr($struct, '%post_id%')
!             || (strstr($struct, '%year%') &&  strstr($struct, '%monthnum%') && strstr($struct, '%day%') && strstr($struct, '%hour%') && strstr($struct, '%minute') && strstr($struct, '%second%'))) {
                  $post = 1;
                  $trackbackmatch = $match . $trackbackregex;

Index: template-functions-comment.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-comment.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** template-functions-comment.php	18 Jun 2004 00:22:09 -0000	1.26
--- template-functions-comment.php	28 Jul 2004 02:43:54 -0000	1.27
***************
*** 18,24 ****
  
  function comments_template() {
! 	global $withcomments, $single, $post, $wpdb, $id, $comment, $cookiehash;
  
! 	if ( $single || $withcomments ) :
  		$req = get_settings('require_name_email');
          $comment_author = isset($_COOKIE['comment_author_'.$cookiehash]) ? trim(stripslashes($_COOKIE['comment_author_'.$cookiehash])) : '';
--- 18,24 ----
  
  function comments_template() {
! 	global $withcomments, $post, $wpdb, $id, $comment, $cookiehash;
  
! 	if ( is_single() || $withcomments ) :
  		$req = get_settings('require_name_email');
          $comment_author = isset($_COOKIE['comment_author_'.$cookiehash]) ? trim(stripslashes($_COOKIE['comment_author_'.$cookiehash])) : '';
***************
*** 72,77 ****
      global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb, $cookiehash;
      global $querystring_start, $querystring_equal, $querystring_separator;
!     global $comment_count_cache, $single;
! 	if (!$single) {
      if ('' == $comment_count_cache["$id"]) {
          $number = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1';");
--- 72,78 ----
      global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb, $cookiehash;
      global $querystring_start, $querystring_equal, $querystring_separator;
!     global $comment_count_cache;
! 
! 	if (! is_single()) {
      if ('' == $comment_count_cache["$id"]) {
          $number = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1';");

Index: template-functions-general.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-general.php,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** template-functions-general.php	12 Jul 2004 06:24:08 -0000	1.38
--- template-functions-general.php	28 Jul 2004 02:43:54 -0000	1.39
***************
*** 99,103 ****
  function wp_title($sep = '»', $display = true) {
      global $wpdb;
!     global $m, $year, $monthnum, $day, $cat, $p, $name, $month, $posts, $single;
  
      // If there's a category
--- 99,103 ----
  function wp_title($sep = '»', $display = true) {
      global $wpdb;
!     global $m, $year, $monthnum, $day, $cat, $p, $name, $month, $posts;
  
      // If there's a category
***************
*** 129,133 ****
  
      // If there's a post
!     if ($single) {
          $title = strip_tags($posts[0]->post_title);
          $title = apply_filters('single_post_title', $title);
--- 129,133 ----
  
      // If there's a post
!     if (is_single()) {
          $title = strip_tags($posts[0]->post_title);
          $title = apply_filters('single_post_title', $title);

Index: classes.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/classes.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** classes.php	28 Jul 2004 01:59:29 -0000	1.2
--- classes.php	28 Jul 2004 02:43:54 -0000	1.3
***************
*** 66,69 ****
--- 66,75 ----
          }
  
+         // If year, month, day, hour, minute, and second are set, a single 
+         // post is being queried.        
+         if (('' != $hour) && ('' != $minute) &&('' != $second) && ('' != $year) && ('' != $monthnum) && ('' != $day)) {
+             $this->single = true;
+         }
+ 
          if (!empty($s)) {
              $this->search = true;




More information about the cvs mailing list