0 ORDER BY post_date DESC";
$querycount++;
$arc_results = $wpdb->get_results($arc_sql);
foreach ($arc_results as $arc_row) {
$arc_year = $arc_row->yr;
$arc_month = $arc_row->mn;
echo "
';
echo $month[zeroise($arc_month,2)].' '.$arc_year;
echo "\n";
}
} elseif ($archive_mode == 'daily') {
$arc_sql="SELECT DISTINCT YEAR(post_date) AS yr, MONTH(post_date) AS mn, DAYOFMONTH(post_date) as dom FROM $tableposts WHERE post_date < '$now' AND post_category > 0 ORDER BY post_date DESC";
$querycount++;
$arc_results = $wpdb->get_results($arc_sql);
foreach ($arc_results as $arc_row) {
$arc_year = $arc_row->yr;
$arc_month = $arc_row->mn;
$arc_dayofmonth = $arc_row->dom;
echo "';
echo mysql2date($archive_day_date_format, $arc_year.'-'.zeroise($arc_month,2).'-'.zeroise($arc_dayofmonth,2).' 00:00:00');
echo "\n";
}
} elseif ($archive_mode == 'weekly') {
if (!isset($start_of_week)) {
$start_of_week = 1;
}
$arc_sql="SELECT DISTINCT YEAR(post_date) AS yr, MONTH(post_date) AS mn, DAYOFMONTH(post_date) AS dom, WEEK(post_date) AS wk FROM $tableposts WHERE post_date < '$now' AND post_category > 0 ORDER BY post_date DESC";
$querycount++;
$arc_results = $wpdb->get_results($arc_sql);
$arc_w_last = '';
foreach ($arc_results as $arc_row) {
$arc_year = $arc_row->yr;
$arc_w = $arc_row->wk;
if ($arc_w != $arc_w_last) {
$arc_w_last = $arc_w;
$arc_ymd = $arc_year.'-'.zeroise($arc_row->mn,2).'-' .zeroise($arc_row->dom,2);
$arc_week = get_weekstartend($arc_ymd, $start_of_week);
$arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']);
$arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']);
echo "";
echo $arc_week_start.$archive_week_separator.$arc_week_end;
echo "\n";
}
}
} elseif ($archive_mode == 'postbypost') {
$requestarc = " SELECT ID, post_date, post_title FROM $tableposts WHERE post_date < '$now' AND post_category > 0 AND post_status = 'publish' ORDER BY post_date DESC";
$querycount++;
$resultarc = $wpdb->get_results($requestarc);
foreach ($resultarc as $row) {
if ($row->post_date != '0000-00-00 00:00:00') {
echo "ID.'">';
$arc_title = stripslashes($row->post_title);
if ($arc_title) {
echo strip_tags($arc_title);
} else {
echo $row->ID;
}
echo "\n";
}
}
}
# echo $querycount."
\n";
# timer_stop(1,8);
?>