"; // echo "

  */ ?>

"; echo "
\n"; // echo "\n"; if( $top == "top"){ $offset = 0; } if( $OFFSET == "<<"){ $offset = $offset - $limit; }else if( $OFFSET == ">>"){ $offset = $offset + $limit; }else if( $OFFSET > 0){ $offset = $limit*($OFFSET-1); } if( $mode == "g"){ $gimage = strtolower($genre); $gimage = str_replace("mini-","mini",$gimage); $image = "./img/logos/".$gimage.".jpg"; $modify = "game.mtime"; if( $type != ""){ $searchMessage = $JTITLE[$type]."の直近30件"; }else{ $searchMessage = ""; } }else{ $timage = strtolower($type); $timage = str_replace("patch","patches",$timage); if( preg_match("/s$/",$timage) == FALSE){ $timage .= "s"; } $image = "./img/logos/".$timage.".jpg"; $modify = "game.mtime"; if( $genre != ""){ $searchMessage = $JTITLE[$genre]."のRecent30"; }else{ $searchMessage = ""; } } echo "

".$searchMessage."

\n"; echo "\n"; echo ""; echo ""; // メニュー if( $mode == "g"){ //$MENU = array("","SPECIAL","PREVIEW","REVIEW","DEMO","SCREENSHOT","MOVIE", // "PATCH","GUIDE","MOD","OPTION"); //$DISPMENU = array("All","スペシャル","プレビュー","レビュー","体験版", // "スクリーンショット","ムービー", "パッチ","ガイド","MOD","その他"); $MENU = array("","SPECIAL","PREVIEW","REVIEW","DEMO","SCREENSHOT","MOVIE", "PATCH","GUIDE","OPTION"); $DISPMENU = array("All","スペシャル","プレビュー","レビュー","体験版", "スクリーンショット","ムービー", "パッチ","ガイド","その他"); }else{ $MENU = array("","Action","Adventure","RPG","mini-Scape", "Simulation","Strategy","ETC"); $DISPMENU = array("All","アクション","アドベンチャー","RPG","ミニスケープ", "シミュレーション","ストラテジー","その他"); } for($i=0;$i"; /* echo ""; echo "\n"; */ } // echo "
"; echo ""; echo ""; */ $gmode = split("-",$mode); /* echo ""; //echo "
$DISPMENU[$i]
"; echo "$DISPMENU[$i]"; echo "
\n"; // echo "
\n"; /* echo ''; echo ' '; */ $lastmonth = mktime (0,0,0,date("m"),date("d")-14, date("Y")); $lastdate = date("Y/m/d",$lastmonth); $host = "10.230.34.1"; $dbname = "data_contents"; $table = "game"; $from = getenv("HTTP_REFERER"); /* PostgreSQL サーバに接続 */ $con = pg_connect("host=".$host." port=5432 dbname=".$dbname." user=nobody"); //$con = pg_connect($host,"","","",$dbname); if (!$con) { echo "データベースに接続出来ませんでした。"; } // 検索条件の作成 $cond = ""; $split = ""; if( $type == "MOVIE"){ // DB上のデータが間違っているため補正 $type = "MOVEI"; } if( $title != ""){ $cond .= $split."upper(game.title) like '%".sqlstring($title,"UPPER")."%'"; $split = " and "; } $imageType = ""; if( $type != ""){ $TYPES = array("NEWS","SPECIAL","SCREENSHOT","DEMO","MOVEI", "REVIEW","PREVIEW","PATCH","OPTION","GUIDE","MOD"); // $FILES = array("/DataContents/img/b_kiji.gif", // "/DataContents/img/b_sp.gif", // "/DataContents/img/b_shot.gif", // "/DataContents/img/b_trial.gif", // "/DataContents/img/b_movie.gif", // "/DataContents/img/b_review.gif", // "/DataContents/img/b_preview.gif", // "/DataContents/img/b_patch.gif", // "/DataContents/img/b_other.gif", // "/DataContents/img/b_guide.gif", // "/DataContents/img/b_mod.gif" // ); $FILES = array("/DataContents/img/icon_kiji.jpg", "/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" ); $gtype = ""; for($jj = 0;$jj < count($TYPES);$jj++){ if( $TYPES[$jj] == $type){ $gtype .= "1"; $imageType = ""; }else{ $gtype .= "_"; } } //$cond .= $split."game.flag like '$gtype'"; $cond .= $split."recent.type = '$type'"; $split = " and "; }else{ $cond .= $split."recent.type = 'NEWS'"; $split = " and "; } if( $genre != ""){ $GENRES = array("---,0", "Action,1", "Adventure,2", "RPG,3", "mini-Scape,4", "Strategy,5", "Simulation,6", "ETC,7" ); //$gcode = searchAtr($GENRES,$genre,"/,/",0,1); //$cond .= $split."game.code like '_____________________$gcode%'"; $cond .= $split."recent.genre = '$genre'"; $split = " and "; } $cond .= $split."recent.id > 0 and recent.id < 10000"; $cond = "recent.id = game.id and game.display != '表示しない' and recent.mode = 'PRD' and ".$cond; if($sort == ""){ $order = "game.title"; }else if( $sort == "time"){ $order = "recent.mtime"; }else{ $order = "game.title"; } if( $using == ""){ $using = "<"; }else if( $using == "gt"){ $using = "<"; }else{ $using = ">"; } if( $cond != ""){ if( $offset == "" || $MODE == "検索"){ $offset = 0; } //$query = "SET DateStyle='ISO';select game.id,game.code,game.flag,game.ctime,$modify,game.title,game.maker,game.maker_url,game.code from game,recent where $cond order by game.title using < limit $limit offset $offset"; //$cquery = "select game.id from game,recent where $cond"; //$query = "SET DateStyle='ISO';select distinct on id recent.id,recent.type,recent.genre,recent.ctime,recent.mtime,recent.url,recent.url2,recent.display,recent.mode,game.title,game.maker,game.maker_url from recent,game where $cond order by $order using $using limit $limit offset $offset"; //$order = "recent.mtime"; $query = "SET DateStyle='ISO';select recent.id,recent.type,recent.genre,recent.ctime,recent.mtime,recent.url,recent.url2,recent.display,recent.mode,game.title,game.maker,game.maker_url,game.date,game.price from recent,game where $cond order by recent.ctime using > limit 300"; $cquery = "select recent.id from recent,game where $cond order by $order using $using "; //echo "QUERY=[$query]
\n"; /* 検索を実行 */ $rtn = pg_exec($con,$query); /* 検索件数 */ $m = pg_numrows($rtn); echo '
'; } echo '
'; echo '
ジャンル タイトル'; echo 'コンテンツ 更新日'; echo '
\n"; //echo ""; // TITLE $datacontents = sprintf("/DataContents/game/%04.4d.html",$id); //echo "\n"; // MAKER if( $makerUrl != ""){ $maker = "$maker"; } // echo ""; // TYPE // echo ""; // MTIME if( $MTIME[$id] == ""){ $INFO_MTIME = toDate2($ctime); }else{ if( $lastdate <= toDate2($MTIME[$id]) ){ $INFO_MTIME = toDate2($MTIME[$id]); }else{ $INFO_MTIME = toDate2($MTIME[$id]); } } //echo "\n"; $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"; } if( $year == 9999){ $INFO_DATE = "未定"; }else{ if( $month == 0 && $day == 0){ $INFO_DATE = sprintf("%04.4d年",$year); }else if( $month <= 12 && $day <= 31){ $INFO_DATE = sprintf("%04.4d/%02.2d/%02.2d",$year,$month,$day); }else{ if( $month == 20 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"春"); }else if( $month == 30 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"夏"); }else if( $month == 40 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"秋"); }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,"月中"); } } } echo '

'; /* データベースとの接続を切り離す */ pg_close($con); $split = ""; $jj=0; for($j=0;$j < $m;$j++) { /* pg_result() は行・列の内容を返す */ //recent.id,recent.type,recent.genre,recent.ctime, //recent.mtime,recent.url,recent.url2,recent.display,recent.mode //,game.title,game.maker,game.maker_url $id = pg_result($rtn,$j,0); $genre = pg_result($rtn,$j,2); $type = pg_result($rtn,$j,1); $ctime = pg_result($rtn,$j,3); $mtime = pg_result($rtn,$j,4); $url = pg_result($rtn,$j,5); $url2 = pg_result($rtn,$j,6); $gameTitle = pg_result($rtn,$j,9); $maker = pg_result($rtn,$j,10); $makerUrl = pg_result($rtn,$j,11); $date = pg_result($rtn,$j,12); $price = pg_result($rtn,$j,13); //echo "$id,$genre,$type,$ctime,$mtime,",count($URL[$id]),$url,$url2,"
\n"; //echo "$id,$gameTitle,$ctime,$mtime,$url2
\n"; if( $diffid[$id] != ""){ continue; } //$diffid[$id] = $id; $jj++; // RECENT30で表示を終了する if( $jj > 30){ break; } if( $jj % 2 == 0){ $bgcolor = "#333333"; }else{ $bgcolor = "#555555"; } $codes = splitCode($code,"BBBBBBBBBBBBBBBBVVVV"); $GENRES = array("---,0", "img/act.gif,Action", "img/adv.gif,Adventure", "img/rpg.gif,RPG", "img/mini.gif,mini-Scape", "img/str.gif,Strategy", "img/sim.gif,Simulation", "img/etc.gif,ETC", "img/mod.gif,MOD" ); $g = $genre; $genre = searchAtr($GENRES,$genre,"/,/",1,0); // GENRE //echo "
$gameTitle$maker
"; // $uu = split("\t",$URL[$id]); // $gmode = split("-",$mode); // $list = "./".$PHP_FORM."?list=l&id=".$id."&mode=".$gmode[1]."&genre=".$g."&type=".$type."&gameTitle=".urlencode($gameTitle); // echo "$imageType"; // TYPE //echo ""; $uu = split("\n",$url2); // $gmode = split("-",$mode); if( $type == "MOVEI"){ $list = "./".$PHP_FORM."?list=l&id=".$id."&mode=".$mode."&genre=".$g."&type=".$type."&gameTitle=".urlencode($gameTitle); //echo "$imageType"; }else{ for($ii = 0;$ii < count($uu);$ii++){ $uline = trim($uu[$ii]); $uuu = split("\t",$uline); if( $uuu[1] == ""){ $uline = $uuu[0]; }else{ $uline = $uuu[1]; } //echo "$imageType"; } } // if( $URL[$id] == ""){ // echo "$imageType"; // } //echo "
メーカー '.$maker.' 機種 PC ジャンル '.$g.'
発売日 '.$INFO_DATE.' 価格 '.$price.' 最終更新日 '.$INFO_MTIME.'
'.$infoDesc.'
'; } echo "\n"; //echo "$paging\n"; //echo "\n"; } // 修正用検索フォーム function makeEditSearch(){ global $id,$gameTitle,$gameUrl,$maker,$makerUrl,$type,$genre,$title, $subType,$mode, $saleDate,$ctime,$mtime,$price,$display,$memo,$header,$footer, $template,$infoImage,$infoTitle,$infoDesc,$infoCopyright,$copyright, $offset,$limit,$OFFSET,$code,$flag,$MODE, $sid,$stitle,$smaker,$sdateL,$sdateH, $stypes,$snewstypes,$scode,$smode,$stbtn,$sort,$using,$top,$PHP_FORM, $STITLE,$JTITLE; // 説明文 // echo ""; // echo " "; // echo "
\n"; // echo "\n"; if( $top == "top"){ $offset = 0; } if( $OFFSET == "<<"){ $offset = $offset - $limit; }else if( $OFFSET == ">>"){ $offset = $offset + $limit; }else if( $OFFSET > 0){ $offset = $limit*($OFFSET-1); } // echo "\n"; //echo "\n"; } // コンテンツリスト function makeContentList(){ global $id,$gameTitle,$gameUrl,$maker,$makerUrl,$type,$genre,$title, $subType,$mode,$list, $saleDate,$ctime,$mtime,$price,$display,$memo,$header,$footer, $template,$infoImage,$infoTitle,$infoDesc,$infoCopyright,$copyright, $offset,$limit,$OFFSET,$code,$flag,$MODE, $sid,$stitle,$smaker,$sdateL,$sdateH, $stypes,$snewstypes,$scode,$smode,$stbtn,$sort,$using,$top,$PHP_FORM; // 説明文 echo "
\n"; // echo ""; // echo "\n"; // echo "\n"; // echo "\n"; // echo "\n"; $SGENRE = array("","Action","Adventure","RPG","mini-Scape", "Simulation","Strategy","ETC"); $STYPE = array("","SPECIAL","SCREENSHOT","DEMO","MOVIE","REVIEW","PREVIEW","PATCH","OPTION","GUIDE"); $sdetail = "sgenre=".getIndex($SGENRE,$genre)."&stype=".getIndex($STYPE,$type); if( $mode == "g"){ $gimage = strtolower($genre); $gimage = str_replace("mini-","mini",$gimage); $image = "./img/logos/".$gimage.".jpg"; $modify = "game.mtime"; if( $type != ""){ $searchMessage = $JTITLE[$type]."で検索"; }else{ $searchMessage = ""; } }else{ $timage = strtolower($type); $timage = str_replace("patch","patches",$timage); if( preg_match("/s$/",$timage) == FALSE){ $timage .= "s"; } $image = "./img/logos/".$timage.".jpg"; $modify = "game.mtime"; if( $genre != ""){ $searchMessage = $JTITLE[$genre]."で検索"; }else{ $searchMessage = ""; } } if( $title != ""){ $searchMessage = "ゲームタイトルで検索"; $image = "./img/logos/all.jpg"; } echo "

".$searchMessage."

\n"; echo "\n"; echo ""; echo ""; // メニュー if( $mode == "g"){ //$MENU = array("","SPECIAL","PREVIEW","REVIEW","DEMO","SCREENSHOT","MOVIE", // "PATCH","GUIDE","MOD","OPTION"); //$DISPMENU = array("All","スペシャル","プレビュー","レビュー","体験版", // "スクリーンショット","ムービー", "パッチ","ガイド","MOD","その他"); $MENU = array("","SPECIAL","PREVIEW","REVIEW","DEMO","SCREENSHOT","MOVIE", "PATCH","GUIDE","OPTION"); $DISPMENU = array("All","スペシャル","プレビュー","レビュー","体験版", "スクリーンショット","ムービー", "パッチ","ガイド","その他"); }else{ $MENU = array("","Action","Adventure","RPG","mini-Scape", "Simulation","Strategy","ETC"); $DISPMENU = array("All","アクション","アドベンチャー","RPG","ミニスケープ", "シミュレーション","ストラテジー","その他"); } for($i=0;$iデータベースに接続出来ませんでした。"; } // 検索条件の作成 $cond = ""; $split = ""; if( $type == "MOVIE"){ // DB上のデータが間違っているため補正 $type = "MOVEI"; } if( $title != ""){ //$cond .= $split."upper(game.title) like '%".sqlstring($title,"UPPER")."%'"; $cond .= $split."(upper(title) like '%".sqlstring($title,"UPPER")."%' or upper(middle_e_title) like '%".sqlstring($title,"UPPER")."%')"; $split = " and "; } $imageType = ""; if( $type != ""){ $TYPES = array("NEWS","SPECIAL","SCREENSHOT","DEMO","MOVEI", "REVIEW","PREVIEW","PATCH","OPTION","GUIDE","MOD"); // $FILES = array("/DataContents/img/b_kiji.gif", // "/DataContents/img/b_sp.gif", // "/DataContents/img/b_shot.gif", // "/DataContents/img/b_trial.gif", // "/DataContents/img/b_movie.gif", // "/DataContents/img/b_review.gif", // "/DataContents/img/b_preview.gif", // "/DataContents/img/b_patch.gif", // "/DataContents/img/b_other.gif", // "/DataContents/img/b_guide.gif", // "/DataContents/img/b_mod.gif" // ); $FILES = array("/DataContents/img/icon_kiji.jpg", "/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" ); $gtype = ""; for($jj = 0;$jj < count($TYPES);$jj++){ if( $TYPES[$jj] == $type){ $gtype .= "1"; $imageType = ""; }else{ $gtype .= "_"; } } //$cond .= $split."game.flag like '$gtype'"; if( $title != ""){ }else{ $cond .= $split."recent.type = '$type'"; } $split = " and "; }else{ $cond .= $split."recent.type = 'NEWS'"; $split = " and "; } if( $genre != ""){ $GENRES = array("---,0", "Action,1", "Adventure,2", "RPG,3", "mini-Scape,4", "Strategy,5", "Simulation,6", "ETC,7" ); //$gcode = searchAtr($GENRES,$genre,"/,/",0,1); //$cond .= $split."game.code like '_____________________$gcode%'"; if( $title != ""){ $cond .= $split."recent.genre != ''"; }else{ $cond .= $split."recent.genre = '$genre'"; } $split = " and "; } $cond .= $split."recent.id > 0 and recent.id < 10000"; $cond = "recent.id = game.id and game.display != '表示しない' and recent.mode = 'PRD' and ".$cond; if($sort == ""){ $order = "game.title"; }else if( $sort == "time"){ $order = "recent.mtime"; }else{ $order = "game.title"; } if( $using == ""){ $using = "<"; }else if( $using == "gt"){ $using = "<"; }else{ $using = ">"; } echo '
'; if( $cond != ""){ if( $offset == "" || $MODE == "検索"){ $offset = 0; } //$query = "SET DateStyle='ISO';select game.id,game.code,game.flag,game.ctime,$modify,game.title,game.maker,game.maker_url,game.code from game,recent where $cond order by game.title using < limit $limit offset $offset"; //$cquery = "select game.id from game,recent where $cond"; //$query = "SET DateStyle='ISO';select distinct on id recent.id,recent.type,recent.genre,recent.ctime,recent.mtime,recent.url,recent.url2,recent.display,recent.mode,game.title,game.maker,game.maker_url from recent,game where $cond order by $order using $using limit $limit offset $offset"; //$order = "recent.mtime"; $query = "SET DateStyle='ISO';select distinct on ($order) recent.id,recent.type,recent.genre,recent.ctime,recent.mtime,recent.url,recent.url2,recent.display,recent.mode,game.title,game.maker,game.maker_url,game.date,game.price from recent,game where $cond order by $order using $using limit $limit offset $offset"; $cquery = "select recent.id from recent,game where $cond order by $order using $using "; //echo "QUERY=[$query]
\n"; //echo "CQUERY=[$cquery]
\n"; /* 検索を実行 */ $crtn = pg_exec($con,$cquery); /* 検索件数 */ $data_num = pg_numrows($crtn); //$data_num = pg_result($crtn, 0, 0); /* 検索を実行 */ $rtn = pg_exec($con,$query); /* 検索件数 */ $m = pg_numrows($rtn); //echo "検索を行います。",$query,"
"; //echo "検索結果 全",$data_num,"件 : Page "; //$paging = "検索結果 全".$data_num."件 : Page "; 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 ""; // TITLE $datacontents = sprintf("/DataContents/game/%04.4d.html",$id); //echo "\n"; // MAKER if( $makerUrl != ""){ $maker = "$maker"; } // echo ""; // TYPE //echo ""; // MTIME if( $MTIME[$id] == ""){ $INFO_MTIME = toDate2($ctime); }else{ if( $lastdate <= toDate2($MTIME[$id]) ){ $INFO_MTIME = toDate2($MTIME[$id]); }else{ $INFO_MTIME = toDate2($MTIME[$id]); } } //echo "\n"; $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"; } if( $year == 9999){ $INFO_DATE = "未定"; }else{ if( $month == 0 && $day == 0){ $INFO_DATE = sprintf("%04.4d年",$year); }else if( $month <= 12 && $day <= 31){ $INFO_DATE = sprintf("%04.4d/%02.2d/%02.2d",$year,$month,$day); }else{ if( $month == 20 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"春"); }else if( $month == 30 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"夏"); }else if( $month == 40 && $day > 31){ $INFO_DATE = sprintf("%04.4d/%s",$year,"秋"); }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,"月中"); } } } // パッケージイメージ $INFO_IMAGE = "/images/pct_top1.jpg"; if( $middle_search != ""){ $INFO_IMAGE = $middle_search; } echo '
'; // if( $m > 0 && $type != ""){ 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.","; } } /* 各種記事の検索 */ //$addquery = "select * from game where id IN (select id from game where $cond limit $limit offset $offset)"; //$addquery = "select distinct on id id,type,genre,ctime,mtime from recent where id IN ($in)"; $addquery = "select id,type,genre,ctime,mtime,url,url2 from recent where id IN ($in) "; if( $title == ""){ if( $type != ""){ $addquery .= " and type = '$type'"; } if( $genre != ""){ $addquery .= " and genre = '$genre'"; } } $addquery .= " order by mtime using <"; //echo "記事URLの検索を行います。",$addquery,"
"; $artn = pg_exec($con,$addquery); $am = pg_numrows($artn); } /* データベースとの接続を切り離す */ pg_close($con); $split = ""; for($j=0;$j < $am;$j++) { /* pg_result() は行・列の内容を返す */ $aid = pg_result($artn,$j,0); $atype = pg_result($artn,$j,1); $agenre = pg_result($artn,$j,2); $actime = pg_result($artn,$j,3); $amtime = pg_result($artn,$j,4); $aurl = pg_result($artn,$j,5); $aurl2 = pg_result($artn,$j,6); if( $MTIME[$aid] < $amtime){ //echo "CHANGE $aid,$amtime
\n"; $MTIME[$aid] = $amtime; } //if( $aid == "824"){ //echo "DATA $amtime,",$MTIME[$aid],",$aid,$aurl,$aurl2
\n"; //} if( $aurl2 == ""){ $uline = $aurl; }else{ $uline = $aurl2; } if( $uline != "" && $DUPLEXURL[$aid."\t".$uline] == ""){ $URL[$aid] .= $split.$uline; //echo "Found $aid,$uline
\n"; $split = "\t"; $DUPLEXURL[$aid."\t".$uline] = $uline; } } for($j=0;$j < $m;$j++) { /* pg_result() は行・列の内容を返す */ //recent.id,recent.type,recent.genre,recent.ctime, //recent.mtime,recent.url,recent.url2,recent.display,recent.mode //,game.title,game.maker,game.maker_url $id = pg_result($rtn,$j,0); $genre = pg_result($rtn,$j,2); $type = pg_result($rtn,$j,1); $ctime = pg_result($rtn,$j,3); $mtime = pg_result($rtn,$j,4); $url = pg_result($rtn,$j,5); // $url2 = pg_result($rtn,$j,6); $gameTitle = pg_result($rtn,$j,9); $maker = pg_result($rtn,$j,10); $makerUrl = pg_result($rtn,$j,11); $date = pg_result($rtn,$j,12); $price = pg_result($rtn,$j,13); // ミドルページ拡張データ $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"]; //$code = pg_result($rtn,$j,8); //$display = pg_result($rtn,$j,18); //echo "$id,$genre,$type,$ctime,$mtime,",count($URL[$id]),$url,$url2,"
\n"; if( $j % 2 == 0){ $bgcolor = "#333333"; }else{ $bgcolor = "#555555"; } $codes = splitCode($code,"BBBBBBBBBBBBBBBBVVVV"); $GENRES = array("---,0", "img/act.gif,Action", "img/adv.gif,Adventure", "img/rpg.gif,RPG", "img/mini.gif,mini-Scape", "img/str.gif,Strategy", "img/sim.gif,Simulation", "img/etc.gif,ETC", "img/mod.gif,MOD" ); $g = $genre; $genre = searchAtr($GENRES,$genre,"/,/",1,0); // GENRE //echo "
$gameTitle$maker
"; $uu = split("\t",$URL[$id]); if( $title == ""){ if( $type == "MOVEI"){ $list = "./".$PHP_FORM."?list=l&id=".$id."&mode=".$mode."&genre=".$g."&type=".$type."&gameTitle=".urlencode($gameTitle); //echo "$imageType"; }else{ for($ii = 0;$ii < count($uu);$ii++){ $uline = trim($uu[$ii]); if( $uline != ""){ //echo "$imageType"; } } if( $URL[$id] == ""){ //echo "$imageType"; } } } //echo "
メーカー '.$maker.' 機種 PC ジャンル '.$g.'
発売日 '.$INFO_DATE.' 価格 '.$price.' 最終更新日 '.$INFO_MTIME.'
'.$infoDesc.'
'; } echo $paging; //echo "
$paging
"; echo " "; if( $mode == "g"){ $gimage = strtolower($genre); $gimage = str_replace("mini-","mini",$gimage); $image = "./img/logos/".$gimage.".jpg"; $modify = "game.mtime"; if( $type != ""){ $searchMessage = "『".$gameTitle."』一覧"; }else{ $searchMessage = ""; } }else{ $timage = strtolower($type); $timage = str_replace("patch","patches",$timage); $timage = str_replace("movei","movie",$timage); if( preg_match("/s$/",$timage) == FALSE){ $timage .= "s"; } $image = "./img/logos/".$timage.".jpg"; $modify = "game.mtime"; if( $genre != ""){ $searchMessage = "『".$gameTitle."』一覧"; }else{ $searchMessage = ""; } } echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo "
\n"; echo "
\n"; $searchMessage = str_replace("MOVEI","MOVIE",$searchMessage); echo "
",$searchMessage,"
\n"; echo "
\n"; // メニュー if( $mode == "g"){ //$MENU = array("","SPECIAL","PREVIEW","REVIEW","DEMO","SCREENSHOT","MOVIE", // "PATCH","GUIDE","MOD","OPTION"); //$DISPMENU = array("All","スペシャル","プレビュー","レビュー","体験版", // "スクリーンショット","ムービー", "パッチ","ガイド","MOD","その他"); $MENU = array("","SPECIAL","PREVIEW","REVIEW","DEMO","SCREENSHOT","MOVIE", "PATCH","GUIDE","OPTION"); $DISPMENU = array("All","スペシャル","プレビュー","レビュー","体験版", "スクリーンショット","ムービー", "パッチ","ガイド","その他"); }else{ $MENU = array("","Action","Adventure","RPG","mini-Scape", "Simulation","Strategy","ETC"); $DISPMENU = array("All","アクション","アドベンチャー","RPG","ミニスケープ", "シミュレーション","ストラテジー","その他"); } echo "
\n"; echo ''; echo "\n"; echo "\n"; echo "
\n"; $lastmonth = mktime (0,0,0,date("m"),date("d")-14, date("Y")); $lastdate = date("Y/m/d",$lastmonth); $host = "localhost"; $dbname = "data_contents"; $table = "game"; $from = getenv("HTTP_REFERER"); /* PostgreSQL サーバに接続 */ $con = pg_connect("host=".$host." port=5432 dbname=".$dbname." user=nobody"); //$con = pg_connect($host,"","","",$dbname); if (!$con) { echo "データベースに接続出来ませんでした。"; } // 検索条件の作成 $cond = ""; $split = ""; if( $type == "MOVIE"){ // DB上のデータが間違っているため補正 $type = "MOVEI"; } /* 各種記事の検索 */ $addquery = "SET DateStyle='ISO';select id,type,genre,ctime,mtime,url,url2,body from recent where id = '$id' "; if( $type != ""){ $addquery .= " and type = '$type'"; } if( $genre != ""){ $addquery .= " and genre = '$genre'"; } $addquery .= " order by ctime using >"; //echo "記事URLの検索を行います。",$addquery,"
"; $artn = pg_exec($con,$addquery); $am = pg_numrows($artn); /* データベースとの接続を切り離す */ pg_close($con); $split = ""; for($j=0;$j < $am;$j++) { /* pg_result() は行・列の内容を返す */ $aid = pg_result($artn,$j,0); $atype = pg_result($artn,$j,1); $agenre = pg_result($artn,$j,2); $actime = pg_result($artn,$j,3); $amtime = pg_result($artn,$j,4); $aurl = pg_result($artn,$j,5); $aurl2 = pg_result($artn,$j,6); $abody = pg_result($artn,$j,7); //echo "$aid,$atype,$agenre,$actime,$amtime,$aurl,$aurl2
\n"; $MTIME[$aid] = $amtime; if( $aurl2 == ""){ $uline = $aurl; }else{ $uline = $aurl2; } if( $uline != "" && $DUPLEXURL[$aid."\t".$uline] == ""){ $URL[$aid] .= $split.$uline; $split = "\t"; $DUPLEXURL[$aid."\t".$uline] = $uline; } if( toDate2($actime) == "2000/01/01"){ $download = "[Download Here]"; }else{ $download = "[Download Here] - ".toDate2($actime).""; } $abody = str_replace("[リンク先の記事をご覧ください]",$download,$abody); //if( preg_match("/[Download Here]/",$abody) == FALSE){ if( preg_match("/NotExist/",$abody) == FALSE){ echo "$abody"; } } 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 "