/*
WordPress(3.1/JP) Blog Reader 3.1 for open
F-NOTES WSE3.1G
20/12/23
script by Motohiro Iwatsuki(info@f-notes.jp)
*/
/*初期設定&サブルーチン読み込み*/
require_once("../setup_wse31.php");
require_once("../funcs_wse31.php");
require_once("../lfuncs_wse31.php");
$rethtd = new CLAHTD;
$retmql = new CLAMQL;
$retmks = new CLAMKS;
$prv_flg = 0;
/*現在のタイマー設定*/
$crytim = sprintf("%02d%02d%02d-%02d%02d%02d", date("y"), date("m"), date("d"), date("H"), date("i"), date("s"));
$crydte = sprintf("%04d-%02d-%02d %02d:%02d:%02d", date("Y"), date("m"), date("d"), date("H"), date("i"), date("s"));
/*ブラウザからのデータ受け取り&不正文字変換*/
//<ブラウザからの受け取り>
if (empty($_POST) == false){
foreach($_POST as $thsnam => $thsval){
$thsval = SUBSTC($thsval, "*");
$DATPST[$thsnam] = $thsval;
}
}
elseif (empty($_GET) == false){
foreach($_GET as $thsnam => $thsval){
$thsval = SUBSTC($thsval, "*");
$DATPST[$thsnam] = $thsval;
}
}
/*サービスコードの読み込み*/
$srv_inf = array();
$actsql = sprintf("SELECT * FROM `%s` LIMIT 0, 30;", $cnt10dbt['services']);
$srv_inf = SUBSQR($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass'], 'service_code', $actsql);
//<システム用>
//プラットフォームチェック
if ($DATPST['style'] == ""){
$dt_mbl_chk = $_SERVER['HTTP_USER_AGENT'];
$dt_mbl_flg = (preg_match($mblura1, $dt_mbl_chk) == true) * 1;
$dt_mbl_dtp = array();
$dt_mbl_dtp[0] = "pc";
$dt_mbl_dtp[1] = "st";
$DATPST['style'] = $dt_mbl_dtp[$dt_mbl_flg];
}
//サービスコード
if ($DATPST['wt'] == ""){$DATPST['wt'] = "pt";}
if (preg_match("/[a-z]{2}/", $DATPST['wt']) == false){SUBDMS("サービスコードが正しくありません。");exit;}
//ドキュメントカテゴリー
if ($DATPST['dcat'] == ""){
$dt_dcat_key = sprintf("key:%s", $DATPST['wt']);
$DATPST['dcat'] = $srv_inf[$dt_dcat_key]['ini_dcat'];
}
if ($DATPST['dcat'] == ""){$DATPST['dcat'] = "3";}
if (preg_match("/[0-9]{1,6}/", $DATPST['dcat']) == false){SUBDMS("ドキュメントカテゴリーが正しくありません");exit;}
//表示モード
if ($DATPST['htm'] == ""){
if ($DATPST['p'] != "") {$DATPST['htm'] = "detail";}
else {
$tbnchk['termmeta'] = str_replace("{wt:pst}", $DATPST['wt'], $cnt10dbt['termmeta']);
$dt_html_chk = array();
$actsql = sprintf("SELECT `html_mode` FROM `%s` WHERE `term_id` = '%s' LIMIT 0, 1;", $tbnchk['termmeta'], $DATPST['dcat']);
$dt_html_chk = SUBSQR($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass'], '', $actsql);
$DATPST['htm'] = $dt_html_chk['cnt:0000']['html_mode'];
}
}
if ($DATPST['htm'] != "list" && $DATPST['htm'] != "detail" && $DATPST['htm'] != "map" && $DATPST['htm'] != "track" && $DATPST['htm'] != "calender"){$DATPST['html'] = "list";}
//テンプレートHTML指定
if ($DATPST['httmp'] != ""){
if (preg_match("/[^0-9a-zA-Z_:.\/@&,~%\-]/is", $DATPST['httmp'])){SUBDMS("テンプレートHTMLファイル名が正しくありません。");exit;}
}
//年月の指定
if ($DATPST['htm'] == "calender"){
if ($DATPST['dc'] == ""){$DATPST['dc'] = substr($crytim, 0, 4);}
if (preg_match("/[0-9]{4}/", $DATPST['dc']) == false){SUBDMS("カレントカレンダーが正しくありません");exit;}
}
//戻り値
if ($DATPST['rt'] != ""){
$dt_rt_len = strlen($DATPST['rt']);
if ($dt_rt_len < 1 || $dt_rt_len > 256){SUBDMS("戻り値が正しくありません");exit;}
}
//<検索キー>
//ページカテゴリーID
if ($DATPST['pcat'] != ""){
if (preg_match("/[0-9]{1,6}/", $DATPST['pcat']) == false){SUBDMS("ページカテゴリーが正しくありません");exit;}
}
//検索カテゴリーID
if ($DATPST['scat'] != ""){
if (preg_match("/[0-9]{1,6}/", $DATPST['scat']) == false){SUBDMS("検索カテゴリーが正しくありません");exit;}
}
//タグ
if ($DATPST['tag'] != ""){
if (preg_match("/[0-9]{1,6}/", $DATPST['tag']) == false){SUBDMS("検索カテゴリーが正しくありません");exit;}
}
//キーワード
$dt_s_len = strlen($DATPST['s']);
if ($dt_s_len > 100){SUBDMS("キーワードが正しくありません");exit;}
//日付指定
if ($DATPST['m'] != ""){
if (preg_match("/[0-9]{2,6}/", $DATPST['m']) == false){SUBDMS("日付指定が正しくありません");exit;}
}
//<ページNo.指定>
//ページNo.
$DATPST['n'] = $DATPST['n'] * 1;
if ($DATPST['n'] < 0 || $DATPST['n'] > $cnt10lmt['inf']){$DATPST['n'] = 0;}
//地図モード初期表示No.
$DATPST['gn'] = $DATPST['gn'] * 1;
if ($DATPST['gn'] < 0 || $DATPST['gn'] > $cnt10lmt['inf']){$DATPST['gn'] = 0;}
/*各種ファイル・パス・データベース名設定*/
$dbtdef = array();
$dbtdef['terms'] = $cnt10dbt['terms'];
$dbtdef['term_taxonomy'] = $cnt10dbt['term_taxonomy'];
$dbtdef['termmeta'] = $cnt10dbt['termmeta'];
$dbtdef['term_relationships'] = $cnt10dbt['term_relationships'];
$dbtdef['postmeta'] = $cnt10dbt['postmeta'];
$dbtdef['posts'] = $cnt10dbt['posts'];
$dbtdef['users'] = $cnt10dbt['users'];
$dbtdef['options'] = $cnt10dbt['options'];
$fildef = array();
$fildef['dir-open'] = $cnt10dir['open-20'];
$fildef['fil-html-list'] = $cnt10htm['html-list-20'];
$fildef['fil-html-detail'] = $cnt10htm['html-detail-20'];
$fildef['fil-html-calender'] = $cnt10htm['html-calender-20'];
$fildef['fil-html-map'] = $cnt10htm['html-map-20'];
$fildef['fil-html-track'] = $cnt10htm['html-track-20'];
$fildef['fil-html-httmp'] = $cnt10htm['html-httmp-20'];
foreach($dbtdef as $thsnam => $thsval){
$dbtdef[$thsnam] = str_replace("{wt:pst}", $DATPST['wt'], $dbtdef[$thsnam]);
}
foreach($fildef as $thsnam => $thsval){
$fildef[$thsnam] = str_replace("{wt:pst}", $DATPST['wt'], $fildef[$thsnam]);
}
/*カテゴリー情報の読み込み*/
//<DBを開く>
$OPNBUF = array();
$OPNBUF = $retmql->MQLOPN($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass']);
//<ドキュメントカテゴリー情報の読み込み>
//データの読み込み
$dctdat = array();
$dctcnt = 0;
$actsql = sprintf("SELECT * FROM `%s` LEFT JOIN `%s` ON `%s`.`term_id` = `%s`.`term_id` WHERE (`%s`.`parent` = '0' AND `%s`.`term_taxonomy_id` > '2') AND `%s`.`taxonomy` = 'category' ORDER BY substring(`%s`.`name`, 1, 5);", $dbtdef['term_taxonomy'], $dbtdef['terms'], $dbtdef['term_taxonomy'], $dbtdef['terms'], $dbtdef['term_taxonomy'], $dbtdef['term_taxonomy'], $dbtdef['term_taxonomy'], $dbtdef['terms']);
$dctdat = $retmql->MQLRED('term_id', $actsql);
//ドキュメントが存在するかのチェック
$dctchk = sprintf("key:%s", $DATPST['dcat']);
if (isset($dctdat[$dctchk]) == false){SUBDMS("指定のドキュメントは存在しません。");exit;}
//ドキュメントのソート設定の読み込み
$dcsdat = array();
$dcsbuf = array();
$actsql = sprintf("SELECT * FROM `%s` WHERE `term_id` = '%s';", $dbtdef['termmeta'], $DATPST['dcat']);
$dcsbuf = $retmql->MQLRED('term_id', $actsql);
$dcsidx = sprintf("key:%s", $DATPST['dcat']);
$dcsdat = array_merge($dcsbuf[$dcsidx]);
if ($DATPST['pcat'] == "" && $dcsdat['ini_pcat'] != "0"){$DATPST['pcat'] = $dcsdat['ini_pcat'];}
//<ページカテゴリー情報の読み込み>
//データの読み込み
$pctdat = array();
$actsql = sprintf("SELECT * FROM `%s` LEFT JOIN `%s` ON `%s`.`term_id` = `%s`.`term_id` WHERE (`%s`.`parent` = '%s' AND `%s`.`taxonomy` = 'category') AND substring(`%s`.`name`, 1, 1) = 'D' ORDER BY substring(`%s`.`name`, 1, 4);", $dbtdef['term_taxonomy'], $dbtdef['terms'], $dbtdef['term_taxonomy'], $dbtdef['terms'], $dbtdef['term_taxonomy'], $DATPST['dcat'], $dbtdef['term_taxonomy'], $dbtdef['terms'], $dbtdef['terms']);
$pctdat = $retmql->MQLRED('term_id', $actsql);
//<検索カテゴリーの読み込み>
//検索カテゴリーデータの読み込み
$sctdat = array();
$actsql = sprintf("SELECT * FROM `%s` LEFT JOIN `%s` ON `%s`.`term_id` = `%s`.`term_id` WHERE (`%s`.`parent` = '%s' AND `%s`.`taxonomy` = 'category') AND substring(`%s`.`name`, 1, 1) = 'S' ORDER BY substring(`%s`.`name`, 1, 4);", $dbtdef['term_taxonomy'], $dbtdef['terms'], $dbtdef['term_taxonomy'], $dbtdef['terms'], $dbtdef['term_taxonomy'], $DATPST['dcat'], $dbtdef['term_taxonomy'], $dbtdef['terms'], $dbtdef['terms']);
$sctdat = $retmql->MQLRED('term_id', $actsql);
//<タグ情報の読み込み>
//データの読み込み(投稿数の多い順)
$ptgdat = array();
$dtgdat = array();
$tagbuf = array();
$actsql = sprintf("SELECT * FROM `%s` LEFT JOIN `%s` ON `%s`.`term_id` = `%s`.`term_id` WHERE `%s`.`taxonomy` = 'post_tag' ORDER BY `%s`.`count` DESC LIMIT 0, %s;", $dbtdef['term_taxonomy'], $dbtdef['terms'], $dbtdef['term_taxonomy'], $dbtdef['terms'], $dbtdef['term_taxonomy'], $dbtdef['term_taxonomy'], $cnt10lmt['tag']);
$tagbuf = $retmql->MQLRED('term_id', $actsql);
//ドキュメント関連タグ
$dtgsqb = array();
$dtgsql = sprintf("SELECT `object_id` FROM `%s` WHERE `term_taxonomy_id` = '%s';", $dbtdef['term_relationships'], $DATPST['dcat']);
$dtgsqb = $retmql->MQLRED('*', $dtgsql);
for ($loopc = 0; $loopc < count($dtgsqb); $loopc++){
$dtgrei0 = sprintf("cnt:%04d", $loopc);
$dtgrei1 = $dtgsqb[$dtgrei0]['term_taxonomy_id'];
$dtgrei2 = sprintf("key:%s", $dtgrei1);
$dtgreq = sprintf("SELECT `term_taxonomy_id` FROM `%s` WHERE `object_id` = '%s'", $dbtdef['term_relationships'], $dtgsqb[$dtgrei0]['object_id']);
$dtgret = $retmql->MQLRED('term_taxonomy_id', $dtgreq);
$dtgrel = array_merge($dtgrel,$dtgret);
}
foreach($dtgrel as $thsnam => $thsval){
if ($tagbuf[$thsnam]['term_taxonomy_id'] == $dtgrel[$thsnam]['term_taxonomy_id']){
$dtgdat[$thsnam] = $tagbuf[$thsnam];
}
}
//ページ関連タグ(ページ指定のみ)
if ($DATPST['p'] != ""){
$ptgsqb = array();
$actsql = sprintf("SELECT `object_id` FROM `%s` WHERE `term_taxonomy_id` = '%s';", $dbtdef['term_relationships'], $DATPST['dcat']);
$ptgsqb = $retmql->MQLRED('*', $actsql);
for ($loopc = 0; $loopc < count($ptgsqb); $loopc++){
$actsql = sprintf("SELECT `term_taxonomy_id` FROM `%s` WHERE `object_id` = '%s'", $dbtdef['term_relationships'], $DATPST['p']);
$ptgrel = $retmql->MQLRED('term_taxonomy_id', $actsql);
$ptgrel = array_merge($ptgrel,$ptgret);
}
foreach($ptgrel as $thsnam => $thsval){
if ($tagbuf[$thsnam]['term_taxonomy_id'] == $ptgrel[$thsnam]['term_taxonomy_id']){$ptgdat[$thsnam] = $tagbuf[$thsnam];}
}
}
//<DBを閉じる>
$OPNBUF = $retmql->MQLCLS();
/*HTMLテンプレート読み込み*/
//<初期設定>
$getdoc = array();
$getlop = array();
$gettmp = array();
$gitdoc = array();
//<ファイル名設定>
//必ず各表示モードに必要なテンプレートファイルは用意してください
if ($DATPST['style'] == "st"){
foreach($fildef as $thsnam => $thsval){
$fildef[$thsnam] = str_replace($cnt10htc['html-style-replace-pc'], $cnt10htc['html-style-replace-st'], $fildef[$thsnam]);
}
}
$htmftp = array();
$htmftp[0] = $fildef['fil-html-list'];
$htmftp[1] = $fildef['fil-html-map'];
$htmftp[2] = $fildef['fil-html-calendar'];
$htmftp[3] = $fildef['fil-html-detail'];
$htmftp[4] = $fildef['fil-html-track'];
$htmftp[5] = $fildef['fil-html-httmp'];
$htmftp[5] = str_replace("{httmp}", $DATPST['httmp'], $htmftp[5]);
$htmflg = ($DATPST['htm'] == "map") * 1 + ($DATPST['htm'] == "calender") * 2 + ($DATPST['htm'] == "detail") * 3 + ($DATPST['htm'] == "track") * 4;
$htmffl = ($htmflg * ($DATPST['httmp'] == "") * 1) + ($DATPST['httmp'] != "") * 5;
$htmfil = $htmftp[$htmffl];
$htmfil = str_replace("{dcat:pst}", $DATPST['dcat'], $htmfil);
$htmfil = str_replace("{pcat:pst}", $DATPST['pcat'], $htmfil);
$htmfck = sprintf("%s%s", $grbpth, $htmfil);
if (file_exists($htmfck) == false){
$htmfil = $htmftp[$htmffl];
$htmfil = str_replace("{dcat:pst}", $DATPST['dcat'], $htmfil);
$htmfil = str_replace("{pcat:pst}", "", $htmfil);
}
$rethtd->HTDDTM($grbpth, $htmfil);
//<HTMLテンプレートセット>
$getdoc['header#0'] = $rethtd->HTDRTB('header#0');
$getdoc['header#1'] = $rethtd->HTDRTB('header#1');
$getdoc['header#2'] = $rethtd->HTDRTB('header#2');
$getdoc['htmchange'] = $rethtd->HTDRTB('htmchange');
$gitdoc['sktitle:header'] = $rethtd->HTDITB('sktitle:header');
$getdoc['nlist'] = $rethtd->HTDRTB('nlist');
$getdoc['point-ini'] = $rethtd->HTDRTB('point-ini');
$getdoc['trkline'] = $rethtd->HTDRTB('trkline');
$getdoc['trkpoint'] = $rethtd->HTDRTB('trkpoint');
$getdoc['track-ini'] = $rethtd->HTDRTB('track-ini');
$getdoc['nlist-navi'] = $rethtd->HTDRTB('nlist-navi');
$getdoc['nlist-seek'] = $rethtd->HTDRTB('nlist-seek');
$getlop['nlist'] = $rethtd->HTDRTL('nlist');
$getlop['nlist-navi'] = $rethtd->HTDRTL('nlist-navi');
$getlop['trkline'] = $rethtd->HTDRTL('trkline');
$getlop['trkpoint'] = $rethtd->HTDRTL('trkpoint');
$gitdoc['pagebox:inf'] = $rethtd->HTDITB('pagebox:inf');
$gitdoc['pagebox:inf-null'] = $rethtd->HTDITB('pagebox:inf-null');
$gitdoc['pagebox-cont:inf'] = $rethtd->HTDITB('pagebox-cont:inf');
$gitdoc['pagebox-imgtag:inf'] = $rethtd->HTDITB('pagebox-imgtag:inf');
$gitdoc['pagebox-gallery:inf'] = $rethtd->HTDITB('pagebox-gallery:inf');
$gitdoc['point:inf'] = $rethtd->HTDITB('point:inf');
$gitdoc['line:track'] = $rethtd->HTDITB('line:track');
$gitdoc['line:exiftime'] = $rethtd->HTDITB('line:exiftime');
$gitdoc['point:track'] = $rethtd->HTDITB('point:track');
$gitdoc['box00:nlist-navi'] = $rethtd->HTDITB('box00:nlist-navi');
$getdoc['dct-latest'] = $rethtd->HTDRTB('dct-latest');
$gettmp['dct-latest'] = $getdoc['dct-latest'];
$getdoc['dct-latest'] = "";
$getdoc['dct-calendar'] = $rethtd->HTDRTB('dct-calendar');
$getlop['dct-latest'] = $rethtd->HTDRTL('dct-latest');
$gitdoc['box00:dct-calendar'] = $rethtd->HTDITB('box00:dct-calendar');
$getdoc['dtg-list#0'] = $rethtd->HTDRTB('dtg-list#0');
$getdoc['dtg-list#1'] = $rethtd->HTDRTB('dtg-list#1');
$gettmp['dtg-list#0'] = $getdoc['dtg-list#0'];
$gettmp['dtg-list#1'] = $getdoc['dtg-list#1'];
$getdoc['dtg-list#0'] = "";
$getdoc['dtg-list#1'] = "";
$getdoc['ptg-list#0'] = $rethtd->HTDRTB('ptg-list#0');
$getdoc['ptg-list#1'] = $rethtd->HTDRTB('ptg-list#1');
$gettmp['ptg-list#0'] = $getdoc['ptg-list#0'];
$gettmp['ptg-list#1'] = $getdoc['ptg-list#1'];
$getdoc['ptg-list#0'] = "";
$getdoc['ptg-list#1'] = "";
$getlop['dtg-list#0'] = $rethtd->HTDRTL('dtg-list#0');
$getlop['ptg-list#0'] = $rethtd->HTDRTL('ptg-list#0');
for ($loopc = 0; $loopc < 5; $loopc++){
$gettbi = sprintf("pct-list-D%s", chr(65 + $loopc));
$getdoc[$gettbi] = $rethtd->HTDRTB($gettbi);
$gettmp[$gettbi] = $getdoc[$gettbi];
$getdoc[$gettbi] = "";
}
for ($loopc = 0; $loopc < 5; $loopc++){
$gettbi = sprintf("sct-list-S%s", chr(65 + $loopc));
$getdoc[$gettbi] = $rethtd->HTDRTB($gettbi);
$gettmp[$gettbi] = $getdoc[$gettbi];
$getdoc[$gettbi] = "";
}
for ($loopc = 0; $loopc < 5; $loopc++){
$gettbi = sprintf("dtg-list-T%s#0", chr(65 + $loopc));
$getdoc[$gettbi] = $rethtd->HTDRTB($gettbi);
$gettmp[$gettbi] = $getdoc[$gettbi];
$getdoc[$gettbi] = "";
$getlop[$gettbi] = $rethtd->HTDRTL($gettbi);
$gettbi = sprintf("dtg-list-T%s#1", chr(65 + $loopc));
$getdoc[$gettbi] = $rethtd->HTDRTB($gettbi);
$gettmp[$gettbi] = $getdoc[$gettbi];
$getdoc[$gettbi] = "";
}
for ($loopc = 0; $loopc < 5; $loopc++){
$gettbi = sprintf("ptg-list-T%s#0", chr(65 + $loopc));
$getdoc[$gettbi] = $rethtd->HTDRTB($gettbi);
$gettmp[$gettbi] = $getdoc[$gettbi];
$getdoc[$gettbi] = "";
$getlop[$gettbi] = $rethtd->HTDRTL($gettbi);
$gettbi = sprintf("ptg-list-T%s#1", chr(65 + $loopc));
$getdoc[$gettbi] = $rethtd->HTDRTB($gettbi);
$gettmp[$gettbi] = $getdoc[$gettbi];
$getdoc[$gettbi] = "";
}
/*ドキュメント情報読み込み*/
//<初期設定>
$infdat = array();
$infgfl = array();
$infgle = array();
$infpcl = array();
$dcldat = array();
$dccdat = array();
//<検索用フラグ>
$infdtf0 = ($DATPST['p'] != "") * 1 + ($DATPST['dc'] != "") * 2;
//<検索キー(リストモード)>
$keysek = "";
if ($infdtf0 == 0){
$infdtf1 = ($DATPST['pcat'] != "") * 1 + ($DATPST['scat'] != "") * 2 + ($DATPST['tag'] != "") * 4 + ($DATPST['s'] != "") * 8 + ($DATPST['m'] != "") * 16;
$keystm = array();
$keystm[0] = sprintf("AND `%s`.`term_taxonomy_id` = '%s'", $dbtdef['term_relationships'], $DATPST['dcat']);
$keystm[1] = sprintf("AND `%s`.`term_taxonomy_id` = '%s'", $dbtdef['term_relationships'], $DATPST['pcat']);
$keystm[2] = sprintf("AND `%s`.`term_taxonomy_id` = '%s'", $dbtdef['term_relationships'], $DATPST['scat']);
$keystm[4] = sprintf("AND `%s`.`term_taxonomy_id` = '%s'", $dbtdef['term_relationships'], $DATPST['tag']);
$key8_s_tmp = urldecode($DATPST['s']);
$keystm[8] = sprintf("AND `%s`.`term_taxonomy_id` ='%s' AND (`%s`.`post_title` REGEXP '%s' OR `%s`.`post_content` REGEXP '%s')", $dbtdef['term_relationships'], $DATPST['dcat'], $dbtdef['posts'], $key8_s_tmp, $dbtdef['posts'], $key8_s_tmp);
$key16_m_tmp[1][0] = sprintf("%04d-01-01 00:00:00",substr($DATPST['m'], 0, 4));
$key16_m_tmp[1][1] = sprintf("%04d-12-31 23:59:59",substr($DATPST['m'], 0, 4));
$key16_m_tmp[2][0] = sprintf("%04d-%02d-01 00:00:00",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2));
$key16_m_tmp[2][1] = sprintf("%04d-%02d-31 23:59:59",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2));
$key16_m_tmp[3][0] = sprintf("%04d-%02d-%02d 00:00:00",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2), substr($DATPST['m'], 6, 2));
$key16_m_tmp[3][1] = sprintf("%04d-%02d-%02d 23:59:59",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2), substr($DATPST['m'], 6, 2));
$key16_m_flg = floor((strlen($DATPST['m']) - 2) / 2);
$keystm[16] = sprintf("AND `%s`.`term_taxonomy_id` ='%s' AND (`%s`.`post_date` BETWEEN '%s' AND '%s')", $dbtdef['term_relationships'], $DATPST['dcat'], $dbtdef['posts'], $key16_m_tmp[$key16_m_flg][0], $key16_m_tmp[$key16_m_flg][1]);
$key17_m_tmp[1][0] = sprintf("%04d-01-01 00:00:00",substr($DATPST['m'], 0, 4));
$key17_m_tmp[1][1] = sprintf("%04d-12-31 23:59:59",substr($DATPST['m'], 0, 4));
$key17_m_tmp[2][0] = sprintf("%04d-%02d-01 00:00:00",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2));
$key17_m_tmp[2][1] = sprintf("%04d-%02d-31 23:59:59",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2));
$key17_m_tmp[3][0] = sprintf("%04d-%02d-%02d 00:00:00",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2), substr($DATPST['m'], 6, 2));
$key17_m_tmp[3][1] = sprintf("%04d-%02d-%02d 23:59:59",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2), substr($DATPST['m'], 6, 2));
$key17_m_flg = floor((strlen($DATPST['m']) - 2) / 2);
$keystm[17] = sprintf("AND `%s`.`term_taxonomy_id` ='%s' AND (`%s`.`post_date` BETWEEN '%s' AND '%s')", $dbtdef['term_relationships'], $DATPST['pcat'], $dbtdef['posts'], $key16_m_tmp[$key16_m_flg][0], $key16_m_tmp[$key16_m_flg][1]);
$key20_m_tmp[1][0] = sprintf("%04d-01-01 00:00:00",substr($DATPST['m'], 0, 4));
$key20_m_tmp[1][1] = sprintf("%04d-12-31 23:59:59",substr($DATPST['m'], 0, 4));
$key20_m_tmp[2][0] = sprintf("%04d-%02d-01 00:00:00",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2));
$key20_m_tmp[2][1] = sprintf("%04d-%02d-31 23:59:59",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2));
$key20_m_tmp[3][0] = sprintf("%04d-%02d-%02d 00:00:00",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2), substr($DATPST['m'], 6, 2));
$key20_m_tmp[3][1] = sprintf("%04d-%02d-%02d 23:59:59",substr($DATPST['m'], 0, 4), substr($DATPST['m'], 4, 2), substr($DATPST['m'], 6, 2));
$key20_m_flg = floor((strlen($DATPST['m']) - 2) / 2);
$keystm[20] = sprintf("AND `%s`.`term_taxonomy_id` ='%s' AND (`%s`.`post_date` BETWEEN '%s' AND '%s')", $dbtdef['term_relationships'], $DATPST['tag'], $dbtdef['posts'], $key16_m_tmp[$key16_m_flg][0], $key16_m_tmp[$key16_m_flg][1]);
$keysek = $keystm[$infdtf1];
}
//<ソート設定>
$srktmp = array();
$srktmp[0] = sprintf("`%s` %s", $dcsdat['sort_key'], $dcsdat['sort_method']);
$srktmp[1] = sprintf("%s", $dcsdat['sort_key']);
$srkflg = ($dcsdat['sort_method'] == "NON") * 1;
$srksql = $srktmp[$srkflg];
//<検索範囲、公開・プレビューフラグ>
$stnlop = $DATPST['n'];
$endlop = $DATPST['n'] + $getlop['nlist'];
$opftmp = array();
$opftmp[0] = sprintf("`%s`.`post_status` = 'publish'", $dbtdef['posts']);
$opftmp[1] = "";
$opftmp[5] = sprintf("`%s`.`post_status` = 'publish'", $dbtdef['posts']);
$opftmp[6] = sprintf("(`%s`.`post_status` <> 'publish' OR `%s`.`post_status` = 'publish')", $dbtdef['posts'], $dbtdef['posts']);
$opfflg = ($infdtf0 == 1) * 5 + ($prv_flg == 1) * 1;
$opfsql = $opftmp[$opfflg];
//<記事検索>
//リストモード(検索キーあり)
if ($infdtf0 == 0 && $infdtf1 > 0){
$actsql = sprintf("SELECT * FROM `%s` RIGHT JOIN `%s` ON `%s`.`ID` = `%s`.`object_id` WHERE %s%s ORDER BY %s LIMIT %s, %s;", $dbtdef['posts'], $dbtdef['term_relationships'], $dbtdef['posts'], $dbtdef['term_relationships'], $opfsql, $keysek, $srksql, $stnlop, $endlop);
$infdat = SUBSQR($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass'], '', $actsql);
$infcnt = count($infdat) * 1;
$actsql = sprintf("SELECT COUNT(*) AS `limit:sys` FROM `%s` RIGHT JOIN `%s` ON `%s`.`ID` = `%s`.`object_id` WHERE %s%s", $dbtdef['posts'], $dbtdef['term_relationships'], $dbtdef['posts'], $dbtdef['term_relationships'], $opfsql, $keysek);
$inflmb = array();
$inflmb = SUBSQR($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass'], '', $actsql);
$inflmt = $inflmb['cnt:0000']['limit:sys'] * 1;
if ($inflmt == 0){$infdtf1 = 0;}
}
//リストモード(検索キー無し)
if ($infdtf0 == 0 && $infdtf1 == 0){
$actsql = sprintf("SELECT * FROM `%s` RIGHT JOIN `%s` ON `%s`.`ID` = `%s`.`object_id` WHERE %s%s ORDER BY %s LIMIT %s, %s;", $dbtdef['posts'], $dbtdef['term_relationships'], $dbtdef['posts'], $dbtdef['term_relationships'], $opfsql, $keystm[0], $srksql, $stnlop, $endlop);
$infdat = SUBSQR($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass'], '', $actsql);
$infcnt = count($infdat) * 1;
$actsql = sprintf("SELECT COUNT(*) AS `limit:sys` FROM `%s` RIGHT JOIN `%s` ON `%s`.`ID` = `%s`.`object_id` WHERE %s%s;", $dbtdef['posts'], $dbtdef['term_relationships'], $dbtdef['posts'], $dbtdef['term_relationships'], $opfsql, $keystm[0]);
$inflmb = array();
$inflmb = SUBSQR($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass'], '', $actsql);
$inflmt = $inflmb['cnt:0000']['limit:sys'] * 1;
}
//ページ詳細モード
if ($infdtf0 == 1) {
$actsql = sprintf("SELECT * FROM `%s` RIGHT JOIN `%s` ON `%s`.`ID` = `%s`.`object_id` WHERE %s AND `ID` = '%s' LIMIT 0, 1;", $dbtdef['posts'], $dbtdef['term_relationships'], $dbtdef['posts'], $dbtdef['term_relationships'], $opfsql, $DATPST['p']);
$infdat = SUBSQR($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass'], '', $actsql);
$infcnt = count($infdat) * 1;
}
//カレンダーモード
if ($infdtf0 == 2) {
}
//<ギャラリー情報の読み込み>
//各記事の(ギャラリー)の1番最初の写真情報読み込み
foreach($infdat as $datnam => $datval){
$infgfi = sprintf("key:%s", $datval['ID']);
$infgfb = array();
$actsql = sprintf("SELECT `ID`, `post_date`, `post_title`, `guid` FROM `%s` WHERE `post_parent` = '%s' AND `post_type` = 'attachment' ORDER BY `menu_order` ASC LIMIT 0, 1;", $dbtdef['posts'], $datval['ID']);
$infgfb = SUBSQR($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass'], '', $actsql);
$infgmb = array();
$actsql = sprintf("SELECT `meta_value` FROM `%s` WHERE `post_id` = '%s' AND `meta_key` = '_wp_attachment_metadata' LIMIT 0, 1;", $dbtdef['postmeta'], $infgfb['cnt:0000']['ID']);
$infgmb = SUBSQR($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass'], '', $actsql);
$infgfl[$infgfi] = array_merge($infgfb['cnt:0000'], $infgmb['cnt:0000']);
}
//ギャラリー情報の読み込み
foreach($infdat as $datnam => $datval){
$infglb = array();
$infgli = sprintf("key:%s", $datval['ID']);
$infglk = "/\[gallery ([^\]]{1,})\]/i";
$infglt_buf = array();
$infglk_src = $datval['post_content'] . $getdoc['nlist'] . $gitdoc['pagebox:inf'] . $gitdoc['pagebox-cont:inf'];
preg_match_all($infglk, $infglk_src, $infglt_buf, PREG_SET_ORDER);
$infglt_elm0 = array();
preg_match_all ("/orderby=\"([^\"]{1,})\"/i", $infglt_buf[0][1], $infglt_elm0, PREG_SET_ORDER);
$infglt_elm1 = array();
preg_match_all ("/order=\"([^\"]{1,})\"/i", $infglt_buf[0][1], $infglt_elm1, PREG_SET_ORDER);
$infglt_elm2 = array();
preg_match_all ("/columns=\"([^\"]{1,})\"/i", $infglt_buf[0][1], $infglt_elm2, PREG_SET_ORDER);
$infglt_src0 = array();
$infglt_src0[0] = "`menu_order`";
$infglt_src0[1] = "`post_title`";
$infglt_src0[2] = "`ID`";
$infglt_src0[3] = "RAND()";
$infglt_srf0 = ($infglt_elm0[0][1] == "") * 0 + ($infglt_elm0[0][1] == "title") * 1 + ($infglt_elm0[0][1] == "ID") * 2 + ($infglt_elm0[0][1] == "rand") * 3;
$infglt_src1 = array();
$infglt_src1[0] = " ASC";
$infglt_src1[1] = " DESC";
$infglt_src1[2] = "";
$infglt_srf1 = ($infglt_elm1[0][1] == "" && $infglt_elm0[0][1] != "rand") * 0 + ($infglt_elm1[0][1] == "DESC") * 1 + ($infglt_elm0[0][1] == "rand") * 2;
$infglt_src2 = array();
$infglt_src2[0] = "3";
$infglt_src2[1] = $infglt_elm2[0][1];
$infglt_srf2 = ($infglt_elm2[0][1] == "") * 0 + ($infglt_elm2[0][1] != "");
$infglc = "/\[gallery\]/i";
$infglc_buf = array();
preg_match_all($infglc, $infglk_src, $infglc_buf, PREG_SET_ORDER);
if ($infglt_buf[0][0] != "" || $infglc_buf[0][0] != ""){
$infglb = array();
$actsql = sprintf("SELECT `ID`, `post_parent`, `post_title`, `guid` FROM `%s` WHERE `post_parent` = '%s' AND `post_type` = 'attachment' AND (`post_mime_type` = 'image/jpeg') ORDER BY %s%s LIMIT 0, 50;", $dbtdef['posts'], $datval['ID'], $infglt_src0[$infglt_srf0], $infglt_src1[$infglt_srf1]);
$infglb = SUBSQR($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass'], 'ID', $actsql);
foreach($infglb as $thsnam => $thsval){
$infglm = array();
$actsql = sprintf("SELECT `meta_value` FROM `%s` WHERE `post_id` = '%s' AND `meta_key` = '_wp_attachment_metadata' LIMIT 0, 1;", $dbtdef['postmeta'], $thsval['ID']);
$infglm = SUBSQR($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass'], '', $actsql);
$infglb[$thsnam]['meta_value'] = $infglm['cnt:0000']['meta_value'];
}
$infgle[$infgli]['gallery'] = array_merge($infglb);
$infgle_tag_dtp = array();
$infgle_tag_dtp[0] = $infglt_buf[0][0];
$infgle_tag_dtp[1] = $infglc_buf[0][0];
$infgle_tag_flg = ($infglc_buf[0][0] != "") * 1;
$infgle[$infgli]['tag'] = $infgle_tag_dtp[$infgle_tag_flg];
$infgle[$infgli]['columns'] = $infglt_src2[$infglt_srf2];
}
}
//<最新情報の読み込み・当月の情報>
//DBを開く
$OPNBUF = array();
$OPNBUF = $retmql->MQLOPN($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass']);
//ドキュメント内での最新記事
$stnlop = 0;
$endlop = $getlop['dct-latest'];
$dclkey = array();
$dclkey = sprintf("AND `%s`.`term_taxonomy_id` = '%s'", $dbtdef['term_relationships'], $DATPST['dcat']);
$actsql = sprintf("SELECT * FROM `%s` RIGHT JOIN `%s` ON `%s`.`ID` = `%s`.`object_id` WHERE %s%s ORDER BY %s LIMIT %s, %s;", $dbtdef['posts'], $dbtdef['term_relationships'], $dbtdef['posts'], $dbtdef['term_relationships'], $opfsql, $dclkey, $srksql, $stnlop, $endlop);
$dcldat = $retmql->MQLRED('*', $actsql);
//ドキュメント内での当月の情報
$dt_cal_end0 = substr($crydte, 0, 4);
$dt_cal_end1 = substr($crydte, 5, 2);
$endlop = date("t", mktime(0, 0, 0, $dt_end_dtp1, 1, $dt_end_dtp0));
for ($loope = 1; $loope <= $endlop; $loope++){
$keycal = sprintf("%04d-%02d-%02d", $dt_cal_end0, $dt_cal_end1, $loope);
$keydate0 = sprintf("%04d-%02d-%02d 00:00:00", $dt_cal_end0, $dt_cal_end1, $loope);
$keydate1 = sprintf("%04d-%02d-%02d 23:59:59", $dt_cal_end0, $dt_cal_end1, $loope);
$actsql = sprintf("SELECT COUNT(*) AS `count:sys` FROM `%s` RIGHT JOIN `%s` ON `%s`.`ID` = `%s`.`object_id` WHERE %s%s AND (`post_date` BETWEEN '%s' AND '%s');", $dbtdef['posts'], $dbtdef['term_relationships'], $dbtdef['posts'], $dbtdef['term_relationships'], $opfsql, $dclkey, $keydate0, $keydate1);
$retbuf = array();
$retbuf = $retmql->MQLRED('*', $actsql);
$dccdat[$keycal] = intval($retbuf['cnt:0000']['count:sys']) * 1;
}
//DBを閉じる
$OPNBUF = $retmql->MQLCLS();
//<記事関連ページカテゴリー>
//DBを開く
$OPNBUF = array();
$OPNBUF = $retmql->MQLOPN($sqlsrv['host'], $sqlsrv['name'], $sqlsrv['user'], $sqlsrv['pass']);
//記事関連ページカテゴリー
foreach($infdat as $datval){
$dt_id_key = $datval['ID'];
$dt_id_idx = sprintf("key:%s", $datval['ID']);
$actsql = sprintf("SELECT `term_taxonomy_id` FROM `%s` WHERE `object_id` = '%s' AND (`term_taxonomy_id` > '2' AND `term_taxonomy_id` != '%s');", $dbtdef['term_relationships'], $dt_id_key, $DATPST['dcat']);
$retbuf = array();
$retbuf = $retmql->MQLRED('*', $actsql);
$infpcl[$dt_id_idx] = array_merge($retbuf);
}
//DBを閉じる
$OPNBUF = $retmql->MQLCLS();
/*HTML生成*/
//<共通設定>
$delfnc = array();
//<リストモード>
if ($htmflg == 0){
//初期設定
$dt_htm_box = SUBSTC($gitdoc['pagebox:inf']);
$dt_htm_cont = SUBSTC($gitdoc['pagebox-cont:inf']);
$dt_htm_imgtag = SUBSTC($gitdoc['pagebox-imgtag:inf']);
//ヘッダー@”header#0~#2”
$deldsp = array();
$dt_skt_buf = SUBSTC($gitdoc['sktitle:header'], "*");
$dt_skt_elm = array();
$dt_skt_elm = split("\n", $dt_skt_buf);
$dt_skt_dtp = array();
$dt_skt_dtp[0] = $dt_skt_elm[0];
$dt_skt1_cid = sprintf("key:%s", $DATPST['pcat']);
$dt_skt1_nam = $pctdat[$dt_skt1_cid]['name'];
$dt_skt1_nam = ereg_replace("[D]{1}[A-E]{1}[0-9]{1,2}:", "", $dt_skt1_nam);
$dt_skt_dtp[1] = str_replace("{name:pcat:pst}", $dt_skt1_nam, $dt_skt_elm[1]);
$dt_skt2_cid = sprintf("key:%s", $DATPST['scat']);
$dt_skt2_nam = $sctdat[$dt_skt2_cid]['name'];
$dt_skt2_nam = ereg_replace("[S]{1}[A-Z]{1}[0-9]{1,2}:", "", $dt_skt2_nam);
$dt_skt2_nam = ereg_replace("[F]{1}[A-E]{1}[0-9]{1,2}:", "", $dt_skt2_nam);
$dt_skt_dtp[2] = str_replace("{name:scat:pst}", $dt_skt2_nam, $dt_skt_elm[2]);
$dt_skt4_cid = sprintf("key:%s", $DATPST['tag']);
$dt_skt4_nam = $dtgdat[$dt_skt4_cid]['name'];
$dt_skt4_nam = ereg_replace("[T]{1}[A-Z]{1}:", "", $dt_skt4_nam);
$dt_skt_dtp[4] = str_replace("{name:tag:pst}", $dt_skt4_nam, $dt_skt_elm[3]);
$dt_skt_dtp[20] = str_replace("{name:tag:pst}", $dt_skt4_nam, $dt_skt_elm[3]);
$dt_skt8_str = $DATPST['s'];
$dt_skt_dtp[8] = str_replace("{s:pst}", $dt_skt8_str, $dt_skt_elm[4]);
$dt_skt16_tmp = array();
$dt_skt16_tmp['d0:m:pst'] = substr($DATPST['m'], 0, 4);
$dt_skt16_tmp['d0:m:pst_s'] = substr($DATPST['m'], 2, 2);
$dt_skt16_tmp['d1:m:pst'] = substr($DATPST['m'], 4, 2);
$dt_skt16_tmp['d1:m:pst_s'] = sprintf("%s", intval($dt_skt16_tmp['d1:m:pst']));
$dt_skt16_tmp['d2:m:pst'] = substr($DATPST['m'], 6, 2);
$dt_skt16_tmp['d2:m:pst_s'] = sprintf("%s", intval($dt_skt16_tmp['d2:m:pst']));
$dt_skt16_elm = array();
$dt_skt16_elm = split("&&", $dt_skt_elm[5], 3);
$dt_skt16_dtp = array();
$dt_skt16_dtp[0] = $dt_skt16_elm[0];
$dt_skt16_dtp[1] = sprintf("%s%s", $dt_skt16_elm[0], $dt_skt16_elm[1]);
$dt_skt16_dtp[2] = sprintf("%s%s%s", $dt_skt16_elm[0], $dt_skt16_elm[1], $dt_skt16_elm[2]);
$dt_skt16_flg = floor((strlen($DATPST['m']) - 2) / 2);
$dt_skt_dtp[16] = $dt_skt16_dtp[$dt_skt16_flg];
foreach($dt_skt16_tmp as $cninam => $cnival){
$cnitag = sprintf("{%s}", $cninam);
$dt_skt_dtp[16] = str_replace($cnitag, $cnival, $dt_skt_dtp[16]);
}
$deldsp['sktitle:pst'] = $dt_skt_dtp[$infdtf1];
$deldsp['sktitle:pst'] = preg_replace("/([0-9]{4})(:)/i", "", $deldsp['sktitle:pst']);
foreach($deldsp as $cnvnam => $cnvval){
$cnvtag = sprintf("{%s}", $cnvnam);
$getdoc['header#0'] = str_replace($cnvtag, $cnvval, $getdoc['header#0']);
$getdoc['header#1'] = str_replace($cnvtag, $cnvval, $getdoc['header#1']);
$getdoc['header#2'] = str_replace($cnvtag, $cnvval, $getdoc['header#2']);
}
//記事リスト作成@”nlist”
$dt_date_d1_elm0 = array();
$dt_date_d1_elm1 = array();
$dt_date_d6_elm0 = array();
$dt_date_d6_elm1 = array();
$deldsp = array();
$dt_cnt_sys = 0;
foreach($infdat as $datval){
$dildsp = array();
$dildsp['post_title'] = $datval['post_title'];
$dildsp['post_title'] = preg_replace("/([0-9]{4})(:)/i", "", $dildsp['post_title']);
$dildsp['ID'] = $datval['ID'];
$dildsp['cnt:sys'] = $dt_cnt_sys;
$dildsp['cnt:sys_02d'] = sprintf("%02d", $dt_cnt_sys);
$dildsp['n:pst'] = sprintf("%s", $DATPST['n']);
$dildsp['key:pst'] = sprintf("pcat@%s/scat@%s/tag@%s/s@%s/m@%s", $DATPST['pcat'], $DATPST['scat'], $DATPST['tag'], $DATPST['s'], $DATPST['m']);
$dildsp['n:pst'] = $DATPST['n'];
$delfnc['key:pst'] = $dildsp['key:pst'];
$dildsp['d0:post_date_s'] = substr($datval['post_date'], 2, 2);
$dildsp['d0:post_date'] = substr($datval['post_date'], 0, 4);
$dildsp['d1:post_date'] = substr($datval['post_date'], 5, 2);
$dildsp['d1:post_date_s'] = sprintf("%s", intval($dildsp['d1:post_date']));
$dt_date_d1_idx = $dildsp['d1:post_date_s'] * 1;
$dildsp['d1:post_date_0'] = LOCCAM($dt_date_d1_idx, $calclx5);
$dildsp['d1:post_date_1'] = LOCCAM($dt_date_d1_idx, $calclx6);
$dildsp['d2:post_date'] = substr($datval['post_date'], 8, 2);
$dildsp['d2:post_date_s'] = sprintf("%s", intval($dildsp['d2:post_date']));
$dildsp['d3:post_date'] = substr($datval['post_date'], 11, 2);
$dildsp['d4:post_date'] = substr($datval['post_date'], 14, 2);
$dildsp['d5:post_date'] = substr($datval['post_date'], 17, 2);
$dildsp['day:post_date_0'] = LOCCAL($dildsp['d0:post_date'], $dildsp['d1:post_date'], $dildsp['d2:post_date'], $calclx);
$dildsp['day:post_date_1'] = LOCCAL($dildsp['d0:post_date'], $dildsp['d1:post_date'], $dildsp['d2:post_date'], $calclx1);
$dildsp['d0:post_modified_s'] = substr($datval['post_modified'], 2, 2);
$dildsp['d0:post_modified'] = substr($datval['post_modified'], 0, 4);
$dildsp['d1:post_modified'] = substr($datval['post_modified'], 5, 2);
$dildsp['d1:post_modified_s'] = sprintf("%s", intval($dildsp['d1:post_modified']));
$dt_date_d1_idx = $dildsp['d1:post_modified_s'] * 1;
$dildsp['d1:post_modified_0'] = LOCCAM($dt_date_d1_idx, $calclx5);
$dildsp['d1:post_modified_1'] = LOCCAM($dt_date_d1_idx, $calclx6);
$dildsp['d2:post_modified'] = substr($datval['post_modified'], 8, 2);
$dildsp['d2:post_modified_s'] = sprintf("%s", intval($dildsp['d2:post_modified']));
$dildsp['d3:post_modified'] = substr($datval['post_modified'], 11, 2);
$dildsp['d4:post_modified'] = substr($datval['post_modified'], 14, 2);
$dildsp['d5:post_modified'] = substr($datval['post_modified'], 17, 2);
$dildsp['day:post_modified_0'] = LOCCAL($dildsp['d0:post_modified'], $dildsp['d1:post_modified'], $dildsp['d2:post_modified'], $calclx);
$dildsp['day:post_modified_1'] = LOCCAL($dildsp['d0:post_modified'], $dildsp['d1:post_modified'], $dildsp['d2:post_modified'], $calclx1);
$dt_terms_idx = sprintf("key:%s", $datval['ID']);
$dt_terms_pcat = sprintf("key:%s", $infpcl[$dt_terms_idx]['cnt:0000']['term_taxonomy_id']);
$dildsp['name:term_taxonomy_id'] = $pctdat[$dt_terms_pcat]['name'];
$dildsp['name:term_taxonomy_id'] = preg_replace("/(D[A-Z]{1}[0-9]{2})(:)/i", "", $dildsp['name:term_taxonomy_id']);
$dt_cont_box = split("", $datval['post_content']);
$dildsp['pagebox:post_content'] = LOCAWT($dt_cont_box[0], $dt_htm_cont, $dt_htm_imgtag , $DATPST['style']);
$dt_pgb_idx = sprintf("key:%s", $datval['ID']);
$dildsp['pagebox:post_content'] = LOCCGL($dildsp['pagebox:post_content'], $infgle[$dt_pgb_idx], $gitdoc['pagebox-gallery:inf']);
$dt_dcat_key = sprintf("key:%s", $DATPST['wt']);
$dt_link_tmp = sprintf("%s%s%s%s?wt=%s&p=%s", $weburl, $htmpth, $srv_inf[$dt_dcat_key]['dir_open'], $srv_inf[$dt_dcat_key][prg_open], $DATPST['wt'], $datval['ID']);
$dildsp['link_url'] = $dt_link_tmp;
$dildsp['link_url:enc'] = rawurlencode($dt_link_tmp);
$dildsp['post_excerpt'] = SUBSTC($datval['post_excerpt'], "*");
$dildsp['post_excerpt'] = str_replace("\n", "
", $dildsp['post_excerpt']);
$dt_lead_dtp = preg_replace("@<[\/\!]*?[^<>]*?>@si", "", $datval['post_content']);
$dt_lead_dtp = SUBSTC($dt_lead_dtp, "*");
$dt_lead_dtp = mb_substr($dt_lead_dtp, 0, 200);
$dt_lead_dtp = preg_replace("/(\[\[map:)([^\]]{1,})(\]\])/i", "", $dt_lead_dtp);
$dt_lead_dtp = preg_replace("/(\[caption )([^\]]{1,})(\])/i", "", $dt_lead_dtp);
$dt_lead_dtp = preg_replace("/(\[gallery)([^\]]{1,})(\])/i", "", $dt_lead_dtp);
$dt_lead_dtp = str_replace("[/caption]", "", $dt_lead_dtp);
$dildsp['len200:post_content'] = str_replace("\n", "
", $dt_lead_dtp);
$dt_img_gsi = array();
preg_match_all("/SIZPHT=([0-9]{2,4})/i", $gitdoc['pagebox:inf'], $dt_img_gsi, PREG_SET_ORDER);
if ($dt_img_gsi[0][1] == ""){$dt_img_gsi[0][1] = $cnt10siz['photo-size'];}
$dt_guid_idx = sprintf("key:%s", $datval['ID']);
$dt_guid_buf = array();
$dt_guid_buf = LOCIMA($infgfl[$dt_guid_idx]['guid'], $infgfl[$dt_guid_idx]['meta_value'], $dt_img_gsi[0][1]);
$dildsp['imgdir:guid'] = rawurlencode($dt_guid_buf['dir']);
$dildsp['imgfil:guid'] = $dt_guid_buf['file'];
if ($dt_guid_buf['file'] == ""){$dildsp['imgfil:guid'] = $dt_guid_buf['file:jpg'];}
$dildsp['width:sys'] = $dt_guid_buf['width:sys'];
$dildsp['height:sys'] = $dt_guid_buf['height:sys'];
$dt_inf_tag = sprintf("pagebox:inf-%02d", $dt_cnt_sys);
$deldsp[$dt_inf_tag] = $gitdoc['pagebox:inf'];
foreach($dildsp as $cninam => $cnival){
$cnitag = sprintf("{%s}", $cninam);
$deldsp[$dt_inf_tag] = str_replace($cnitag, $cnival, $deldsp[$dt_inf_tag]);
}
$dt_cnt_sys++;
}
//データの内タグの削除
for ($loopc = $infcnt; $loopc < $getlop['nlist']; $loopc++){
$dt_inf_tag = sprintf("pagebox:inf-%02d", $loopc);
$deldsp[$dt_inf_tag] = "";
}
//HTMLテーブルへセット
foreach($deldsp as $cnvnam => $cnvval){
$cnvtag = sprintf("{%s}", $cnvnam);
$getdoc['nlist'] = str_replace($cnvtag, $cnvval, $getdoc['nlist']);
}
//データが無い場合
if ($infcnt == 0){
$getdoc['nlist'] = $gitdoc['pagebox:inf-null'];
}
}
//<マップモード>
elseif ($htmflg == 1){
}
//<カレンダーモード>
elseif ($htmflg == 2){
}
//<ページ詳細モード・トラックモード>
elseif ($htmflg == 3 || $htmflg == 4){
//初期設定
$dt_htm_cont = SUBSTC($gitdoc['pagebox-cont:inf']);
$dt_htm_imgtag = SUBSTC($gitdoc['pagebox-imgtag:inf']);
//ヘッダー@”header#0~#2”
$deldsp = array();
$deldsp['post_title'] = $infdat['cnt:0000']['post_title'];
$deldsp['post_title'] = preg_replace("/([0-9]{4})(:)/i", "", $deldsp['post_title']);
foreach($deldsp as $cnvnam => $cnvval){
$cnvtag = sprintf("{%s}", $cnvnam);
$getdoc['header#0'] = str_replace($cnvtag, $cnvval, $getdoc['header#0']);
$getdoc['header#1'] = str_replace($cnvtag, $cnvval, $getdoc['header#1']);
$getdoc['header#2'] = str_replace($cnvtag, $cnvval, $getdoc['header#2']);
}
//記事詳細@”nlist”
$deldsp = array();
$deldsp['post_title'] = $infdat['cnt:0000']['post_title'];
$deldsp['post_title'] = preg_replace("/([0-9]{4})(:)/i", "", $deldsp['post_title']);
$deldsp['d0:post_date_s'] = substr($infdat['cnt:0000']['post_date'], 2, 2);
$deldsp['d0:post_date'] = substr($infdat['cnt:0000']['post_date'], 0, 4);
$deldsp['d1:post_date'] = substr($infdat['cnt:0000']['post_date'], 5, 2);
$deldsp['d1:post_date_s'] = sprintf("%s", intval($deldsp['d1:post_date']));
$dt_date_d1_idx = $deldsp['d1:post_date_s'] * 1;
$deldsp['d1:post_date_0'] = LOCCAM($dt_date_d1_idx, $calclx5);
$deldsp['d1:post_date_1'] = LOCCAM($dt_date_d1_idx, $calclx6);
$deldsp['d2:post_date'] = substr($infdat['cnt:0000']['post_date'], 8, 2);
$deldsp['d2:post_date_s'] = sprintf("%s", intval($deldsp['d2:post_date']));
$deldsp['d3:post_date'] = substr($infdat['cnt:0000']['post_date'], 11, 2);
$deldsp['d4:post_date'] = substr($infdat['cnt:0000']['post_date'], 14, 2);
$deldsp['d5:post_date'] = substr($infdat['cnt:0000']['post_date'], 17, 2);
$deldsp['day:post_date_0'] = LOCCAL($deldsp['d0:post_date'], $deldsp['d1:post_date'], $deldsp['d2:post_date'], $calclx);
$deldsp['day:post_date_1'] = LOCCAL($deldsp['d0:post_date'], $deldsp['d1:post_date'], $deldsp['d2:post_date'], $calclx1);
$deldsp['d0:post_modified_s'] = substr($infdat['cnt:0000']['post_modified'], 2, 2);
$deldsp['d0:post_modified'] = substr($infdat['cnt:0000']['post_modified'], 0, 4);
$deldsp['d1:post_modified'] = substr($infdat['cnt:0000']['post_modified'], 5, 2);
$deldsp['d1:post_modified_s'] = sprintf("%s", intval($deldsp['d1:post_modified']));
$dt_date_d1_idx = $deldsp['d1:post_modified_s'] * 1;
$deldsp['d1:post_modified_0'] = LOCCAM($dt_date_d1_idx, $calclx5);
$deldsp['d1:post_modified_1'] = LOCCAM($dt_date_d1_idx, $calclx6);
$deldsp['d2:post_modified'] = substr($infdat['cnt:0000']['post_modified'], 8, 2);
$deldsp['d2:post_modified_s'] = sprintf("%s", intval($deldsp['d2:post_modified']));
$deldsp['d3:post_modified'] = substr($infdat['cnt:0000']['post_modified'], 11, 2);
$deldsp['d4:post_modified'] = substr($infdat['cnt:0000']['post_modified'], 14, 2);
$deldsp['d5:post_modified'] = substr($infdat['cnt:0000']['post_modified'], 17, 2);
$deldsp['day:post_modified_0'] = LOCCAL($deldsp['d0:post_modified'], $deldsp['d1:post_modified'], $deldsp['d2:post_modified'], $calclx);
$deldsp['day:post_modified_1'] = LOCCAL($deldsp['d0:post_modified'], $deldsp['d1:post_modified'], $deldsp['d2:post_modified'], $calclx1);
$dt_terms_idx = sprintf("key:%s", $infdat['cnt:0000']['ID']);
$dt_terms_pcat = sprintf("key:%s", $infpcl[$dt_terms_idx]['cnt:0000']['term_taxonomy_id']);
$deldsp['name:term_taxonomy_id'] = $pctdat[$dt_terms_pcat]['name'];
$deldsp['name:term_taxonomy_id'] = preg_replace("/(D[A-Z]{1}[0-9]{2})(:)/i", "", $deldsp['name:term_taxonomy_id']);
$deldsp['pagebox:post_content'] = "";
$dt_cont_box = split("", $datval['post_content']);
foreach($dt_cont_box as $elmval){
$dt_cont_htm = LOCAWT($elmval, $dt_htm_cont, $dt_htm_imgtag , $DATPST['style']);
$deldsp['pagebox:post_content'] .= $dt_cont_htm;
}
$dt_pgb_idx = sprintf("key:%s", $datval['ID']);
$deldsp['pagebox:post_content'] = LOCCGL($deldsp['pagebox:post_content'], $infgle[$dt_pgb_idx], $gitdoc['pagebox-gallery:inf']);
$dt_line_cont = $datval['post_content'];
$dt_line_cont = str_replace("\r\n", "\n", $dt_line_cont);
$dt_line_cont = str_replace("\r", "\n", $dt_line_cont);
$dt_line_cont = str_replace(" \n", "", $dt_line_cont);
$dt_line_elm = array();
$dt_line_elm = split("\n\n", $dt_line_cont);
for ($loope0 = 0; $loope0 < count($dt_line_elm); $loope0++){
$dt_line_tag0 = sprintf("line%02d:post_content", $loope0);
$deldsp[$dt_line_tag0] = $dt_line_elm[$loope0];
$dt_line_eac = array();
$dt_line_eac = split(",", $dt_line_elm[$loope0]);
for ($loope1 = 0; $loope1 < count($dt_line_eac); $loope1++){
$dt_line_tag1 = sprintf("line%02d-%02d:post_content", $loope0, $loope1);
$deldsp[$dt_line_tag1] = $dt_line_eac[$loope1];
}
}
$dt_dcat_key = sprintf("key:%s", $DATPST['wt']);
$dt_link_tmp = sprintf("%s%s%s%s?wt=%s&p=%s", $weburl, $htmpth, $srv_inf[$dt_dcat_key]['dir_open'], $srv_inf[$dt_dcat_key][prg_open], $DATPST['wt'], $datval['ID']);
$deldsp['link_url'] = $dt_link_tmp;
$deldsp['link_url:enc'] = rawurlencode($dt_link_tmp);
//ページナビ
$deldsp['rt:sys'] = $DATPST['rt'];
$deldsp['rt:sys'] = str_replace("/", "&", $deldsp['rt:sys']);
$deldsp['rt:sys'] = str_replace("@", "=", $deldsp['rt:sys']);
//HTMLテーブルへセット
foreach($deldsp as $cnvnam => $cnvval){
$cnvtag = sprintf("{%s}", $cnvnam);
$getdoc['nlist'] = str_replace($cnvtag, $cnvval, $getdoc['nlist']);
}
//データが無い場合
if ($infcnt == 0){
$getdoc['nlist'] = $gitdoc['pagebox:inf-null'];
}
}
//<ページナビ@”nlist-navi”(リスト、マップ時のみ)>
if ($htmflg == 0 || $htmflg == 1){
$deldsp = array();
$dt_box_hte = array();
$gitdoc['box00:nlist-navi'] = SUBSTC($gitdoc['box00:nlist-navi'], "*");
$dt_box_hte = split("\n", $gitdoc['box00:nlist-navi'], 3);
//-トップ・最後-
$deldsp['png0:sys'] = 0;
$deldsp['key:pst'] = str_replace("@", "=", $delfnc['key:pst']);
$deldsp['key:pst'] = str_replace("/", "&", $deldsp['key:pst']);
$deldsp['htm:pst'] = $DATPST['htm'];
$dt_png2_lop = $getlop['nlist'];
$dt_png2_cal0 = floor(($inflmt - 1) / $dt_png2_lop);
$dt_png2_cal1 = $dt_png2_cal0 * ($dt_png2_cal0 > 0) * 1;
$dt_png2_cal2 = $dt_png2_cal1 * $getlop['nlist'];
$deldsp['png2:sys'] = abs($dt_png2_cal2);
//-ページ送り-
$deldsp['box00:navi'] = "";
$dt_png1_cnt0 = 1;
$dt_png1_cnt1 = $getlop['nlist-navi'] - $dt_png1_cnt0;
$dt_png1_lop = $getlop['nlist'];
$dt_png1_plt = array();
$dt_png1_plt[0] = 0;
$dt_png1_plt[1] = ceil($DATPST['n'] / $dt_png1_lop) - $dt_png1_cnt0;
$dt_png1_slf = ($dt_png1_plt[1] > 0) * 1;
$dt_png1_slp = $dt_png1_plt[$dt_png1_slf];
$dt_png1_lmt = $inflmt;
$dt_png1_elt = array();
$dt_png1_elt[0] = ceil($DATPST['n'] / $dt_png1_lop) + $dt_png1_cnt1;
$dt_png1_elt[1] = ceil($dt_png1_lmt / $dt_png1_lop);
$dt_png1_elf = ($dt_png1_elt[0] > $dt_png1_elt[1]) * 1;
$dt_png1_elp = $dt_png1_elt[$dt_png1_elf];
$dt_navi_tmp = array();
$dt_navi_tmp[0] = $dt_box_hte[0];
$dt_navi_tmp[1] = $dt_box_hte[1];
for ($loopc = $dt_png1_slp; $loopc <$dt_png1_elp; $loopc++){
$dildsp = array();
$dildsp['png1:sys'] = $loopc * $dt_png1_lop;
$dildsp['pnd1:sys'] = sprintf("%s", $loopc + 1);
$dildsp['key:pst'] = str_replace("@", "=", $delfnc['key:pst']);
$dildsp['key:pst'] = str_replace("/", "&", $dildsp['key:pst']);
$dt_navi_flg0 = floor($DATPST['n'] / $dt_png1_lop) * $dt_png1_lop;
$dt_navi_flg1 = ($dildsp['png1:sys'] == $dt_navi_flg0) * 1;
$dt_navi_dtp = $dt_navi_tmp[$dt_navi_flg1];
$dildsp['htm:pst'] = $DATPST['htm'];
foreach($dildsp as $cninam => $cnival){
$cnitag = sprintf("{%s}", $cninam);
$dt_navi_dtp = str_replace($cnitag, $cnival, $dt_navi_dtp);
}
$deldsp['box00:navi'] .= $dt_navi_dtp;
}
$dt_navi1_dtp = array();
$dt_navi1_dtp[0] = "";
$dt_navi1_dtp[1] = $dt_box_hte[2];
$dt_navi1_flg = ($deldsp['png2:sys'] > (($dt_png1_elp - 1) * $dt_png1_lop)) * 1;
$deldsp['box00:navi'] .= $dt_navi1_dtp[$dt_navi1_flg];
//-ページNo.-
$deldsp['stn:sys'] = $DATPST['n'] + 1;
$dt_edn_cal = array();
$dt_edn_cal[0] = $DATPST['n'] + $dt_png1_lop;
$dt_edn_cal[1] = $inflmt;
$dt_edn_caf = ($dt_edn_cal[0] > $inflmt) * 1;
$deldsp['edn:sys'] = $dt_edn_cal[$dt_edn_caf];
$deldsp['cnt:sys'] = $inflmt;
//-HTMLセット-
foreach($deldsp as $cnvnam => $cnvval){
$cnvtag = sprintf("{%s}", $cnvnam);
$getdoc['nlist-navi'] = str_replace($cnvtag, $cnvval, $getdoc['nlist-navi']);
}
//-データが無い場合-
if ($infcnt == 0){
$getdoc['nlist-navi'] = "";
}
}
//<最新情報の読み込み・当月の情報@”dct-latest”、”dct-calendar”>
//ドキュメント内での最新記事
$deldsp = array();
$dt_cnt_sys = 0;
foreach($dcldat as $datval){
$deldsp = array();
$deldsp['ID'] = $datval['ID'];
$deldsp['cnt:sys'] = $dt_cnt_sys;
$deldsp['cnt:sys_02d'] = sprintf("%02d", $dt_cnt_sys);
$deldsp['post_title'] = $datval['post_title'];
$deldsp['post_title'] = preg_replace("/([0-9]{4})(:)/i", "", $deldsp['post_title']);
$gettml = $gettmp['dct-latest'];
foreach($deldsp as $cnvnam => $cnvval){
$cnvtag = sprintf("{%s}", $cnvnam);
$gettml = str_replace($cnvtag, $cnvval, $gettml);
}
$getdoc['dct-latest'] .= $gettml;
$dt_cnt_sys++;
}
//ドキュメント内での当月の情報
//-初期設定-
$dt_box_hte = array();
$gitdoc['box00:dct-calendar'] = SUBSTC($gitdoc['box00:dct-calendar'], "*");
$dt_box_hte = split("\n", $gitdoc['box00:dct-calendar'], 3);
$dt_end_dtp0 = substr($crydte, 0, 4);
$dt_end_dtp1 = substr($crydte, 5, 2);
$daylop0 = date("t", mktime(0, 0, 0, $dt_end_dtp1, 1, $dt_end_dtp0));
$daylop1 = date("w", mktime(0, 0, 0, $dt_end_dtp1, 1, $dt_end_dtp0));
$daylop2 = $daylop1 + $daylop0;
//-当月の年月-
$deldsp['d0:sys'] = substr($crydte, 0, 4);
$deldsp['d0:sys_s'] = substr($crydte, 2, 2);
$deldsp['d1:sys'] = substr($crydte, 5, 2);
$deldsp['d1:sys_s'] = intval($deldsp['d1:sys']);
$dt_d1_idx = $deldsp['d1:sys_s'];
$deldsp['d1:sys_0'] = LOCCAM($dt_date_d1_idx, $calclx5);
$deldsp['d1:sys_1'] = LOCCAM($dt_date_d1_idx, $calclx6);
//-月初めまでの空白-
for ($loope = 0; $loope < $daylop1; $loope++){
$dt_box_day = sprintf("box:day-%02d", $loope);
$deldsp[$dt_box_day] = $dt_box_hte[0];
}
//-カレンダー-
$dt_d2_cnt = 1;
for ($loope = $daylop1; $loope < $daylop2; $loope++){
$dildsp = array();
$dildsp['d0:sys'] = substr($crydte, 0, 4);
$dildsp['d0:sys_s'] = substr($crydte, 2, 2);
$dildsp['d1:sys'] = substr($crydte, 5, 2);
$dildsp['d2:sys'] = sprintf("%02d", $dt_d2_cnt);
$dildsp['d2:sys_s'] = sprintf("%s", $dt_d2_cnt);
$dt_box_dtp = array();
$dt_box_dtp[0] = $dt_box_hte[1];
$dt_box_dtp[1] = $dt_box_hte[2];
$dt_box_key = sprintf("%04d-%02d-%02d", substr($crydte, 0, 4), substr($crydte, 5, 2), $dt_d2_cnt);
$dt_box_flg = ($dccdat[$dt_box_key] > 0) * 1;
$dt_box_htm = $dt_box_dtp[$dt_box_flg];
$dt_box_day = sprintf("box:day-%02d", $loope);
$deldsp[$dt_box_day] = $dt_box_dtp[$dt_box_flg];
foreach($dildsp as $cninam => $cnival){
$cnitag = sprintf("{%s}", $cninam);
$deldsp[$dt_box_day] = str_replace($cnitag, $cnival, $deldsp[$dt_box_day]);
}
$dt_d2_cnt++;
}
//-月末からの空白-
for ($loope = $daylop2; $loope < 42; $loope++){
$dt_box_day = sprintf("box:day-%02d", $loope);
$deldsp[$dt_box_day] = $dt_box_hte[0];
}
//-HTMLテーブルへセット-
foreach($deldsp as $cnvnam => $cnvval){
$cnvtag = sprintf("{%s}", $cnvnam);
$getdoc['dct-calendar'] = str_replace($cnvtag, $cnvval, $getdoc['dct-calendar']);
}
//<カテゴリー・タグリスト>
//ページカテゴリー
$dt_pct_buf = array();
for ($loopc = 0; $loopc < 5; $loopc++){
$dt_pct_key = sprintf("D%s", chr(65 + $loopc));
$dt_pct_buf[$dt_pct_key] = array();
foreach ($pctdat as $datval){
if (substr($datval['name'], 0, 2) == $dt_pct_key) {
array_push($dt_pct_buf[$dt_pct_key], $datval);
}
}
}
for ($loopc = 0; $loopc < 5; $loopc++){
$gettbi = sprintf("pct-list-D%s", chr(65 + $loopc));
$dt_pct_key = sprintf("D%s", chr(65 + $loopc));
foreach ($dt_pct_buf[$dt_pct_key] as $datval){
$deldsp = array();
$deldsp['term_id'] = $datval['term_id'];
$deldsp['name'] = preg_replace("/(D[A-Z]{1}[0-9]{2})(:)/i", "", $datval['name']);
$deldsp['count'] = $datval['count'];
$gettml = $gettmp[$gettbi];
foreach($deldsp as $cnvnam => $cnvval){
$cnvtag = sprintf("{%s}", $cnvnam);
$gettml = str_replace($cnvtag, $cnvval, $gettml);
}
$getdoc[$gettbi] .= $gettml;
}
}
//ドキュメントにリレーションするタグ@”dtg-list#0、1”
foreach($dtgdat as $thsnam => $thsval){
$deldsp = array();
$dt_trg_tid = sprintf("key:%s", $thsval['term_id']);
$deldsp['term_id'] = $dtgdat[$dt_trg_tid]['term_id'];
$deldsp['name'] = $dtgdat[$dt_trg_tid]['name'];
$deldsp['name'] = ereg_replace("[T]{1}[A-E]{1}:", "", $deldsp['name']);
$deldsp['count'] = $dtgdat[$dt_trg_tid]['count'];
$getltp0 = $gettmp['dtg-list#0'];
$getltp1 = $gettmp['dtg-list#1'];
foreach($deldsp as $cnvnam => $cnvval){
$cnvtag = sprintf("{%s}", $cnvnam);
$getltp0 = str_replace($cnvtag, $cnvval, $getltp0);
$getltp1 = str_replace($cnvtag, $cnvval, $getltp1);
}
$getdoc['dtg-list#0'] .= $getltp0;
$getdoc['dtg-list#1'] .= $getltp1;
}
//ドキュメントにリレーションするタグ(タグ種別)@”dtg-list-TA~TE#0、1”
for ($loopc = 0; $loopc < 5; $loopc++){
$gettbc = sprintf("T%s", chr(65 + $loopc));
$gettbi0 = sprintf("dtg-list-T%s#0", chr(65 + $loopc));
$gettbi1 = sprintf("dtg-list-T%s#1", chr(65 + $loopc));
foreach($dtgdat as $thsnam => $thsval){
if (substr($thsval['name'], 0, 2) == $gettbc){
$gettml0 = $gettmp[$gettbi0];
$gettml1 = $gettmp[$gettbi1];
$deldsp = array();
$deldsp['term_id'] = $thsval['term_id'];
$deldsp['name'] = $thsval['name'];
$deldsp['name'] = ereg_replace("[T]{1}[A-E]{1}:", "", $deldsp['name']);
$deldsp['count'] = $thsval['count'];
foreach($deldsp as $cnvnam => $cnvval){
$cnvtag = sprintf("{%s}", $cnvnam);
$gettml0 = str_replace($cnvtag, $cnvval, $gettml0);
$gettml1 = str_replace($cnvtag, $cnvval, $gettml1);
}
$getdoc[$gettbi0] .= $gettml0;
$getdoc[$gettbi1] .= $gettml1;
}
}
}
/*HTMLテンプレートへ表示データデータセット*/
$rethtd->HTDEST('header#0', $getdoc['header#0']);
$rethtd->HTDEST('header#1', $getdoc['header#1']);
$rethtd->HTDEST('header#2', $getdoc['header#2']);
$rethtd->HTDEST('nlist', $getdoc['nlist']);
$rethtd->HTDEST('nlist-navi', $getdoc['nlist-navi']);
$rethtd->HTDEST('dct-latest', $getdoc['dct-latest']);
$rethtd->HTDEST('dct-calendar', $getdoc['dct-calendar']);
$rethtd->HTDEST('dtglist#0', $getdoc['dtglist#0']);
$rethtd->HTDEST('dtglist#1', $getdoc['dtglist#1']);
for ($loopc = 0; $loopc < 5; $loopc++){
$gettbi = sprintf("pct-list-D%s", chr(65 + $loopc));
$rethtd->HTDEST($gettbi, $getdoc[$gettbi]);
}
for ($loopc = 0; $loopc < 5; $loopc++){
$gettbi = sprintf("dtg-list-T%s#0", chr(65 + $loopc));
$rethtd->HTDEST($gettbi, $getdoc[$gettbi]);
$gettbi = sprintf("dtg-list-T%s#1", chr(65 + $loopc));
$rethtd->HTDEST($gettbi, $getdoc[$gettbi]);
}
$rethtd->HTDETM(0);
exit;
?>