3283 | | $comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits"); |
| 3283 | $key = md5( serialize( array( $cjoin, $cwhere, $cgroupby, $corderby, $climits ) ) ); |
| 3284 | $last_changed = wp_cache_get( 'last_changed', 'comment' ); |
| 3285 | if ( ! $last_changed ) { |
| 3286 | $last_changed = microtime(); |
| 3287 | wp_cache_set( 'last_changed', $last_changed, 'comment' ); |
| 3288 | } |
| 3289 | $cache_key = "get_comment_feed_ids:$key:$last_changed"; |
| 3290 | $comment_ids = wp_cache_get( $cache_key, 'comment' ); |
| 3291 | if ( false === $comment_ids ) { |
| 3292 | $comment_ids = (array) $wpdb->get_results( "SELECT $distinct $wpdb->comments.comment_ID FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits" ); |
| 3293 | wp_cache_add( $cache_key, $comment_ids, 'comment' ); |
| 3294 | } |
| 3295 | |
3655 | | $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits"; |
3656 | | $comments = $wpdb->get_results($comments_request); |
| 3667 | $key = md5( serialize( array( $cjoin, $cwhere, $cgroupby, $corderby, $climits ) ) ); |
| 3668 | $last_changed = wp_cache_get( 'last_changed', 'comment' ); |
| 3669 | if ( ! $last_changed ) { |
| 3670 | $last_changed = microtime(); |
| 3671 | wp_cache_set( 'last_changed', $last_changed, 'comment' ); |
| 3672 | } |
| 3673 | $cache_key = "get_comment_feed_ids:$key:$last_changed"; |
| 3674 | $comment_ids = wp_cache_get( $cache_key, 'comment' ); |
| 3675 | if ( false === $comment_ids ) { |
| 3676 | $comment_ids = (array) $wpdb->get_results( "SELECT $distinct $wpdb->comments.comment_ID FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits" ); |
| 3677 | wp_cache_add( $cache_key, $comment_ids, 'comment' ); |
| 3678 | } |
| 3679 | |