1) { header("HTTP/1.1 404 Not Found"); header('location: http://www.baby.co.jp/'); } */ // インクルード ===================================================================== include_once("_include/settings/html_header.php"); include_once("_include/settings/sub_title_shuffle.php"); $pgi = 0; $page["name"] = "株式会社 赤ちゃんの城"; // データベースコネクト ===================================================================== include_once('/usr/home/ad1132yvdm/data/mat_MySQL_class.php'); $DB = new mat_MySQL_class; // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ // // 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' ORDER BY `post_date` DESC LIMIT 10"; $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"]]); } // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ // // 商品 Pickup // // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ // 商品一覧を取得 ===================================================================== $sql = "SELECT `ID` FROM `wp_baby_2_posts` WHERE `post_status` = 'publish' AND `post_type` = 'post' LIMIT 12"; $DB->Q($sql); while($DBR = $DB->Fetch_key()) { $item_count[] = NULL; } $item_count = count($item_count); $item_per_page = 40; $max_page = ceil($item_count / $item_per_page); if(isset($_GET["parent"]) && strlen($_GET["parent"]) <= 3 && preg_match("/^[0-9]+$/",$_GET["parent"])) { $get_parent = $_GET["parent"]; $url_parent = "&parent=".$get_parent; } else { $url_parent = ""; } // 商品データ参照 ===================================================================== $sql = "SELECT `ID` FROM `wp_baby_2_posts` WHERE `post_status` = 'publish' AND `post_type` = 'post' ORDER BY RAND() ASC LIMIT 12"; $DB->Q($sql); while($DBR = $DB->Fetch_key()) { $items[$DBR["ID"]] = array(); $pid[] = $DBR["ID"]; } $pid_in = implode(",",$pid); // アイキャッチ画像の参照 $sql = "SELECT `post_id`,`guid` FROM `wp_baby_2_postmeta` LEFT JOIN `wp_baby_2_posts` ON `wp_baby_2_postmeta`.`meta_value` = `wp_baby_2_posts`.`ID` WHERE `meta_key` = '_thumbnail_id' AND `post_mime_type` LIKE 'image/%' AND `post_id` IN ($pid_in)"; $DB->Q($sql); while($DBR = $DB->Fetch_key()) { $DBR["guid"] = preg_replace("/\.jpg/","-300x300.jpg",$DBR["guid"]); $DBR["guid"] = preg_replace("/\.gif/","-300x300.gif",$DBR["guid"]); $DBR["guid"] = preg_replace("/\.png/","-300x300.png",$DBR["guid"]); $items[$DBR["post_id"]]["eye_catch"] = $DBR["guid"]; } // カスタムフィールドのデータ参照(テキスト) $sql = "SELECT `post_id`,`meta_value`,`meta_key` FROM `wp_baby_2_postmeta` WHERE `post_id` IN ($pid_in) AND `meta_key` IN ('商品名A','商品名B','本体価格')"; $DB->Q($sql); while($DBR = $DB->Fetch_key()) { if($DBR["meta_key"] == '商品名A') { $items[$DBR["post_id"]]["name_A"] = $DBR["meta_value"]; } elseif($DBR["meta_key"] == '商品名B') { $items[$DBR["post_id"]]["name_B"] = $DBR["meta_value"]; } elseif($DBR["meta_key"] == '本体価格') { $items[$DBR["post_id"]]["price"] = $DBR["meta_value"]; } } ?> <?=$html_header["site_name"];?>|<?=$page["name"];?>
$newsV) { $newsV["date"] = substr(preg_replace("/\-/",".",$newsV["date"]),0,10); $post_date = (int)preg_replace("/\./","",$newsV["date"]); ?>
$categoryV) { if($categoryK == "1") { ?>
$itemV) { if(!isset($itemV["eye_catch"])) { $itemV["eye_catch"] = "img/products/no_image.jpg"; } ?>
" width="168" height="168">
本体価格 ¥ + 税