Changeset 10731
- Timestamp:
- 03/06/2009 05:06:15 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/comment.php
r10680 r10731 217 217 218 218 $comment_id = absint( $_POST['comment_ID'] ); 219 $comment_post_id = absint( $_POST['comment_post_ id'] );219 $comment_post_id = absint( $_POST['comment_post_ID'] ); 220 220 221 221 check_admin_referer( 'update-comment_' . $comment_id ); -
trunk/wp-admin/update-links.php
r9051 r10731 48 48 $returns = explode("\n", $body); 49 49 50 foreach ($returns as $return) :50 foreach ($returns as $return) { 51 51 $time = substr($return, 0, 19); 52 52 $uri = preg_replace('/(.*?) | (.*?)/', '$2', $return); 53 $w pdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_updated = %s WHERE link_url = %s", $time,$uri) );54 endforeach; 53 $wdpdb->update( $wpdb->links, array('link_updated' => $time), array('link_url' => $uri) ); 54 } 55 55 56 56 ?> -
trunk/wp-includes/comment.php
r10730 r10731 881 881 $comment_type = ''; 882 882 883 $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->comments 884 (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_karma, comment_approved, comment_agent, comment_type, comment_parent, user_id) 885 VALUES (%d, %s, %s, %s, %s, %s, %s, %s, %d, %s, %s, %s, %d, %d)", 886 $comment_post_ID, $comment_author, $comment_author_email, $comment_author_url, $comment_author_IP, $comment_date, $comment_date_gmt, $comment_content, $comment_karma, $comment_approved, $comment_agent, $comment_type, $comment_parent, $user_id) ); 883 $data = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_karma', 'comment_approved', 'comment_agent', 'comment_type', 'comment_parent', 'user_id'); 884 $wpdb->insert($wpdb->comments, $data); 887 885 888 886 $id = (int) $wpdb->insert_id; 889 887 890 if ( $comment_approved == 1 )888 if ( $comment_approved == 1 ) 891 889 wp_update_comment_count($comment_post_ID); 892 890 … … 1081 1079 1082 1080 // Escape data pulled from DB. 1083 foreach ( (array) $comment as $key => $value ) 1084 $comment[$key] = $wpdb->escape($value); 1081 $comment = $wpdb->escape($comment); 1085 1082 1086 1083 // Merge old and new fields with new fields overwriting old ones. … … 1103 1100 $comment_approved = 1; 1104 1101 1105 $wpdb->query( $wpdb->prepare("UPDATE $wpdb->comments SET 1106 comment_content = %s, 1107 comment_author = %s, 1108 comment_author_email = %s, 1109 comment_approved = %s, 1110 comment_karma = %d, 1111 comment_author_url = %s, 1112 comment_date = %s, 1113 comment_date_gmt = %s 1114 WHERE comment_ID = %d", 1115 $comment_content, 1116 $comment_author, 1117 $comment_author_email, 1118 $comment_approved, 1119 $comment_karma, 1120 $comment_author_url, 1121 $comment_date, 1122 $comment_date_gmt, 1123 $comment_ID) ); 1102 $data = compact('comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt'); 1103 $wpdb->update($wpdb->comments, $data, compact('comment_ID')); 1124 1104 1125 1105 $rval = $wpdb->rows_affected; … … 1220 1200 $old = (int) $post->comment_count; 1221 1201 $new = (int) $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1'", $post_id) ); 1222 $wpdb-> query( $wpdb->prepare("UPDATE $wpdb->posts SET comment_count = %d WHERE ID = %d", $new,$post_id) );1202 $wpdb->update( $wpdb->posts, array('comment_count' => $new), array('ID' => $post_id) ); 1223 1203 1224 1204 if ( 'page' == $post->post_type ) -
trunk/wp-settings.php
r10726 r10731 255 255 'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'commment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d', 256 256 'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d', 257 'user_status' => '%d', 'umeta_id' => '%d' );257 'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d'); 258 258 259 259 require_wp_db();
Note: See TracChangeset
for help on using the changeset viewer.