0){ $gameid = $_GET["gameid"]; $overwrite_4gamer = ""; if( preg_match("/^G[0-9]{6}$/",$gameid) ){ link4gamer($result[0],$gameid); $overwrite_4gamer = $gameid; } foreach($result as $r){ if( $overwrite_4gamer != ""){ $r["4gamer"] = $overwrite_4gamer; } //$IMAGE = ""; $IMAGE = ""; $METAIMAGE=""; if( $r["LargeImage"] != ""){ $DetailPageURL = $r["DetailPageURL"]; $DetailPageURL = urldecode($DetailPageURL); $DetailPageURL = str_replace("&tag=bkm-jp-22","&tag=xboxmgr1-22",$DetailPageURL); //$ddd = split("\?",$DetailPageURL); //$DetailPageURL = $ddd[0]; $IMAGE = << EOD; $METAIMAGE= HTTP."/package/Package_{$r["id"]}_large.jpg"; } $WishlistURL = $r["WishlistURL"]; $WishlistURL = urldecode($WishlistURL); //$WishlistURL = str_replace("&tag=bkm-jp-22","",$WishlistURL); $WARNING = ""; if( $r["SavePercent"] == "0"){ $LowestNewPrice = $r["LowestNewPrice"]; $ListPrice = ""; $SavePercent = ""; $SavePercent2 = ""; $ItemOffered = "{$LowestNewPrice}"; }else{ $PATH = "/home/users/1/lolipop.jp-dp27144940/web/xbox/cache/"; $FILE = "{$r["code"]}.cache"; $FILEPATH = $PATH.$FILE; if( file_exists($FILEPATH) ){ $mtime = filemtime($FILEPATH); $mtime = date("Y/m/d H:i",$mtime); $WARNING = "※{$mtime}時点のデータ"; } $LowestNewPrice = $r["LowestNewPrice"]; $ListPrice = $r["ListPrice"]; $SavePercent = " -".$r["SavePrice"]."(".$r["SavePercent"]."%OFF)"; $SavePercent2 = $r["SavePercent"]."%OFF"; $ItemOffered = "通常価格:{$ListPrice},販売価格:{$LowestNewPrice}({$r["SavePercent"]}%OFF)"; } $HIT = $r["hit"]." XP"; if( $r["hit"] > 10){ $HIT = "{$HIT}"; }else if( $r["hit"] > 5){ $HIT = "{$HIT}"; } $NAME = $r["name"]; $NAME = $r["name"]; $NAMES = split("\(",$NAME); $NAMES = split("\[",$NAMES[0]); $NAMES = split("【",$NAMES[0]); $NAMES = split("「",$NAMES[0]); $NAMES[0] = str_replace("リミテッドエディション","",$NAMES[0]); $NAMES[0] = str_replace("初回限定特典","",$NAMES[0]); $NAMES[0] = str_replace("DayOneエディション","",$NAMES[0]); $NAMES[0] = str_replace("レジェンダリーエディション","",$NAMES[0]); $NAMES[0] = str_replace("Amazon.co.jp限定","",$NAMES[0]); $NAMES[0] = str_replace("予約特典","",$NAMES[0]); $NAME = trim($NAMES[0]); $description = sprintf("タイトル: %s,プラットフォーム: %s, ジャンル: %s, 価格: %s, 割引: %s, 発売日: %s,メーカー: %s, ASIN: %s, XBOX ONE, 箱1,%s ゲーム情報まとめ,%s ムービー,%s 発売日,%s 発売スケジュール",$r["name"],$r["Platform"],$r["genre"],$LowestNewPrice,$SavePercent2,$r["ReleaseDate"],$r["Manufacturer"],$r["code"],$NAME,$NAME,$NAME,"XBOX ONE"); $twitter_description = sprintf("タイトル: %s,プラットフォーム: %s, ジャンル: %s, 価格: %s, 割引: %s, 発売日: %s,メーカー: %s",$NAME,$r["Platform"],$r["genre"],$LowestNewPrice,$SavePercent2,$r["ReleaseDate"],$r["Manufacturer"]); $meta_description = htmlescape(sprintf("%sゲーム情報。『%s』に関する記事や攻略情報、ムービー、スクリーンショット、価格情報も紹介します。",$r["Platform"],$NAME)); $meta_description = $description; $FORGAMER=""; if( $r["4gamer"] != "" ){ $GPATH = getMediaPath("GAMES",$r["4gamer"]); $forgamer = "http://www.4gamer.net{$GPATH}"; $FORGAMER = <<4Gamerまとめページ EOD; } $OFFICIAL=""; if( $r["official_url"] != "" ){ $OFFICIAL = <<
公式サイト{$FORGAMER}
EOD; }else{ $OFFICIAL = <<
{$FORGAMER}
EOD; } $info = <<
{$IMAGE}
Amazonでこの商品を見る
{$OFFICIAL}
コンテンツ情報
タイトル名

{$r["name"]}

プラットフォーム

{$r["Platform"]}

メーカー

{$r["Manufacturer"]}

ジャンル {$r["genre"]}
発売日 {$r["ReleaseDate"]}
Amazon価格 {$LowestNewPrice}{$WARNING}
通常価格 {$ListPrice}
ディスカウント {$SavePercent2}{$WARNING}
CODE {$r["code"]}
人気 {$HIT}
EOD; /* */ //print "{$r["name"]}:{$r["ReleaseDate"]}:{$r["ListPrice"]}{$r["LowestNewPrice"]}({$r["SavePercent"]}%OFF)
"; } }else{ $info = "Not found..."; } ?> () - : XBOX ONEまとめ情報
※売価と値下げ率は取得時のものです。価格は変動しますので実際の価格は販売サイトに移動してご確認ください。随時更新しています。
\n"; if( file_exists($FILEPATH) ){ $cache = unserialize(file_get_contents($FILEPATH)); }else{ continue; } $rr = $cache[1][0]; if( $rr["id"] == "" || $rr["name"] == ""){ continue; } $IMAGE = ""; if( $rr["Image"] != ""){ $DetailPageURL = $rr["DetailPageURL"]; $DetailPageURL = urldecode($DetailPageURL); $DetailPageURL = str_replace("&tag=bkm-jp-22","&tag=xboxmgr1-22",$DetailPageURL); $IMAGE = << EOD; } $gtime = substr($rr["gtime"],0,16); $WARNING = "※{$gtime}時点"; if( $rr["ListPrice"] != ""){ $TotalPriceDummy = "定価:{$rr["ListPrice"]}"; }else{ $TotalPriceDummy = "定価:---"; } if( $rr["SavePercent"] == "0"){ $LowestNewPrice = $rr["LowestNewPrice"]; $ListPrice = ""; $SavePercent = ""; $TotalPrice = "{$LowestNewPrice}{$WARNING}"; }else{ $LowestNewPrice = $rr["LowestNewPrice"]; $ListPrice = $rr["ListPrice"]; $SavePercent = $rr["SavePercent"]."%OFF"; $TotalPrice = "{$LowestNewPrice}({$SavePercent}){$WARNING}"; } $HIT = $rr["hit"]." XP"; if( $rr["hit"] > 10){ $HIT = "{$HIT}"; }else if( $rr["hit"] > 5){ $HIT = "{$HIT}"; } print <<
{$IMAGE}
{$rr["genre"]}
{$rr["name"]}
人気:{$HIT}
発売日:{$rr["ReleaseDate"]}
{$TotalPrice}
EOD; } ?>
'wiki_name_1','wiki_url_2'=>'wiki_name_2','walk_url_1'=>'walk_name_1'); $wiki=Array(); foreach($check as $url=>$name){ if( $r[$url] != "" && $r[$name] != ""){ //print "{$url}:[{$r[$url]}],{$name}:[{$r[$name]}]
\n"; $wiki[$r[$url]] = $r[$name]; } } if( count($wiki)>0 ){ foreach($wiki as $url=>$name){ print <<
攻略サイト情報

{$name}

{$r["name"]}の攻略情報をチェックしよう
EOD; $excount++; } } if( $r["4gamer"] != ""){ list($sb_num,$sb_lists) = getSameBlog("xbox",$r["4gamer"]); if( $sb_num > 0){ foreach($sb_lists as $si=>$blog){ //$nc++; //if( $nc > 8){ // $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; $excount++; } } } if( $r["4gamer"] != ""){ $rssdata = getRSS($r["4gamer"]); $rssmax = 8-$excount; for($i=0;$i<$rssmax;$i++){ $rss = $rssdata[$i]; if( $rss["link"] == ""){ continue; } print <<
XBOX ONE RSS FEED(4gamer.net)

{$rss["title"]}

{$rss["description"]}
EOD; $excount++; } } function getSameBlog($store,$gid){ $db = new Database(DBHOST,DBNAME,DBUSER,DBPASSWORD,DBCODE,DEBUG,"Y"); $GID = $db->escape($gid); $PATH = "/home/users/1/lolipop.jp-dp27144940/web/xbox/blogcache/"; $FILE = "{$GID}_sameblog.cache"; $FILEPATH = $PATH.$FILE; if( file_exists($FILEPATH) ){ // DEVはキャッシュをみない $mtime = filemtime($FILEPATH); $nowtime = time(); if( ($nowtime - $mtime)/60 < 30){ //print "



☆USE CACHE ".(($nowtime - $mtime)/60)."min)\n"; $cache = unserialize(file_get_contents($FILEPATH)); return $cache; } } $COND = <<escape($store,"QUOTE"); $query=<<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 listYoutube($r){ $NAME = $r["name"]; $NAMES = split("\(",$NAME); $NAMES = split("\[",$NAMES[0]); $NAMES = split("【",$NAMES[0]); $NAMES = split("「",$NAMES[0]); $NAMES[0] = str_replace("リミテッドエディション","",$NAMES[0]); $NAMES[0] = str_replace("初回限定特典","",$NAMES[0]); $NAMES[0] = str_replace("DayOneエディション","",$NAMES[0]); $NAMES[0] = str_replace("レジェンダリーエディション","",$NAMES[0]); $NAMES[0] = str_replace("Amazon.co.jp限定","",$NAMES[0]); $NAMES[0] = str_replace("予約特典","",$NAMES[0]); $NAME = trim($NAMES[0]); $api = "https://www.googleapis.com/youtube/v3/search"; $args = Array(); $args["key"] = "AIzaSyCtFwQUFXjRfTcUUdKFkGaejMExHyTbNBQ"; $args["maxResults"] = 8; $args["part"] = "snippet"; $args["callback"] = "callbackYoutubeList"; // $q = $NAME." ".$r["Platform"]; $q = $NAME." 攻略 ".$r["Platform"]; $q = str_replace(" ","+",$q); //$args["q"] = rawurlencode(); $args["q"] = $q; //print "
QUERY:[{$NAME} {$r["Platform"]}]q[{$args["q"]}]
\n"; $ARGS = Array(); foreach($args as $apiA => $apiV){ $ARGS[] = "{$apiA}=".urlencode($apiV); } $api = $api."?".join("&",$ARGS); print << EOD; // APIの接続元が規定されているので保存ができない。 // 保存するなら return; $gameid = $r["code"]; $PATH = "/home/users/1/lolipop.jp-dp27144940/web/xbox/youtubecache/"; $FILE = "{$gameid}.cache"; $FILEPATH = $PATH.$FILE; if( file_exists($FILEPATH) ){ $mtime = filemtime($FILEPATH); $nowtime = time(); if( ($nowtime - $mtime)/60 < 60){ print "



☆USE CACHE ".(($nowtime - $mtime)/60)."min)\n"; $jsonp = unserialize(file_get_contents($FILEPATH)); return $jsonp; } } print "CACHE FILE is [{$FILE}].\n"; /* print <<{$api} {$jsonp} EOD; */ $jsonp = unserialize($jsonp); writeCache($PATH,$FILE,$jsonp); return $rss; } ?>
$image){ if( $i == 0){ continue; } print <<
コンテンツイメージ #{$i}
EOD; } function getMediaPath($media,$id){ $MEDIA == ""; if( $media == "GAME" || $media == "GAMES"){ $MEDIA = "games"; $start = 2; $len=3; } if( $media == "WORDS"){ $MEDIA = "words"; $start = 1; $len=3; } if( $media == "TAGS"){ $MEDIA = "tags"; $start = 0; $len=2; } if( $media == "DEV"){ $MEDIA = "developer"; $start = 1; $len=3; } if( $media == "PUB"){ $MEDIA = "publisher"; $start = 1; $len=3; } if( $media == "NEWS"){ $MEDIA = ""; // メインゲームの下に作成 } if( $media == "FREE"){ $MEDIA = ""; // メインゲームの下に作成 } if( $media == "USERS"){ // /users/234/123456 $id = sprintf("U%06s",$id); $MEDIA = "users"; $start = 2; $len=3; } if( $MEDIA != ""){ $PRE = substr($id,$start,$len); return <<


☆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{$GPATH}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:http://www.4gamer.net{$GPATH}contents.xml
\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 getData($store,$id){ $db = new Database(DBHOST,DBNAME,DBUSER,DBPASSWORD,DBCODE,DEBUG,"Y"); $ID = $db->escape($id); $PATH = "/home/users/1/lolipop.jp-dp27144940/web/xbox/cache/"; $FILE = "{$ID}.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 = <<escape($store,"QUOTE"); $query=<< 'ENTRY' {$COND} EOD; list($count_num, $data_num) = $db->searchSQL($query,""); $db->close(); //print "CACHE FILE is [{$FILE}].\n"; if( $data_num > 0){ 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; } function link4gamer($target,$gameid){ $db = new Database(DBHOST,DBNAME,DBUSER,DBPASSWORD,DBCODE,DEBUG,"Y"); $atr = array(); $atr["4gamer"] = $db->escape($gameid,"QUOTE"); if( $target["id"] == "" || $target["code"] == ""){ return; } $ID = $db->escape($target["id"],"QUOTE"); $CODE = $db->escape($target["code"],"QUOTE"); $cond = <<
{$cond}
\n"; list($rtn,$data_num) = $db->updateSQL("manager",$atr,$cond,"EXEC"); } function hitCounter($target){ $db = new Database(DBHOST,DBNAME,DBUSER,DBPASSWORD,DBCODE,DEBUG,"Y"); $DAY = date("j"); $atr = array(); $atr["gtime"] = "cast( now() as datetime)"; $atr["hit"] = "LAST_INSERT_ID(hit + 1)"; $atr["day_{$DAY}"] = "LAST_INSERT_ID(day_{$DAY} + 1)"; $atr["status"] = $db->escape("REBUILD","QUOTE"); if( $target["id"] == "" || $target["code"] == ""){ return; } $AGENT = $_SERVER["HTTP_USER_AGENT"]; if( preg_match("/bot/",$AGENT) ){ return; } $ID = $db->escape($target["id"],"QUOTE"); $CODE = $db->escape($target["code"],"QUOTE"); $cond = <<
{$cond}
\n"; list($rtn,$data_num) = $db->updateSQL("manager",$atr,$cond,"EXEC"); } hitCounter($result[0]); ?>
「Amazon、Amazon.co.jpおよびAmazon.co.jpロゴは、Amazon.com, Inc.またはその関連会社の商標です」
CPUTIME:
Copyright © 2014- PAN-THAU-RA. All rights reserved.