function readNew($aThread) { global $_conf, $newthre_num, $STYLE; global $spmode, $word, $newtime; $orig_no_label = !empty($_conf['expack.iphone.toolbars.no_label']); $_conf['expack.iphone.toolbars.no_label'] = true; $newthre_num++; //========================================================== // idxの読み込み //========================================================== //hostを分解してidxファイルのパスを求める $aThread->setThreadPathInfo($aThread->host, $aThread->bbs, $aThread->key); //FileCtl::mkdirFor($aThread->keyidx); // 板ディレクトリが無ければ作る //この操作はおそらく不要 $aThread->itaj = P2Util::getItaName($aThread->host, $aThread->bbs); if (!$aThread->itaj) { $aThread->itaj = $aThread->bbs; } // idxファイルがあれば読み込む if ($lines = FileCtl::file_read_lines($aThread->keyidx, FILE_IGNORE_NEW_LINES)) { $data = explode('<>', $lines[0]); } else { $data = array_fill(0, 12, ''); } $aThread->getThreadInfoFromIdx(); //================================================================== // DATのダウンロード //================================================================== if (!($word and file_exists($aThread->keydat))) { $aThread->downloadDat(); } // DATを読み込み $aThread->readDat(); $aThread->setTitleFromLocal(); // ローカルからタイトルを取得して設定 //=========================================================== // 表示レス番の範囲を設定 //=========================================================== // 取得済みなら if ($aThread->isKitoku()) { $from_num = $aThread->readnum + 1 - $_conf['respointer'] - $_conf['before_respointer_new']; if ($from_num > $aThread->rescount) { $from_num = $aThread->rescount - $_conf['respointer'] - $_conf['before_respointer_new']; } if ($from_num < 1) { $from_num = 1; } //if (!$aThread->ls) { $aThread->ls = "{$from_num}-"; //} } $aThread->lsToPoint(); //================================================================== // ヘッダ 表示 //================================================================== $motothre_url = $aThread->getMotoThread(); $ttitle_en = UrlSafeBase64::encode($aThread->ttitle); $ttitle_en_q = '&ttitle_en=' . $ttitle_en; $bbs_q = '&bbs=' . $aThread->bbs; $key_q = '&key=' . $aThread->key; $host_bbs_key_q = 'host=' . $aThread->host . $bbs_q . $key_q; $popup_q = '&popup=1'; $itaj_hd = htmlspecialchars($aThread->itaj, ENT_QUOTES, 'Shift_JIS'); if ($spmode) { $read_header_itaj_ht = "({$itaj_hd})"; } else { $read_header_itaj_ht = ''; } if ($_conf['iphone']) { if ($read_header_itaj_ht !== '') { $read_header_itaj_ht = "<span class=\"btitle\">{$read_header_itaj_ht}</span>"; } $read_header_ht = <<<EOP <div class="ntoolbar mtoolbar mtoolbar_top" id="ntt{$newthre_num}"> <h2 class="ttitle">{$aThread->ttitle_hd} {$read_header_itaj_ht}</h2> EOP; $read_header_ht .= '<div class="mover">'; $read_header_ht .= toolbar_i_standard_button('img/gp2-down.png', '', sprintf('#ntt%d', $newthre_num + 1)); $read_header_ht .= '</div>'; $info_ht = P2Util::getInfoHtml(); if (strlen($info_ht)) { $read_header_ht .= "<div class=\"info\">{$info_ht}</div>"; } $read_header_ht .= '</div>'; } else { P2Util::printInfoHtml(); $read_header_ht = <<<EOP <hr><div id="ntt{$newthre_num}" name="ntt{$newthre_num}"><font color="{$STYLE['mobile_read_ttitle_color']}"><b>{$aThread->ttitle_hd}</b></font> {$read_header_itaj_ht} <a href="#ntt_bt{$newthre_num}">▼</a></div><hr> EOP; } //================================================================== // ローカルDatを読み込んでHTML表示 //================================================================== $aThread->resrange['nofirst'] = true; $GLOBALS['newres_to_show_flag'] = false; $read_cont_ht = ''; if ($aThread->rescount) { $aShowThread = new ShowThreadK($aThread, true); if ($_conf['iphone'] && $_conf['expack.spm.enabled']) { $read_cont_ht .= $aShowThread->getSpmObjJs(); } $read_cont_ht .= $aShowThread->getDatToHtml(); unset($aShowThread); } //================================================================== // フッタ 表示 //================================================================== // 表示範囲 if ($aThread->resrange['start'] == $aThread->resrange['to']) { $read_range_on = $aThread->resrange['start']; } else { $read_range_on = "{$aThread->resrange['start']}-{$aThread->resrange['to']}"; } $read_range_ht = "{$read_range_on}/{$aThread->rescount}"; // ツールバー部分HTML ======= if ($spmode) { $toolbar_itaj_ht = "(<a href=\"{$_conf['subject_php']}?{$host_bbs_key_q}{$_conf['k_at_a']}\">{$itaj_hd}</a>)"; } else { $toolbar_itaj_ht = ''; } if ($_conf['iphone']) { if ($toolbar_itaj_ht !== '') { $toolbar_itaj_ht = "<span class=\"btitle\">{$toolbar_itaj_ht}</span>"; } $read_footer_ht = <<<EOP <div class="ntoolbar mtoolbar mtoolbar_bottom" id="ntt_btm{$newthre_num}"> <table><tbody><tr> EOP; // 情報 $read_footer_ht .= '<td>'; $escaped_url = "info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}"; $read_footer_ht .= toolbar_i_opentab_button('img/gp5-info.png', '', $escaped_url); $read_footer_ht .= '</td>'; // 表示範囲 $read_footer_ht .= "<td colspan=\"3\"><span class=\"large\">{$read_range_ht}</span></td>"; // ツール $read_footer_ht .= '<td>'; $escaped_url = "spm_k.php?{$host_bbs_key_q}&ls={$aThread->ls}&spm_default={$aThread->resrange['to']}{$_conf['k_at_a']}"; $read_footer_ht .= toolbar_i_opentab_button('img/glyphish/icons2/20-gear2.png', '', $escaped_url); $read_footer_ht .= '</td>'; // タイトル等 $read_footer_ht .= <<<EOP </tr></tbody></table> <div class="ttitle"><a href="{$_conf['read_php']}?{$host_bbs_key_q}&offline=1&rescount={$aThread->rescount}{$_conf['k_at_a']}" target="_blank">{$aThread->ttitle_hd}</a> {$toolbar_itaj_ht}</div> <div class="mover"> EOP; $read_footer_ht .= toolbar_i_standard_button('img/gp1-up.png', '', "#ntt{$newthre_num}"); $read_footer_ht .= '</div></div>'; } else { $read_footer_ht = <<<EOP <div id="ntt_bt{$newthre_num}" name="ntt_bt{$newthre_num}" class="read_new_toolbar"> {$read_range_ht} <a href="info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}">情</a> <a href="spm_k.php?{$host_bbs_key_q}&ls={$aThread->ls}&spm_default={$aThread->resrange['to']}&from_read_new=1{$_conf['k_at_a']}">特</a> <br> <a href="{$_conf['read_php']}?{$host_bbs_key_q}&offline=1&rescount={$aThread->rescount}{$_conf['k_at_a']}#r{$aThread->rescount}">{$aThread->ttitle_hd}</a> {$toolbar_itaj_ht} <a href="#ntt{$newthre_num}">▲</a> </div> <hr> EOP; } // 透明あぼーんや表示数制限で新しいレス表示がない場合はスキップ if ($GLOBALS['newres_to_show_flag']) { echo $read_header_ht; echo $read_cont_ht; echo $read_footer_ht; } //================================================================== // key.idxの値設定 //================================================================== if ($aThread->rescount) { $aThread->readnum = min($aThread->rescount, max(0, $data[5], $aThread->resrange['to'])); $newline = $aThread->readnum + 1; // $newlineは廃止予定だが、旧互換用に念のため $sar = array($aThread->ttitle, $aThread->key, $data[2], $aThread->rescount, $aThread->modified, $aThread->readnum, $data[6], $data[7], $data[8], $newline, $data[10], $data[11], $aThread->datochiok); P2Util::recKeyIdx($aThread->keyidx, $sar); // key.idxに記録 } $_conf['expack.iphone.toolbars.no_label'] = $orig_no_label; }
. '</body></html>'; $doc->loadHTML($html); error_reporting($err); echo '<?xml version="1.0" encoding="utf-8" ?>'; echo $doc->saveXML($doc->getElementsByTagName('div')->item(0)); } else {*/ // よって、HTMLの断片をそのまま返してinnterHTMLに代入しないといけない。 // (根本的にレスポンスのフォーマットとクライアント側での処理を変えない限りは) header('Content-Type: text/html; charset=UTF-8'); echo $response; //} } else { $content = $aShowThread->getDatToHtml(); include READ_HEADER_INC_PHP; if ($_conf['iphone'] && $_conf['expack.spm.enabled']) { echo $aShowThread->getSpmObjJs(); } echo $content; include READ_FOOTER_INC_PHP; } } else { // ヘッダ 表示 include READ_HEADER_INC_PHP; flush(); //=========================================================== // ローカルDatを変換してHTML表示 //=========================================================== // レスがあり、検索指定があれば if ($resFilter && $resFilter->hasWord() && $aThread->rescount) { $all = $aThread->rescount; $GLOBALS['filter_hits'] = 0;