get_col("SELECT DISTINCT YEAR(post_date) as year FROM {$wpdb->posts[$wp_id]} ORDER BY year ASC");
$output = '
'.NL;
foreach ($years as $year) {
$output .= '
'.NL;
foreach ($users as $user) {
$output .= '
'.NL;
} else {
$output .= '
'.NL;
}
if ($orderby == 'title') {
$output .= '
'.NL;
} else {
$output .= '
'.NL;
}
if ($orderby == 'category') {
$output .= '
'.NL;
} else {
$output .= '
'.NL;
}
$output = '
'.NL;
echo $output;
}
function show_order_select() {
global $order;
$output ='';
if ($order == 'ASC') {
$output .= '
'.NL;
} else {
$output .= '
'.NL;
}
if ($order == 'DESC') {
$output .= '
'.NL;
} else {
$output .= '
'.NL;
}
$output = '
'.NL;
echo $output;
}
function archive_header($before='', $after='') {
global $post, $orderby, $month, $previous, $siteurl, $blogfilename, $archiveheadstart, $archiveheadend, $category_name, $blog_charset;
$output ='';
$orderby = explode(' ', $orderby);
$orderby = $orderby[0];
if ('date' == $orderby || empty($orderby)) {
$thismonth = mysql2date('m', $post->post_date);
$thisyear = mysql2date('Y', $post->post_date);
$thisdate = $thisyear.$thismonth;
if ($thisdate != $previous) {
$thismonth = mysql2date('m', $post->post_date);
$output .= '
'.$thisyear.'年'.$month[$thismonth].'';
}
$previous = $thisdate;
} elseif ('title' == $orderby) {
$thisletter = ucfirst(mb_substr($post->yomi,0,1,$blog_charset));
if ($thisletter > "ん") $thisletter = "漢字";
if ($thisletter != $previous) {
$output .= "
".$thisletter;
}
$previous = $thisletter;
} elseif ('category' == $orderby) {
$thiscategory = $category_name;
if ($thiscategory != $previous) {
$output .= '
'.get_catname($thiscategory).'';
}
$previous = $thiscategory;
}
if (!empty($output)) {
$output = $before.$output.$after.NL;
echo $output;
}
}
function archive_date($format='Y-m-d H:i:s') {
global $post;
echo mysql2date($format, $post->post_date);
}
function cmp($a, $b) {
global $order;
if ($order == 'ASC') {
return strcasecmp($a->yomi, $b->yomi);
} else {
return strcasecmp($b->yomi, $a->yomi);
}
}
?>
get_var("SELECT ID FROM {$wpdb->users[$wp_id]} WHERE user_nicename='".$author_name."'");
$whichauthor .= ' AND (post_author = '.intval($author).')';
}
if (!empty($year)) $where .= ' AND YEAR(post_date)=' . $year;
if (!empty($whichauthor)) $where .= $whichauthor;
?>
過去ログ :
get_results("SELECT * FROM {$wpdb->categories[$wp_id]} WHERE 1=1 ORDER BY cat_name $order");
foreach ($dogs as $catt) {
$categories = $wpdb->get_results("SELECT * FROM {$wpdb->post2cat[$wp_id]} WHERE category_id = $catt->cat_ID");
if ($categories) {
foreach ($categories as $post2category) {
$posts = $wpdb->get_results("SELECT * FROM {$wpdb->posts[$wp_id]} WHERE $post2category->post_id = ID".$where);
global $category_name;
$category_name = $post2category->category_id;
if ($posts) {
foreach ($posts as $post) {
start_wp();
archive_header('
', '
');
archive_date('Y/m/d H:i:s') ?>:
過去ログ :
array("pipe", "r"), // stdin is a pipe that the child will read from
1 => array("pipe", "w"), // stdout is a pipe that the child will write to
);
$process = proc_open($kakasi." -kH -KH -JH", $descriptorspec, $pipes);
if (is_resource($process)) {
for($i = 0; $i < count($posts); $i++) {
fputs($pipes[0], mb_convert_encoding($posts[$i]->post_title."\n", $kakasi_encode, $blog_charset));
}
fclose($pipes[0]);
for($i = 0; $i < count($posts); $i++) {
$posts[$i]->yomi = mb_convert_encoding(fgets ($pipes[1]), $blog_charset, $kakasi_encode);
}
fclose($pipes[1]);
$return_value = proc_close($process);
}
} else {
for($i = 0; $i < count($posts); $i++) {
$posts[$i]->yomi = mb_convert_kana($posts[$i]->post_title,"KcV", $blog_charset);
}
}
usort($posts, "cmp");
}
?>
', '') ?>
:
querycount; ?> queries. sec.
Powered by WordPress Module based on WordPress ME & WordPress