[wp-cvs] wordpress/wp-includes classes.php, 1.59, 1.60 comment-functions.php, 1.28, 1.29 functions.php, 1.261, 1.262

Ryan Boren rboren at users.sourceforge.net
Mon Feb 14 09:17:25 GMT 2005


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

Modified Files:
	classes.php comment-functions.php functions.php 
Log Message:
Load comments-popup template through the index.

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.261
retrieving revision 1.262
diff -C2 -d -r1.261 -r1.262
*** functions.php	14 Feb 2005 01:57:48 -0000	1.261
--- functions.php	14 Feb 2005 09:17:23 -0000	1.262
***************
*** 1245,1248 ****
--- 1245,1254 ----
  }
  
+ function is_comments_popup () {
+     global $wp_query;
+ 
+     return $wp_query->is_comments_popup;
+ }
+ 
  function is_paged () {
      global $wp_query;
***************
*** 1577,1580 ****
--- 1583,1595 ----
  }
  
+ function get_comments_popup_template() {
+ 	if ( file_exists( TEMPLATEPATH . '/comments-popup.php') )
+ 		$template = TEMPLATEPATH . '/comments-popup.php';
+ 	else
+ 		$template = get_theme_base() . '/default/comments-popup.php';
+ 
+ 	return apply_filters('comments_popup_template', $template);
+ }
+ 
  // Borrowed from the PHP Manual user notes. Convert entities, while
  // preserving already-encoded entities:

Index: comment-functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/comment-functions.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** comment-functions.php	12 Feb 2005 08:58:27 -0000	1.28
--- comment-functions.php	14 Feb 2005 09:17:23 -0000	1.29
***************
*** 78,85 ****
  
  		if (empty ($file)) {
! 			if ( file_exists( TEMPLATEPATH . '/comments-popup.php') )
! 				$wpcommentspopupfile = str_replace(ABSPATH, '', TEMPLATEPATH . '/comments-popup.php');
! 			else
! 				$wpcommentspopupfile = 'wp-content/themes/default/comments-popup.php';
  		} else {
  			$wpcommentspopupfile = $file;
--- 78,82 ----
  
  		if (empty ($file)) {
! 			$wpcommentspopupfile = '';  // Use the index.
  		} else {
  			$wpcommentspopupfile = $file;
***************
*** 113,119 ****
          echo '<a href="';
          if ($wpcommentsjavascript) {
!             echo get_settings('siteurl') . '/' . $wpcommentspopupfile.'?p='.$id.'amp;c=1';
!             //echo get_permalink();
!             echo '" onclick="wpopen(this.href); return false"';
          } else {
              // if comments_popup_script() is not in the template, display simple comment link
--- 110,119 ----
          echo '<a href="';
          if ($wpcommentsjavascript) {
! 					if ( empty($wpcommentspopupfile) )
! 						$home = get_settings('home');
! 					else
! 						$home = get_settings('siteurl');
! 					echo $home . '/' . $wpcommentspopupfile.'?comments_popup='.$id;
! 					echo '" onclick="wpopen(this.href); return false"';
          } else {
              // if comments_popup_script() is not in the template, display simple comment link

Index: classes.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/classes.php,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** classes.php	13 Feb 2005 19:45:04 -0000	1.59
--- classes.php	14 Feb 2005 09:17:22 -0000	1.60
***************
*** 27,30 ****
--- 27,31 ----
  	var $is_home = false;
  	var $is_404 = false;
+ 	var $is_comments_popup = false;
  	var $is_admin = false;
  
***************
*** 188,196 ****
  		}
  
  		if (strstr($_SERVER['PHP_SELF'], 'wp-admin/')) {
  			$this->is_admin = true;
  		}
  
! 		if ( ! ($this->is_archive || $this->is_single || $this->is_page || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin)) {
  			$this->is_home = true;
  		}
--- 189,201 ----
  		}
  
+ 		if ('' != $qv['comments_popup']) {
+ 			$this->is_comments_popup = true;
+ 		}
+ 
  		if (strstr($_SERVER['PHP_SELF'], 'wp-admin/')) {
  			$this->is_admin = true;
  		}
  
! 		if ( ! ($this->is_archive || $this->is_single || $this->is_page || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_comments_popup)) {
  			$this->is_home = true;
  		}
***************
*** 313,316 ****
--- 318,324 ----
  		}
  
+ 		if ( intval($q['comments_popup']) )
+ 			$q['p'] = intval($q['comments_popup']);
+ 
  		// If a post number is specified, load that post
  		if (($q['p'] != '') && intval($q['p']) != 0) {



More information about the cvs mailing list