// -----------------------------------------------------------------------
// 初期設定
// -----------------------------------------------------------------------
list(,$my) = @explode("mori-machinery.co.jp",$_SERVER["SCRIPT_FILENAME"]);
$path = @preg_replace("/[^\/]/","",$my);
$path = @preg_replace("/[\/]/","../",$path);
@require_once($path."phpset/init.php");
@require_once($path."phpset/DBinit.php");
@require_once("../php/mob_menu.php");
define("TABLE","topics");
define("MNUM",10); // メニューの表示個数
define("PMAX",5); // ページリンク表示個数
// ページ値取得
if(f("p")){ $page = f("p");}
if(!$page){ $page = 1;}
// 選択データ番号取得
$select = "";
if(f("n")){ $select = f("n");}
// -----------------------------------------------------------------------
// DBデータ登録数取得
// -----------------------------------------------------------------------
$DBARY_count = array();
$DBARY_count["table"] = TABLE;
$DBARY_count["get_f"] = "Num";
$count = @DB_count();
// -----------------------------------------------------------------------
// DBデータ取得(メニュー生成)
// -----------------------------------------------------------------------
$dfAry = array();
$dfAry = @explode(",",@DB_field(TABLE));
if(count($dfAry)){
$DBARY = array();
$DBARY['table'] = TABLE;
$DBARY['get_f'] = @join(",",$dfAry);
$DBARY['concat'] = "Year,Month,Day,Num";
$DBARY['order'] = 1;
$DBARY['limit'] = (($page-1)*MNUM).",".MNUM; // 「始点,データ数」
$dbd = @DB_data_select();
}
$se_title = "";
$se_date = "";
$se_kiji = "";
$topics_menu = "";
$mAry = array();
if($dbd){
foreach(explode("<__>",$dbd) as $v){
if($v){
$ary = array();
$ary = @explode("<>",$v);
foreach($dfAry as $k2 => $v2){
$v2 = @strtolower($v2);
$GLOBALS[$v2] = $ary[$k2];
}
// 記事詳細データ表示
if($select){
if($select == $num){
$se_title = $title;
$se_date = "$year/$month/$day";
$se_kiji = @preg_replace("/SPBR/","
\r\n",tag_f($kiji));
}
}else{
if(!$se_title){
$se_title = $title;
$se_date = "$year/$month/$day";
$se_kiji = @preg_replace("/SPBR/","
\r\n",tag_f($kiji));
$select = $num;
}
}
// リンクメニュー
$sp = " ";
if($select == $num){
$mAry[] = $sp.'
'."$year/$month/$day".'
'.$title.''."$year/$month/$day".'
'.$title.'