[wp-cvs]
wordpress/wp-includes classes.php, 1.31, 1.32 functions.php,
1.224, 1.225
Ryan Boren
rboren at users.sourceforge.net
Sat Dec 18 00:28:27 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17981/wp-includes
Modified Files:
classes.php functions.php
Log Message:
Rework query precedence for bug 541. Add is_trackback().
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.224
retrieving revision 1.225
diff -C2 -d -r1.224 -r1.225
*** functions.php 16 Dec 2004 02:57:05 -0000 1.224
--- functions.php 18 Dec 2004 00:28:24 -0000 1.225
***************
*** 1196,1199 ****
--- 1196,1205 ----
}
+ function is_trackback () {
+ global $wp_query;
+
+ return $wp_query->is_trackback;
+ }
+
function is_home () {
global $wp_query;
Index: classes.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/classes.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** classes.php 15 Dec 2004 01:23:38 -0000 1.31
--- classes.php 18 Dec 2004 00:28:24 -0000 1.32
***************
*** 24,27 ****
--- 24,28 ----
var $is_search = false;
var $is_feed = false;
+ var $is_trackback = false;
var $is_home = false;
var $is_404 = false;
***************
*** 40,43 ****
--- 41,45 ----
$this->is_search = false;
$this->is_feed = false;
+ $this->is_trackback = false;
$this->is_home = false;
$this->is_404 = false;
***************
*** 62,166 ****
if ('' != $qv['name']) {
$this->is_single = true;
! }
!
! if (($qv['p'] != '') && ($qv['p'] != 'all')) {
$this->is_single = true;
! }
!
! if ('' != $qv['static'] || '' != $qv['pagename'] || '' != $qv['page_id']) {
$this->is_page = true;
$this->is_single = false;
! }
!
! if ( (int) $qv['second']) {
! $this->is_time = true;
! $this->is_date = true;
! }
!
! if ( (int) $qv['minute']) {
! $this->is_time = true;
! $this->is_date = true;
! }
!
! if ( (int) $qv['hour']) {
! $this->is_time = true;
! $this->is_date = true;
! }
! if ( (int) $qv['day']) {
! if (! $this->is_date) {
! $this->is_day = true;
$this->is_date = true;
}
- }
! if ( (int) $qv['monthnum']) {
! if (! $this->is_date) {
! $this->is_month = true;
$this->is_date = true;
}
- }
! if ( (int) $qv['year']) {
! if (! $this->is_date) {
! $this->is_year = true;
$this->is_date = true;
}
- }
! if ( (int) $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;
! }
! // If year, month, day, hour, minute, and second are set, a single
! // post is being queried.
! if (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) {
! $this->is_single = true;
! }
! if (!empty($qv['s'])) {
! $this->is_search = true;
! }
! if (empty($qv['cat']) || ($qv['cat'] == 'all') || ($qv['cat'] == '0')) {
! $this->is_category = false;
! } else {
! if (stristr($qv['cat'],'-')) {
$this->is_category = false;
} else {
! $this->is_category = true;
}
- }
! if ('' != $qv['category_name']) {
! $this->is_category = true;
! }
! // single, page, date, and search override category.
! if ($this->is_single || $this->is_page || $this->is_date || $this->is_search) {
! $this->is_category = false;
! }
! if ((empty($qv['author'])) || ($qv['author'] == 'all') || ($qv['author'] == '0')) {
! $this->is_author = false;
! } else {
! $this->is_author = true;
! }
! if ('' != $qv['author_name']) {
! $this->is_author = true;
}
--- 64,161 ----
if ('' != $qv['name']) {
$this->is_single = true;
! } else if (($qv['p'] != '') && ($qv['p'] != 'all')) {
$this->is_single = true;
! } else if (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) {
! // If year, month, day, hour, minute, and second are set, a single
! // post is being queried.
! $this->is_single = true;
! } else if ('' != $qv['static'] || '' != $qv['pagename'] || '' != $qv['page_id']) {
$this->is_page = true;
$this->is_single = false;
! } else if (!empty($qv['s'])) {
! $this->is_search = true;
! } else {
! // Look for archive queries. Dates, categories, authors.
! if ( (int) $qv['second']) {
! $this->is_time = true;
$this->is_date = true;
}
! if ( (int) $qv['minute']) {
! $this->is_time = true;
$this->is_date = true;
}
! if ( (int) $qv['hour']) {
! $this->is_time = true;
$this->is_date = true;
}
! if ( (int) $qv['day']) {
! if (! $this->is_date) {
! $this->is_day = true;
! $this->is_date = true;
! }
}
! if ( (int) $qv['monthnum']) {
! if (! $this->is_date) {
! $this->is_month = true;
! $this->is_date = true;
! }
! }
! if ( (int) $qv['year']) {
! if (! $this->is_date) {
! $this->is_year = true;
! $this->is_date = true;
! }
! }
! if ( (int) $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;
! }
!
! if (empty($qv['cat']) || ($qv['cat'] == 'all') || ($qv['cat'] == '0')) {
$this->is_category = false;
} else {
! if (stristr($qv['cat'],'-')) {
! $this->is_category = false;
! } else {
! $this->is_category = true;
! }
}
! if ('' != $qv['category_name']) {
! $this->is_category = true;
! }
! if ((empty($qv['author'])) || ($qv['author'] == 'all') || ($qv['author'] == '0')) {
! $this->is_author = false;
! } else {
! $this->is_author = true;
! }
! if ('' != $qv['author_name']) {
! $this->is_author = true;
! }
! if ( ($this->is_date || $this->is_author || $this->is_category)) {
! $this->is_archive = true;
! }
}
***************
*** 169,172 ****
--- 164,171 ----
}
+ if ('' != $qv['tb']) {
+ $this->is_trackback = true;
+ }
+
if ('404' == $qv['error']) {
$this->is_404 = true;
***************
*** 177,186 ****
}
! if ( ($this->is_date || $this->is_author || $this->is_category)
! && (! ($this->is_single || $this->is_page)) ) {
! $this->is_archive = true;
! }
!
! if ( ! ($this->is_archive || $this->is_single || $this->is_page || $this->is_search || $this->is_feed || $this->is_404)) {
$this->is_home = true;
}
--- 176,180 ----
}
! if ( ! ($this->is_archive || $this->is_single || $this->is_page || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404)) {
$this->is_home = true;
}
***************
*** 900,904 ****
}
! function generate_rewrite_rules($permalink_structure = '', $page = true, $feed = true, $forcomments = false) {
$feedregex2 = '(feed|rdf|rss|rss2|atom)/?$';
$feedregex = 'feed/' . $feedregex2;
--- 894,898 ----
}
! function generate_rewrite_rules($permalink_structure, $page = true, $feed = true, $forcomments = false, $walk_dirs = true) {
$feedregex2 = '(feed|rdf|rss|rss2|atom)/?$';
$feedregex = 'feed/' . $feedregex2;
More information about the cvs
mailing list