/** * 設定ファイル編集ウインドウを開くHTMLを表示する * * @return void */ function _printEditFileHtml($path_value, $submit_value) { global $_conf; // アクティブ if (file_exists($path_value) && is_writable($path_value) || !file_exists($path_value) && is_writable(dirname($path_value))) { $onsubmit = ''; $disabled = ''; // 非アクティブ } else { $onsubmit = ' onsubmit="return false;"'; $disabled = ' disabled'; } $rows = 36; // 18 $cols = 92; // 90 // edit_aborn_word.php if (preg_match('/^p2_(aborn|ng)_(name|mail|id|msg)\\.txt$/', basename($path_value))) { $edit_php = 'edit_aborn_word.php'; $target = '_self'; $path_value = basename($path_value); $q_ar = array('path' => $path_value, UA::getQueryKey() => UA::getQueryValue()); $url = $edit_php . '?' . UriUtil::buildQuery($q_ar); $html = P2View::tagA($url, $submit_value) . "\n"; // editfile.php } else { $edit_php = 'editfile.php'; $target = 'editfile'; $html = <<<EOFORM <form action="{$edit_php}" method="POST" target="{$target}" class="inline-form"{$onsubmit}> \t{$_conf['k_input_ht']} \t<input type="hidden" name="path" value="{$path_value}"> \t<input type="hidden" name="encode" value="Shift_JIS"> \t<input type="hidden" name="rows" value="{$rows}"> \t<input type="hidden" name="cols" value="{$cols}"> \t<input type="submit" value="{$submit_value}"{$disabled}> </form> EOFORM; // IE用にform HTML内のタグ間の空白を除去整形する if (strstr(geti($_SERVER['HTTP_USER_AGENT']), 'MSIE')) { $html = ' ' . preg_replace('{>\\s+<}', '><', $html); } } echo $html; }
/** * @static * @access public * @param string $uri * @param array $qs * @return string */ function buildQueryUri($uri, $qs, $opts = array()) { if ($q = UriUtil::buildQuery($qs, $opts)) { $separator = empty($opts['separator']) ? '&' : $opts['separator']; $mark = strpos($uri, '?') === false ? '?' : $separator; $uri .= $mark . $q; } return $uri; }
$ita_url = UriUtil::buildQueryUri($_conf['subject_php'], array_merge($thread_qs, $b_qs)); $ita_url_hs = hs($ita_url); $similar_atag = P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array_merge($similar_qs, $thread_qs, $b_qs, array('refresh' => 1))), hs($siml_thre_st), array('style' => 'white-space: nowrap;', 'target' => 'subject', 'title' => '同じ板からタイトルが似ているスレッドを検索する')); $info_php = UA::isIPhoneGroup() ? 'info_i.php' : 'info.php'; $info_qs = array_merge($thread_qs, $b_qs, array('ttitle_en' => $ttitle_en)); $info_url = UriUtil::buildQueryUri($info_php, $info_qs); $info_url_hs = hs($info_url); $info_js_url = UriUtil::buildQueryUri($info_php, array_merge($info_qs, array('popup' => '1'), $sid_qs)); $info_js_url_es = str_replace("'", "\\'", $info_js_url); $info_atag = P2View::tagA($info_url, hs($info_st), array('style' => 'white-space: nowrap;', 'accesskey' => $_conf['pc_accesskey']['info'], 'title' => sprintf('スレッド情報を表\示(アクセスキー[%s])', $_conf['pc_accesskey']['info']), 'onclick' => "return !openSubWin('{$info_js_url_es}',{$STYLE['info_pop_size']},0,0)")); $setfav_url = UriUtil::buildQueryUri($info_php, array_merge($info_qs, array('setfav' => $favvalue))); $setFavJs_query = UriUtil::buildQuery(array_merge($info_qs, $sid_qs)); $setFavJs_query_es = str_replace("'", "\\'", $setFavJs_query); $setFavATag = P2View::tagA($setfav_url, hs("お気に{$favmark}"), array('accesskey' => $_conf['pc_accesskey']['setfav'], 'title' => $favtitle, 'target' => 'info', 'onclick' => "return setFavJs('{$setFavJs_query_es}', '{$favvalue}', {$STYLE['info_pop_size']}, 'read', this);")); $dele_url = UriUtil::buildQueryUri($info_php, array_merge($info_qs, array('dele' => 'true'))); $deleLogJs_query = UriUtil::buildQuery(array_merge($info_qs, $sid_qs)); $deleLogJs_query_es = str_replace("'", "\\'", $deleLogJs_query); $deleLogATag = P2View::tagA($dele_url, hs($dele_st), array('accesskey' => $_conf['pc_accesskey']['dele'], 'title' => sprintf("ログを削除する。自動で「お気にスレ」「殿堂」からも外れます。(アクセスキー[%s])", $_conf['pc_accesskey']['dele']), 'target' => 'info', 'onclick' => "return !deleLog('{$deleLogJs_query_es}', {$STYLE['info_pop_size']}, 'read', this);")); $tabornATag = ''; /* $taborn_url = UriUtil::buildQueryUri($info_php, array_merge($info_qs, array('taborn' => '2'))); $taborn_js_url = UriUtil::buildQueryUri($info_php, array_merge($info_qs, array('taborn' => '2'), array('popup' => '2'), $sid_qs) ); $taborn_js_url_es = str_replace("'", "\\'", $taborn_js_url); $tabornATag = P2View::tagA( $taborn_url, hs($aborn_st), array(
function buildQuery($array, $opts = array()) { return UriUtil::buildQuery($array, $opts); }
/** * スレッド一覧をHTML表示する (PC用 <tr>〜</tr>) * * @access public * @return void */ function sb_print($aThreadList) { global $_conf, $sb_view, $p2_setting, $STYLE; $GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('sb_print()'); if (!$aThreadList->threads) { echo '<tr><td> 該当サブジェクトはなかったぽ</td></tr>'; $GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('sb_print()'); return; } // 変数 ================================================ // >>1 表示 $onlyone_bool = false; if ($_conf['sb_show_one'] == 1 or $_conf['sb_show_one'] == 2 and ereg('news', $aThreadList->bbs) || $aThreadList->bbs == 'bizplus') { // spmodeは除く if (empty($aThreadList->spmode)) { $onlyone_bool = true; } } // チェックボックス $checkbox_bool = false; if ($aThreadList->spmode == 'taborn' || $aThreadList->spmode == 'soko') { $checkbox_bool = true; } // 板名 $ita_name_bool = false; if ($aThreadList->spmode && $aThreadList->spmode != 'taborn' && $aThreadList->spmode != 'soko') { $ita_name_bool = true; } $norefresh_q = '&norefresh=1'; // ソート ================================================== // 現在のソート形式をclass指定でCSSカラーリング $class_sort_midoku = ''; // 新着 $class_sort_res = ''; // レス $class_sort_no = ''; // No. $class_sort_title = ''; // タイトル $class_sort_ita = ''; // 板 $class_sort_spd = ''; // すばやさ $class_sort_ikioi = ''; // 勢い $class_sort_bd = ''; // スレ立て日 $class_sort_fav = ''; // お気に入り if ($GLOBALS['now_sort']) { $nowsort_code = <<<EOP \$class_sort_{$GLOBALS['now_sort']}=' class="now_sort"'; EOP; eval($nowsort_code); } $sortq_spmode = ''; $sortq_host = ''; $sortq_ita = ''; // spmode時 if ($aThreadList->spmode) { $sortq_spmode = "&spmode={$aThreadList->spmode}"; } // spmodeでない、または、spmodeがあぼーん or dat倉庫なら if (!$aThreadList->spmode || $aThreadList->spmode == "taborn" || $aThreadList->spmode == "soko") { $sortq_host = "&host={$aThreadList->host}"; $sortq_ita = "&bbs={$aThreadList->bbs}"; } $midoku_sort_ht = "<td class=\"tu\" nowrap><a{$class_sort_midoku} href=\"{$_conf['subject_php']}?sort=midoku{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\" style=\"white-space:nowrap;\"><nobr>新着</nobr></a></td>"; //===================================================== // テーブルヘッダHTML表示 //===================================================== echo '<tr class="tableheader">' . "\n"; // 並替 if ($sb_view == "edit") { echo '<td class="te"> </td>'; } // 新着 if ($sb_view != "edit") { echo $midoku_sort_ht; } // レス数 if ($sb_view != "edit") { echo "<td class=\"tn\" nowrap><a{$class_sort_res} href=\"{$_conf['subject_php']}?sort=res{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\">レス</a></td>"; } // >>1 if ($onlyone_bool) { echo '<td class="t"> </td>'; } // チェックボックス if ($checkbox_bool) { echo '<td class="tc"><input id="allbox" name="allbox" type="checkbox" onClick="checkAll();" title="すべての項目を選択、または選択解除"></td>'; } // No. $title = empty($aThreadList->spmode) ? " title=\"2ch標準の並び順番号\"" : ''; echo "<td class=\"to\"><a{$class_sort_no} href=\"{$_conf['subject_php']}?sort=no{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\"{$title}>No.</a></td>"; // タイトル echo "<td class=\"tl\"><a{$class_sort_title} href=\"{$_conf['subject_php']}?sort=title{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\">タイトル</a></td>"; // 板 if ($ita_name_bool) { echo "<td class=\"t\"><a{$class_sort_ita} href=\"{$_conf['subject_php']}?sort=ita{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\">板</a></td>"; } // すばやさ if ($_conf['sb_show_spd']) { echo "<td class=\"ts\"><a{$class_sort_spd} href=\"{$_conf['subject_php']}?sort=spd{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\">すばやさ</a></td>"; } // 勢い if ($_conf['sb_show_ikioi']) { echo "<td class=\"ti\"><a{$class_sort_ikioi} href=\"{$_conf['subject_php']}?sort=ikioi{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\" title=\"一日あたりのレス数\">勢い</a></td>"; } // スレ立て日 echo "<td class=\"t\"><a{$class_sort_bd} href=\"{$_conf['subject_php']}?sort=bd{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\">スレ立て日</a></td>"; // お気に入り if ($_conf['sb_show_fav'] and $aThreadList->spmode != "taborn") { echo "<td class=\"t\"><a{$class_sort_fav} href=\"{$_conf['subject_php']}?sort=fav{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\" title=\"お気にスレ\">☆</a></td>"; } echo "\n</tr>\n"; //===================================================== //テーブルボディ //===================================================== //spmodeがあればクエリー追加 if ($aThreadList->spmode) { $spmode_q = "&spmode={$aThreadList->spmode}"; } else { $spmode_q = ''; } $sid_q = defined('SID') && strlen(SID) ? '&' . hs(SID) : ''; $i = 0; foreach ($aThreadList->threads as $aThread) { $i++; $midoku_ari = ''; $anum_ht = ''; // #r1 $offline_q = ''; $bbs_q = "&bbs=" . $aThread->bbs; $key_q = "&key=" . $aThread->key; if ($aThreadList->spmode != 'taborn') { if (!$aThread->torder) { $aThread->torder = $i; } } // td欄 cssクラス if ($i % 2 == 0) { $class_t = ' class="t"'; // 基本 $class_te = ' class="te"'; // 並び替え $class_tu = ' class="tu"'; // 新着レス数 $class_tn = ' class="tn"'; // レス数 $class_tc = ' class="tc"'; // チェックボックス $class_to = ' class="to"'; // オーダー番号 $class_tl = ' class="tl"'; // タイトル $class_ts = ' class="ts"'; // すばやさ $class_ti = ' class="ti"'; // 勢い } else { $class_t = ' class="t2"'; $class_te = ' class="te2"'; $class_tu = ' class="tu2"'; $class_tn = ' class="tn2"'; $class_tc = ' class="tc2"'; $class_to = ' class="to2"'; $class_tl = ' class="tl2"'; $class_ts = ' class="ts2"'; $class_ti = ' class="ti2"'; } // 新着レス数 ============================================= $unum_ht_c = " "; // 既得済み if ($aThread->isKitoku()) { // $ttitle_en_q は節減省略 $onclick_at = " onClick=\"return !deleLog('host={$aThread->host}{$bbs_q}{$key_q}{$sid_q}', {$STYLE['info_pop_size']}, 'subject', this);\""; $title_at = ' title="クリックするとログ削除"'; $unum_ht_c = "<a class=\"un\" href=\"{$_conf['subject_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$spmode_q}&dele=1\" target=\"_self\"{$onclick_at}{$title_at}>{$aThread->unum}</a>"; $anum = $aThread->rescount - $aThread->unum + 1 - $_conf['respointer']; if ($anum > $aThread->rescount) { $anum = $aThread->rescount; } $anum_ht = '#r' . $anum; // {{{ 新着あり if ($aThread->unum > 0) { $midoku_ari = true; $dele_log_qs = $thread_qs = array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key); if (defined('SID') && strlen(SID)) { $dele_log_qs[session_name()] = session_id(); } $dele_log_q = UriUtil::buildQuery($dele_log_qs); $unum_ht_c = P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array_merge($thread_qs, array('spmode' => $aThreadList->spmode, 'dele' => '1', UA::getQueryKey() => UA::getQueryValue()))), hs($aThread->unum), array('id' => "un{$i}", 'class' => 'un_a', 'target' => '_self', 'title' => 'クリックするとログ削除', 'onClick' => sprintf("return !deleLog('%s', %s, 'subject', this);", str_replace("'", "\\'", $dele_log_q), $STYLE['info_pop_size']))); } // }}} // subject.txtにない時 if (!$aThread->isonline) { // JavaScriptでの確認ダイアログあり $unum_ht_c = "<a class=\"un_n\" href=\"{$_conf['subject_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$spmode_q}&dele=true\" target=\"_self\" onClick=\"if (!window.confirm('ログを削除しますか?')) {return false;} return !deleLog('host={$aThread->host}{$bbs_q}{$key_q}{$sid_q}', {$STYLE['info_pop_size']}, 'subject', this)\"{$title_at}>-</a>"; } } $unum_ht = "<td{$class_tu}>" . $unum_ht_c . "</td>"; // 総レス数 $rescount_ht = "<td{$class_tn}>{$aThread->rescount}</td>"; // {{{ 板名 $ita_td_ht = ''; if ($ita_name_bool) { $ita_name = $aThread->itaj ? $aThread->itaj : $aThread->bbs; $ita_atag = P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $aThread->host, 'bbs' => $aThread->bbs)), $ita_name, array('target' => '_self')); $ita_td_ht = "<td{$class_t} nowrap>{$ita_atag}</td>"; } // }}} // お気に入り if ($_conf['sb_show_fav'] and $aThreadList->spmode != 'taborn') { $favmark = !empty($aThread->fav) ? '★' : '+'; $favvalue = !empty($aThread->fav) ? 0 : 1; $favtitle = $favvalue ? 'お気にスレに追加' : 'お気にスレから外す'; $setfav_q = '&setfav=' . $favvalue; // $ttitle_en_q も付けた方がいいが、節約のため省略する $fav_ht = <<<EOP <td{$class_t}><a class="fav" href="info.php?host={$aThread->host}{$bbs_q}{$key_q}{$setfav_q}" target="info" onClick="return setFavJs('host={$aThread->host}{$bbs_q}{$key_q}', '{$favvalue}', {$STYLE['info_pop_size']}, 'subject', this);" title="{$favtitle}">{$favmark}</a></td> EOP; } // torder(info) ================================================= // お気にスレ if ($aThread->fav) { $torder_st = "<b>{$aThread->torder}</b>"; } else { $torder_st = $aThread->torder; } $torder_ht = "<a id=\"to{$i}\" class=\"info\" href=\"info.php?host={$aThread->host}{$bbs_q}{$key_q}\" target=\"_self\" onClick=\"return !openSubWin('info.php?host={$aThread->host}{$bbs_q}{$key_q}&popup=1{$sid_q}',{$STYLE['info_pop_size']},0,0)\">{$torder_st}</a>"; // title ================================================= $chUnColor_ht = ''; $rescount_q = "&rc=" . $aThread->rescount; // dat倉庫 or 殿堂なら if ($aThreadList->spmode == "soko" || $aThreadList->spmode == "palace") { $rescount_q = ''; $offline_q = "&offline=1"; $anum_ht = ''; } // タイトル未取得or全角空白なら(IEで全角空白もリンククリックできないので) if (!$aThread->ttitle_ht or $aThread->ttitle_ht == ' ') { $aThread->ttitle_ht = "http://{$aThread->host}/test/read.cgi/{$aThread->bbs}/{$aThread->key}/"; } if ($aThread->similarity) { $aThread->ttitle_ht .= sprintf(' <var>(%0.1f)</var>', $aThread->similarity * 100); } // 元スレ $moto_thre_ht = ''; if ($_conf['sb_show_motothre']) { if (!$aThread->isKitoku()) { $moto_thre_ht = '<a class="thre_title" href="' . hs($aThread->getMotoThread()) . '">・</a> '; } } // 新規スレ if ($aThread->new) { $classtitle_q = ' class="thre_title_new"'; } else { $classtitle_q = ' class="thre_title"'; } // スレリンク if (!empty($_REQUEST['find_cont']) && strlen($GLOBALS['word_fm'])) { $word_q = "&word=" . urlencode($GLOBALS['word']) . "&method=" . urlencode($GLOBALS['sb_filter']['method']); $rescount_q = ''; $offline_q = '&offline=1'; $anum_ht = ''; } else { $word_q = ''; } $thre_url = "{$_conf['read_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$rescount_q}{$offline_q}{$word_q}{$anum_ht}"; if ($midoku_ari) { $chUnColor_ht = "chUnColor('{$i}');"; } $change_color = " onClick=\"chTtColor('{$i}');{$chUnColor_ht}\""; // オンリー>>1 if ($onlyone_bool) { $one_ht = "<td{$class_t}><a href=\"{$_conf['read_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$rescount_q}&onlyone=true\">>>1</a></td>"; } else { $one_ht = ''; } // チェックボックス $checkbox_ht = ''; if ($checkbox_bool) { $checked_ht = ''; if ($aThreadList->spmode == "taborn") { if (!$aThread->isonline) { $checked_ht = " checked"; } // or ($aThread->rescount >= 1000) } $checkbox_ht = "<td{$class_tc}><input name=\"checkedkeys[]\" type=\"checkbox\" value=\"{$aThread->key}\"{$checked_ht}></td>"; } // 並替 $edit_ht = ''; if ($sb_view == "edit") { $unum_ht = ''; $rescount_ht = ''; if ($aThreadList->spmode == "fav") { $setkey = "setfav"; } elseif ($aThreadList->spmode == "palace") { $setkey = "setpal"; } $narabikae_a = UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'spmode' => $aThreadList->spmode, 'sb_view' => 'edit')); $edit_ht = <<<EOP \t\t<td{$class_te}> \t\t\t<a class="te" href="{$narabikae_a}&{$setkey}=top" target="_self">▲</a> \t\t\t<a class="te" href="{$narabikae_a}&{$setkey}=up" target="_self">↑</a> \t\t\t<a class="te" href="{$narabikae_a}&{$setkey}=down" target="_self">↓</a> \t\t\t<a class="te" href="{$narabikae_a}&{$setkey}=bottom" target="_self">▼</a> \t\t</td> EOP; } // すばやさ(= 時間/レス = レス間隔) $spd_ht = ''; if ($_conf['sb_show_spd']) { if ($spd_st = $aThread->getTimePerRes()) { $spd_ht = "<td{$class_ts}>{$spd_st}</td>"; } } // 勢い $ikioi_ht = ''; if ($_conf['sb_show_ikioi']) { if ($aThread->dayres > 0) { // 0.0 とならないように小数点第2位で切り上げ $dayres = ceil($aThread->dayres * 10) / 10; $dayres_st = sprintf("%01.1f", $dayres); } else { $dayres_st = "-"; } $ikioi_ht = "<td{$class_ti}>" . hs($dayres_st) . "</td>"; } // スレ立て日 //if (preg_match('/^\d{9,10}$/', $aThread->key) { if (631119600 < $aThread->key && $aThread->key < time() + 1000) { // 1990年- $birthday = date("y/m/d", $aThread->key); // (y/m/d H:i) } else { $birthday = '-'; } $birth_ht = "<td{$class_t}>{$birthday}</td>"; // スレッド一覧 table ボディ HTMLプリント <tr></tr> echo "<tr>\n{$edit_ht}\n{$unum_ht}\n{$rescount_ht}\n{$one_ht}\n{$checkbox_ht}\n<td{$class_to}>{$torder_ht}</td>\n<td{$class_tl} nowrap>{$moto_thre_ht}<a id=\"tt{$i}\" href=\"{$thre_url}\"{$classtitle_q}{$change_color}>{$aThread->ttitle_ht}</a></td>\n{$ita_td_ht}\n{$spd_ht}\n{$ikioi_ht}\n{$birth_ht}\n{$fav_ht}\n</tr>\n"; ob_flush(); flush(); } $GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('sb_print()'); }
//=================================================================== // HTMLプリント //=================================================================== P2View::printDoctypeTag(); ?> <html lang="ja"> <head> <?php P2View::printExtraHeadersHtml(); if ($_conf['refresh_time']) { $refresh_time_s = $_conf['refresh_time'] * 60; $qs = array('host' => $aThreadList->host, 'bbs' => $aThreadList->bbs, 'spmode' => $aThreadList->spmode, UA::getQueryKey() => UA::getQueryValue()); if (defined('SID') && strlen(SID)) { $qs[session_name()] = session_id(); } $refresh_url = $_conf['subject_php'] . '?' . UriUtil::buildQuery($qs); ?> <meta http-equiv="refresh" content="<?php eh($refresh_time_s); ?> ;URL=<?php eh($refresh_url); ?> "> <?php } ?> <title><?php eh($aThreadList->ptitle); ?> </title>
// $read_navi_previous_ht -- 前 $before_rnum = $aThread->resrange['start'] - $rnum_range; if ($before_rnum < 1) { $before_rnum = 1; } if ($aThread->resrange['start'] == 1 or !empty($_GET['onlyone'])) { $read_navi_prev_isInvisible = true; } else { $read_navi_prev_isInvisible = false; } $read_navi_prev_anchor = ''; //if ($before_rnum != 1) { // $read_navi_prev_anchor = "#r{$before_rnum}"; //} if (!$read_navi_prev_isInvisible) { $q = UriUtil::buildQuery(array_merge($thread_qs, array('offline' => '1', UA::getQueryKey() => UA::getQueryValue()))); $html = "{$_conf['k_accesskey']['prev']}.{$prev_st}"; $url = $_conf['read_php'] . '?' . $q; if ($aThread->resrange_multi and !empty($_REQUEST['page']) and $_REQUEST['page'] > 1) { $html = $html . '*'; // ls は http_build_query() を通して urlencode を掛けたくないので // → 2007/10/04 urlencodeされるとどう困るのだろう。その理由を忘れた。かけてもいいような気がするが。 $url .= '&ls=' . $aThread->ls; $prev_page = intval($_REQUEST['page']) - 1; $url .= '&page=' . $prev_page; } else { $url .= '&ls=' . "{$before_rnum}-{$aThread->resrange['start']}n"; } $read_navi_previous_ht = P2View::tagA($url, $html); $read_navi_previous_btm_ht = P2View::tagA($url, $html, array($_conf['accesskey_for_k'] => $_conf['k_accesskey']['prev'])); }
/** * スレッドの新着部分を読み込んで表示する * * @return void */ function _readNew(&$aThread) { global $_conf, $_newthre_num, $STYLE, $sid_q; $_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 (file_exists($aThread->keyidx)) { $lines = file($aThread->keyidx); $data = explode('<>', rtrim($lines[0])); } $aThread->getThreadInfoFromIdx(); // DATのダウンロード if (!(isset($GLOBALS['word']) && 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 = base64_encode($aThread->ttitle); $popup_q = "&popup=1"; // require_once P2_LIB_DIR . '/read_header.inc.php'; $prev_thre_num = $_newthre_num - 1; $next_thre_num = $_newthre_num + 1; $prev_thre_ht = ''; if ($prev_thre_num != 0) { $prev_thre_ht = "<a href=\"#ntt{$prev_thre_num}\">▲</a>"; } $next_thre_ht = "<a href=\"#ntt{$next_thre_num}\">▼</a> "; // スマートポップアップメニュー if ($_conf['enable_spm']) { $aThread->showSmartPopUpMenuJs(); } P2Util::printInfoHtml(); // ヘッダ部分HTML $read_header_ht = <<<EOP \t<table id="ntt{$_newthre_num}" class="toolbar" width="100%" style="padding:0px 10px 0px 0px;"> \t\t<tr> \t\t\t<td align="left"> \t\t\t\t<h3 class="thread_title">{$aThread->ttitle_hs} </h3> \t\t\t</td> \t\t\t<td align="right"> \t\t\t\t{$prev_thre_ht} \t\t\t\t{$next_thre_ht} \t\t\t</td> \t\t</tr> \t</table> EOP; //================================================================== // ローカルDatを読み込んでHTML表示 //================================================================== $aThread->resrange['nofirst'] = true; $GLOBALS['newres_to_show_flag'] = false; if ($aThread->rescount) { // $aThread->datToHtml(); // dat を html に変換表示 require_once P2_LIB_DIR . '/ShowThreadPc.php'; $aShowThread = new ShowThreadPc($aThread); $res1 = $aShowThread->quoteOne(); $read_cont_ht = $res1['q']; $read_cont_ht .= $aShowThread->getDatToHtml(); unset($aShowThread); } //================================================================== // フッタ 表示 //================================================================== // require_once P2_LIB_DIR . '/read_footer.inc.php'; //---------------------------------------------- // $read_footer_navi_new_ht 続きを読む 新着レスの表示 $newtime = date("gis"); // リンクをクリックしても再読込しない仕様に対抗するダミークエリー $info_st = "情報"; $dele_st = "削除"; $prev_st = "前"; $next_st = "次"; $thread_qs = array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, UA::getQueryKey() => UA::getQueryValue()); $sid_qs = array(); if (defined('SID') && strlen(SID)) { $sid_qs[session_name()] = session_id(); } /* $read_footer_navi_new_ht = P2View::tagA( UriUtil::buildQueryUri($_conf['read_php'], array_merge($thread_qs, array( 'ls' => "$aThread->rescount-", 'nt' => $newtime )) ) . '#r' . rawurlencode($aThread->rescount), '新着レスの表示' ); */ if ($_conf['disable_res']) { $dores_ht = P2View::tagA($motothre_url, '書込', array('target' => '_blank')); } else { $post_form_uri = UriUtil::buildQueryUri('post_form.php', array_merge($thread_qs, array('rescount' => $aThread->rescount, 'ttitle_en' => $ttitle_en))); $post_form_uri_hs = hs($post_form_uri); $post_from_openwin_uri = UriUtil::buildQueryUri('post_form.php', array_merge($thread_qs, array('rescount' => $aThread->rescount, 'ttitle_en' => $ttitle_en, 'popup' => '1', 'from_read_new' => '1'), $sid_qs)); $post_from_openwin_uri_hs = hs($post_from_openwin_uri); $dores_ht = <<<EOP <a href="{$post_form_uri_hs}" target='_self' onClick="return !openSubWin('{$post_from_openwin_uri_hs}',{$STYLE['post_pop_size']},1,0)">書込</a> EOP; } $dores_ht = '<span style="white-space: nowrap;">' . $dores_ht . '</span>'; // ツールバー部分HTML ======= // お気にマーク設定 $favmark = !empty($aThread->fav) ? '★' : '+'; $favvalue = !empty($aThread->fav) ? 0 : 1; $favtitle = $favvalue ? 'お気にスレに追加' : 'お気にスレから外す'; $setfav_q = '&setfav=' . $favvalue; $itaj_hs = hs($aThread->itaj); $similar_qs = array('detect_hint' => '◎◇', 'itaj_en' => base64_encode($aThread->itaj), 'method' => 'similar', 'word' => $aThread->ttitle_hc); $b_qs = array(UA::getQueryKey() => UA::getQueryValue()); $info_qs = array_merge($thread_qs, $b_qs, array('ttitle_en' => $ttitle_en)); $ita_atag = P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array_merge($thread_qs, $b_qs)), hs($aThread->itaj), array('style' => 'white-space: nowrap;', 'target' => 'subject', 'title' => '板を開く')); $similar_atag = P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array_merge($similar_qs, $thread_qs, $b_qs, array('refresh' => 1))), hs('似スレ'), array('style' => 'white-space: nowrap;', 'target' => 'subject', 'title' => '同じ板からタイトルが似ているスレッドを検索する')); $info_url = UriUtil::buildQueryUri('info.php', $info_qs); $info_url_hs = hs($info_url); $info_hs = hs($info_st); $js_q_hs = hs(UriUtil::buildQuery(array_merge($info_qs, $sid_qs))); $motothre_atag = P2View::tagA($motothre_url, '元スレ', array('style' => 'white-space: nowrap;', 'title' => '板サーバ上のオリジナルスレを表\示')); $toolbar_right_ht = <<<EOTOOLBAR {$ita_atag} {$similar_atag} \t\t<a style="white-space: nowrap;" href="{$info_url_hs}" target="info" onClick="return !openSubWin('{$info_url_hs}{$popup_q}{$sid_q}',{$STYLE['info_pop_size']},0,0)" title="スレッド情報を表\示">{$info_hs}</a> \t\t<span class="setfav" style="white-space: nowrap;"><a href="{$info_url_hs}{$setfav_q}{$sid_q}" target="info" onClick="return setFavJs('{$js_q_hs}', '{$favvalue}', {$STYLE['info_pop_size']}, 'read_new', this);" title="{$favtitle}">お気に{$favmark}</a></span> \t\t<span style="white-space: nowrap;"><a href="{$info_url_hs}&dele=1" target="info" onClick="return !deleLog('{$js_q_hs}', {$STYLE['info_pop_size']}, 'read_new', this);" title="ログを削除する。自動で「お気にスレ」「殿堂」からも外れます。">{$dele_st}</a></span> <!--\t\t<a style="white-space: nowrap;" href="{$info_url_hs}&taborn=2" target="info" onClick="return !openSubWin('{$info_url_hs}&popup=2&taborn=2{$sid_q}',{$STYLE['info_pop_size']},0,0)" title="スレッドのあぼーん状態をトグルする">あぼん</a> --> \t\t{$motothre_atag} EOTOOLBAR; // レスのすばやさ $spd_ht = ""; if ($spd_st = $aThread->getTimePerRes() and $spd_st != "-") { $spd_ht = '<span class="spd" style="white-space: nowrap;" title="すばやさ=時間/レス">' . $spd_st . '</span>'; } // フッタ部分HTML $read_atag = P2View::tagA(UriUtil::buildQueryUri($_conf['read_php'], array_merge($thread_qs, array('offline' => '1', 'rescount' => $aThread->rescount))) . '#r' . rawurlencode($aThread->rescount), hs($aThread->ttitle_hc)); $read_footer_ht = <<<EOP \t<table class="toolbar" width="100%" style="padding:0px 10px 0px 0px;"> \t\t<tr> \t\t\t<td align="left"> \t\t\t\t{$res1['body']} | {$read_atag} | {$dores_ht} {$spd_ht} \t\t\t</td> \t\t\t<td align="right"> \t\t\t\t{$toolbar_right_ht} \t\t\t</td> \t\t\t<td align="right"> \t\t\t\t<a href="#ntt{$_newthre_num}">▲</a> \t\t\t</td> \t\t</tr> \t</table> EOP; // 透明あぼーんで表示がない場合はスキップ if ($GLOBALS['newres_to_show_flag']) { echo '<div style="width:100%;">' . "\n"; // ほぼIE ActiveXのGray()のためだけに囲ってある echo $read_header_ht; echo $read_cont_ht; echo $read_footer_ht; echo '</div>' . "\n\n"; echo '<hr>' . "\n\n"; } // 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 に記録 } unset($aThread); }