\n"; //echo "\n"; //echo "\n"; } // 共通のツール関数 function readFileInArray($path,$mode){ $i = 0; $fp = fopen ($path,$mode); while ($data = fgets($fp, 65535)) { $line[$i] = $data; $i++; } fclose ($fp); return $line; } function splitCode($code){ $c = preg_split("//",$code); for($i = 0;$i\n"; } return $r; } function printList($TYPES,$select,$split){ while ($key = current($TYPES)) { //$key = $TYPES[$i]; $atr = $key; $val = $key; if( $split != ""){ $keys = preg_split ($split, $key); $atr = $keys[0]; $val = $keys[0]; if( $keys[1] != ""){ $val = $keys[1]; } } if( $select == $val){ echo "

  */ ?>

1){ $ssubgenre = "0"; $smulti = "0"; } // 説明文 //echo "\n"; //echo "\n"; if( $OFFSET == "<<"){ $offset = $offset - $limit; }else if( $OFFSET == ">>"){ $offset = $offset + $limit; }else if( $OFFSET > 0){ $offset = $limit*($OFFSET-1); } $icon_mode = 0; if( $schedule == "on" || ($smaker == "" && $stitle == "" && $stype == "0" && $sgenre == "0" && $smulti == "0" && $ssort == "0" && $ssubgenre == "0" && $schedule != "off") ){ echo "

",date("Y/m/d",$lastmonth),"以降を表示

\n"; $schedule = "on"; }else{ echo "

全タイトルから条件で検索

\n"; } echo '
'; echo "\n"; echo ""; echo ""; if( $schedule != ""){ echo ""; } if( $stype != "0"){ $icon_mode = 1; } //echo "\n"; $SEARCH_NAME = "−".$SITESEARCH[$ssite]."から検索−"; echo << EOD; echo '\n"; echo ' '; echo "\n"; echo ' '; echo "\n"; echo "\n"; echo "\n"; if( $schedule == "on"){ echo "\n"; echo "\n"; }else{ echo "\n"; echo "\n"; } echo ' '; echo "\n"; echo ' '; echo "\n"; echo ' '; echo "\n"; echo "\n"; if( $schedule== "on"){ echo ""; } echo "
"; $SITESEARCH = array( 1 => "PCゲーム",2=>"ハードウェア",3=>"Mac",0=>"全て" ); //echo " EOD; $SITETYPES = array( "PCゲーム,1","ハードウェア,2","MAC,3","全て,0" ); printRadio($SITETYPES,$ssite,"ssite",",",0,1,"onClick=\"form.submit();\""); echo <<

{$SEARCH_NAME}

 
検索条件 ジャンル '; // "パソコン","HARDWARE","MAC","携帯電話","XBOX","PS3","Nintendo" // パソコン $SITENAME = array( "全て","パソコン","HARDWARE","MAC" //,"MAC","携帯電話","XBOX","PS3","Nintendo" ); $TYPES["全て"] = array("指定しない,0"); $TYPES["パソコン"] = array("指定しない,0", "アクション,1", "アドベンチャー&シングルRPG,2", "オンラインRPG,3", "ミニスケープ,4", "ストラテジー,5", "シミュレーション,6", "その他,7" ); // HARDWARE $TYPES["HARDWARE"] = array("指定しない,0", "汎用,1", "PC本体,2", "ATI,3", "NVIDIA,4", "サウンド,5", "CPU,6", "入力デバイス,7" ); // MAC $TYPES["MAC"] = array("指定しない,0", "ゲーム,1", "ipod,2", "本体,3", "周辺機器,4", "入荷情報,5" ); $multisite = $SITENAME[$ssite]; echo "\n"; echo "サブジャンル"; echo "\n"; echo "記事"; echo '\n"; echo ""; echo '\n"; echo "
条件で絞り込めます
 タイトルメーカーマルチ"; echo "\n"; echo ""; echo "
\n"; echo "→過去の全タイトルも含めた詳細検索\n"; echo "
"; echo "
\n\n"; $host = "10.230.34.1"; $dbname = "data_contents"; $table = "game"; $from = getenv("HTTP_REFERER"); $modify = date("Y/m/d H:i:s"); /* PostgreSQL サーバに接続 */ $con = pg_connect("host=".$host." port=5432 dbname=".$dbname." user=nobody"); //$con = pg_connect($host,"","","",$dbname); if (!$con) { echo "データベースに接続出来ませんでした。"; } // 検索条件の作成 $cond = ""; $split = ""; if( $sid != ""){ if( preg_match("/[0-9]+/",$sid) ){ $cond .= $split."id = '$sid'"; $split = " and "; }else if( preg_match("/[*]/",$sid) ){ $cond .= $split."id > 0"; $split = " and "; } } if( $stitle != ""){ //$cond .= $split."upper(title) like '%".sqlstring($stitle,"UPPER")."%'"; $cond .= $split."(upper(title) like '%".sqlstring($stitle,"UPPER")."%' or upper(title) like '%".sqlstring($stitle,"UPPER+")."%' or upper(title) like '%".sqlstring($stitle,"UPPER-")."%' or upper(middle_e_title) like '%".sqlstring($stitle,"UPPER-")."%' or upper(memo) like '%".sqlstring($stitle,"UPPER")."%')"; $split = " and "; } if( $smaker != ""){ $cond .= $split."upper(maker) like '%".sqlstring($smaker,"UPPER")."%'"; $split = " and "; } if( $searchSaleDate != ""){ $cond .= $split."sales = '$searchSaleDate'"; $split = " and "; } //echo "TYPE,GENRE,MULTU=$stype,$sgenre,$smulti
\n"; if( $sgenre != "0"){ // 000000000111100000000542- $cond .= $split."code like '_____________________".$sgenre."%'"; $split = " and "; } if( $ssubgenre != "0"){ // 000000000111100000000542- $cond .= $split."code like '______________________".$ssubgenre."%'"; $split = " and "; } if( $stype != "0"){ // 0-10 $typecode = ""; for($tt=0;$tt<$stype;$tt++){ $typecode .= "_"; } $cond .= $split."flag like '".$typecode."1%'"; $split = " and "; } if( $smulti != "0"){ // 000000000111100000000542- $cond .= $split."code like '_______________________".$smulti."%'"; $split = " and "; } if( $searchType != ""){ $cond .= $split."type = '$searchType'"; $split = " and "; } if( $multisite != "全て"){ $cond .= $split."platform = '$multisite'"; $split = " and "; } $cond .= $split."id > 0 and id < 10000 "; //$cond = sprintf("%s and date != %d",$cond,"99999999"); if( $schedule == "on"){ //echo "
",date("Y/m/d",$lastmonth),"以降のスケジュールを表示します。

\n"; // いつでも過去1ヶ月前から検索、絞込みも同様 $cond = sprintf("%s and date != 0 and date != %d",$cond,"99999999"); $cond = sprintf("%s and date > %d",$cond,date("Ymd",$lastmonth)); }else{ if( $ssort == "0"){ //$cond = sprintf("%s and date > %d",$cond,"10000000"); } } $orderby = "order by date,title using <"; if( $ssort == "1"){ // タイトル名順 $orderby = "order by title using <"; }else if( $ssort == "2"){ // メーカー名順 $orderby = "order by maker,title using <"; }else if( $ssort == "3"){ // 更新日順 $orderby = "order by mtime using >,title"; } $cond = "display like '表示する' and ".$cond; if( $cond != ""){ if( $offset == "" || $MODE == "検索"){ $offset = 0; } $query = "SET DateStyle='ISO';select * from game where $cond $orderby limit $limit offset $offset"; $cquery = "select count(id) from game where $cond"; //echo "QUERY=[$query]
\n"; //echo "CQUERY=[$cquery]
\n"; /* 検索を実行 */ $crtn = pg_exec($con,$cquery); /* 検索件数 */ $data_num = pg_result($crtn, 0, 0); /* 検索を実行 */ $rtn = pg_exec($con,$query); /* 検索件数 */ $m = pg_numrows($rtn); //echo "検索を行います。",$query,"
"; echo '

'; if( $data_num == 0){ echo ""; $paging = "検索結果 0件  "; }else{ echo "検索結果 ",($offset+1),"〜",$offset+$limit,"(全",$data_num,"件)  "; $paging = "検索結果 1〜".$data_num."(全".$data_num."件)  "; } if( $offset != 0){ echo " "; $paging .= " "; } $dd=1; $ddd=0; for($d = 0;$d/$limit < $data_num/$limit;$d += $limit){ if( $offset >= ($dd-1)*$limit && $offset < ($dd)*$limit ){ echo "$dd "; $paging .= "$dd "; }else{ echo " "; $paging .= " "; } $dd++; } if( $data_num > $offset+$limit){ echo ">\" ID=\"OFFSET\"> "; $paging .= ">\" ID=\"OFFSET\"> "; } echo "\n"; //echo "

\n"; } echo '

'; echo '\n"; // echo ""; $datacontents = sprintf("/DataContents/game/%04.4d.html",$id); // echo "\n"; if( $icon_mode == 0){ if( $makerUrl != ""){ $maker = "$maker"; } // echo ""; }else{ // echo ""; } $year = substr($date,0,4); $month = substr($date,4,2); if( $month == ""){ $month = "99"; $day = "99"; } $day = substr($date,6,2); if( $day == ""){ $day = "80"; } $INFO_DATE = "N/A"; if( $date == "99999999"){ $INFO_DATE = "N/A"; }else if( $date == "0"){ $INFO_DATE = "-"; }else if( $year == 9999){ $INFO_DATE = "未定"; }else{ if( $month <= 12 && $day <= 31 && $month != 0 && $day != 0){ $INFO_DATE = sprintf("%04.4d/%02.2d/%02.2d",$year,$month,$day); }else{ if( $month == 00 ){ $INFO_DATE = sprintf("%04.4d/%s〜%04.4d/%s",$year-1,"Q4",$year,"Q1"); }else if( $month == 15 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"Q1"); }else if( $month == 21 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"前半"); }else if( $month == 20 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"春"); }else if( $month == 25 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"Q2"); }else if( $month == 30 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"夏"); }else if( $month == 35 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"Q3"); }else if( $month == 40 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"秋"); }else if( $month == 41 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"後半"); }else if( $month == 45 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"Q4"); }else if( $month == 50 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"冬"); }else if( $month == 99){ $INFO_DATE = sprintf("%04.4d%s",$year,"年内"); }else if( $month <= 12 && $day == 40){ $INFO_DATE = sprintf("%04.4d/%02.2d%s",$year,$month,"月上旬"); }else if( $month <= 12 && $day == 50){ $INFO_DATE = sprintf("%04.4d/%02.2d%s",$year,$month,"月中旬"); }else if( $month <= 12 && $day == 60){ $INFO_DATE = sprintf("%04.4d/%02.2d%s",$year,$month,"月下旬"); }else if( $month <= 12 && $day == 80){ $INFO_DATE = sprintf("%04.4d/%02.2d%s",$year,$month,"月中"); }else if( $month <= 12 && $day == 99){ $INFO_DATE = sprintf("%04.4d/%02.2d%s",$year,$month,"月中"); } } } // echo "\n"; if( $ssort == 0 || ($schedule == "on" && ($ssort == 1 || $ssort == 2)) ){ // echo "\n"; }else{ $MTIME = toDate2($mtime); // echo "\n"; } // パッケージイメージ $INFO_IMAGE = "/images/pct_top1.jpg"; if( $middle_search != ""){ $INFO_IMAGE = $middle_search; } $INFO_DESC = strip_tags($middle_desc); if( mb_strlen($INFO_DESC) > 60){ $INFO_DESC=mb_substr($INFO_DESC,0,60,"EUC-JP")."……"; } // 価格 if( $price == $middle_price){ $middle_price = ""; } $INFO_PRICE = $price; if( trim($INFO_PRICE) == ""){ $INFO_PRICE="N/A"; } echo '
'; if( $m > 0){ $in = ""; for($j=0;$j < $m;$j++) { /* pg_result() は行・列の内容を返す */ $id = pg_result($rtn,$j,0); $in = $in."$id"; if( $j < $m-1){ $in = $in.","; } } /* 各種記事の検索 */ if( $icon_mode == 1){ $addquery = "select * from contents where id IN (select id from game where $cond limit $limit offset $offset)"; $addquery = "select * from contents where id IN ($in);"; //echo "記事URLの検索を行います。",$addquery,"
"; $artn = pg_exec($con,$addquery); $am = pg_numrows($artn); } } /* データベースとの接続を切り離す */ pg_close($con); for($j=0;$j < $am;$j++) { /* pg_result() は行・列の内容を返す */ $id = pg_result($artn,$j,0); $type = pg_result($artn,$j,3); $url = pg_result($artn,$j,4); //echo "$id,$type,$url
\n"; $URL[$type."\t".$id] = $url; } for($j=0;$j < $m;$j++) { /* pg_result() は行・列の内容を返す */ $id = pg_result($rtn,$j,0); $gameTitle = pg_result($rtn,$j,1); $date = pg_result($rtn,$j,2); $code = pg_result($rtn,$j,3); $flag = pg_result($rtn,$j,4); $gameUrl = pg_result($rtn,$j,5); $maker = pg_result($rtn,$j,6); $makerUrl = pg_result($rtn,$j,7); $type = pg_result($rtn,$j,8); $subType = pg_result($rtn,$j,9); $saleDate = pg_result($rtn,$j,10); $saleDateYear = pg_result($rtn,$j,11); $saleDateMonth = pg_result($rtn,$j,12); $saleDateSuffix = pg_result($rtn,$j,13); $saleDateSort = pg_result($rtn,$j,14); $ctime = pg_result($rtn,$j,15); $mtime = pg_result($rtn,$j,16); $price = pg_result($rtn,$j,17); $display = pg_result($rtn,$j,18); $memo = pg_result($rtn,$j,19); $header = pg_result($rtn,$j,20); $footer = pg_result($rtn,$j,21); $template = pg_result($rtn,$j,22); $infoImage = pg_result($rtn,$j,23); $infoTitle = pg_result($rtn,$j,24); $infoDesc = pg_result($rtn,$j,25); $infoCopyright = pg_result($rtn,$j,26); $copyright = pg_result($rtn,$j,27); // ミドルページ拡張データ $dbline = pg_fetch_array($rtn,$j); $middle_package = $dbline["middle_package"]; $middle_search = $dbline["middle_search"]; $middle_desc = $dbline["middle_desc"]; $middle_spec = $dbline["middle_spec"]; $middle_copyright = $dbline["middle_copyright"]; $middle_e_title = $dbline["middle_e_title"]; $middle_publisher = $dbline["middle_publisher"]; $middle_developer = $dbline["middle_developer"]; $middle_internatinal_sale = $dbline["middle_internatinal_sale"]; $middle_local_sale = $dbline["middle_local_sale"]; $middle_price = $dbline["middle_price"]; $middle_e_title_url = $dbline["middle_e_title_url"]; $middle_publisher_url = $dbline["middle_publisher_url"]; $middle_developer_url = $dbline["middle_developer_url"]; $multisite = $dbline["platform"]; //echo "'$id','$gameTitle','$date','$code','$gameUrl','$maker','$makerUrl','$type','$subType', //'$saleDate','$saleDateYear','$saleDateMonth','$saleDateSuffix','$saleDateSort', //'$ctime','$mtime','$price','$display','$memo','$header','$footer'
"; // アイコンテスト用表示。 $TYPES = array("SPECIAL","SCREENSHOT","DEMO","MOVEI","REVIEW", "PREVIEW","PATCH","OPTION","GUIDE","MOD"); $FILES = array( "/DataContents/img/icon_sp.jpg", "/DataContents/img/icon_shot.jpg", "/DataContents/img/icon_trial.jpg", "/DataContents/img/icon_movie.jpg", "/DataContents/img/icon_review.jpg", "/DataContents/img/icon_preview.jpg", "/DataContents/img/icon_patch.jpg", "/DataContents/img/icon_other.jpg", "/DataContents/img/icon_guide.jpg", "/DataContents/img/icon_mod.jpg"); if( $j % 2 == 0){ $bgcolor = "#333333"; }else{ $bgcolor = "#555555"; } $codes = splitCode($code,"BBBBBBBBBBBBBBBBVVVV"); $GENRES = array("---,0", "img/act.gif,1", "img/adv.gif,2", "img/rpg.gif,3", "img/mini.gif,4", "img/str.gif,5", "img/sim.gif,6", "img/etc.gif,7" ); $genre = searchAtr($GENRES,$codes[21],"/,/",1,0); $uc=0; $INFO_ICON=""; // INFOMATION用データ生成 $c = preg_split("//",$code); $GENRE = array("指定なし", "Action", "Adventure", "RPG", "mini-Scape", "Strategy", "Simulation", "ETC" ); $INFO_TYPE = $GENRE[$c[22]]; $GENRETYPES["パソコン"] = array("-", "Action", "Adventure", "RPG", "mini-Scape", "Strategy", "Simulation", "ETC" ); // HARDWARE $GENRETYPES["HARDWARE"] = array("-", "汎用", "PC本体", "ATI", "NVIDIA", "サウンド", "CPU", "入力デバイス" ); // MAC $GENRETYPES["MAC"] = array("-", "ゲーム", "ipod", "本体", "周辺機器", "入荷情報" ); $INFO_TYPE = $GENRETYPES[$multisite][$c[22]]; if($icon_mode == 1){ for($u=0;$u\n"; if( $TYPES[$u] != $STYPES[$stype]){ continue; } if( $TYPES[$u] == "MOVEI"){ $list = "/DataContents/game_search.php3?list=l&id=".$id."&mode=g&genre=".$INFO_TYPE."&type=".$TYPES[$u]."&gameTitle=".urlencode($gameTitle); $INFO_ICON = $INFO_ICON.""; $uc++; if( $uc % 5 == 0){ $INFO_ICON .= "
"; } }else{ for($uu=0;$uu\n"; if( $DUPLEX_URL[$directurl] != ""){ $duplexFlag = 1; //echo "DUPLEX
\n"; } $DUPLEX_URL[$directurl] = $directurl; }else{ $directurl = $urls[0]; } //if( $TYPES[$u] == "DEMO" || $TYPES[$u] == "PATCH"){ if( $TYPES[$u] != "" ){ //echo "SELECT
"; if( $duplexFlag == 0){ //echo "ADD IMAGE
"; $uc++; $INFO_ICON = $INFO_ICON.""; if( $uc % 5 == 0){ $INFO_ICON .= "
"; } } }else{ $uc++; $INFO_ICON = $INFO_ICON.""; if( $uc % 5 == 0){ $INFO_ICON .= "
"; } } } } } } } // echo "
$gameTitle$maker
$INFO_ICON$price
$INFO_DATE
$MTIME
メーカー '.$maker.' 機種 PC ジャンル '.$INFO_TYPE.'
発売日 '.$INFO_DATE.' 価格 '.$INFO_PRICE.'      
'.$INFO_DESC.'
'; } echo $paging; //echo "
$paging