Changeset 1185
- Timestamp:
- 04/26/2004 11:54:52 PM (21 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upgrade-functions.php
r1156 r1185 804 804 delete_option($option); 805 805 endforeach; 806 } 806 807 // Forward-thinking 808 $wpdb->query("ALTER TABLE `$tableposts` CHANGE `post_status` `post_status` ENUM( 'publish', 'draft', 'private', 'static' ) DEFAULT 'publish' NOT NULL"); 809 } 810 811 maybe_add_column($tableposts, 'post_parent', "ALTER TABLE `$tableposts` ADD `post_parent` INT NOT NULL ;"); 807 812 808 813 ?> -
trunk/wp-includes/template-functions-comment.php
r1132 r1185 31 31 32 32 function comments_number($zero='No Comments', $one='1 Comment', $more='% Comments', $number='') { 33 global $id, $comment, $tablecomments, $wpdb; 34 if ('' == $number) $number = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1'"); 33 global $id, $comment, $tablecomments, $wpdb, $comment_count_cache; 34 if ('' == $comment_count_cache["$id"]) $number = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1'"); 35 else $number = $comment_count_cache["$id"]; 35 36 if ($number == 0) { 36 37 $blah = $zero; -
trunk/wp-includes/template-functions-general.php
r1157 r1185 93 93 function wp_title($sep = '»', $display = true) { 94 94 global $wpdb, $tableposts, $tablecategories; 95 global $year, $monthnum, $day, $cat, $p, $name, $month ;95 global $year, $monthnum, $day, $cat, $p, $name, $month, $posts, $single; 96 96 97 97 // If there's a category … … 123 123 124 124 // If there's a post 125 if (intval($p) || '' != $name) { 126 if (!$p) { 127 if ($year != '') { 128 $year = '' . intval($year); 129 $where .= ' AND YEAR(post_date)=' . $year; 130 } 131 132 if ($monthnum != '') { 133 $monthnum = '' . intval($monthnum); 134 $where .= ' AND MONTH(post_date)=' . $monthnum; 135 } 136 137 if ($day != '') { 138 $day = '' . intval($day); 139 $where .= ' AND DAYOFMONTH(post_date)=' . $day; 140 } 141 $p = $wpdb->get_var("SELECT ID FROM $tableposts WHERE post_name = '$name' $where"); 142 } 143 $post_data = get_postdata($p); 144 $title = strip_tags(stripslashes($post_data['Title'])); 125 if ($single) { 126 $title = strip_tags(stripslashes($posts[0]->post_title)); 145 127 $title = apply_filters('single_post_title', $title); 146 128 }
Note: See TracChangeset
for help on using the changeset viewer.