Exemplo n.º 1
0
         }
     }
     // }}}
     // {{{ ■ワードフィルタ(for spmode)
     if ($do_filtering) {
         // マッチしなければスキップ
         if (!matchSbFilter($aThread)) {
             unset($aThread);
             continue;
             // マッチした時
         } else {
             $GLOBALS['sb_mikke_num']++;
             if ($_conf['ktai']) {
                 $aThread->ttitle_ht = $aThread->ttitle_hd;
             } else {
                 $aThread->ttitle_ht = StrCtl::filterMarking($GLOBALS['word_fm'], $aThread->ttitle_hd);
             }
         }
     }
     // }}}
 }
 //$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('FORLOOP_HIP');
 // subjexctからrescountが取れなかった場合は、gotnumを利用する。
 if (!$aThread->rescount and $aThread->gotnum) {
     $aThread->rescount = $aThread->gotnum;
 }
 // マーキング等の処理をしない場合 ttitle_hc, ttitle_hd, ttitle_ht はJITで設定される
 //if (!$aThread->ttitle_ht) { $aThread->ttitle_ht = $aThread->ttitle_hd; }
 // 新着あり
 if ($aThread->unum > 0) {
     $shinchaku_attayo = true;
Exemplo n.º 2
0
 /**
  * データを読み込んで、カテゴリと板を登録する
  *
  * @access  public
  * @return  void
  */
 function setBrdList($data)
 {
     global $_conf;
     if (empty($data)) {
         return;
     }
     // 除外URLリスト
     $not_bbs_list = array('http://members.tripod.co.jp/Backy/del_2ch/');
     foreach ($data as $v) {
         $v = rtrim($v);
         // カテゴリを探す
         if (preg_match($this->cate_match, $v, $matches)) {
             $aBrdMenuCate = new BrdMenuCate($matches[1]);
             if ($this->format == 'brd') {
                 $aBrdMenuCate->is_open = (bool) $matches[2];
             }
             $this->addBrdMenuCate($aBrdMenuCate);
             // 板を探す
         } elseif (preg_match($this->ita_match, $v, $matches)) {
             // html形式なら除外URLを外す
             if ($this->format == 'html') {
                 foreach ($not_bbs_list as $not_a_bbs) {
                     if ($not_a_bbs == $matches[1]) {
                         continue 2;
                     }
                 }
             }
             $aBrdMenuIta = new BrdMenuIta();
             // html形式
             if ($this->format == 'html') {
                 $aBrdMenuIta->host = $matches[2];
                 $aBrdMenuIta->bbs = $matches[3];
                 $itaj_match = $matches[6];
                 // brd形式
             } else {
                 $aBrdMenuIta->host = $matches[1];
                 $aBrdMenuIta->bbs = $matches[2];
                 $itaj_match = $matches[3];
             }
             $aBrdMenuIta->setItaj(rtrim($itaj_match));
             // {{{ 板検索マッチ
             // and検索
             if ($GLOBALS['words_fm']) {
                 $no_match = false;
                 foreach ($GLOBALS['words_fm'] as $word_fm_ao) {
                     $target = $aBrdMenuIta->itaj . "\t" . $aBrdMenuIta->bbs;
                     if (false === StrCtl::filterMatch($word_fm_ao, $target)) {
                         $no_match = true;
                     }
                 }
                 if (!$no_match) {
                     $this->categories[$this->num - 1]->ita_match_num++;
                     if (isset($GLOBALS['ita_mikke']['num'])) {
                         $GLOBALS['ita_mikke']['num']++;
                     } else {
                         $GLOBALS['ita_mikke']['num'] = 1;
                     }
                     $GLOBALS['ita_mikke']['host'] = $aBrdMenuIta->host;
                     $GLOBALS['ita_mikke']['bbs'] = $aBrdMenuIta->bbs;
                     $GLOBALS['ita_mikke']['itaj_en'] = $aBrdMenuIta->itaj_en;
                     // マーキング
                     if ($_conf['ktai'] && is_string($_conf['k_filter_marker'])) {
                         $aBrdMenuIta->itaj_ht = StrCtl::filterMarking($GLOBALS['word_fm'], $aBrdMenuIta->itaj, $_conf['k_filter_marker']);
                     } else {
                         $aBrdMenuIta->itaj_ht = StrCtl::filterMarking($GLOBALS['word_fm'], $aBrdMenuIta->itaj);
                     }
                     // マッチマーキングなければ(bbsでマッチしたとき)、全部マーキング
                     if ($aBrdMenuIta->itaj_ht == $aBrdMenuIta->itaj) {
                         $aBrdMenuIta->itaj_ht = '<b class="filtering">' . $aBrdMenuIta->itaj_ht . '</b>';
                     }
                     // 検索が見つからなくて、さらに携帯の時
                 } else {
                     if ($_conf['ktai']) {
                         continue;
                     }
                 }
             }
             // }}}
             if ($this->num) {
                 $this->categories[$this->num - 1]->addBrdMenuIta($aBrdMenuIta);
             }
         }
     }
     // foreach
 }
Exemplo n.º 3
0
 /**
  * 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}\">&nbsp;</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;
 }
Exemplo n.º 4
0
    /**
     * DatレスをHTMLレスに変換する
     *
     * @param   string  $ares       datの1ライン
     * @param   int     $i          レス番号
     * @param   string  $pattern    ハイライト用正規表現
     * @return  string
     */
    public function transRes($ares, $i, $pattern = null)
    {
        global $_conf, $STYLE, $mae_msg;
        list($name, $mail, $date_id, $msg) = $this->thread->explodeDatLine($ares);
        if (($id = $this->thread->ids[$i]) !== null) {
            $idstr = 'ID:' . $id;
            $date_id = str_replace($this->thread->idp[$i] . $id, $idstr, $date_id);
        } else {
            $idstr = null;
        }
        // +Wiki:置換ワード
        if (isset($GLOBALS['replaceWordCtl'])) {
            $replaceWordCtl = $GLOBALS['replaceWordCtl'];
            $name = $replaceWordCtl->replace('name', $this->thread, $ares, $i);
            $mail = $replaceWordCtl->replace('mail', $this->thread, $ares, $i);
            $date_id = $replaceWordCtl->replace('date', $this->thread, $ares, $i);
            $msg = $replaceWordCtl->replace('msg', $this->thread, $ares, $i);
        }
        $tores = '';
        $rpop = '';
        if ($this->_matome) {
            $res_id = "t{$this->_matome}r{$i}";
            $msg_id = "t{$this->_matome}m{$i}";
        } else {
            $res_id = "r{$i}";
            $msg_id = "m{$i}";
        }
        $msg_class = 'message';
        // NGあぼーんチェック
        $ng_type = $this->_ngAbornCheck($i, strip_tags($name), $mail, $date_id, $id, $msg, false, $ng_info);
        if ($ng_type == self::ABORN) {
            return $this->_abornedRes($res_id);
        }
        if ($ng_type != self::NG_NONE) {
            $ngaborns_head_hits = self::$_ngaborns_head_hits;
            $ngaborns_body_hits = self::$_ngaborns_body_hits;
        }
        // AA判定
        if ($this->am_autodetect && $this->activeMona->detectAA($msg)) {
            $msg_class .= ' ActiveMona';
        }
        //=============================================================
        // レスをポップアップ表示
        //=============================================================
        if ($_conf['quote_res_view']) {
            $quote_res_nums = $this->checkQuoteResNums($i, $name, $msg);
            foreach ($quote_res_nums as $rnv) {
                if (!isset($this->_quote_res_nums_done[$rnv])) {
                    $this->_quote_res_nums_done[$rnv] = true;
                    if (isset($this->thread->datlines[$rnv - 1])) {
                        if ($this->_matome) {
                            $qres_id = "t{$this->_matome}qr{$rnv}";
                        } else {
                            $qres_id = "qr{$rnv}";
                        }
                        $ds = $this->qRes($this->thread->datlines[$rnv - 1], $rnv);
                        $onPopUp_at = " onmouseover=\"showResPopUp('{$qres_id}',event)\" onmouseout=\"hideResPopUp('{$qres_id}')\"";
                        $rpop .= "<div id=\"{$qres_id}\" class=\"respopup\"{$onPopUp_at}>\n{$ds}</div>\n";
                    }
                }
            }
        }
        //=============================================================
        // まとめて出力
        //=============================================================
        $name = $this->transName($name);
        // 名前HTML変換
        $msg = $this->transMsg($msg, $i);
        // メッセージHTML変換
        // BEプロファイルリンク変換
        $date_id = $this->replaceBeId($date_id, $i);
        // HTMLポップアップ
        if ($_conf['iframe_popup']) {
            $date_id = preg_replace_callback("{<a href=\"(http://[-_.!~*()0-9A-Za-z;/?:@&=+\$,%#]+)\"({$_conf['ext_win_target_at']})>((\\?#*)|(Lv\\.\\d+))</a>}", array($this, 'iframePopupCallback'), $date_id);
        }
        // NGメッセージ変換
        if ($ng_type != self::NG_NONE && count($ng_info)) {
            $ng_info = implode(', ', $ng_info);
            $msg = <<<EOMSG
<span class="ngword" onclick="show_ng_message('ngm{$ngaborns_body_hits}', this);">{$ng_info}</span>
<div id="ngm{$ngaborns_body_hits}" class="ngmsg ngmsg-by-msg">{$msg}</div>
EOMSG;
        }
        // NGネーム変換
        if ($ng_type & self::NG_NAME) {
            $name = <<<EONAME
<span class="ngword" onclick="show_ng_message('ngn{$ngaborns_head_hits}', this);">{$name}</span>
EONAME;
            $msg = <<<EOMSG
<div id="ngn{$ngaborns_head_hits}" class="ngmsg ngmsg-by-name">{$msg}</div>
EOMSG;
            // NGメール変換
        } elseif ($ng_type & self::NG_MAIL) {
            $mail = <<<EOMAIL
<span class="ngword" onclick="show_ng_message('ngn{$ngaborns_head_hits}', this);">{$mail}</span>
EOMAIL;
            $msg = <<<EOMSG
<div id="ngn{$ngaborns_head_hits}" class="ngmsg ngmsg-by-mail">{$msg}</div>
EOMSG;
            // NGID変換
        } elseif ($ng_type & self::NG_ID) {
            $date_id = <<<EOID
<span class="ngword" onclick="show_ng_message('ngn{$ngaborns_head_hits}', this);">{$date_id}</span>
EOID;
            $msg = <<<EOMSG
<div id="ngn{$ngaborns_head_hits}" class="ngmsg ngmsg-by-id">{$msg}</div>
EOMSG;
        }
        /*
        //「ここから新着」画像を挿入
        if ($i == $this->thread->readnum +1) {
            $tores .= <<<EOP
                <div><img src="img/image.png" alt="新着レス" border="0" vspace="4"></div>
        EOP;
        }
        */
        // SPM
        if ($_conf['expack.spm.enabled']) {
            $spmeh = " onmouseover=\"{$this->spmObjName}.show({$i},'{$msg_id}',event)\"";
            $spmeh .= " onmouseout=\"{$this->spmObjName}.hide(event)\"";
        } else {
            $spmeh = '';
        }
        if ($_conf['backlink_block'] > 0) {
            // 被参照ブロック表示用にonclickを設定
            $tores .= "<div id=\"{$res_id}\" class=\"res\" onclick=\"toggleResBlk(event, this, " . $_conf['backlink_block_readmark'] . ")\">\n";
        } else {
            $tores .= "<div id=\"{$res_id}\" class=\"res\">\n";
        }
        $tores .= "<div class=\"res-header\">";
        if ($this->thread->onthefly) {
            $GLOBALS['newres_to_show_flag'] = true;
            //番号(オンザフライ時)
            $tores .= "<span class=\"ontheflyresorder spmSW\"{$spmeh}>{$i}</span> : ";
        } elseif ($i > $this->thread->readnum) {
            $GLOBALS['newres_to_show_flag'] = true;
            // 番号(新着レス時)
            $tores .= "<span style=\"color:{$STYLE['read_newres_color']}\" class=\"spmSW\"{$spmeh}>{$i}</span> : ";
        } elseif ($_conf['expack.spm.enabled']) {
            // 番号(SPM)
            $tores .= "<span class=\"spmSW\"{$spmeh}>{$i}</span> : ";
        } else {
            // 番号
            $tores .= "{$i} : ";
        }
        // 名前
        $tores .= preg_replace('{<b>[ ]*</b>}i', '', "<span class=\"name\"><b>{$name}</b></span> : ");
        // メール
        if ($mail) {
            if (strpos($mail, 'sage') !== false && $STYLE['read_mail_sage_color']) {
                $tores .= "<span class=\"sage\">{$mail}</span> : ";
            } elseif ($STYLE['read_mail_color']) {
                $tores .= "<span class=\"mail\">{$mail}</span> : ";
            } else {
                $tores .= $mail . ' : ';
            }
        }
        // IDフィルタ
        if ($_conf['flex_idpopup'] == 1 && $id && $this->thread->idcount[$id] > 1) {
            $date_id = str_replace($idstr, $this->idFilter($idstr, $id), $date_id);
        }
        $tores .= $date_id;
        // 日付とID
        if ($this->am_side_of_id) {
            $tores .= ' ' . $this->activeMona->getMona($msg_id);
        }
        $tores .= "</div>\n";
        // res-headerを閉じる
        // 被レスリスト(縦形式)
        if ($_conf['backlink_list'] == 1 || $_conf['backlink_list'] > 2) {
            $tores .= $this->_quotebackListHtml($i, 1);
        }
        $tores .= "<div id=\"{$msg_id}\" class=\"{$msg_class}\">{$msg}</div>\n";
        // 内容
        // 被レス展開用ブロック
        if ($_conf['backlink_block'] > 0) {
            $backlinks = $this->_getBacklinkComment($i);
            if (strlen($backlinks)) {
                $tores .= '<div class="resblock"><img src="img/btn_plus.gif" width="15" height="15" align="left"></div>';
                $tores .= $backlinks;
            }
        }
        // 被レスリスト(横形式)
        if ($_conf['backlink_list'] == 2 || $_conf['backlink_list'] > 2) {
            $tores .= $this->_quotebackListHtml($i, 2, false);
        }
        $tores .= "</div>\n";
        //      $tores .= $rpop; // レスポップアップ用引用
        /*if ($_conf['expack.am.enabled'] == 2) {
                    $tores .= <<<EOJS
        <script type="text/javascript">
        //<![CDATA[
        detectAA("{$msg_id}");
        //]]>
        </script>\n
        EOJS;
                }*/
        // まとめてフィルタ色分け
        if ($pattern) {
            $tores = StrCtl::filterMarking($pattern, $tores);
        }
        return array('body' => $tores, 'q' => $rpop);
    }
Exemplo n.º 5
0
    /**
     * DatレスをHTMLレスに変換する
     *
     * @access  public
     * @param   string   $ares  datの1ライン
     * @param   integer  $i     レス番号
     * @return  string
     */
    function transRes($ares, $i)
    {
        global $_conf, $STYLE, $mae_msg;
        global $ngaborns_head_hits, $ngaborns_body_hits;
        $tores = "";
        $rpop = "";
        $resar = $this->thread->explodeDatLine($ares);
        $name = $resar[0];
        $mail = $resar[1];
        $date_id = $resar[2];
        $msg = $resar[3];
        // {{{ フィルタリングカット
        if (isset($GLOBALS['word']) && strlen($GLOBALS['word']) > 0) {
            if (strlen($GLOBALS['word_fm']) <= 0) {
                return '';
                // ターゲット設定
            } elseif (!($target = $this->getFilterTarget($i, $name, $mail, $date_id, $msg))) {
                return '';
                // マッチング
            } elseif (!$this->filterMatch($target, $i)) {
                return '';
            }
        }
        // }}}
        // {{{ あぼーんチェック(名前、メール、ID、メッセージ)
        $aborned_res = "<dt id=\"r{$i}\" class=\"aborned\"><span>&nbsp;</span></dt>\n";
        // 名前
        $aborned_res .= "<!-- <dd class=\"aborned\">&nbsp;</dd> -->\n";
        // 内容
        if (false !== $this->checkAborns($name, $mail, $date_id, $msg)) {
            return $aborned_res;
        }
        // }}}
        // {{{ NGチェック(名前、メール、ID、メッセージ)
        $isNgName = false;
        $isNgMail = false;
        $isNgId = false;
        $isNgMsg = false;
        if (false !== $this->ngAbornCheck('ng_name', strip_tags($name))) {
            $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;
        }
        // }}}
        // {{{ レスをポップアップ表示
        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);
                    $onPopUp_at = " onMouseover=\"showResPopUp('q{$rnv}of{$this->thread->key}',event,true)\"";
                    $rpop .= "<dd id=\"q{$rnv}of{$this->thread->key}\" class=\"respopup\"{$onPopUp_at}><i>" . $ds . "</i></dd>\n";
                    $this->quote_res_nums_done[$rnv] = true;
                }
            }
        }
        // }}}
        //=============================================================
        // まとめて出力
        //=============================================================
        $name = $this->transName($name, $i);
        // 名前HTML変換
        $msg = $this->transMsg($msg, $i);
        // メッセージHTML変換
        // BEプロファイルリンク変換
        $date_id = $this->replaceBeId($date_id, $i);
        // HTMLポップアップ
        if ($_conf['iframe_popup']) {
            $date_id = preg_replace_callback("{<a href=\"(http://[-_.!~*()a-zA-Z0-9;/?:@&=+\$,%#]+)\"({$_conf['ext_win_target_at']})>((\\?#*)|(Lv\\.\\d+))</a>}", array($this, 'iframe_popup_callback'), $date_id);
        }
        $a_ng_msg_hs = htmlspecialchars($a_ng_msg, ENT_QUOTES);
        // NGメッセージ変換
        if ($isNgMsg) {
            $msg = <<<EOMSG
<s class="ngword" onMouseover="document.getElementById('ngm{$ngaborns_body_hits}').style.display = 'block';">NG:{$a_ng_msg_hs}</s>
<div id="ngm{$ngaborns_body_hits}" style="display:none;">{$msg}</div>
EOMSG;
        }
        // NGネーム変換
        if ($isNgName) {
            $name = <<<EONAME
<s class="ngword" onMouseover="document.getElementById('ngn{$ngaborns_head_hits}').style.display = 'block';">{$name}</s>
EONAME;
            $msg = <<<EOMSG
<div id="ngn{$ngaborns_head_hits}" style="display:none;">{$msg}</div>
EOMSG;
            // NGメール変換
        } elseif ($isNgMail) {
            $mail = <<<EOMAIL
<s class="ngword" onMouseover="document.getElementById('ngn{$ngaborns_head_hits}').style.display = 'block';">{$mail}</s>
EOMAIL;
            $msg = <<<EOMSG
<div id="ngn{$ngaborns_head_hits}" style="display:none;">{$msg}</div>
EOMSG;
            // NGID変換
        } elseif ($isNgId) {
            $date_id = preg_replace('|ID: ?([0-9A-Za-z/.+]{8,11})|', "<s class=\"ngword\" onMouseover=\"document.getElementById('ngn{$ngaborns_head_hits}').style.display = 'block';\">\\0</s>", $date_id);
            /*
            $date_id = <<<EOID
            <s class="ngword" onMouseover="document.getElementById('ngn{$ngaborns_head_hits}').style.display = 'block';">$date_id</s>
            EOID;
            */
            $msg = <<<EOMSG
<div id="ngn{$ngaborns_head_hits}" style="display:none;">{$msg}</div>
EOMSG;
        }
        /*
        //「ここから新着」画像を挿入
        if ($i == $this->thread->readnum +1) {
            $tores .= <<<EOP
                <div><img src="img/image.png" alt="新着レス" border="0" vspace="4"></div>
        EOP;
        }
        */
        // スマートポップアップメニュー
        if ($_conf['enable_spm']) {
            $onPopUp_at = " onmouseover=\"showSPM({$this->thread->spmObjName},{$i},'{$id}',event,this)\" onmouseout=\"hideResPopUp('{$this->thread->spmObjName}_spm')\"";
        } else {
            $onPopUp_at = "";
        }
        if ($this->thread->onthefly) {
            $GLOBALS['newres_to_show_flag'] = true;
            // 番号(オンザフライ時)
            $tores .= "<dt id=\"r{$i}\"><span class=\"ontheflyresorder\">{$i}</span> :";
        } elseif ($i > $this->thread->readnum) {
            $GLOBALS['newres_to_show_flag'] = true;
            // 番号(新着レス時)
            if ($onPopUp_at) {
                //  style=\"cursor:pointer;\"
                $tores .= "<dt id=\"r{$i}\"><a class=\"resnum\"{$onPopUp_at}><font color=\"{$STYLE['read_newres_color']}\" class=\"newres\">{$i}</font></a> :";
            } else {
                $tores .= "<dt id=\"r{$i}\"><font color=\"{$STYLE['read_newres_color']}\" class=\"newres\">{$i}</font> :";
            }
        } else {
            // 番号
            if ($onPopUp_at) {
                //  style=\"cursor:pointer;\"
                $tores .= "<dt id=\"r{$i}\"><a href=\"#\" class=\"resnum\"{$onPopUp_at}>{$i}</a> :";
            } else {
                $tores .= "<dt id=\"r{$i}\">{$i} :";
            }
        }
        // 名前
        $tores .= "<span class=\"name\"><b>{$name}</b></span>:";
        // メール
        if ($mail) {
            if (strstr($mail, "sage") && $STYLE['read_mail_sage_color']) {
                $tores .= "<span class=\"sage\">{$mail}</span> :";
            } elseif ($STYLE['read_mail_color']) {
                $tores .= "<span class=\"mail\">{$mail}</span> :";
            } else {
                $tores .= $mail . " :";
            }
        }
        // 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);
                }
            }
        }
        $tores .= $date_id;
        // 日付とID
        $tores .= "</dt>\n";
        $tores .= $rpop;
        // レスポップアップ用引用
        $tores .= "<dd>{$msg}<br><br></dd>\n";
        // 内容
        // まとめてフィルタ色分け
        if (!empty($GLOBALS['word_fm']) && $GLOBALS['res_filter']['match'] != 'off') {
            $tores = StrCtl::filterMarking($GLOBALS['word_fm'], $tores);
        }
        return $tores;
    }
Exemplo n.º 6
0
    /**
     * DatレスをHTMLレスに変換する
     *
     * @param   string  $ares       datの1ライン
     * @param   int     $i          レス番号
     * @param   string  $pattern    ハイライト用正規表現
     * @return  string
     */
    public function transRes($ares, $i, $pattern = null)
    {
        global $_conf, $STYLE, $mae_msg;
        list($name, $mail, $date_id, $msg) = $this->thread->explodeDatLine($ares);
        if (($id = $this->thread->ids[$i]) !== null) {
            $idstr = 'ID:' . $id;
            $date_id = str_replace($this->thread->idp[$i] . $id, $idstr, $date_id);
        } else {
            $idstr = null;
        }
        $tores = '';
        if ($this->_matome) {
            $res_id = "t{$this->_matome}r{$i}";
        } else {
            $res_id = "r{$i}";
        }
        // NGあぼーんチェック
        $nong = !empty($_GET['nong']);
        $ng_type = $this->_ngAbornCheck($i, strip_tags($name), $mail, $date_id, $id, $msg, $nong, $ng_info);
        if ($ng_type == self::ABORN) {
            return $this->_abornedRes($res_id);
        }
        if (!$nong && $this->am_autong && $this->activeMona->detectAA($msg)) {
            $is_ng = array_key_exists($i, $this->_ng_nums);
            $ng_type |= $this->_markNgAborn($i, self::NG_AA, true);
            $ng_info[] = 'AA略';
            // AAを連鎖NG対象から外す場合
            if (!$is_ng && $_conf['expack.am.autong_k'] == 2) {
                unset($this->_ng_nums[$i]);
            }
        }
        if ($ng_type != self::NG_NONE) {
            $ngaborns_head_hits = self::$_ngaborns_head_hits;
            $ngaborns_body_hits = self::$_ngaborns_body_hits;
        }
        // {{{ 名前と日付・IDを調整
        // 串焼きマークを短縮
        if ($this->_kushiYakiName !== null && strpos($name, $this->_kushiYakiName) === 0) {
            $name = substr($name, strlen($this->_kushiYakiName));
            // デフォルトの名前は省略
            if ($name === $this->_nanashiName) {
                $name = '[串]';
            } else {
                $name = '[串]' . $name;
            }
            // デフォルトの名前と同じなら省略
        } elseif ($name === $this->_nanashiName) {
            $name = '';
        }
        // 現在の年号は省略カットする。月日の先頭0もカット。
        $date_id = preg_replace($this->_dateIdPattern, $this->_dateIdReplace, $date_id);
        // 曜日と時間の間を詰める
        $date_id = str_replace(') ', ')', $date_id);
        // 秒もカット
        if ($_conf['mobile.clip_time_sec']) {
            $date_id = preg_replace('/(\\d\\d:\\d\\d):\\d\\d(?:\\.\\d\\d)?/', '$1', $date_id);
        }
        // ID
        if ($id !== null) {
            $id_suffix = substr($id, -1);
            if ($_conf['mobile.underline_id'] && $id_suffix == 'O' && strlen($id) % 2) {
                $do_underline_id_suffix = true;
            } else {
                $do_underline_id_suffix = false;
            }
            if ($this->thread->idcount[$id] > 1) {
                if ($_conf['flex_idpopup'] == 1) {
                    $date_id = str_replace($idstr, $this->idFilter($idstr, $id), $date_id);
                }
                if ($do_underline_id_suffix) {
                    $date_id = str_replace($idstr, substr($idstr, 0, -1) . '<u>' . $id_suffix . '</u>', $date_id);
                }
            } else {
                if ($_conf['mobile.clip_unique_id']) {
                    if ($do_underline_id_suffix) {
                        $date_id = str_replace($idstr, 'ID:*<u>' . $id_suffix . '</u>', $date_id);
                    } else {
                        $date_id = str_replace($idstr, 'ID:*' . $id_suffix, $date_id);
                    }
                } else {
                    if ($do_underline_id_suffix) {
                        $date_id = str_replace($idstr, substr($idstr, 0, -1) . '<u>' . $id_suffix . '</u>', $date_id);
                    }
                }
            }
        } else {
            if ($_conf['mobile.clip_unique_id']) {
                $date_id = str_replace('ID:???', 'ID:?', $date_id);
            }
        }
        // }}}
        //=============================================================
        // まとめて出力
        //=============================================================
        if ($name) {
            $name = $this->transName($name);
            // 名前HTML変換
        }
        $msg = $this->transMsg($msg, $i);
        // メッセージHTML変換
        // BEプロファイルリンク変換
        $date_id = $this->replaceBeId($date_id, $i);
        // NGメッセージ変換
        if ($ng_type != self::NG_NONE && count($ng_info)) {
            $ng_info = implode(', ', $ng_info);
            if ($ng_type == self::NG_AA && $_conf['iphone']) {
                $msg = <<<EOMSG
<a class="button" href="{$_conf['read_php']}?host={$this->thread->host}&amp;bbs={$this->thread->bbs}&amp;key={$this->thread->key}&amp;ls={$i}&amp;k_continue=1&amp;nong=1{$_conf['k_at_a']}"{$this->respopup_at}{$this->target_at}>{$ng_info}</a>
EOMSG;
            } else {
                $msg = <<<EOMSG
<s><font color="{$STYLE['mobile_read_ngword_color']}">{$ng_info}</font></s> <a class="button" href="{$_conf['read_php']}?host={$this->thread->host}&amp;bbs={$this->thread->bbs}&amp;key={$this->thread->key}&amp;ls={$i}&amp;k_continue=1&amp;nong=1{$_conf['k_at_a']}"{$this->respopup_at}{$this->target_at}>{$this->check_st}</a>
EOMSG;
            }
            // AAS
            if ($ng_type & self::NG_AA && P2_AAS_AVAILABLE) {
                $aas_url = "aas.php?host={$this->thread->host}&amp;bbs={$this->thread->bbs}&amp;key={$this->thread->key}&amp;resnum={$i}";
                if (P2_AAS_AVAILABLE == 2) {
                    $aas_txt = "<img src=\"{$aas_url}{$_conf['k_at_a']}&amp;inline=1\">";
                } else {
                    $aas_txt = "AAS";
                }
                if ($_conf['iphone']) {
                    //$img_title = htmlspecialchars($this->thread->getMotoThread(true, $i), ENT_QUOTES);
                    //$img_title = "{$this->thread->bbs}/{$this->thread->key}/{$i}";
                    //$img_title = "{$this->thread->ttitle_hd}&#10;&gt;&gt;{$i}";
                    $msg .= " <a class=\"aas limelight\" href=\"{$aas_url}&amp;b=pc\" title=\"&gt;&gt;{$i}\"{$this->target_at}>{$aas_txt}</a>";
                } else {
                    $msg .= " <a class=\"aas\" href=\"{$aas_url}{$_conf['k_at_a']}\"{$this->target_at}>{$aas_txt}</a>";
                    $msg .= " <a class=\"button\" href=\"{$aas_url}{$_conf['k_at_a']}&amp;rotate=1\"{$this->target_at}>{$this->aas_rotate}</a>";
                }
            }
        }
        // NGネーム変換
        if ($ng_type & self::NG_NAME) {
            $name = <<<EONAME
<s><font color="{$STYLE['mobile_read_ngword_color']}">{$name}</font></s>
EONAME;
            $msg = <<<EOMSG
<a class="button" href="{$_conf['read_php']}?host={$this->thread->host}&amp;bbs={$this->thread->bbs}&amp;key={$this->thread->key}&amp;ls={$i}&amp;k_continue=1&amp;nong=1{$_conf['k_at_a']}"{$this->respopup_at}{$this->target_at}>{$this->check_st}</a>
EOMSG;
            // NGメール変換
        } elseif ($ng_type & self::NG_MAIL) {
            $mail = <<<EOMAIL
<s class="ngword" onmouseover="document.getElementById('ngn{$ngaborns_head_hits}').style.display = 'block';">{$mail}</s>
EOMAIL;
            $msg = <<<EOMSG
<div id="ngn{$ngaborns_head_hits}" style="display:none;">{$msg}</div>
EOMSG;
            // NGID変換
        } elseif ($ng_type & self::NG_ID) {
            $date_id = <<<EOID
<s><font color="{$STYLE['mobile_read_ngword_color']}">{$date_id}</font></s>
EOID;
            $msg = <<<EOMSG
<a class="button" href="{$_conf['read_php']}?host={$this->thread->host}&amp;bbs={$this->thread->bbs}&amp;key={$this->thread->key}&amp;ls={$i}&amp;k_continue=1&amp;nong=1{$_conf['k_at_a']}"{$this->respopup_at}{$this->target_at}>{$this->check_st}</a>
EOMSG;
        }
        /*
        //「ここから新着」画像を挿入
        if ($i == $this->thread->readnum +1) {
            $tores .= <<<EOP
                <div><img src="img/image.png" alt="新着レス" border="0" vspace="4"></div>
        EOP;
        }
        */
        if ($_conf['iphone']) {
            $tores .= "<div id=\"{$res_id}\" class=\"res\"><div class=\"res-header\">";
            $no_class = 'no';
            $no_onclick = '';
            // オンザフライ時
            if ($this->thread->onthefly) {
                $GLOBALS['newres_to_show_flag'] = true;
                $no_class .= ' onthefly';
                // 新着レス時
            } elseif ($i > $this->thread->readnum) {
                $GLOBALS['newres_to_show_flag'] = true;
                $no_class .= ' newres';
            }
            // SPM
            if ($_conf['expack.spm.enabled']) {
                $no_onclick = " onclick=\"{$this->spmObjName}.show({$i},'{$res_id}',event)\"";
            }
            // 番号
            $tores .= "<span class=\"{$no_class}\"{$no_onclick}>{$i}</span>";
            // 名前
            $tores .= " <span class=\"name\">{$name}</span>";
            // メール
            $tores .= " <span class=\"mail\">{$mail}</span>";
            // 日付とID
            $tores .= " <span class=\"date-id\">{$date_id}</span></div>\n";
            // 内容
            $tores .= "<div class=\"message\">{$msg}</div></div>\n";
        } else {
            // 番号(オンザフライ時)
            if ($this->thread->onthefly) {
                $GLOBALS['newres_to_show_flag'] = true;
                $tores .= "<div id=\"{$res_id}\" name=\"{$res_id}\">[<font color=\"{$STYLE['mobile_read_onthefly_color']}'\">{$i}</font>]";
                // 番号(新着レス時)
            } elseif ($i > $this->thread->readnum) {
                $GLOBALS['newres_to_show_flag'] = true;
                $tores .= "<div id=\"{$res_id}\" name=\"{$res_id}\">[<font color=\"{$STYLE['mobile_read_newres_color']}\">{$i}</font>]";
                // 番号
            } else {
                $tores .= "<div id=\"{$res_id}\" name=\"{$res_id}\">[{$i}]";
            }
            // 名前
            if ($name) {
                $tores .= "{$name}: ";
            }
            // メール
            if ($mail) {
                $tores .= "{$mail}: ";
            }
            // 日付とID
            $tores .= "{$date_id}<br>\n";
            // 内容
            $tores .= "{$msg}</div><hr>\n";
        }
        // まとめてフィルタ色分け
        if ($pattern) {
            if (is_string($_conf['k_filter_marker'])) {
                $tores = StrCtl::filterMarking($pattern, $tores, $_conf['k_filter_marker']);
            } else {
                $tores = StrCtl::filterMarking($pattern, $tores);
            }
        }
        // 全角英数スペースカナを半角に
        if (!empty($_conf['mobile.save_packet'])) {
            $tores = mb_convert_kana($tores, 'rnsk');
            // CP932 だと ask で < を < に変換してしまうようだ
        }
        return $tores;
    }
Exemplo n.º 7
0
    /**
     * レス引用HTMLを生成取得する
     *
     * @access  private
     * @param   string   $resline
     * @return  string
     */
    function qRes($resline, $i, $hideid)
    {
        global $_conf;
        $resar = $this->thread->explodeDatLine($resline);
        $name = isset($resar[0]) ? $resar[0] : '';
        $mail = isset($resar[1]) ? $resar[1] : '';
        $date_id = isset($resar[2]) ? $resar[2] : '';
        $msg = isset($resar[3]) ? $resar[3] : '';
        if (!empty($this->BBS_NONAME_NAME) and $this->BBS_NONAME_NAME == $name) {
            $name = '';
        }
        // 現在の年号は省略カットする。月日の先頭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 (false !== $this->checkAborns($name, $mail, $date_id, $msg)) {
            $name = $date_id = $msg = 'あぼーん';
            $mail = '';
        } else {
            $isNgName = false;
            $isNgMail = false;
            $isNgId = false;
            $isNgMsg = false;
            if (false !== $this->ngAbornCheck('ng_name', strip_tags($name))) {
                $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);
            $has_aa = 0;
            // 1:弱反応, 2:強反応(AA略)
            $msg = $this->transMsg($msg, $i, $has_aa);
            // メッセージ変換
            // BEプロファイルリンク変換
            $date_id = $this->replaceBeId($date_id, $i);
            $a_ng_msg_hs = htmlspecialchars($a_ng_msg, ENT_QUOTES);
            // NG変換
            $kakunin_msg_ht = <<<EOP
<a href="{$_conf['read_php']}?host={$this->thread->host}&amp;bbs={$this->thread->bbs}&amp;key={$this->thread->key}&amp;ls={$i}&amp;k_continue=1&amp;nong=1{$_conf['k_at_a']}">確</a>
EOP;
            // NGメッセージ変換
            if ($isNgMsg) {
                $msg = <<<EOMSG
<s><font color="{$STYLE['read_ngword']}">NG:{$a_ng_msg_hs}</font></s> {$kakunin_msg_ht}
EOMSG;
            }
            // NGネーム変換
            if ($isNgName) {
                $name = <<<EONAME
<s><font color="{$STYLE['read_ngword']}">{$name}</font></s>
EONAME;
                $msg = $kakunin_msg_ht;
                // NGメール変換
            } elseif ($isNgMail) {
                $mail = <<<EOMAIL
<s><font color="{$STYLE['read_ngword']}">{$mail}</font></s>
EOMAIL;
                $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 = <<<EOID
                <s><font color="{$STYLE['read_ngword']}">$date_id</font></s>
                EOID;
                */
                $msg = $kakunin_msg_ht;
            }
            // 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;
                        }
                    }
                }
            }
        }
        // $toresにまとめて出力
        //$tores = "<input type=\"submit\" value=\"閉じる\" onClick=\"hideResPopUp('{$hideid}')\"><br>\n";
        $tores = "<img class=\"close\" src=\"iui/icon_close.png\" onClick=\"hideResPopUp('{$hideid}')\">\n";
        $tores .= " {$i} :";
        // 番号
        $tores .= "<b>{$name}</b> :";
        // 名前
        if ($mail) {
            $tores .= $mail . " :";
        }
        // メール
        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}\n";
        // 内容  iPhone用にhr削除
        // まとめてフィルタ色分け
        if ($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;
    }
Exemplo n.º 8
0
 /**
  * レス引用HTMLを生成取得する
  *
  * @access  private
  * @param   string   $resline
  * @return  string
  */
 function qRes($resline, $i, $hideid)
 {
     global $_conf;
     $resar = $this->thread->explodeDatLine($resline);
     $name = isset($resar[0]) ? $resar[0] : '';
     $mail = isset($resar[1]) ? $resar[1] : '';
     $date_id = isset($resar[2]) ? $resar[2] : '';
     $msg = isset($resar[3]) ? $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 (false !== $this->checkAborns($nameForAborn, $mail, $date_id, $msg)) {
         $name = $date_id = $msg = 'あぼーん';
         $mail = '';
     } else {
         $isNgName = false;
         $isNgMail = false;
         $isNgId = false;
         $isNgMsg = false;
         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;
         }
         $name = $this->transName($name, $i);
         $has_aa = 0;
         // 1:弱反応, 2:強反応(AA略)
         $msg = $this->transMsg($msg, $i, $has_aa);
         // メッセージ変換
         // 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;
         }
         // 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;
                     }
                 }
             }
         }
     }
     // $toresにまとめて出力
     //$tores = "<input type=\"submit\" value=\"閉じる\" onClick=\"hideResPopUp('{$hideid}')\"><br>\n";
     $tores = "<img class=\"close\" src=\"iui/icon_close.png\" onClick=\"hideResPopUp('{$hideid}')\">\n";
     $tores .= " {$i} :";
     // 番号
     // 名前
     //$tores .= "<b>$name</b> :";
     if (strlen($name) > 0) {
         $tores .= '<span class="tname">' . $name . '</span> :';
     }
     if ($mail) {
         $tores .= $mail . " :";
     }
     // メール
     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}\n";
     // 内容  iPhone用にhr削除
     // まとめてフィルタ色分け
     if ($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;
 }