| 1 | 261c261,263 |
|---|
| 2 | < get_archives($r['type'], $r['limit'], $r['format'], $r['before'], $r['after'], $r['show_post_count']); |
|---|
| 3 | --- |
|---|
| 4 | > if (!isset($r['orderby'])) $r['orderby'] = 'post_date'; |
|---|
| 5 | > if (!isset($r['sort'])) $r['sort'] = 'DESC'; |
|---|
| 6 | > get_archives($r['type'], $r['limit'], $r['format'], $r['before'], $r['after'], $r['show_post_count'], $r['orderby'], $r['sort']); |
|---|
| 7 | 264c266 |
|---|
| 8 | < function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { |
|---|
| 9 | --- |
|---|
| 10 | > function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false, $orderby='post_date', $sort='') { |
|---|
| 11 | 274a277,280 |
|---|
| 12 | > |
|---|
| 13 | > if ('' = $sort) { |
|---|
| 14 | > $sort = 'DESC'; |
|---|
| 15 | > } |
|---|
| 16 | 300c306 |
|---|
| 17 | < $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit); |
|---|
| 18 | --- |
|---|
| 19 | > $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY $orderby $sort" . $limit); |
|---|
| 20 | 315c321 |
|---|
| 21 | < $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth` FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' ORDER BY post_date DESC" . $limit); |
|---|
| 22 | --- |
|---|
| 23 | > $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth` FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' ORDER BY $orderby $sort" . $limit); |
|---|
| 24 | 326c332 |
|---|
| 25 | < $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 FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' ORDER BY post_date DESC" . $limit); |
|---|
| 26 | --- |
|---|
| 27 | > $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 FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' ORDER BY $orderby $sort" . $limit); |
|---|
| 28 | 345c351 |
|---|
| 29 | < $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' ORDER BY post_date DESC" . $limit); |
|---|
| 30 | --- |
|---|
| 31 | > $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' ORDER BY $orderby $sort" . $limit); |
|---|