Ejemplo n.º 1
0
 /**
  * IDストーカーに対応しているか調べる
  * $boardがなければloadも実行される
  */
 function isEnable()
 {
     if ($this->host) {
         if (!P2Util::isHost2chs($this->host)) {
             return false;
         }
     }
     return preg_match('/plus$/', $this->bbs);
 }
Ejemplo n.º 2
0
 /**
  * @access  protected
  * @return  void
  */
 function setBbsNonameName()
 {
     if (P2Util::isHost2chs($this->thread->host)) {
         require_once P2_LIB_DIR . '/SettingTxt.php';
         $SettingTxt = new SettingTxt($this->thread->host, $this->thread->bbs);
         if (array_key_exists('BBS_NONAME_NAME', $SettingTxt->setting_array)) {
             $this->BBS_NONAME_NAME = $SettingTxt->setting_array['BBS_NONAME_NAME'];
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * 必死チェッカーに対応しているか調べる
  * $boardがなければloadも実行される
  */
 function isEnable()
 {
     if ($this->host) {
         if (!P2Util::isHost2chs($this->host)) {
             return false;
         }
     }
     if (!isset($this->boards)) {
         $this->load();
     }
     $this->enabled = in_array($this->bbs, $this->boards) ? true : false;
     return $this->enabled;
 }
Ejemplo n.º 4
0
 /**
  * @constructor
  */
 function ShowThreadK(&$aThread)
 {
     parent::ShowThread($aThread);
     global $_conf;
     $this->url_handlers = array(array('this' => 'plugin_link2ch'), array('this' => 'plugin_linkMachi'), array('this' => 'plugin_linkJBBS'), array('this' => 'plugin_link2chKako'), array('this' => 'plugin_link2chSubject'), array('this' => 'plugin_linkReadCgi'));
     if ($_conf['k_use_picto']) {
         $this->url_handlers[] = array('this' => 'plugin_viewImage');
     }
     $_conf['link_youtube'] and $this->url_handlers[] = array('this' => 'plugin_linkYouTube');
     $_conf['link_niconico'] and $this->url_handlers[] = array('this' => 'plugin_linkNicoNico');
     $this->url_handlers[] = array('this' => 'plugin_linkURL');
     if (!$_conf['k_bbs_noname_name'] and P2Util::isHost2chs($this->thread->host)) {
         require_once P2_LIB_DIR . '/SettingTxt.php';
         $st = new SettingTxt($this->thread->host, $this->thread->bbs);
         if (!empty($st->setting_array['BBS_NONAME_NAME'])) {
             $this->BBS_NONAME_NAME = $st->setting_array['BBS_NONAME_NAME'];
         }
     }
 }
Ejemplo n.º 5
0
 /**
  * 元スレURLを返す
  *
  * @param   bool    $force_pc   trueなら携帯モードでもPC用の元スレURLを返す
  * @param   string  $ls         レス表示番号or範囲。nullならlsプロパティを使う
  *                              掲示板によっては無視される場合もある
  * @return  string  元スレURL
  */
 public function getMotoThread($force_pc = false, $ls = null)
 {
     global $_conf;
     if ($force_pc) {
         $mobile = false;
     } elseif ($_conf['iphone']) {
         $mobile = false;
     } elseif ($_conf['ktai']) {
         $mobile = true;
     } else {
         $mobile = false;
     }
     if ($ls === null) {
         $ls = $this->ls;
     }
     // 2ch系
     if (P2Util::isHost2chs($this->host)) {
         // PC
         if (!$mobile) {
             $motothre_url = "http://{$this->host}/test/read.cgi/{$this->bbs}/{$this->key}/{$ls}";
             // 携帯
         } else {
             if (P2Util::isHostBbsPink($this->host)) {
                 //$motothre_url = "http://{$this->host}/test/r.i/{$this->bbs}/{$this->key}/{$ls}";
                 $motothre_url = "http://speedo.ula.cc/test/r.so/{$this->host}/{$this->bbs}/{$this->key}/{$ls}";
             } else {
                 $mail = rawurlencode($_conf['my_mail']);
                 // c.2chはl指定に非対応なので、代わりにn
                 $ls = substr($ls, 0, 1) == 'l' ? 'n' : $ls;
                 $motothre_url = "http://c.2ch.net/test/--3!mail={$mail}/{$this->bbs}/{$this->key}/{$ls}";
             }
         }
         // まちBBS
     } elseif (P2Util::isHostMachiBbs($this->host)) {
         if ($mobile) {
             $motothre_url = "http://{$this->host}/bbs/read.pl?IMODE=TRUE&BBS={$this->bbs}&KEY={$this->key}";
         } else {
             $motothre_url = "http://{$this->host}/bbs/read.cgi/{$this->bbs}/{$this->key}/{$ls}";
         }
         // まちびねっと
     } elseif (P2Util::isHostMachiBbsNet($this->host)) {
         $motothre_url = "http://{$this->host}/test/read.cgi?bbs={$this->bbs}&key={$this->key}";
         if ($mobile) {
             $motothre_url .= '&imode=true';
         }
         // JBBSしたらば
     } elseif (P2Util::isHostJbbsShitaraba($this->host)) {
         list($host, $category) = explode('/', P2Util::adjustHostJbbs($this->host), 2);
         $bbs_cgi = $mobile ? 'i.cgi' : 'read.cgi';
         $motothre_url = "http://{$host}/bbs/{$bbs_cgi}/{$category}/{$this->bbs}/{$this->key}/{$ls}";
         // その他
     } else {
         $motothre_url = "http://{$this->host}/test/read.cgi/{$this->bbs}/{$this->key}/{$ls}";
     }
     return $motothre_url;
 }
Ejemplo n.º 6
0
 /**
  * datlineをexplodeする
  *
  * @access  public
  * @param   string  $aline
  * @return  array
  */
 function explodeDatLine($aline)
 {
     global $_conf;
     if (!($aline = rtrim($aline))) {
         return array();
     }
     $stripped = false;
     if ($_conf['strip_tags_trusted_dat'] || !P2Util::isTrustedHost($this->host)) {
         require_once P2_LIB_DIR . '/HTML/StripTags.php';
         $HTML_StripTags = new HTML_StripTags();
         $aline = $HTML_StripTags->cleanup($aline);
         $stripped = true;
     }
     if ($this->dat_type == '2ch_old') {
         $parts = explode(',', $aline);
     } else {
         $parts = explode('<>', $aline);
     }
     if (!$stripped && P2Util::isHost2chs($this->host)) {
         // iframe を削除。2chが正常化して必要なくなったらこのコードは外したい。2005/05/19
         isset($parts[3]) and $parts[3] = preg_replace('{<(iframe|script)( .*?)?>.*?</\\1>}i', '', $parts[3]);
     }
     return $parts;
 }
Ejemplo n.º 7
0
$post_backup_key = PostDataStore::getKeyForBackup($host, $bbs, $key, !empty($_REQUEST['newthread']));
$post_config_key = PostDataStore::getKeyForConfig($host, $bbs);
// 設定を保存
PostDataStore::set($post_config_key, array('beres' => !empty($_REQUEST['beres']), 'p2res' => !empty($_REQUEST['p2res'])));
//================================================================
// 書き込み処理
//================================================================
// 書き込みを一時的に保存
PostDataStore::set($post_backup_key, $post_cache);
// ポスト実行
if (!empty($_POST['p2res']) && empty($_POST['newthread'])) {
    // 公式p2で書き込み
    $posted = postIt2($host, $bbs, $key, $FROM, $mail, $MESSAGE);
} else {
    // cookie 読み込み
    $cookie_key = $_login->user_u . '/' . P2Util::normalizeHostName(P2Util::isHostBbsPink($host) ? 'www.bbspink.com' : P2Util::isHost2chs($host) ? 'www.2ch.net' : $host);
    // 忍法帳対応
    if ($p2cookies = CookieDataStore::get($cookie_key)) {
        if (is_array($p2cookies)) {
            if (array_key_exists('expires', $p2cookies)) {
                // 期限切れなら破棄
                if (time() > strtotime($p2cookies['expires'])) {
                    CookieDataStore::delete($cookie_key);
                    $p2cookies = null;
                }
            }
        } else {
            CookieDataStore::delete($cookie_key);
            $p2cookies = null;
        }
    } else {
Ejemplo n.º 8
0
/**
 * sb_print - スレッド一覧を表示する (<tr>〜</tr>)
 */
function sb_print_k($aThreadList)
{
    global $_conf, $sb_view, $p2_setting, $STYLE;
    global $sb_view;
    //=================================================
    if (!$aThreadList->threads) {
        if ($_conf['iphone']) {
            if ($aThreadList->spmode == 'fav' && $sb_view == 'shinchaku') {
                echo '<p class="empty">お気にスレに新着なかったぽ</p>';
            } else {
                echo '<p class="empty">該当サブジェクトはなかったぽ</p>';
            }
        } else {
            if ($aThreadList->spmode == 'fav' && $sb_view == 'shinchaku') {
                echo '<p>お気にスレに新着なかったぽ</p>';
            } else {
                echo '<p>該当サブジェクトはなかったぽ</p>';
            }
        }
        return;
    }
    // 変数 ================================================
    $only_one_bool = false;
    $ita_name_bool = false;
    $sortq_spmode = '';
    $sortq_host = '';
    $sortq_ita = '';
    // >>1
    if (strpos($aThreadList->bbs, 'news') !== false || $aThreadList->bbs == 'bizplus') {
        // 倉庫は除く
        if ($aThreadList->spmode != 'soko') {
            $only_one_bool = true;
        }
    }
    // 板名
    if ($aThreadList->spmode and $aThreadList->spmode != 'taborn' and $aThreadList->spmode != 'soko') {
        $ita_name_bool = true;
    }
    $norefresh_q = '&amp;norefresh=1';
    // ソート ==================================================
    // スペシャルモード時
    if ($aThreadList->spmode) {
        $sortq_spmode = "&amp;spmode={$aThreadList->spmode}";
        // あぼーんなら
        if ($aThreadList->spmode == "taborn" or $aThreadList->spmode == "soko") {
            $sortq_host = "&amp;host={$aThreadList->host}";
            $sortq_ita = "&amp;bbs={$aThreadList->bbs}";
        }
    } else {
        $sortq_host = "&amp;host={$aThreadList->host}";
        $sortq_ita = "&amp;bbs={$aThreadList->bbs}";
    }
    $midoku_sort_ht = "<a href=\"{$_conf['subject_php']}?sort=midoku{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}{$_conf['k_at_a']}\">新着</a>";
    //=====================================================
    // ボディ
    //=====================================================
    // spmodeがあればクエリー追加
    if ($aThreadList->spmode) {
        $spmode_q = "&amp;spmode={$aThreadList->spmode}";
    }
    if ($aThreadList->spmode == 'palace' || $aThreadList->spmode == 'soko' || $aThreadList->spmode == 'taborn') {
        $show_unum = false;
    } else {
        $show_unum = true;
    }
    if ($_conf['iphone']) {
        echo '<ul class="subject">';
    }
    $i = 0;
    foreach ($aThreadList->threads as $aThread) {
        $i++;
        $midoku_ari = '';
        $anum_ht = '';
        //#r1
        $htm = array('ita' => '', 'rnum' => '', 'unum' => '', 'sim' => '');
        $bbs_q = '&amp;bbs=' . $aThread->bbs;
        $key_q = '&amp;key=' . $aThread->key;
        $host_bbs_key_q = 'host=' . $aThread->host . $bbs_q . $key_q;
        $offline_q = '';
        if ($aThreadList->spmode != 'taborn') {
            if (!$aThread->torder) {
                $aThread->torder = $i;
            }
        }
        // 新着レス数 =============================================
        // 既得済み
        if ($show_unum && $aThread->isKitoku()) {
            $htm['unum'] = "{$aThread->unum}";
            // iPhone用
            if ($_conf['iphone']) {
                $classunum = 'num unread';
                // 新着あり
                if ($aThread->unum >= 1) {
                    $midoku_ari = true;
                    $classunum .= ' new';
                }
                // subject.txtにない時
                if (!$aThread->isonline) {
                    $htm['unum'] = '-';
                    $classunum .= ' offline';
                }
                $htm['unum'] = "<span class=\"{$classunum}\">{$htm['unum']}</span>";
            } else {
                $anum_ht = sprintf('#r%d', min($aThread->rescount, $aThread->rescount - $aThread->nunum + 1 - $_conf['respointer']));
                // 新着あり
                if ($aThread->unum >= 1) {
                    $midoku_ari = true;
                    $htm['unum'] = "<font color=\"{$STYLE['mobile_subject_newres_color']}\">{$aThread->unum}</font>";
                }
                // subject.txtにない時
                if (!$aThread->isonline) {
                    $htm['unum'] = '-';
                }
                $htm['unum'] = "[{$htm['unum']}]";
            }
        }
        // 新規スレ
        if ($_conf['iphone']) {
            $classtitle = 'title';
            if ($aThread->new) {
                $classtitle .= ' new';
            }
        } else {
            if ($show_unum && $aThread->new) {
                $htm['unum'] = "<font color=\"{$STYLE['mobile_subject_newthre_color']}\">新</font>";
            }
        }
        // 総レス数 =============================================
        $rescount_ht = "{$aThread->rescount}";
        // 板名 ============================================
        if ($ita_name_bool) {
            $ita_name = $aThread->itaj ? $aThread->itaj : $aThread->bbs;
            $ita_name_hd = p2h($ita_name);
            // 全角英数カナスペースを半角に
            if (!empty($_conf['mobile.save_packet'])) {
                $ita_name_hd = mb_convert_kana($ita_name_hd, 'rnsk');
            }
            //$htm['ita'] = "<a href=\"{$_conf['subject_php']}?host={$aThread->host}{$bbs_q}{$_conf['k_at_a']}\">{$ita_name_hd}</a>)";
            //$htm['ita'] = " ({$ita_name_hd})";
            $htm['ita'] = $ita_name_hd;
        }
        // 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_bbs_key_q}{$_conf['k_at_a']}\">{$torder_st}</a>";
        */
        $torder_ht = $aThread->torder;
        // title =================================================
        $rescount_q = '&amp;rescount=' . $aThread->rescount;
        // dat倉庫 or 殿堂なら
        if ($aThreadList->spmode == 'soko' || $aThreadList->spmode == 'palace') {
            $rescount_q = '';
            $offline_q = '&amp;offline=true';
            $anum_ht = '';
            // subject.txt にない場合
        } elseif (!$aThread->isonline) {
            $offline_q = '&amp;offline=true';
        }
        // タイトル未取得なら
        $ttitle_ht = $aThread->ttitle_ht;
        if (strlen($ttitle_ht) == 0) {
            // 見かけ上のタイトルなので携帯対応URLである必要はない
            $ttitle_ht = p2h($aThread->getMotoThread(true, ''));
        }
        // 全角英数カナスペースを半角に
        if (!empty($_conf['mobile.save_packet'])) {
            $ttitle_ht = mb_convert_kana($ttitle_ht, 'rnsk');
        }
        if ($_conf['iphone']) {
            $htm['rnum'] = "<span class=\"num count\">{$rescount_ht}</span>";
            if ($aThread->similarity) {
                $htm['sim'] .= sprintf(' <span class="num score">%0.1f%%</span>', $aThread->similarity * 100);
            }
        } else {
            $htm['rnum'] = "({$rescount_ht})";
            if ($aThread->similarity) {
                $htm['sim'] .= sprintf(' %0.1f%%', $aThread->similarity * 100);
            }
        }
        $thre_url = "{$_conf['read_php']}?{$host_bbs_key_q}";
        if ($_conf['iphone']) {
            $thre_url .= '&amp;ttitle_en=' . UrlSafeBase64::encode($aThread->ttitle);
        }
        $thre_url .= "{$rescount_q}{$offline_q}{$_conf['k_at_a']}{$anum_ht}";
        // オンリー>>1
        $onlyone_url = "{$_conf['read_php']}?{$host_bbs_key_q}&amp;one=true&amp;k_continue=1{$_conf['k_at_a']}";
        if ($only_one_bool) {
            $one_ht = "<a href=\"{$onlyone_url}\">&gt;&gt;1</a>";
        }
        // >>1のみ, >>1から
        if (P2Util::isHost2chs($aThreadList->host) && !$aThread->isKitoku()) {
            switch ($_conf['mobile.sb_show_first']) {
                case 1:
                    $thre_url = $onlyone_url;
                    break;
                case 2:
                    $thre_url .= '&amp;ls=1-';
                    break;
                default:
                    $thre_url .= '&amp;ls=l' . $_conf['mobile.rnum_range'];
            }
        }
        // アクセスキー
        /*
        $access_ht = '';
        if ($aThread->torder >= 1 and $aThread->torder <= 9) {
            $access_ht = " {$_conf['accesskey']}=\"{$aThread->torder}\"";
        }
        */
        //====================================================================================
        // スレッド一覧 table ボディ HTMLプリント <tr></tr>
        //====================================================================================
        //ボディ
        if ($_conf['iphone']) {
            // information bubble用の隠しスレッド情報。
            // torderの指示子が"%d"でないのはmerge_favitaのため
            $thre_info = sprintf('[%s] %s (%01.1fレス/日)', $aThread->torder, date('y/m/d H:i', $aThread->key), $aThread->dayres);
            if ($htm['ita'] !== '') {
                $htm['ita'] = "<span class=\"ita\">{$htm['ita']}</span>";
            }
            echo <<<EOP
<li><a href="{$thre_url}"><span class="info">{$thre_info}</span> {$htm['unum']} <span class="{$classtitle}">{$ttitle_ht}</span> {$htm['rnum']} {$htm['sim']} {$htm['ita']}</a></li>

EOP;
        } else {
            echo <<<EOP
<div>{$htm['unum']}{$aThread->torder}.<a href="{$thre_url}">{$ttitle_ht}</a> {$htm['rnum']} {$htm['sim']} {$htm['ita']}</div>

EOP;
        }
    }
    if ($_conf['iphone']) {
        echo '</ul>';
    }
}
Ejemplo n.º 9
0
 * for subject.php
 */
//===============================================================
// HTML表示用変数
//===============================================================
$newtime = date("gis");
$norefresh_q = "&amp;norefresh=1";
// {{{ ページタイトル部分URL設定
$p2_subject_url = "{$_conf['subject_php']}?host={$aThreadList->host}&amp;bbs={$aThreadList->bbs}{$_conf['k_at_a']}";
// 通常 板
if (!$aThreadList->spmode) {
    // 検索語あり
    if (isset($GLOBALS['word']) && strlen($GLOBALS['word']) > 0 || !empty($GLOBALS['wakati_words'])) {
        $ptitle_url = $p2_subject_url;
        // 2ch系
    } elseif (P2Util::isHost2chs($aThreadList->host)) {
        if (P2Util::isHostBbsPink($aThreadList->host)) {
            //$ptitle_url = "http://{$aThreadList->host}/{$aThreadList->bbs}/i/";
            $ptitle_url = "http://speedo.ula.cc/test/p.so/{$aThreadList->host}/{$aThreadList->bbs}/";
        } else {
            $ptitle_url = "http://c.2ch.net/test/-/{$aThreadList->bbs}/i";
        }
        // その他
    } else {
        $ptitle_url = "http://{$aThreadList->host}/{$aThreadList->bbs}/";
        // 特別なパターン index2.html
        // match登録よりheadなげて聞いたほうがよさそうだが、ワンレスポンス増えるのが困る
        if (!strcasecmp($aThreadList->host, 'livesoccer.net')) {
            $ptitle_url .= 'index2.html';
        }
    }
Ejemplo n.º 10
0
// ログありなしフラグセット
if (file_exists($aThread->keydat) or file_exists($aThread->keyidx)) {
    $existLog = true;
}
//=================================================================
// HTMLプリント
//=================================================================
if (!$_conf['ktai']) {
    $target_read_at = ' target="read"';
    $target_sb_at = ' target="subject"';
} else {
    $target_read_at = '';
    $target_sb_at = '';
}
$motothre_url = $aThread->getMotoThread();
if (P2Util::isHost2chs($aThread->host)) {
    $motothre_org_url = $aThread->getMotoThread(true);
} else {
    $motothre_org_url = $motothre_url;
}
if ($title_msg) {
    $hc['title'] = $title_msg;
} else {
    $hc['title'] = "info - {$hc['ttitle_name']}";
}
$hs = array_map('htmlspecialchars', $hc);
if ($_GET['i']) {
    P2Util::header_nocache();
    echo $_conf['doctype'];
    echo <<<EOHEADER
<html>
Ejemplo n.º 11
0
/**
 * 2ch●書き込み
 *
 * @return  string  HTML
 */
function _getMaruKakikoHtml($host)
{
    global $_conf;
    $maru_kakiko_ht = '';
    if (P2Util::isHost2chs($host) and file_exists($_conf['sid2ch_php'])) {
        $maru_kakiko_ht = sprintf('<span>2ch●ID: <input id="maru_kakiko" name="maru_kakiko" type="checkbox" value="1"%s></span>', $_conf['maru_kakiko'] ? ' checked' : '');
    }
    return $maru_kakiko_ht;
}
Ejemplo n.º 12
0
/**
 * スレッド一覧を表示する (<tr>〜</tr>)
 *
 * @access  public
 * @return  void
 */
function sb_print_k(&$aThreadList)
{
    global $_conf, $sb_view, $p2_setting, $STYLE;
    global $sb_view;
    if (!$aThreadList->threads) {
        if ($aThreadList->spmode == 'fav' && $sb_view == 'shinchaku') {
            if (UA::isIPhoneGroup()) {
                ?>
<p>お気にスレに新着なかったぽ</p><?php 
            } else {
                ?>
<p>お気にスレに新着なかったぽ</p><?php 
            }
        } else {
            if (UA::isIPhoneGroup()) {
                ?>
<p>該当サブジェクトはなかったぽ</p><?php 
            } else {
                ?>
<p>該当サブジェクトはなかったぽ</p><?php 
            }
        }
        return;
    }
    // 変数 ================================================
    // >>1 表示
    $onlyone_bool = false;
    /*
    // ニュース系の板なら適用
    if (ereg('news', $aThreadList->bbs) || $aThreadList->bbs == 'bizplus' || $aThreadList->spmode == 'news') {
        // 倉庫は除く
        if ($aThreadList->spmode != "soko") {
            $onlyone_bool = true;
        }
    }
    */
    // 板名
    if ($aThreadList->spmode and $aThreadList->spmode != "taborn" and $aThreadList->spmode != "soko") {
        $ita_name_bool = true;
    } else {
        $ita_name_bool = false;
    }
    /*
    // {{{ 新着ソート(現在未使用)
    
    $qs = array(
        'sort'      => 'midoku',
        'norefresh' => '1',
        UA::getQueryKey() => UA::getQueryValue()
    );
    // スペシャルモード時
    if ($aThreadList->spmode) {
        $qs['spmode'] = $aThreadList->spmode;
        // あぼーんなら
        if ($aThreadList->spmode == "taborn" or $aThreadList->spmode == "soko") {
            $qs['host'] = $aThreadList->host;
            $qs['bbs']  = $aThreadList->bbs;
        }
    } else {
        $qs['host'] = $aThreadList->host;
        $qs['bbs']  = $aThreadList->bbs;
    }
    
    $midoku_sort_ht = P2View::tagA(
        UriUtil::buildQueryUri($_conf['subject_php'], $qs),
        '新着'
    );
    
    // }}}
    */
    //=====================================================
    // ボディ
    //=====================================================
    // spmodeがあればクエリー追加
    if ($aThreadList->spmode) {
        $spmode_q = "&amp;spmode={$aThreadList->spmode}";
    }
    $i = 0;
    foreach ($aThreadList->threads as $aThread) {
        $i++;
        $midoku_ari = "";
        $anum_ht = "";
        // #r1
        $bbs_q = "&amp;bbs=" . $aThread->bbs;
        $key_q = "&amp;key=" . $aThread->key;
        if ($aThreadList->spmode != "taborn") {
            if (!$aThread->torder) {
                $aThread->torder = $i;
            }
        }
        // {{{ 新着レス数
        $unum_ht = '';
        // 既得済み
        if ($aThread->isKitoku()) {
            $unum_ht = "{$aThread->unum}";
            $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;
                if (UA::isIPhoneGroup()) {
                    $unum_ht = "{$aThread->unum}";
                } else {
                    $unum_ht = "<font color=\"#ff6600\">{$aThread->unum}</font>";
                }
            }
            // subject.txtにない時
            if (!$aThread->isonline) {
                // 誤動作防止のためログ削除操作をロック
                $unum_ht = "-";
            }
            if (UA::isIPhoneGroup()) {
                $unum_ht = '<font class="unum">' . $unum_ht . '</font>';
            } else {
                $unum_ht = '[' . $unum_ht . ']';
            }
        }
        // }}}
        // 新規スレ
        $unum_new_ht = '';
        if ($aThread->new) {
            if (UA::isIPhoneGroup()) {
                // $unum_ht = '<font color="#0000ff">●</font>';
                $unum_ht = '';
                $unum_new_ht = '<img class="unew" src="iui/icon_new.png">';
            } else {
                $unum_ht = '<font color="#ff0000">新</font>';
            }
        }
        // {{{ 板名
        $ita_name_ht = '';
        if ($ita_name_bool) {
            $ita_name = $aThread->itaj ? $aThread->itaj : $aThread->bbs;
            // 全角英数カナスペースを半角に
            if ($_conf['k_save_packet']) {
                $ita_name = mb_convert_kana($ita_name, 'rnsk');
            }
            /*
            $ita_name_ht = sprintf('(%s)',
                P2View::tagA(
                    UriUtil::buildQueryUri($_conf['subject_php'],
                        array(
                            'host' => $aThread->host,
                            'bbs'  => $aThread->bbs,
                            UA::getQueryKey() => UA::getQueryValue()
                        )
                    ),
                    hs($ita_name)
                )
            );
            */
            if (UA::isIPhoneGroup()) {
                $ita_name_ht = sprintf(' <span class="ita">(%s)</span>', hs($ita_name));
            } else {
                $ita_name_ht = sprintf('(%s)', hs($ita_name));
            }
        }
        // }}}
        // 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}{$_conf['k_at_a']}\">{$torder_st}</a>";
        */
        $torder_ht = $aThread->torder;
        // title =========================================================
        $rescount_qs = array('rc' => $aThread->rescount);
        $offline_qs = array();
        // dat倉庫 or 殿堂なら
        if ($aThreadList->spmode == 'soko' || $aThreadList->spmode == 'palace') {
            $rescount_qs = array();
            $offline_qs = array('offline' => '1');
            $anum_ht = '';
        }
        // タイトル未取得なら
        if (!$aThread->ttitle_ht) {
            // 見かけ上のタイトルなので携帯対応URLである必要はない
            //if (P2Util::isHost2chs($aThread->host)) {
            //    $aThread->ttitle_ht = "http://c.2ch.net/z/-/{$aThread->bbs}/{$aThread->key}/";
            //} else {
            $aThread->ttitle_ht = "http://{$aThread->host}/test/read.cgi/{$aThread->bbs}/{$aThread->key}/";
            //}
        }
        // 全角英数カナスペースを半角に
        if ($_conf['k_save_packet']) {
            $aThread->ttitle_ht = mb_convert_kana($aThread->ttitle_ht, 'rnsk');
        }
        // 総レス数
        if (UA::isIPhoneGroup()) {
            $rescount_ht = '<font class="sbnum"> ' . $aThread->rescount . '</font>';
        } else {
            $rescount_ht = ' (' . $aThread->rescount . ')';
        }
        $similarity_ht = '';
        if ($aThread->similarity) {
            $similarity_ht = sprintf(' %0.1f%%', $aThread->similarity * 100);
        }
        // 新規スレ
        if ($aThread->new) {
            $classtitle_q = ' class="thre_title_new"';
        } else {
            $classtitle_q = ' class="thre_title"';
        }
        $thre_url = UriUtil::buildQueryUri($_conf['read_php'], array_merge(array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, UA::getQueryKey() => UA::getQueryValue()), $rescount_qs, $offline_qs)) . $anum_ht;
        // オンリー>>1
        $onlyone_url = UriUtil::buildQueryUri($_conf['read_php'], array_merge(array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'onlyone' => '1', 'k_continue' => '1', UA::getQueryKey() => UA::getQueryValue()), $rescount_qs));
        if ($onlyone_bool) {
            $one_ht = "<a href=\"{$onlyone_url}\">&gt;&gt;1</a>";
        }
        if (P2Util::isHost2chs($aThreadList->host) and !$aThread->isKitoku()) {
            if ($GLOBALS['_conf']['k_sb_show_first'] == 1) {
                $thre_url = $onlyone_url;
            } elseif ($GLOBALS['_conf']['k_sb_show_first'] == 2) {
                $thre_url .= '&amp;ls=1-';
            }
        }
        // アクセスキー
        /*
        $access_ht = "";
        if ($aThread->torder >= 1 and $aThread->torder <= 9) {
            $access_ht = " {$_conf['accesskey_for_k']}=\"{$aThread->torder}\"";
        }
        */
        if (UA::isIPhoneGroup()) {
            // お気にマーク設定
            $favvalue = !empty($aThread->fav) ? 0 : 1;
            $favtitle = $favvalue ? 'お気にスレに追加' : 'お気にスレから外す';
            $itaj_hs = htmlspecialchars($aThread->itaj, ENT_QUOTES);
            $favmark = !empty($aThread->fav) ? '★' : '+';
            if ($favmark == '★') {
                $favmark = '<img src="iui/icon_del.png">';
            } else {
                $favmark = '<img src="iui/icon_add.png">';
            }
            $sid_qs = array();
            $sid_q = '';
            if (defined('SID') && strlen(SID)) {
                $sid_qs[session_name()] = session_id();
                $sid_q = hs('&' . session_name() . '=' . session_id());
            }
            $setFavUri = UriUtil::buildQueryUri('info_i.php', array_merge(array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'ttitle_en' => base64_encode($aThread->ttitle), 'setfav' => $favvalue), $sid_qs));
            $setFavUri_hs = hs($setFavUri);
        }
        //====================================================================================
        // スレッド一覧 table ボディ HTMLプリント <tr></tr>
        //====================================================================================
        if (UA::isIPhoneGroup()) {
            ?>
<li><?php 
            echo "<span class=\"plus\" id=\"{$aThread->torder}\" ><a href=\"{$setFavUri_hs}\" target=\"info\" onClick=\"return setFavJsNoStr('host={$aThread->host}{$bbs_q}{$key_q}{$ttitle_en_q}{$sid_q}', '{$favvalue}', {$STYLE['info_pop_size']}, 'read', 'this',{$aThread->torder});\" title=\"{$favtitle}\">{$favmark}</a></span>";
            // ボディ
            echo <<<EOP
 <a href="{$thre_url}" class="ttitle">{$unum_new_ht}{$aThread->ttitle_ht}{$ita_name_ht}{$rescount_ht}{$similarity_ht}</a>{$unum_ht}</li>
EOP;
        } else {
            echo <<<EOP
<div>
    {$unum_ht}{$aThread->torder}.<a href="{$thre_url}">{$aThread->ttitle_ht}{$rescount_ht}{$similarity_ht}</a>{$ita_name_ht}
</div>
EOP;
        }
    }
}
Ejemplo n.º 13
0
Archivo: post.php Proyecto: poppen/p2
/**
 * p2 sambaに引っかかっていたら、エラーメッセージHTMLを返す
 *
 * @return  string|null
 */
function _getP2SambaErrorMsgHtml($host, $bbs)
{
    global $_conf;
    $kisei_second = 10;
    $samba24 = null;
    if (P2Util::isHost2chs($host)) {
        if (!empty($_POST['maru_kakiko']) and file_exists($_conf['sid2ch_php'])) {
            // samba24スルー
        } else {
            if ($r = P2Util::getSamba24TimeCache($host, $bbs)) {
                $kisei_second = $r;
                $samba24 = true;
            }
        }
    }
    //if (_isSambaDeny($kisei_second)) { // 確認時間でチェックする場合
    if (_isDenyWithUpdateLastPostTime($kisei_second)) {
        // 試行時間でチェックする場合
        $samba24_msg = $samba24 ? '2chのsamba24設定 ' : '';
        return sprintf('p2 samba規制: 連続投稿はできません。(%s%d秒)', hs($samba24_msg), $kisei_second);
    }
    return null;
}
Ejemplo n.º 14
0
Archivo: P2Util.php Proyecto: poppen/p2
 /**
  * host が 信頼できる掲示板サイトなら true を返す
  *
  * @access  public
  * @return  boolean
  */
 function isTrustedHost($host)
 {
     return P2Util::isHost2chs($host) || P2Util::isHostBbsPink($host) || P2Util::isHostMachiBbs($host) || P2Util::isHostJbbsShitaraba($host);
 }
Ejemplo n.º 15
0
unset($post_cache['submit']);
if (!empty($_POST['newthread'])) {
    unset($post[$key_k]);
    $location_ht = "{$_conf['subject_php']}?host={$host}&amp;bbs={$bbs}{$_conf['k_at_a']}";
} else {
    unset($post[$subject_k]);
    $location_ht = "{$_conf['read_php']}?host={$host}&amp;bbs={$bbs}&amp;key={$key}&amp;ls={$rescount}-&amp;refresh=1&amp;nt={$newtime}{$_conf['k_at_a']}";
    if (!$_conf['iphone']) {
        $location_ht .= "#r{$rescount}";
    }
}
if (P2Util::isHostJbbsShitaraba($host)) {
    $post[$dir_k] = $dir;
}
// {{{ 2chで●ログイン中ならsid追加
if (!empty($_POST['maru']) and P2Util::isHost2chs($host) && file_exists($_conf['sid2ch_php'])) {
    // ログイン後、24時間以上経過していたら自動再ログイン
    if (file_exists($_conf['idpw2ch_php']) && filemtime($_conf['sid2ch_php']) < time() - 60 * 60 * 24) {
        require_once P2_LIB_DIR . '/login2ch.inc.php';
        login2ch();
    }
    include $_conf['sid2ch_php'];
    $post['sid'] = $SID2ch;
}
// }}}
if (!empty($_POST['p2_post_confirm_cookie'])) {
    $post_ignore_keys = array_merge($post_param_keys, $post_internal_keys, $post_optional_keys, $post_p2_flag_keys);
    foreach ($_POST as $k => $v) {
        if (!array_key_exists($k, $post) && !in_array($k, $post_ignore_keys)) {
            $post[$k] = $v;
        }
Ejemplo n.º 16
0
if (!$_conf['ktai']) {
    if ($_conf['editor_srcfix'] == 1 || $_conf['editor_srcfix'] == 2 && preg_match('/pc\\d+\\.2ch\\.net/', $host)) {
        $htm['src_fix'] = <<<EOP
<input type="checkbox" id="fix_source" name="fix_source" value="1"><label for="fix_source">src</label>
EOP;
    }
}
// }}}
// {{{ 書き込みプレビュー
$htm['dpreview_onoff'] = '';
$htm['dpreview_amona'] = '';
$htm['dpreview'] = '';
$htm['dpreview2'] = '';
if (!$_conf['ktai'] && $_conf['expack.editor.dpreview']) {
    $_dpreview_noname = 'null';
    if (P2Util::isHost2chs($host)) {
        $_dpreview_st = new SettingTxt($host, $bbs);
        $_dpreview_st->setSettingArray();
        if (!empty($_dpreview_st->setting_array['BBS_NONAME_NAME'])) {
            $_dpreview_noname = $_dpreview_st->setting_array['BBS_NONAME_NAME'];
            $_dpreview_noname = '"' . StrCtl::toJavaScript($_dpreview_noname) . '"';
        }
    }
    $_dpreview_hide = 'false';
    if ($_conf['expack.editor.dpreview'] == 2) {
        if (P2Util::isBrowserSafariGroup() && basename($_SERVER['SCRIPT_NAME']) != 'post_form.php') {
            $_dpreview_hide = 'true';
        }
        $_dpreview_pos = 'dpreview2';
    } else {
        $_dpreview_pos = 'dpreview';
Ejemplo n.º 17
0
 /**
  * datを走査してスレ立て時のホスト候補を検出する
  *
  * @param void
  * @return array
  */
 public function scanOriginalHosts()
 {
     if (P2Util::isHost2chs($this->host) && file_exists($this->keydat) && ($dat = file_get_contents($this->keydat))) {
         $bbs_re = preg_quote($this->bbs, '@');
         $pattern = "@/(\\w+\\.(?:2ch\\.net|bbspink\\.com))(?:/test/read\\.cgi)?/{$bbs_re}\\b@";
         if (preg_match_all($pattern, $dat, $matches, PREG_PATTERN_ORDER)) {
             $hosts = array_unique($matches[1]);
             $arKey = array_search($this->host, $hosts);
             if ($arKey !== false && array_key_exists($arKey, $hosts)) {
                 unset($hosts[$arKey]);
             }
             return $hosts;
         }
     }
     return array();
 }
Ejemplo n.º 18
0
 function getSamba($host, $bbs)
 {
     if (!P2Util::isHost2chs($host)) {
         return -1;
     }
     // 読み込んでいなければ読み込む
     if (!$this->isLoaded) {
         $this->load();
     }
     // 書き込んでいなければ残り0秒
     if ($this->data[$bbs]['write'] <= 0) {
         return 0;
     }
     // 規制0秒なら計算するまでもなく残り0秒
     if ($this->data[$bbs]['samba'] <= 0) {
         return 0;
     }
     // 残り時間
     $time = $this->data[$bbs]['write'] + $this->data[$bbs]['samba'] - time();
     return $time > 0 ? $time : 0;
 }
Ejemplo n.º 19
0
    if ($_conf['be_2ch_code'] && $_conf['be_2ch_mail']) {
        $htm['title_need_be'] = ' title="Be板につき、自動Be書き込みします"';
    } else {
        $htm['title_need_be'] = ' title="書き込むにはBeログインが必要です"';
    }
}
// PC用 sage checkbox
if (!$_conf['ktai']) {
    $on_check_sage = ' onChange="checkSage();"';
    $sage_cb_ht = <<<EOP
<input id="sage" type="checkbox" onClick="mailSage();">
EOP;
}
// {{{ 2ch●書き込み
$htm['maru_kakiko'] = '';
if (P2Util::isHost2chs($host) and file_exists($_conf['sid2ch_php'])) {
    $maru_kakiko_checked = empty($_conf['maru_kakiko']) ? '' : ' checked';
    $htm['maru_kakiko'] = <<<EOP
<span>2ch●ID: <input id="maru_kakiko" name="maru_kakiko" type="checkbox" value="1"{$maru_kakiko_checked}></span>
EOP;
}
// }}}
// {{{ソースコード補正用チェックボックス
$htm['src_fix'] = '';
if (!$_conf['ktai']) {
    if ($_conf['editor_srcfix'] == 1 || $_conf['editor_srcfix'] == 2 && preg_match('/pc\\d\\.2ch\\.net/', $host)) {
        $htm['src_fix'] = '<input type="checkbox" id="fix_source" name="fix_source" value="1">ソ\ースコード補正';
    }
}
// }}}
/*
Ejemplo n.º 20
0
Archivo: Thread.php Proyecto: poppen/p2
 /**
  * 元スレURLを返す
  *
  * @access  public
  * @param   boolean  $original  携帯でも2chのスレURLを返す
  * @return  string  URL
  */
 function getMotoThread($original = false)
 {
     global $_conf;
     // 携帯カスタマイズ指定
     if ($_conf['ktai'] && !$original && $_conf['k_motothre_external']) {
         $motothre_url = $this->compileMobile2chUri();
         // まちBBS
     } elseif (P2Util::isHostMachiBbs($this->host)) {
         // PC
         if (!$_conf['ktai'] || $original) {
             /*
             $motothre_url = sprintf(
                 'http://%s/bbs/read.cgi?BBS=%s&KEY=%s',
                 $this->host, rawurlencode($this->bbs), rawurlencode($this->key)
             );
             */
             $motothre_url = "http://{$this->host}/bbs/read.cgi/{$this->bbs}/{$this->key}/{$this->ls}";
             // 携帯
         } else {
             $motothre_url = sprintf('http://%s/bbs/read.cgi?IMODE=TRUE&BBS=%s&KEY=%s', $this->host, rawurlencode($this->bbs), rawurlencode($this->key));
         }
         // まちびねっと
     } elseif (P2Util::isHostMachiBbsNet($this->host)) {
         $motothre_url = sprintf('http://%s/test/read.cgi?bbs=%s&key=%s', $this->host, rawurlencode($this->bbs), rawurlencode($this->key));
         // JBBSしたらば
     } elseif (P2Util::isHostJbbsShitaraba($this->host)) {
         $preg = '{(jbbs\\.shitaraba\\.com|jbbs\\.livedoor\\.com|jbbs\\.livedoor\\.jp)}';
         $host_bbs_cgi = preg_replace($preg, '$1/bbs/read.cgi', $this->host);
         $motothre_url = "http://{$host_bbs_cgi}/{$this->bbs}/{$this->key}/{$this->ls}";
         // $motothre_url = "http://{$this->host}/bbs/read.cgi?BBS={$this->bbs}&KEY={$this->key}";
         // 2ch系
     } elseif (P2Util::isHost2chs($this->host)) {
         // PC
         if (!UA::isK() || UA::isIPhoneGroup() || $original) {
             $motothre_url = "http://{$this->host}/test/read.cgi/{$this->bbs}/{$this->key}/{$this->ls}";
             // 携帯
         } else {
             // BBS PINK
             if (P2Util::isHostBbsPink($this->host)) {
                 // r.iはもう使われていない
                 //$motothre_url = "http://{$this->host}/test/r.i/{$this->bbs}/{$this->key}/{$this->ls}";
                 $motothre_url = "http://speedo.ula.cc/test/r.so/{$this->host}/{$this->bbs}/{$this->key}/{$this->ls}?guid=ON";
                 // 2ch(c.2ch)
             } else {
                 $motothre_url = $this->compileMobile2chUri();
             }
         }
         // その他
     } else {
         $motothre_url = "http://{$this->host}/test/read.cgi/{$this->bbs}/{$this->key}/{$this->ls}";
     }
     return $motothre_url;
 }
Ejemplo n.º 21
0
 /**
  * ホストの種類を判定する
  *
  * @param   string  $host   ホスト名
  * @return  string  ホストの種類
  */
 private static function _detectHostType($host)
 {
     if (P2Util::isHostBbsPink($host)) {
         $type = 'bbspink';
     } elseif (P2Util::isHost2chs($host)) {
         $type = '2channel';
     } elseif (P2Util::isHostMachiBbs($host)) {
         $type = 'machibbs';
     } elseif (P2Util::isHostJbbsShitaraba($host)) {
         $type = 'jbbs';
     } else {
         $type = $host;
     }
     return $type;
 }
Ejemplo n.º 22
0
 /**
  * みみずん検索に対応しているか調べる
  */
 public function isEnabled()
 {
     // hostがセットされてないかもしれないので
     // (セットされていなければ2chとみなす)
     if ($this->host) {
         // まちBBSならfalse
         if (P2Util::isHostMachiBbs($this->host)) {
             return false;
         }
         // 2chでなければfalse
         if (!P2Util::isHost2chs($this->host)) {
             return false;
         }
     }
     $this->enabled = true;
     return $this->enabled;
 }
Ejemplo n.º 23
0
 /**
  * コンストラクタ
  */
 public function __construct(ThreadRead $aThread, $matome = false)
 {
     parent::__construct($aThread, $matome);
     global $_conf, $STYLE;
     if ($_conf['iphone']) {
         $this->respopup_at = ' onclick="return iResPopUp(this, event);"';
         $this->target_at = ' target="_blank"';
         $this->check_st = 'check';
     }
     $this->_url_handlers = array('plugin_linkThread', 'plugin_link2chSubject');
     if (P2_IMAGECACHE_AVAILABLE == 2) {
         $this->_url_handlers[] = 'plugin_imageCache2';
     } elseif ($_conf['mobile.use_picto']) {
         $this->_url_handlers[] = 'plugin_viewImage';
     }
     if ($_conf['mobile.link_youtube']) {
         $this->_url_handlers[] = 'plugin_linkYouTube';
     }
     $this->_url_handlers[] = 'plugin_linkURL';
     if (!$_conf['mobile.bbs_noname_name']) {
         $st = new SettingTxt($this->thread->host, $this->thread->bbs);
         $st->setSettingArray();
         if (array_key_exists('BBS_NONAME_NAME', $st->setting_array)) {
             $BBS_NONAME_NAME = $st->setting_array['BBS_NONAME_NAME'];
             if (strlen($BBS_NONAME_NAME)) {
                 $this->_nanashiName = $BBS_NONAME_NAME;
             }
         }
     }
     if (P2Util::isHost2chs($aThread->host)) {
         $this->_kushiYakiName = ' </b>[—\{}@{}@{}-]<b> ';
     }
     if ($_conf['mobile.date_zerosuppress']) {
         $this->_dateIdPattern = '~^(?:' . date('Y|y') . ')/(?:0(\\d)|(\\d\\d))?(?:(/)0)?~';
         $this->_dateIdReplace = '$1$2$3';
     } else {
         $this->_dateIdPattern = '~^(?:' . date('Y|y') . ')/~';
         $this->_dateIdReplace = '';
     }
     // 連続する改行の置換文字列を設定
     /*
     if ($_conf['mobile.strip_linebreaks']) {
         $ngword_color = $GLOBALS['STYLE']['mobile_read_ngword_color'];
         if (strpos($ngword_color, '\\') === false && strpos($ngword_color, '$') === false) {
             $this->_lineBreaksReplace = " <br><s><font color=\"{$ngword_color}\">***</font></s><br> ";
         } else {
             $this->_lineBreaksReplace = ' <br><s>***</s><br> ';
         }
     } else {
         $this->_lineBreaksReplace = null;
     }
     */
     // サムネイル表示制限数を設定
     if (!isset($GLOBALS['pre_thumb_unlimited']) || !isset($GLOBALS['expack.ic2.pre_thumb_limit_k'])) {
         if (isset($_conf['expack.ic2.pre_thumb_limit_k']) && $_conf['expack.ic2.pre_thumb_limit_k'] > 0) {
             $GLOBALS['pre_thumb_limit_k'] = $_conf['expack.ic2.pre_thumb_limit_k'];
             $GLOBALS['pre_thumb_unlimited'] = false;
         } else {
             $GLOBALS['pre_thumb_limit_k'] = null;
             // ヌル値だとisset()はFALSEを返す
             $GLOBALS['pre_thumb_unlimited'] = true;
         }
     }
     $GLOBALS['pre_thumb_ignore_limit'] = false;
     // アクティブモナー初期化
     if (P2_ACTIVEMONA_AVAILABLE) {
         ExpackLoader::initActiveMona($this);
     }
     // ImageCache2初期化
     if (P2_IMAGECACHE_AVAILABLE == 2) {
         ExpackLoader::initImageCache($this);
     }
     // AAS 初期化
     if (P2_AAS_AVAILABLE) {
         ExpackLoader::initAAS($this);
     }
     // SPM初期化
     //if ($this->_matome) {
     //    $this->spmObjName = sprintf('t%dspm%u', $this->_matome, crc32($this->thread->keydat));
     //} else {
     $this->spmObjName = sprintf('spm%u', crc32($this->thread->keydat));
     //}
 }
Ejemplo n.º 24
0
 /**
  * コンストラクタ
  */
 protected function __construct(ThreadRead $aThread, $matome = false)
 {
     global $_conf;
     // スレッドオブジェクトを登録
     $this->thread = $aThread;
     $this->str_to_link_regex = $this->_buildStrToLinkRegex();
     // まとめ読みモードか否か
     if ($matome) {
         $this->_matome = ++self::$_matome_count;
     } else {
         $this->_matome = false;
     }
     $this->_url_handlers = array();
     $this->_user_url_handlers = array();
     $this->_ngaborn_frequent = 0;
     if ($_conf['ngaborn_frequent']) {
         if ($_conf['ngaborn_frequent_dayres'] == 0) {
             $this->_ngaborn_frequent = $_conf['ngaborn_frequent'];
         } elseif ($this->thread->setDayRes() && $this->thread->dayres < $_conf['ngaborn_frequent_dayres']) {
             $this->_ngaborn_frequent = $_conf['ngaborn_frequent'];
         }
     }
     $this->_has_ngaborns = false;
     $this->_aborn_nums = array();
     $this->_ng_nums = array();
     if (P2Util::isHostBbsPink($this->thread->host)) {
         $this->_redirector = self::REDIRECTOR_PINKTOWER;
     } elseif (P2Util::isHost2chs($this->thread->host)) {
         $this->_redirector = self::REDIRECTOR_IMENU;
     } elseif (P2Util::isHostMachiBbs($this->thread->host)) {
         $this->_redirector = self::REDIRECTOR_MACHIBBS;
     } else {
         $this->_redirector = self::REDIRECTOR_NONE;
     }
     $this->_quote_res_nums = array();
     $this->_quote_res_nums_checked = array();
     $this->_quote_res_nums_done = array();
 }
Ejemplo n.º 25
0
/**
 * sb_print - スレッド一覧を表示する (<tr>〜</tr>)
 *
 * @return  void
 */
function sb_print_k(&$aThreadList)
{
    global $_conf, $browser, $_conf, $sb_view, $p2_setting, $STYLE;
    global $sb_view;
    //=================================================
    if (!$aThreadList->threads) {
        if ($aThreadList->spmode == "fav" && $sb_view == "shinchaku") {
            echo "<p>お気にスレに新着なかったぽ</p>";
        } else {
            echo "<p>該当サブジェクトはなかったぽ</p>";
        }
        return;
    }
    // 変数 ================================================
    // >>1
    $onlyone_bool = false;
    /*
    	if (ereg("news", $aThreadList->bbs) || $aThreadList->bbs == "bizplus" || $aThreadList->spmode == "news") {
    		// 倉庫は除く
    		if ($aThreadList->spmode != "soko") {
    			$onlyone_bool = true;
    		}
    	}
    */
    // 板名
    if ($aThreadList->spmode and $aThreadList->spmode != "taborn" and $aThreadList->spmode != "soko") {
        $ita_name_bool = true;
    } else {
        $ita_name_bool = false;
    }
    $norefresh_q = "&amp;norefresh=1";
    // ソート ==================================================
    $sortq_host = '';
    $sortq_ita = '';
    $sortq_spmode = '';
    // スペシャルモード時
    if ($aThreadList->spmode) {
        $sortq_spmode = "&amp;spmode={$aThreadList->spmode}";
        // あぼーんなら
        if ($aThreadList->spmode == "taborn" or $aThreadList->spmode == "soko") {
            $sortq_host = "&amp;host={$aThreadList->host}";
            $sortq_ita = "&amp;bbs={$aThreadList->bbs}";
        }
    } else {
        $sortq_host = "&amp;host={$aThreadList->host}";
        $sortq_ita = "&amp;bbs={$aThreadList->bbs}";
    }
    $midoku_sort_ht = "<a href=\"{$_conf['subject_php']}?sort=midoku{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}{$_conf['k_at_a']}\">新着</a>";
    //=====================================================
    // ボディ
    //=====================================================
    // spmodeがあればクエリー追加
    if ($aThreadList->spmode) {
        $spmode_q = "&amp;spmode={$aThreadList->spmode}";
    }
    $i = 0;
    foreach ($aThreadList->threads as $aThread) {
        $i++;
        $midoku_ari = "";
        $anum_ht = "";
        //#r1
        echo '<li>';
        $bbs_q = "&amp;bbs=" . $aThread->bbs;
        $key_q = "&amp;key=" . $aThread->key;
        if ($aThreadList->spmode != "taborn") {
            if (!$aThread->torder) {
                $aThread->torder = $i;
            }
        }
        // 新着レス数 =============================================
        $unum_ht = "";
        // 既得済み
        if ($aThread->isKitoku()) {
            $unum_ht = "{$aThread->unum}";
            $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;
                $unum_ht = "{$aThread->unum}";
            }
            // subject.txtにない時
            if (!$aThread->isonline) {
                // 誤動作防止のためログ削除操作をロック
                $unum_ht = "-";
            }
            $unum_ht = '<font class="unum">' . $unum_ht . '</font>';
        }
        // 新規スレ
        if ($aThread->new) {
            //$unum_ht = "<font color=\"#0000ff\">●</font>";
            $unum_new_ht = "<img class=\"unew\" src=\"iui/icon_new.png\">";
            $unum_ht = "";
        } else {
            $unum_new_ht = "";
        }
        // 総レス数
        $rescount_ht = "{$aThread->rescount}";
        // 板名
        $ita_name_ht = '';
        if ($ita_name_bool) {
            $ita_name = $aThread->itaj ? $aThread->itaj : $aThread->bbs;
            // 全角英数カナスペースを半角に
            if ($_conf['k_save_packet']) {
                $ita_name = mb_convert_kana($ita_name, 'rnsk');
            }
            $ita_name_hs = htmlspecialchars($ita_name, ENT_QUOTES);
            // $ita_name_ht = "(<a href=\"{$_conf['subject_php']}?host={$aThread->host}{$bbs_q}{$_conf['k_at_a']}\">{$ita_name_hs}</a>)";
            $ita_name_ht = "({$ita_name_hs})";
        }
        // 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}{$_conf['k_at_a']}\">{$torder_st}</a>";
        */
        $torder_ht = $aThread->torder;
        // title =================================================
        $rescount_q = "&amp;rc=" . $aThread->rescount;
        // dat倉庫 or 殿堂なら
        if ($aThreadList->spmode == "soko" || $aThreadList->spmode == "palace") {
            $rescount_q = "";
            $offline_q = "&amp;offline=true";
            $anum_ht = "";
        } else {
            $offline_q = '';
        }
        // タイトル未取得なら
        if (!$aThread->ttitle_ht) {
            // 見かけ上のタイトルなので携帯対応URLである必要はない
            //if (P2Util::isHost2chs($aThread->host)) {
            //	$aThread->ttitle_ht = "http://c.2ch.net/z/-/{$aThread->bbs}/{$aThread->key}/";
            //}else{
            $aThread->ttitle_ht = "http://{$aThread->host}/test/read.cgi/{$aThread->bbs}/{$aThread->key}/";
            //}
        }
        // 全角英数カナスペースを半角に
        if ($_conf['k_save_packet']) {
            $aThread->ttitle_ht = mb_convert_kana($aThread->ttitle_ht, 'rnsk');
        }
        $aThread->ttitle_ht = $aThread->ttitle_ht . ' <font class="sbnum">' . $rescount_ht . "</font>";
        if ($aThread->similarity) {
            $aThread->ttitle_ht .= sprintf(' %0.1f%%', $aThread->similarity * 100);
        }
        // 新規スレ
        if ($aThread->new) {
            $classtitle_q = " class=\"thre_title_new\"";
        } else {
            $classtitle_q = " class=\"thre_title\"";
        }
        $thre_url = "{$_conf['read_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$rescount_q}{$offline_q}{$_conf['k_at_a']}{$anum_ht}";
        // オンリー>>1
        $onlyone_url = "{$_conf['read_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$rescount_q}&amp;onlyone=true&amp;k_continue=1{$_conf['k_at_a']}";
        if ($onlyone_bool) {
            $one_ht = "<a href=\"{$onlyone_url}\">&gt;&gt;1</a>";
        }
        if (P2Util::isHost2chs($aThreadList->host) and !$aThread->isKitoku()) {
            if ($GLOBALS['_conf']['k_sb_show_first'] == 1) {
                $thre_url = $onlyone_url;
            } elseif ($GLOBALS['_conf']['k_sb_show_first'] == 2) {
                $thre_url .= '&amp;ls=1-';
            }
        }
        // アクセスキー
        /*
        $access_ht = "";
        if ($aThread->torder >= 1 and $aThread->torder <= 9) {
        	$access_ht = " {$_conf['accesskey']}=\"{$aThread->torder}\"";
        }
        */
        // お気にマーク設定
        $favmark = !empty($aThread->fav) ? '★' : '╋';
        $favdo = !empty($aThread->fav) ? 0 : 1;
        $favtitle = $favdo ? 'お気にスレに追加' : 'お気にスレから外す';
        $favdo_q = '&amp;setfav=' . $favdo;
        $similar_q = '&amp;itaj_en=' . rawurlencode(base64_encode($aThread->itaj)) . '&amp;method=similar&amp;word=' . rawurlencode($aThread->ttitle_hc);
        // . '&amp;refresh=1';
        $itaj_hs = htmlspecialchars($aThread->itaj, ENT_QUOTES);
        if ($favmark == '★') {
            $favmark = '<img src="iui/icon_del.png">';
        } else {
            $favmark = '<img src="iui/icon_add.png">';
        }
        //====================================================================================
        // スレッド一覧 table ボディ HTMLプリント <tr></tr>
        //====================================================================================
        echo "<span class=\"plus\" id=\"{$aThread->torder}\" ><a href=\"info_i.php?host={$aThread->host}{$bbs_q}{$key_q}{$ttitle_en_q}{$favdo_q}{$sid_q}\" target=\"info\" onClick=\"return setFavJsNoStr('host={$aThread->host}{$bbs_q}{$key_q}{$ttitle_en_q}{$sid_q}', '{$favdo}', {$STYLE['info_pop_size']}, 'read', 'this',{$aThread->torder});\" title=\"{$favtitle}\">{$favmark}</a></span>";
        // ボディ
        echo <<<EOP
\t<a href="{$thre_url}">{$unum_new_ht}{$aThread->ttitle_ht}</a>{$ita_name_ht}{$unum_ht}</li>
EOP;
    }
}