使い方:当月と翌月に配信された記事や、その間に発売されるゲームを表示します。タイトルをクリックすることでゲームの詳細情報(ニュースや画像等)をチェックできます。FILTER:の過去、未来をクリックすることで表示範囲を変更します。また黄色のゲーム、本体・周辺機器でフィルター表示します。※売価と値下げ率は取得時のものです。価格は変動しますので実際の価格は販売サイトに移動してご確認ください。随時更新しています。
4){ $style="display:none;"; } $uptime = substr($blog["uptime"],0,16); $BLOG_UPTIME = "({$uptime})"; $BLOG_URL = HTTP."/blog.php?id={$blog["id"]}"; $BLOG_SUBJECT = $blog["subject"]; $BLOG_IMAGE = ""; if( $blog["lead_image"] ){ list($ipath,$iparent,$blogimage,$tparen) = getImagePath($blog["lead_image"],"jpg"); if( file_exists(APACHEPATH.$blogimage) ){ $BLOG_IMAGE = << EOD; }else{ list($ipath,$iparent,$blogimage,$tparen) = getImagePath($blog["lead_image"],"png"); if( file_exists(APACHEPATH.$blogimage) ){ $BLOG_IMAGE = << EOD; }else{ $BLOG_IMAGE = ""; } } } print <<
BLOG記事{$BLOG_UPTIME}

{$BLOG_SUBJECT}

{$BLOG_IMAGE}
EOD; } if( $period == "now"){ $rssdata = getRSS(); for($i=0;$i<$next_rss1;$i++){ $nc++; $rss = $rssdata[$i]; if( $nc > 4){ $style="display:none;"; } print <<
XBOX ONE RSS FEED(4gamer.net)

{$rss["title"]}

{$rss["description"]}
EOD; } } print <<

XBOX ONE発売スケジュール

▼もっと記事をみる

スケジュールメニュー

直近の割引率の高いタイトル

-
-
-
-
-

おすすめアイテム

EOD; $OFFS = Array(); // 先月分のデータがあればOFFデータとして使う if( $count_off != null && $count_off > 0 ){ foreach($result_off as $r){ if( $r["SavePercent"] == "0"){ ; }else{ $LowestNewPrice = $r["LowestNewPrice"]; $ListPrice = $r["ListPrice"]; $SavePercent = $r["SavePercent"]."%OFF"; $TotalPrice = "{$LowestNewPrice}({$SavePercent}){$WARNING}"; $OFFS[sprintf("%010s%020s",$SavePercent,$r["code"])] = $r; //print "BEFORE OFF:{$SavePercent}:{$r["code"]}
\n"; } } } if( $count > 0){ foreach($result as $r){ //$IMAGE = ""; $IMAGE = ""; if( $r["Image"] != ""){ $DetailPageURL = $r["DetailPageURL"]; $DetailPageURL = urldecode($DetailPageURL); $DetailPageURL = str_replace("&tag=bkm-jp-22","",$DetailPageURL); /* $IMAGE = << EOD; */ $IMAGE = << EOD; } //$PricePATH = "/home/users/1/lolipop.jp-dp27144940/web/xbox/cache/"; //$PriceFILE = "{$r["code"]}.cache"; //$PriceFILEPATH = $PATH.$PriceFILE; $WARNING = ""; /* if( file_exists($PriceFILEPATH) ){ $mtime = filemtime($PriceFILEPATH); $mtime = date("Y/m/d H:i",$mtime); $WARNING = "※{$mtime}時点のデータ"; } */ $gtime = substr($r["gtime"],0,16); $WARNING = "※{$gtime}時点"; if( $r["ListPrice"] != ""){ $TotalPriceDummy = "定価:{$r["ListPrice"]}"; }else{ $TotalPriceDummy = "定価:---"; } if( $r["SavePercent"] == "0"){ $LowestNewPrice = $r["LowestNewPrice"]; $ListPrice = ""; $SavePercent = ""; $TotalPrice = "{$LowestNewPrice}{$WARNING}"; }else{ $LowestNewPrice = $r["LowestNewPrice"]; $ListPrice = $r["ListPrice"]; $SavePercent = $r["SavePercent"]."%OFF"; $TotalPrice = "{$LowestNewPrice}({$SavePercent}){$WARNING}"; $OFFS[sprintf("%010s%020s",$SavePercent,$r["code"])] = $r; } $HIT = $r["hit"]." XP"; if( $r["hit"] > 10){ $HIT = "{$HIT}"; }else if( $r["hit"] > 5){ $HIT = "{$HIT}"; } print <<
{$IMAGE}
{$r["genre"]}

{$r["name"]}

人気: {$HIT}
発売日:{$r["ReleaseDate"]}
{$TotalPrice}
EOD; //print "{$r["name"]}:{$r["ReleaseDate"]}:{$r["ListPrice"]}{$r["LowestNewPrice"]}({$r["SavePercent"]}%OFF)
"; } }else{ print "Not found..."; } /* for($i=$next_rss2;$i
XBOX ONE RSS FEED(4gamer.net)

{$rss["title"]}

{$rss["description"]}
EOD; } */ function getRSS(){ $PATH = "/home/users/1/lolipop.jp-dp27144940/web/xbox/rsscache/"; $FILE = "xboxone.cache"; $FILEPATH = $PATH.$FILE; if( file_exists($FILEPATH) ){ $mtime = filemtime($FILEPATH); $nowtime = time(); if( ($nowtime - $mtime)/60 < 30){ //print "



☆USE CACHE ".(($nowtime - $mtime)/60)."min)\n"; $rss = unserialize(file_get_contents($FILEPATH)); return $rss; } } $header = array( 'User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:13.0) Gecko/20100101 Firefox/13.0.1' ); // POST送信 $options = array('http' => array( 'method' => 'GET', 'request_fulluri' => true, 'header' => implode("\r\n", $header) )); $string = file_get_contents("http://www.4gamer.net/tags/TS/TS025/contents.xml",false,stream_context_create($options)); if(!preg_match("/\<\?xml/",$string) ){ if( file_exists($FILEPATH) ){ $rss = unserialize(file_get_contents($FILEPATH)); return $rss; } return; } $xml_array = simplexml_load_string($string); //print "
RSS DEBUG:
\n"; $rss = Array(); foreach($xml_array->item as $i => $item){ $title = (string)$item->title; $link = (string)$item->link; $description = (string)$item->description; //print "{$i}:{$title}
\n"; $rss[] = array("title"=>$title,"link"=>$link,"description"=>$description); } //print "CACHE FILE is [{$FILE}].\n"; writeCache($PATH,$FILE,$rss); return $rss; } function getBLOG($store,$period){ $db = new Database(DBHOST,DBNAME,DBUSER,DBPASSWORD,DBCODE,DEBUG,"Y"); $YEAR = date("Y"); $MON = date("m"); $DAY = date("d"); $START = date("Y-m-d 00:00:00", mktime(0, 0, 0, $MON+$period, 1, $YEAR)); $END = date("Y-m-d 00:00:00", mktime(0, 0, 0, $MON+$period+2, 1, $YEAR)); $DSTART = date("Y/m", mktime(0, 0, 0, $MON+$period, 1, $YEAR)); $DEND = date("Y/m", mktime(0, 0, 0, $MON+$period+2, -1, $YEAR)); //print "





TARGET:{$YEAR}/{$MON}/{$DAY} -> {$START}~{$END}
\n"; $PATH = "/home/users/1/lolipop.jp-dp27144940/web/xbox/pagecache/"; $FILE = "{$START}_blog.cache"; $MINDATE = date("Y-m-d 00:00:00", mktime(0, 0, 0, 6, 1, 2014)); $MAXDATE = date("Y-m-d 00:00:00", mktime(0, 0, 0, 1, 1-1, $YEAR+2)); //print "{$MINDATE},{$START},{$MAXDATE}
"; if( $START <= $MINDATE ){ //print "RANGE MIN
"; $FILE = "MIN_blog.cache"; }else if( $START >= $MAXDATE){ //print "RANGE MAX
"; $FILE = "MAX_blog.cache"; } $FILEPATH = $PATH.$FILE; if( file_exists($FILEPATH) ){ // devはキャッシュしない $mtime = filemtime($FILEPATH); $nowtime = time(); if( ($nowtime - $mtime)/60 < 10){ //print "



☆USE CACHE ".(($nowtime - $mtime)/60)."min)\n"; $cache = unserialize(file_get_contents($FILEPATH)); return $cache; } } $COND = <<= '{$START}' and uptime < '{$END}' EOD; $STORE = $db->escape($store,"QUOTE"); $query=<<\n"; list($count_num, $data_num) = $db->searchSQL($query,""); $db->close(); //print "CACHE FILE is [{$FILE}].\n"; writeCache($PATH,$FILE,Array($data_num,$db->getResult(),$DSTART,$DEND)); return Array($data_num,$db->getResult(),$DSTART,$DEND); } function index_before($store,$period){ $db = new Database(DBHOST,DBNAME,DBUSER,DBPASSWORD,DBCODE,DEBUG,"Y"); $YEAR = date("Y"); $MON = date("m"); $DAY = date("d"); $START = date("Y-m-d", mktime(0, 0, 0, $MON+$period-1, 1, $YEAR)); $PATH = "/home/users/1/lolipop.jp-dp27144940/web/xbox/pagecache/"; $FILE = "{$START}.cache"; $FILEPATH = $PATH.$FILE; if( file_exists($FILEPATH) ){ $cache = unserialize(file_get_contents($FILEPATH)); return $cache; } return null; } function index($store,$period){ $db = new Database(DBHOST,DBNAME,DBUSER,DBPASSWORD,DBCODE,DEBUG,"Y"); $YEAR = date("Y"); $MON = date("m"); $DAY = date("d"); $START = date("Y-m-d", mktime(0, 0, 0, $MON+$period, 1, $YEAR)); $END = date("Y-m-d", mktime(0, 0, 0, $MON+$period+2, 1, $YEAR)); $DSTART = date("Y/m", mktime(0, 0, 0, $MON+$period, 1, $YEAR)); $DEND = date("Y/m", mktime(0, 0, 0, $MON+$period+2, -1, $YEAR)); //print "





TARGET:{$YEAR}/{$MON}/{$DAY} -> {$START}~{$END}
\n"; $PATH = "/home/users/1/lolipop.jp-dp27144940/web/xbox/pagecache/"; $FILE = "{$START}.cache"; $MINDATE = date("Y-m-d", mktime(0, 0, 0, 6, 1, 2014)); $MAXDATE = date("Y-m-d", mktime(0, 0, 0, 1, 1-1, $YEAR+2)); if( $START <= $MINDATE ){ $FILE = "MIN.cache"; }else if( $START >= $MAXDATE){ $FILE = "MAX.cache"; } $FILEPATH = $PATH.$FILE; if( file_exists($FILEPATH) ){ $mtime = filemtime($FILEPATH); $nowtime = time(); if( ($nowtime - $mtime)/60 < 10){ //print "



☆USE CACHE ".(($nowtime - $mtime)/60)."min)\n"; $cache = unserialize(file_get_contents($FILEPATH)); return $cache; } } $COND = <<= '{$START}' and ReleaseDate < '{$END}' EOD; $STORE = $db->escape($store,"QUOTE"); /* $query=<< 'ENTRY' {$COND} and name not like '%北米%' order by ReleaseDate asc,name asc EOD; */ /* $query=<< 'ENTRY' {$COND} and name not like '%北米%' order by case genre when '周辺機器・アクセサリ' then '周辺機器3' when 'コントローラー(ハンドル・ジョイスティック)' then '周辺機器2' when 'ケーブル・アダプター' then '周辺機器3' when 'バッテリー・充電器' then '周辺機器3' when 'ケース・収納' then '周辺機器3' when 'その他のゲーム機種本体全般' then '_本体2' when 'ゲーム機本体' then '_本体1' else 'ゲーム' end asc,ReleaseDate asc,name asc EOD; */ $query=<< 'ENTRY' {$COND} order by case genre when '周辺機器・アクセサリ' then '周辺機器3' when 'コントローラー(ハンドル・ジョイスティック)' then '周辺機器2' when 'ケーブル・アダプター' then '周辺機器3' when 'バッテリー・充電器' then '周辺機器3' when 'ケース・収納' then '周辺機器3' when 'その他のゲーム機種本体全般' then '_本体2' when 'ゲーム機本体' then '_本体1' else 'ゲーム' end asc,ReleaseDate asc,name asc EOD; list($count_num, $data_num) = $db->searchSQL($query,""); $db->close(); //print "CACHE FILE is [{$FILE}].\n"; writeCache($PATH,$FILE,Array($data_num,$db->getResult(),$DSTART,$DEND)); return Array($data_num,$db->getResult(),$DSTART,$DEND); } function writeCache($path,$file,$data){ $FILE = $path.$file; if( preg_match("/\.\./",$file) ){ print "ERROR WRITE CACHE
\n"; return false; } $fp = fopen($FILE, "w"); if (!fwrite($fp, serialize($data))) { return false; } fclose($fp); } function getCpuTime(){ global $CPU_start,$CPUTIME; list($tmp1,$tmp2)=split(" ",$CPU_start); list($tmp3,$tmp4)=split(" ",microtime()); $CPUTIME = sprintf("(%.3fs)",$tmp4-$tmp2+$tmp3-$tmp1); return $CPUTIME; } function processTime($before="START"){ if( $before == "START"){ return microtime(); } list($tmp1,$tmp2)=split(" ",$before); list($tmp3,$tmp4)=split(" ",microtime()); $CPUTIME = sprintf("(%.3fs)",$tmp4-$tmp2+$tmp3-$tmp1); return $CPUTIME; } ?>
$v){ if( in_array($v["genre"],$SKIP_GENRE) ){ continue; } $n++; if( $n > 5){ break; } $CODE = htmlescape($v["code"]); $NAME = htmlescape($v["name"]); $NAME = mb_strimwidth($NAME,0,36,"…"); $SavePercent = $v["SavePercent"]."%OFF"; print << var obj=getobject("SCHEDULE_{$n}"); if( obj != null){ obj.innerHTML = "{$SavePercent}

{$NAME}

"; } EOD; } $cputime = processTime($start); ?>
CPUTIME:
Copyright © 2014- PAN-THAU-RA. All rights reserved.