| 397 | | $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit); |
| | 397 | $query = "SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC $limit"; |
| | 398 | $key = md5($query); |
| | 399 | $cache = wp_cache_get( 'wp_get_archives' , 'general'); |
| | 400 | if ( !isset( $cache[ $key ] ) ) { |
| | 401 | $arcresults = $wpdb->get_results($query); |
| | 402 | $cache[ $key ] = $arcresults; |
| | 403 | wp_cache_add( 'wp_get_archives', $cache, 'general' ); |
| | 404 | } else { |
| | 405 | $arcresults = $cache[ $key ]; |
| | 406 | } |
| 409 | | $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date DESC" . $limit); |
| | 418 | $query = "SELECT DISTINCT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date DESC $limit"; |
| | 419 | $key = md5($query); |
| | 420 | $cache = wp_cache_get( 'wp_get_archives' , 'general'); |
| | 421 | if ( !isset( $cache[ $key ] ) ) { |
| | 422 | $arcresults = $wpdb->get_results($query); |
| | 423 | $cache[ $key ] = $arcresults; |
| | 424 | wp_cache_add( 'wp_get_archives', $cache, 'general' ); |
| | 425 | } else { |
| | 426 | $arcresults = $cache[ $key ]; |
| | 427 | } |
| 421 | | $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC" . $limit); |
| | 439 | $query = "SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC $limit"; |
| | 440 | $key = md5($query); |
| | 441 | $cache = wp_cache_get( 'wp_get_archives' , 'general'); |
| | 442 | if ( !isset( $cache[ $key ] ) ) { |
| | 443 | $arcresults = $wpdb->get_results($query); |
| | 444 | $cache[ $key ] = $arcresults; |
| | 445 | wp_cache_add( 'wp_get_archives', $cache, 'general' ); |
| | 446 | } else { |
| | 447 | $arcresults = $cache[ $key ]; |
| | 448 | } |
| 435 | | $arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC" . $limit); |
| | 462 | $query = "SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC $limit"; |
| | 463 | $key = md5($query); |
| | 464 | $cache = wp_cache_get( 'wp_get_archives' , 'general'); |
| | 465 | if ( !isset( $cache[ $key ] ) ) { |
| | 466 | $arcresults = $wpdb->get_results($query); |
| | 467 | $cache[ $key ] = $arcresults; |
| | 468 | wp_cache_add( 'wp_get_archives', $cache, 'general' ); |
| | 469 | } else { |
| | 470 | $arcresults = $cache[ $key ]; |
| | 471 | } |
| 456 | | $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit"); |
| | 492 | $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit"; |
| | 493 | $key = md5($query); |
| | 494 | $cache = wp_cache_get( 'wp_get_archives' , 'general'); |
| | 495 | if ( !isset( $cache[ $key ] ) ) { |
| | 496 | $arcresults = $wpdb->get_results($query); |
| | 497 | $cache[ $key ] = $arcresults; |
| | 498 | wp_cache_add( 'wp_get_archives', $cache, 'general' ); |
| | 499 | } else { |
| | 500 | $arcresults = $cache[ $key ]; |
| | 501 | } |