Ticket #1892: extra-comment-api-calls.diff
| File extra-comment-api-calls.diff, 5.1 KB (added by , 21 years ago) |
|---|
-
wp-includes/functions.php
2146 2146 return $file; 2147 2147 } 2148 2148 2149 ?> 2149 function get_num_queries() { 2150 global $wpdb; 2151 return $wpdb->num_queries; 2152 } 2153 2154 ?> 2155 No newline at end of file -
wp-includes/comment-functions.php
863 863 return true; 864 864 } 865 865 866 function get_approved_comments($post_id) { 867 global $wpdb; 868 return $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post_id AND comment_approved = '1' ORDER BY comment_date"); 869 } 870 866 871 ?> -
wp-content/themes/classic/footer.php
3 3 4 4 <?php get_sidebar(); ?> 5 5 6 <p class="credit"><!--<?php echo $wpdb->num_queries; ?> queries. <?php timer_stop(1); ?> seconds. --> <cite><?php echo sprintf(__("Powered by <a href='http://wordpress.org/' title='%s'><strong>WordPress</strong></a>"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?></cite></p>6 <p class="credit"><!--<?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. --> <cite><?php echo sprintf(__("Powered by <a href='http://wordpress.org/' title='%s'><strong>WordPress</strong></a>"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?></cite></p> 7 7 8 8 </div> 9 9 -
wp-content/themes/classic/comments-popup.php
32 32 $comment_author = (isset($_COOKIE['comment_author_' . COOKIEHASH])) ? trim($_COOKIE['comment_author_'. COOKIEHASH]) : ''; 33 33 $comment_author_email = (isset($_COOKIE['comment_author_email_'. COOKIEHASH])) ? trim($_COOKIE['comment_author_email_'. COOKIEHASH]) : ''; 34 34 $comment_author_url = (isset($_COOKIE['comment_author_url_'. COOKIEHASH])) ? trim($_COOKIE['comment_author_url_'. COOKIEHASH]) : ''; 35 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date");36 $commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $wpdb->posts WHERE ID = $id");35 $comments = get_approved_comments($id); 36 $commentstatus = get_post($id); 37 37 if (!empty($commentstatus->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) { // and it doesn't match the cookie 38 38 echo(get_the_password_form()); 39 39 } else { ?> -
wp-content/themes/default/footer.php
6 6 <a href="http://wordpress.org/">WordPress</a> 7 7 <br /><a href="feed:<?php bloginfo('rss2_url'); ?>">Entries (RSS)</a> 8 8 and <a href="feed:<?php bloginfo('comments_rss2_url'); ?>">Comments (RSS)</a>. 9 <!-- <?php echo $wpdb->num_queries; ?> queries. <?php timer_stop(1); ?> seconds. -->9 <!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. --> 10 10 </p> 11 11 </div> 12 12 </div> -
wp-content/themes/default/comments-popup.php
32 32 $comment_author = (isset($_COOKIE['comment_author_' . COOKIEHASH])) ? trim($_COOKIE['comment_author_'. COOKIEHASH]) : ''; 33 33 $comment_author_email = (isset($_COOKIE['comment_author_email_'. COOKIEHASH])) ? trim($_COOKIE['comment_author_email_'. COOKIEHASH]) : ''; 34 34 $comment_author_url = (isset($_COOKIE['comment_author_url_'. COOKIEHASH])) ? trim($_COOKIE['comment_author_url_'. COOKIEHASH]) : ''; 35 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date");36 $ commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $wpdb->posts WHERE ID = $id");37 if (!empty($ commentstatus->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) { // and it doesn't match the cookie35 $comments = get_approved_comments($id); 36 $post = get_post($id); 37 if (!empty($post->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie 38 38 echo(get_the_password_form()); 39 39 } else { ?> 40 40 … … 52 52 <p>No comments yet.</p> 53 53 <?php } ?> 54 54 55 <?php if ('open' == $ commentstatus->comment_status) { ?>55 <?php if ('open' == $post->comment_status) { ?> 56 56 <h2>Leave a comment</h2> 57 57 <p>Line and paragraph breaks automatic, e-mail address never displayed, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p> 58 58
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)