";
if (empty($before_widget))
$before_widget='';
if (empty($after_widget))
$after_widget='
';
foreach ( $defaults as $key => $value )
if ( !isset($options[$key]) )
$options[$key] = $defaults[$key];
echo $before_widget;
echo $before_title;
echo (!empty($options['title'])) ? $options['title'] : "On This Day In...";
echo $after_title;
?>
get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAY(post_date) AS `day`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND MONTH(post_date)=" . date(n) . " AND DAY(post_date)=" . date(j) ." GROUP BY YEAR(post_date), MONTH(post_date), DAY(post_date) ORDER BY post_date DESC" . $limit);
if ($otd_results) {
?>
get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND MONTH(post_date)=" . date(n) . " AND DAY(post_date)=" . date(j) ." ORDER BY post_date DESC" . $limit);
if ($otd_results) {
?>-
ID);
$title = $post->post_title;
?>
-