'; $yearscount = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) as year, count(ID) as pcount FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' GROUP BY year ORDER BY post_date DESC"); foreach($yearscount as $yearc) { $output .= '
  • '.$yearc->year.' ('.$yearc->pcount.' '.__(ajaxar_format_posts_count($yearc->pcount)).')'; $output .= '
  • '; } $output .= ''; return $output; } function ajaxar_get_months($ayear) { global $wpdb, $month; $output = ''; return $output; } function ajaxar_get_posts($ayear, $amonth) { global $wpdb; $output = ''; return $output; } function ajaxar_format_comments_count($count) { $c = (int) $count; if ($c == 0) { return 'Comments'; } else if ($c == 1) { // Comment isn't translated in all languages, modify here the text for only one comment return 'Comment'; } return 'Comments'; } function ajaxar_format_posts_count($count) { $c = (int) $count; if ($c == 0) { return 'Posts'; } else if ($c == 1) { // Post isn't translated in all languages, modify here the text for only one post return 'Post'; } return 'Posts'; } function ajaxar_js() { wp_print_scripts( array( 'sack' )); $output .= ''."\n"; return $output; } function ajaxar_snippet ($content) { if (eregi ('\[ajaxar\]', $content)) { return eregi_replace ('\[ajaxar\]', ajaxar_get_years(), $content); } return $content; } add_action ('the_content', 'ajaxar_snippet'); ?>