/** * p2 - 携帯用インデックスをHTMLプリントする関数 * * @access public * @return void */ function index_print_k() { global $_conf, $_login; $menuKLinkHtmls = getIndexMenuKLinkHtmls(getIndexMenuKIni()); $ptitle = $_conf['p2name'] . 'iPhone'; // ログインユーザ情報 $auth_user_ht = sprintf('<p>ログインユーザ: %s - %s</p>', hs($_login->user_u), date('Y/m/d (D) G:i:s')); // p2ログイン用URL $login_url = rtrim(dirname(UriUtil::getMyUri()), '/') . '/'; $login_url_pc = UriUtil::buildQueryUri($login_url, array(UA::getQueryKey() => 'pc')); $login_url_k = UriUtil::buildQueryUri($login_url, array(UA::getQueryKey() => 'k', 'user' => $_login->user_u)); // 前回のログイン情報 if ($_conf['login_log_rec'] && $_conf['last_login_log_show']) { if (false !== ($log = P2Util::getLastAccessLog($_conf['login_log_file']))) { $log_hs = array_map('htmlspecialchars', $log); $htm['last_login'] = <<<EOP <font color="#888888"> 前回のログイン情報 - {$log_hs['date']}<br> ユーザ: {$log_hs['user']}<br> IP: {$log_hs['ip']}<br> HOST: {$log_hs['host']}<br> UA: {$log_hs['ua']}<br> REFERER: {$log_hs['referer']} </font> EOP; } } // 古いセッションIDがキャッシュされていることを考慮して、ユーザ情報を付加しておく // (リファラを考慮して、つけないほうがいい場合もあるので注意) $narabikae_uri = UriUtil::buildQueryUri('edit_indexmenui.php', array('user' => $_login->user_u, UA::getQueryKey() => UA::getQueryValue())); require_once P2_LIB_DIR . '/BrdCtl.php'; $search_form_htm = BrdCtl::getMenuKSearchFormHtml('menu_i.php'); $body_at = P2View::getBodyAttrK(); $hr = P2View::getHrHtmlK(); //========================================================= // 携帯用 HTML出力 //========================================================= P2Util::headerNoCache(); P2View::printDoctypeTag(); ?> <html> <head> <?php P2View::printExtraHeadersHtml(); ?> <script type="text/javascript"> <!-- window.onload = function() { setTimeout(scrollTo, 100, 0, 1); } // --> </script> <style type="text/css" media="screen">@import "./iui/iui.css";</style> <title><?php eh($ptitle); ?> </title> </head> <body> <div class="toolbar"> <h1 id="pageTitle"><?php eh($ptitle); ?> </h1> <a class="button" href="<?php eh($narabikae_uri); ?> ">並替</a> </div> <ul id="home"> <li class="group">メニュー</li> <?php P2Util::printInfoHtml(); foreach ($menuKLinkHtmls as $v) { ?> <li><?php echo $v; ?> </li><?php } ?> <li class="group">検索</li> <?php echo $search_form_htm; ?> </ul> <br> </body> </html> <?php }
/** * DatレスをHTMLレスに変換する * * @access public * @param string $ares datの1ライン * @param integer $i レス番号 * @return string HTML */ function transRes($ares, $i) { global $STYLE, $mae_msg, $res_filter, $word_fm; global $_conf; $hr = P2View::getHrHtmlK(); $tores = ''; // 返却するレスHTML全体 $rpop = ''; // レスポップアップ用引用 $resar = $this->thread->explodeDatLine($ares); $name = $resar[0]; $mail = $resar[1]; $date_id = $resar[2]; $msg = $resar[3]; // デフォルトの名前は、NG・あぼーんとフィルタ検索の対象外とする $nameForAborn = $name; if (strlen($this->BBS_NONAME_NAME) && $this->BBS_NONAME_NAME == $name) { if (!$_conf['k_bbs_noname_name']) { $nameForAborn = $name = ''; } else { $nameForAborn = ''; } } // 現在の年号は省略カットする。(設定で)月日の先頭0もカット。 if ($_conf['k_date_zerosuppress']) { $date_id = preg_replace('~^(?:' . date('Y') . '|' . date('y') . ')/(?:0(\\d)|(\\d\\d))?(?:(/)0)?~', '$1$2$3', $date_id); } else { $date_id = preg_replace('~^(?:' . date('Y') . '|' . date('y') . ')/~', '$1', $date_id); } // 曜日と時間の間を詰める $date_id = str_replace(') ', ')', $date_id); // 秒もカット if ($_conf['k_clip_time_sec']) { $date_id = preg_replace('/(\\d\\d:\\d\\d):\\d\\d(\\.\\d\\d)?/', '$1', $date_id); } // {{{ フィルタリング if (strlen($GLOBALS['word'])) { if (!strlen($GLOBALS['word_fm'])) { return ''; // ターゲット設定 } elseif (!($target = $this->getFilterTarget($i, $nameForAborn, $mail, $date_id, $msg))) { return ''; // マッチング } elseif (false === $this->filterMatch($target, $i)) { return ''; } } // }}} // {{{ あぼーんチェック(名前、メール、ID、メッセージ) /* $aborned_res = "<div id=\"r{$i}\" name=\"r{$i}\"> </div>\n"; // 名前 $aborned_res .= ""; // 内容 */ $aborned_res = "<span id=\"r{$i}\" name=\"r{$i}\"></span>\n"; if (false !== $this->checkAborns($nameForAborn, $mail, $date_id, $msg)) { return $aborned_res; } // }}} // {{{ NGチェック(名前、メール、ID、メッセージ) $isNgName = false; $isNgMail = false; $isNgId = false; $isNgMsg = false; if (empty($_GET['nong'])) { if ($nameForAborn and false !== $this->ngAbornCheck('ng_name', strip_tags($nameForAborn))) { $isNgName = true; } if (false !== $this->ngAbornCheck('ng_mail', $mail)) { $isNgMail = true; } if (false !== $this->ngAbornCheck('ng_id', $date_id)) { $isNgId = true; } if (false !== ($a_ng_msg = $this->ngAbornCheck('ng_msg', $msg))) { $isNgMsg = true; } } // }}} //============================================================= // まとめて出力 //============================================================= $name = $this->transName($name, $i); // 名前HTML変換 $has_aa = 0; // 1:弱反応, 2:強反応(AA略) $msg = $this->transMsg($msg, $i, $has_aa); // メッセージHTML変換 // BEプロファイルリンク変換 $date_id = $this->replaceBeId($date_id, $i); // NG変換 $kakunin_msg_ht = P2View::tagA(UriUtil::buildQueryUri($_conf['read_php'], array('host' => $this->thread->host, 'bbs' => $this->thread->bbs, 'key' => $this->thread->key, 'ls' => $i, 'k_continue' => '1', 'nong' => '1', UA::getQueryKey() => UA::getQueryValue())), '確'); // NGメッセージ変換 if ($isNgMsg) { $msg = sprintf('<s><font color="%s">NG:%s</font></s>', $STYLE['read_ngword'], hs($a_ng_msg)); $msg .= ' ' . $kakunin_msg_ht; } // NGネーム変換 if ($isNgName) { $name = sprintf('<s><font color="%s">%s</font></s>', $STYLE['read_ngword'], $name); $msg = $kakunin_msg_ht; // NGメール変換 } elseif ($isNgMail) { $mail = sprintf('<s><font color="%s">%s</font></s>', $STYLE['read_ngword'], $mail); $msg = $kakunin_msg_ht; // NGID変換 } elseif ($isNgId) { $date_id = preg_replace('|ID: ?([0-9A-Za-z/.+]{8,11})|', "<s><font color=\"{$STYLE['read_ngword']}\">\\0</font></s>", $date_id); // $date_id = sprintf('<s><font color="%s">%s</font></s>', $STYLE['read_ngword'], $date_id); $msg = $kakunin_msg_ht; } /* //「ここから新着」画像を挿入 if ($i == $this->thread->readnum +1) { $tores .= "\n" . '<div><img src="img/image.png" alt="新着レス" border="0" vspace="4"></div>' . "\n"; } */ // 番号(オンザフライ時) if ($this->thread->onthefly) { $GLOBALS['newres_to_show_flag'] = true; $tores .= "<div id=\"r{$i}\" name=\"r{$i}\">[<font color=\"#00aa00\">{$i}</font>]"; // 番号(新着レス時) } elseif ($i > $this->thread->readnum) { $GLOBALS['newres_to_show_flag'] = true; $tores .= "<div id=\"r{$i}\" name=\"r{$i}\">[<font color=\"{$STYLE['read_newres_color']}\">{$i}</font>]"; // 番号 } else { $tores .= "<div id=\"r{$i}\" name=\"r{$i}\">[{$i}]"; } //$tores .= ' '; // 名前 if (strlen($name)) { $tores .= $name; } // メール $is_sage = false; if (strlen($mail)) { if ($mail == 'sage') { $is_sage = true; } else { //$tores .= $mail . " :"; $tores .= ':' . StrSjis::fixSjis($mail); } } if (strlen($name) or strlen($mail) && !$is_sage) { $tores .= ' '; } $no_trim_id_flag = false; // {{ IDフィルタ if ($_conf['flex_idpopup'] == 1) { if (preg_match('|ID: ?([0-9a-zA-Z/.+]{8,11})|', $date_id, $matches)) { $id = $matches[1]; if ($this->thread->idcount[$id] > 1) { $date_id = preg_replace_callback('|ID: ?([0-9A-Za-z/.+]{8,11})|', array($this, 'idfilter_callback'), $date_id); } else { if ($_conf['k_clip_unique_id']) { $date_id = str_replace($matches[0], 'ID:' . substr($matches[0], -1, 1), $date_id); $no_trim_id_flag = true; } } } } // }}} if ($_conf['mobile.id_underline']) { $date_id = preg_replace('!((?:ID: ?)| )([0-9A-Za-z/.+]{10}|[0-9A-Za-z/.+]{8}|\\?\\?\\?)?O(?=[^0-9A-Za-z/.+]|$)!', '$1$2<u>O</u>', $date_id); } if ($_conf['k_clip_unique_id']) { $date_id = str_replace('???', '?', $date_id); } if (!$no_trim_id_flag) { $date_id = preg_replace('/ID: ?/', '', $date_id); } $tores .= $date_id; // 日付とID if ($is_sage) { $tores .= '<font color="#aaaaaa">↓</font>'; } $tores .= "<br>\n"; // 日付とID $tores .= $rpop; // レスポップアップ用引用 $tores .= "{$msg}</div>{$hr}\n"; // 内容 // まとめてフィルタ色分け if (strlen($GLOBALS['word_fm']) && $GLOBALS['res_filter']['match'] != 'off') { if (is_string($_conf['k_filter_marker'])) { $tores = StrCtl::filterMarking($GLOBALS['word_fm'], $tores, $_conf['k_filter_marker']); } else { $tores = StrCtl::filterMarking($GLOBALS['word_fm'], $tores); } } // 全角英数スペースカナを半角に if ($_conf['k_save_packet']) { $tores = mb_convert_kana($tores, 'rnsk'); // SJIS-win だと ask で < を < に変換してしまうようだ } return $tores; }
/** * 新着まとめ読みのキャッシュリンクHTMLを表示する * * @return void */ function _printMatomeCacheLinksHtml() { global $_conf; $max = $_conf['matome_cache_max']; $links = array(); for ($i = 0; $i <= $max; $i++) { $dnum = $i ? '.' . $i : ''; $file = $_conf['matome_cache_path'] . $dnum . $_conf['matome_cache_ext']; //echo '<!-- ' . $file . ' -->'; if (file_exists($file)) { $filemtime = filemtime($file); $date = date('Y/m/d G:i:s', $filemtime); $b = filesize($file) / 1024; $kb = round($b, 0); $atag = P2View::tagA(UriUtil::buildQueryUri('read_new.php', array('cview' => '1', 'cnum' => "{$i}", 'filemtime' => $filemtime)), hs($date), array('target' => 'read')); $links[] = sprintf('%s %dKB', $atag, $kb); } } if ($links) { echo '<p>新着まとめ読みの前回キャッシュを表\示<br>' . implode('<br>', $links) . '</p>' . "\n"; if ($_conf['ktai']) { $hr = P2View::getHrHtmlK(); echo $hr . "\n"; } } }
/** * スレッドの新着部分を読み込んで表示する */ function _readNew(&$aThread) { global $_conf, $_newthre_num, $STYLE; global $spmode; $_newthre_num++; $hr = P2View::getHrHtmlK(); //========================================================== // 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 (is_readable($aThread->keyidx)) { $lines = file($aThread->keyidx); $data = explode('<>', rtrim($lines[0])); } $aThread->getThreadInfoFromIdx(); //$aThread->readDatInfoFromFile(); // DATのダウンロード if (!(strlen(geti($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 = base64_encode($aThread->ttitle); $ttitle_en_q = "&ttitle_en=" . $ttitle_en; $bbs_q = "&bbs=" . $aThread->bbs; $key_q = "&key=" . $aThread->key; $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; 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> "; $next_thre_ht = "<a class=\"button\" href=\"#ntt_bt{$_newthre_num}\">▼</a> "; if ($spmode) { $read_header_itaj_ht = sprintf(' (%s)', hs($aThread->itaj)); if ($_conf['k_save_packet']) { $read_header_itaj_ht = mb_convert_kana($read_header_itaj_ht, 'rnsk'); } } // スマートポップアップメニュー JavaScriptコード if ($_conf['enable_spm']) { // フォントサイズ等 conf_user_style.inc.php をいじるとPCも変わるのでここで書き換え $STYLE['respop_color'] = "#FFFFFF"; // ("#000") レスポップアップのテキスト色 $STYLE['respop_bgcolor'] = ""; // ("#ffffcc") レスポップアップの背景色 $STYLE['respop_fontsize'] = '13px'; $aThread->showSmartPopUpMenuJs(); } P2Util::printInfoHtml(); $ttitle_hs = hs($aThread->ttitle_hc); if ($_conf['k_save_packet']) { $ttitle_hs = mb_convert_kana($ttitle_hs, 'rnsk'); } $read_header_ht = <<<EOP \t<p id="ntt{$_newthre_num}" name="ntt{$_newthre_num}"><font color="{$STYLE['read_k_thread_title_color']}"><b>{$ttitle_hs}</b></font>{$read_header_itaj_ht} {$next_thre_ht}</p> \t{$hr} EOP; // {{{ ローカルDatを読み込んでHTML表示 $aThread->resrange['nofirst'] = true; $GLOBALS['newres_to_show_flag'] = false; $read_cont_ht = ''; if ($aThread->rescount) { //$aThread->datToHtml(); // dat を html に変換表示 require_once P2_IPHONE_LIB_DIR . '/ShowThreadK.php'; $aShowThread = new ShowThreadK($aThread); $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 = "次"; // 表示範囲 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}<br>"; /* $read_footer_navi_new_ht = P2View::tagA( UriUtil::buildQueryUri( $_conf['read_php'], array( 'host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'ls' => "$aThread->rescount-", 'nt' => $newtime, UA::getQueryKey() => UA::getQueryValue() ) . "#r{$aThread->rescount}" ), '新着レスの表示' ); $dores_ht _getDoResATag($aThread, $motothre_url); */ // {{{ ツールバー部分HTML if ($spmode) { $ita_atag = _getItaATag($aThread); $toolbar_itaj_ht = " ({$ita_atag})"; if ($_conf['k_save_packet']) { $toolbar_itaj_ht = mb_convert_kana($toolbar_itaj_ht, 'rnsk'); } } /* $info_atag = _getInfoATag($aThread, $info_st); $dele_atag = _getDeleATag($aThread, $dele_st); $motothre_atag = P2View::tagA($motothre_url, '元スレ') $toolbar_right_ht = "{$info_atag} {$dele_atag} {$motothre_atag}\n"; */ // }}} $read_atag = _getReadATag($aThread); $read_footer_ht = <<<EOP <div id="ntt_bt{$_newthre_num}" name="ntt_bt{$_newthre_num}"> {$read_range_ht} {$read_atag}{$toolbar_itaj_ht} <a href="#ntt{$_newthre_num}">▲</a> </div> 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->readnum, $data[6], $data[7], $data[8], $newline, $data[10], $data[11], $aThread->datochiok); P2Util::recKeyIdx($aThread->keyidx, $sar); // key.idxに記録 } // }}} unset($aThread); }
/** * お気に板をHTML表示する for 携帯 * * @access public * @return void */ function printFavItaHtml() { global $_conf; $csrfid = P2Util::getCsrfId(); $hr = P2View::getHrHtmlK(); $show_flag = false; if (file_exists($_conf['favita_path']) and $lines = file($_conf['favita_path'])) { echo 'お気に板 [<a href="editfavita.php?b=k">編集</a>]' . $hr; $i = 0; foreach ($lines as $l) { $i++; $l = rtrim($l); if (preg_match("/^\t?(.+)\t(.+)\t(.+)\$/", $l, $matches)) { $itaj = rtrim($matches[3]); $attr = array(); $key_num_st = ''; if ($i <= 9) { $attr[$_conf['accesskey_for_k']] = $i; $key_num_st = "{$i}."; } $atag = P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $matches[1], 'bbs' => $matches[2], 'itaj_en' => base64_encode($itaj), UA::getQueryKey() => UA::getQueryValue())), UA::isIPhoneGroup() ? hs($itaj) : hs("{$key_num_st}{$itaj}"), $attr); if (UA::isIPhoneGroup()) { echo '<li>' . $atag . '</li>'; } else { echo $atag . '<br>'; } // [<a href="{$_SERVER['SCRIPT_NAME']}?host={$matches[1]}&bbs={$matches[2]}&setfavita=0&csrfid={$csrfid}&view=favita{$_conf['k_at_a']}">削</a>] $show_flag = true; } } if (UA::isIPhoneGroup()) { ?> </ul><?php } } if (!$show_flag) { ?> <p>お気に板はまだないようだ</p><?php } }
$qs['user'] = $_login->user_u; } $qs[UA::getQueryKey()] = UA::getMobileQuery(); $atag = P2View::tagA( $uri = UriUtil::buildQueryUri( rtrim(dirname(UriUtil::getMyUri()), '/') . '/', $qs ), $uri, array('target' => '_blank') ); $ktai_url_ht = sprintf('携帯%s用URL %s<br>', hs($p_str['login']), $atag); */ // }}} $csrfid = P2Util::getCsrfId(); $hr = P2View::getHrHtmlK(); // パスワード変更登録処理 _preExecChangePass(); //==================================================== // 補助認証 //==================================================== $auth_ctl_html = ''; $auth_cookie_html = ''; $mobile =& Net_UserAgent_Mobile::singleton(); require_once P2_LIB_DIR . '/HostCheck.php'; // EZ認証 if (!empty($_SERVER['HTTP_X_UP_SUBNO'])) { if ($_login->hasRegistedAuthCarrier('EZWEB')) { $atag = P2View::tagA(UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('ctl_regist_ez' => '1', UA::getQueryKey() => UA::getQueryValue())), '解除'); $auth_ctl_html = sprintf('EZ端末ID認証登録済[%s]<br>', $atag); } else {
if (!empty($formdata)) { foreach ($formdata as $k => $v) { printf($row_format, $k, htmlspecialchars($v['word'], ENT_QUOTES), $v['ic'], $v['re'], htmlspecialchars($v['ht'], ENT_QUOTES), $v['hn'], htmlspecialchars($v['bbs'], ENT_QUOTES), htmlspecialchars($v['tt'], ENT_QUOTES), strlen($v['ht']) > 0 ? htmlspecialchars($v['ht'], ENT_QUOTES) : '--'); } echo $htm['form_submit']; } // PCなら if (!$_conf['ktai']) { echo '</table>' . "\n"; } ?> </form> <?php // 携帯なら if (UA::isK()) { echo P2View::getHrHtmlK(); echo P2View::tagA(UriUtil::buildQueryUri($_conf['editpref_php'], array(UA::getQueryKey() => UA::getQueryValue())), hs(sprintf('%s.設定編集', $_conf['k_accesskey']['up'])), array($_conf['accesskey_for_k'] => $_conf['k_accesskey']['up'])); echo P2View::getBackToIndexKATag(); } ?> </body></html> <?php /* * Local Variables: * mode: php * coding: cp932 * tab-width: 4 * c-basic-offset: 4 * indent-tabs-mode: nil * End: */
/** * レス記事をHTML表示する 携帯用 * * @access public * @param array * @return void */ function printArticlesHtmlK($datlines) { global $_conf; $hr = P2View::getHrHtmlK(); $n = 0; foreach ($datlines as $aline) { $n++; if ($n < $this->resrange['start'] or $n > $this->resrange['to']) { continue; } $aline = rtrim($aline); $ResArticle = $this->lineToRes($aline, $n); $daytime_hs = hs($ResArticle->daytime); $ttitle = html_entity_decode($ResArticle->ttitle, ENT_COMPAT, 'Shift_JIS'); $ttitle_hs = hs($ttitle); $msg_ht = $ResArticle->msg; // 大きさ制限 if (empty($_GET['k_continue'])) { if ($_conf['ktai_res_size'] && strlen($msg_ht) > $_conf['ktai_res_size']) { $msg_ht = substr($msg_ht, 0, $_conf['ktai_ryaku_size']); // 末尾に<br>があれば取り除く(不完全なものも含めて) $brtag = '<br>'; for ($i = 0; $i < strlen($brtag); $i++) { if (substr($msg_ht, -1) == $brtag[strlen($brtag) - $i - 1]) { $msg_ht = substr($msg_ht, 0, strlen($msg_ht) - 1); } } $msg_ht .= ' ' . P2View::tagA(UriUtil::buildQueryUri('read_res_hist.php', array('from' => $ResArticle->order, 'end' => $ResArticle->order, 'k_continue' => '1', UA::getQueryKey() => UA::getQueryValue())), hs('略')); } } // 番号 $res_ht = "[{$ResArticle->order}]"; // 名前 $array = explode('#', $ResArticle->name, 2); if (count($array) == 2) { $name_ht = sprintf('%s◆%s', $array[0], P2Util::mkTrip($array[1])); } else { $name_ht = hs($ResArticle->name); } $res_ht .= $name_ht . ':'; // メール if ($ResArticle->mail) { $res_ht .= hs($ResArticle->mail) . ':'; } // 日付とID $res_ht .= "{$daytime_hs}<br>\n"; // 板名 $res_ht .= P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $ResArticle->host, 'bbs' => $ResArticle->bbs, UA::getQueryKey() => UA::getQueryValue())), hs($ResArticle->itaj)) . ' / '; if ($ResArticle->key) { if (empty($ResArticle->resnum) || $ResArticle->resnum == 1) { $ls_qs = array(); $footer_anchor = '#footer'; } else { $lf = max(1, $ResArticle->resnum - 0); $ls_qs = array('ls' => "{$lf}-"); $footer_anchor = "#r{$lf}"; } $time = time(); $ttitle_qs = array_merge(array('host' => $ResArticle->host, 'bbs' => $ResArticle->bbs, 'key' => $ResArticle->key, UA::getQueryKey() => UA::getQueryValue(), 'nt' => time()), $ls_qs); $res_ht .= P2View::tagA(UriUtil::buildQueryUri($_conf['read_php'], $ttitle_qs) . $footer_anchor, "{$ttitle_hs} "); } else { $res_ht .= "{$ttitle_hs}\n"; } // 削除 // $res_ht = "<dt><input name=\"checked_hists[]\" type=\"checkbox\" value=\"{$ResArticle->order},,,,{$daytime_hs}\"> "; $from_q = isset($_GET['from']) ? '&from=' . intval($_GET['from']) : ''; $dele_ht = "[<a href=\"read_res_hist.php?checked_hists[]={$ResArticle->order},,,," . hs(urlencode($ResArticle->daytime)) . "{$from_q}{$_conf['k_at_a']}\">削除</a>]"; $res_ht .= $dele_ht; $res_ht .= '<br>'; // 内容 $res_ht .= "{$msg_ht}{$hr}\n"; if ($_conf['k_save_packet']) { $res_ht = mb_convert_kana($res_ht, 'rnsk'); } echo $res_ht; } }
if (!empty($_GET['popup'])) { ?> <div align="center"><?php if ($_GET['popup'] == 1) { ?> <form action=""><input type="button" value="ウィンドウを閉じる" onClick="window.close();"></form><?php } elseif ($_GET['popup'] == 2) { ?> <form action=""><input id="timerbutton" type="button" value="Close Timer" onClick="stopTimer(document.getElementById('timerbutton'))"></form><?php } ?> </div><?php } // }}} if (UA::isK()) { echo P2View::getHrHtmlK() . P2View::getBackToIndexKATag(); } ?> </body></html><?php exit; //======================================================================== // 関数 (このファイル内でのみ利用) //======================================================================== /** * スレ情報HTMLを表示する * * @return void */ function _printInfoTrHtml($s, $c_ht) { global $_conf;
/** * DatレスをHTMLレスに変換する * * @access public * @param string $ares datの1ライン * @param integer $i レス番号 * @return string HTML */ function transRes($ares, $i) { global $STYLE, $mae_msg, $res_filter, $word_fm; global $ngaborns_hits; global $_conf; $hr = P2View::getHrHtmlK(); $tores = ''; $rpop = ''; $resar = $this->thread->explodeDatLine($ares); $name = $resar[0]; $mail = $resar[1]; $date_id = $resar[2]; $msg = $resar[3]; // デフォルトの名前は、NG・あぼーんとフィルタ検索の対象外とする $nameForAborn = $name; if (strlen($this->BBS_NONAME_NAME) && $this->BBS_NONAME_NAME == $name) { if (!$_conf['k_bbs_noname_name']) { $nameForAborn = $name = ''; } else { $nameForAborn = ''; } } // 現在の年号は省略カットする。(設定で)月日の先頭0もカット。 if ($_conf['k_date_zerosuppress']) { $date_id = preg_replace('~^(?:' . date('Y') . '|' . date('y') . ')/(?:0(\\d)|(\\d\\d))?(?:(/)0)?~', '$1$2$3', $date_id); } else { $date_id = preg_replace('~^(?:' . date('Y') . '|' . date('y') . ')/~', '$1', $date_id); } // 曜日と時間の間を詰める $date_id = str_replace(') ', ')', $date_id); // 秒もカット if ($_conf['k_clip_time_sec']) { $date_id = preg_replace('/(\\d\\d:\\d\\d):\\d\\d(\\.\\d\\d)?/', '$1', $date_id); } // {{{ フィルタリング if (strlen($GLOBALS['word'])) { if (!strlen($GLOBALS['word_fm'])) { return ''; // ターゲット設定 } elseif (!($target = $this->getFilterTarget($i, $nameForAborn, $mail, $date_id, $msg))) { return ''; // マッチング } elseif (false === $this->filterMatch($target, $i)) { return ''; } } // }}} // {{{ あぼーんチェック(名前、メール、ID、メッセージ) /* $aborned_res = "<div id=\"r{$i}\" name=\"r{$i}\"> </div>\n"; // 名前 $aborned_res .= ""; // 内容 */ $aborned_res = "<span id=\"r{$i}\" name=\"r{$i}\"></span>\n"; if (false !== $this->checkAborns($nameForAborn, $mail, $date_id, $msg)) { return $aborned_res; } // }}} // {{{ NGチェック(名前、メール、ID、メッセージ) $isNgName = false; $isNgMail = false; $isNgId = false; $isNgMsg = false; if (empty($_GET['nong'])) { if (strlen($nameForAborn) and false !== $this->ngAbornCheck('ng_name', strip_tags($nameForAborn))) { $isNgName = true; } if (false !== $this->ngAbornCheck('ng_mail', $mail)) { $isNgMail = true; } if (false !== $this->ngAbornCheck('ng_id', $date_id)) { $isNgId = true; } if (false !== ($a_ng_msg = $this->ngAbornCheck('ng_msg', $msg))) { $isNgMsg = true; } } // }}} // iPhone用PopUp // {{{ レスをポップアップ表示 if ($_conf['quote_res_view']) { $quote_res_nums = $this->checkQuoteResNums($i, $name, $msg); foreach ($quote_res_nums as $rnv) { if (empty($this->quote_res_nums_done[$rnv]) and $rnv < count($this->thread->datlines)) { $ds = $this->qRes($this->thread->datlines[$rnv - 1], $rnv, 'q' . $rnv . 'of' . $this->thread->key); $onPopUp_at = " onMouseover=\"showResPopUp('q{$rnv}of{$this->thread->key}',event,true)\""; $rpop .= "<span id=\"q{$rnv}of{$this->thread->key}\" class=\"respopup\"{$onPopUp_at}>" . $ds . "</span>\n"; $this->quote_res_nums_done[$rnv] = true; } } } //============================================================= // まとめて出力 //============================================================= $name = $this->transName($name, $i); // 名前HTML変換 $has_aa = 0; // 1:弱反応, 2:強反応(AA略) $msg = $this->transMsg($msg, $i, $has_aa); // メッセージHTML変換 // BEプロファイルリンク変換 $date_id = $this->replaceBeId($date_id, $i); // NG変換 $kakunin_msg_ht = P2View::tagA(UriUtil::buildQueryUri($_conf['read_php'], array('host' => $this->thread->host, 'bbs' => $this->thread->bbs, 'key' => $this->thread->key, 'ls' => $i, 'k_continue' => '1', 'nong' => '1', UA::getQueryKey() => UA::getQueryValue())), '確'); // NGメッセージ変換 if ($isNgMsg) { $msg = sprintf('<s><font color="%s">NG:%s</font></s>', $STYLE['read_ngword'], hs($a_ng_msg)); $msg .= ' ' . $kakunin_msg_ht; } // NGネーム変換 if ($isNgName) { $name = sprintf('<s><font color="%s">%s</font></s>', $STYLE['read_ngword'], $name); $msg = $kakunin_msg_ht; // NGメール変換 } elseif ($isNgMail) { $mail = sprintf('<s><font color="%s">%s</font></s>', $STYLE['read_ngword'], $mail); $msg = $kakunin_msg_ht; // NGID変換 } elseif ($isNgId) { $date_id = preg_replace('|ID: ?([0-9A-Za-z/.+]{8,11})|', "<s><font color=\"{$STYLE['read_ngword']}\">\\0</font></s>", $date_id); // $date_id = sprintf('<s><font color="%s">%s</font></s>', $STYLE['read_ngword'], $date_id); $msg = $kakunin_msg_ht; } /* //「ここから新着」画像を挿入 if ($i == $this->thread->readnum +1) { $tores .= "\n" . '<div><img src="img/image.png" alt="新着レス" border="0" vspace="4"></div>' . "\n"; } */ $id = "qr{$i}of{$this->thread->key}"; // iphone用 // スマートポップアップメニュー(read_new中は未対応とする) if ($_conf['enable_spm'] and empty($GLOBALS['_read_new_html'])) { //$onPopUp_at = " onmouseover=\"showSPM({$this->thread->spmObjName},{$i},'{$id}',event,this)\" onmouseout=\"hideResPopUp('{$this->thread->spmObjName}_spm')\""; // onmouseout="hideResPopUp()" は外す必要がある $onPopUp_at = " onmouseover=\"showSPM({$this->thread->spmObjName},{$i},'{$id}',event,this)\""; $is = "<a href=\"javascript:void(0);\" class=\"resnum\"{$onPopUp_at}>{$i}</a>"; } else { $is = $i; } // レスポップアップ用引用 $tores .= $rpop; // 番号(オンザフライ時) if ($this->thread->onthefly) { $GLOBALS['newres_to_show_flag'] = true; $tores .= "<div id=\"r{$i}\" name=\"r{$i}\">[<font color=\"#00aa00\">{$i}</font>]"; // 番号(新着レス時) } elseif ($i > $this->thread->readnum) { $GLOBALS['newres_to_show_flag'] = true; $tores .= "<div id=\"r{$i}\" name=\"r{$i}\">[<font color=\"{$STYLE['read_newres_color']}\">{$is}</font>]"; // 番号 } else { // iPhone用にクラス追加 thread 以下も同様 // ↑このclass thread がどこで利用されているのかわからない。使われいないような気がする。 // ここでclass名にthreadを使うのはふさわしくないので、外したいところ。 $tores .= "<div class=\"thread\" id=\"r{$i}\" name=\"r{$i}\">[{$is}]"; } //$tores .= ' '; // 名前 if (strlen($name)) { $tores .= '<span class="tname">' . $name . '</span>'; } // メール $is_sage = false; if (strlen($mail)) { if ($mail == 'sage') { $is_sage = true; } else { //$tores .= $mail . " :"; $tores .= ':<span class="tmail">' . StrSjis::fixSjis($mail) . '</span>'; } } if (strlen($name) > 0 or strlen($mail) > 0 && !$is_sage) { $tores .= ' '; } $no_trim_id_flag = false; // {{ IDフィルタ if ($_conf['flex_idpopup'] == 1) { if (preg_match('|ID: ?([0-9a-zA-Z/.+]{8,11})|', $date_id, $matches)) { $id = $matches[1]; if ($this->thread->idcount[$id] > 1) { $date_id = preg_replace_callback('|ID: ?([0-9A-Za-z/.+]{8,11})|', array($this, 'idfilter_callback'), $date_id); } else { if ($_conf['k_clip_unique_id']) { $date_id = str_replace($matches[0], 'ID:' . substr($matches[0], -1, 1), $date_id); $no_trim_id_flag = true; } } } } // }}} if ($_conf['mobile.id_underline']) { $date_id = preg_replace('!((?:ID: ?)| )([0-9A-Za-z/.+]{10}|[0-9A-Za-z/.+]{8}|\\?\\?\\?)?O(?=[^0-9A-Za-z/.+]|$)!', '$1$2<u>O</u>', $date_id); } if ($_conf['k_clip_unique_id']) { $date_id = str_replace('???', '?', $date_id); } if (!$no_trim_id_flag) { $date_id = preg_replace('/ID: ?/', '', $date_id); } $tores .= '<span class="tdate">' . $date_id . '</span>'; if ($is_sage) { $tores .= '<font color="#aaaaaa">↓</font>'; } $tores .= "<br>\n"; // 日付とID $tores .= "{$msg}</div>{$hr}\n"; // 内容 // iPhone用にhr削除 // まとめてフィルタ色分け if (strlen($GLOBALS['word_fm']) && $GLOBALS['res_filter']['match'] != 'off') { if (is_string($_conf['k_filter_marker'])) { $tores = StrCtl::filterMarking($GLOBALS['word_fm'], $tores, $_conf['k_filter_marker']); } else { $tores = StrCtl::filterMarking($GLOBALS['word_fm'], $tores); } } // 全角英数スペースカナを半角に if ($_conf['k_save_packet']) { $tores = mb_convert_kana($tores, 'rnsk'); // SJIS-win だと ask で < を < に変換してしまうようだ } // 080809 スマートポップアップの背景色削除 iPhone用 $STYLE['respop_bgcolor'] = ''; // {{{ iphone 引用してレス // レスと引用レスが全て2重に埋め込まれている。 // 埋め込みしないでアクションがあったときに呼び出したい。 $quoteMsg = $msg; if (preg_match('~(.*)<a href="[^"]+" target="_blank">(\\>)*([0-9]{1,4})</a>([\\x00-\\xff]+)~im', $msg, $matches)) { $quoteMsg = $matches[1] . ">>" . $matches[3] . $matches[4]; } // タグ化&改行にマークしとく $quoteMsg = sprintf('<span class="respopup" id="quote_msg%s">%s</span>', $i, str_replace('<br>', '___[br]___>', nl2br($quoteMsg))); $tores = "\n" . $quoteMsg . "\n" . $tores; // }}} return $tores; }
/** * グループ分け用のHTMLを得る(関数内でPC、携帯用表示を振り分け) * * @return string */ function getGroupSepaHtml($title) { global $_conf; // PC用 if (empty($_conf['ktai'])) { $ht = <<<EOP <tr class="group"> <td colspan="4"><h4 style="display:inline;">{$title}</h4></td> </tr> EOP; // 携帯用 } else { $hr = P2View::getHrHtmlK(); $ht = "{$hr}<h4>{$title}</h4>" . "\n"; } return $ht; }