Q($sql); while($DBR = $DB->Fetch_key()) { $post_year = substr($DBR['post_date'],0,4); $all_years[$post_year] = $post_year; } $year_list = "/(".implode("|",$all_years).")/"; if(isset($_GET['y']) && strlen($_GET['y']) == 4 && preg_match($year_list,$_GET['y'])) { $select_date = $_GET['y']; } else { $select_date = date("Y",time()); } $page["name"] = $select_date." News & Topics"; // 記事 と カテゴリ の 関係を紐づける -------------------------------------------- $sql = "SELECT `object_id`,`term_taxonomy_id` FROM `wp_baby_term_relationships` ORDER BY `term_taxonomy_id`"; $DB->Q($sql); while($DBR = $DB->Fetch_key()) { $term_id[$DBR["object_id"]][$DBR["term_taxonomy_id"]] = NULL; } // 記事を 取得 -------------------------------------------- $now_date_time = date("Y-m-d H:i:s",time()); $sql = "SELECT `ID`,`post_date`,`post_title` FROM `wp_baby_posts` WHERE `post_status` IN ('publish','future') AND `post_date` <= '$now_date_time' AND `post_type` = 'post' AND `post_date` LIKE '$select_date%' ORDER BY `post_date` DESC LIMIT 50"; $DB->Q($sql); while($DBR = $DB->Fetch_key()) { $news_list[$DBR["ID"]] = array("date" => $DBR["post_date"], "title" => $DBR["post_title"], "category" => $term_id[$DBR["ID"]]); } // アイキャッチ画像 を 取得 -------------------------------------------- $sql = "SELECT `post_id`,`meta_value`,`post_title`,`guid` FROM `wp_baby_postmeta` LEFT JOIN `wp_baby_posts` ON `wp_baby_postmeta`.`meta_value` = `wp_baby_posts`.`ID` WHERE `meta_key` = '_thumbnail_id'"; $DB->Q($sql); while($DBR = $DB->Fetch_key()) { $eyecatch_list[$DBR["post_id"]] = $DBR["meta_value"]; $eyecatch_list[$DBR["post_id"]] = $DBR["post_title"]; $DBR["guid"] = preg_replace("/\.jpg/","-150x150.jpg",$DBR["guid"]); $DBR["guid"] = preg_replace("/\.gif/","-150x150.gif",$DBR["guid"]); $DBR["guid"] = preg_replace("/\.png/","-150x150.png",$DBR["guid"]); $eyecatch_list[$DBR["post_id"]] = $DBR["guid"]; } ?> <?=$html_header["site_name"];?>|<?=$page["name"];?>
TOP  

$newsV) { $newsV["date"] = substr(preg_replace("/\-/",".",$newsV["date"]),0,10); $post_date = (int)preg_replace("/\./","",$newsV["date"]); ?>
$categoryV) { if($categoryK == "1") { ?>