Ejemplo n.º 1
0
} elseif (!$aThreadList->spmode) {
    // 特別なパターン index2.html
    // match登録よりheadなげて聞いたほうがよさそうだが、ワンレスポンス増えるのが困る
    if (preg_match('/www\\.onpuch\\.jp/', $aThreadList->host)) {
        $ptitle_url = $ptitle_url . 'index2.html';
    } elseif (preg_match("/livesoccer\\.net/", $aThreadList->host)) {
        $ptitle_url = $ptitle_url . 'index2.html';
        // PC
    } elseif (empty($_conf['ktai'])) {
        $ptitle_url = "http://{$aThreadList->host}/{$aThreadList->bbs}/i/";
        // 携帯
    } else {
        if (!empty($GLOBALS['word']) || !empty($GLOBALS['wakati_words'])) {
            $ptitle_url = $p2_subject_url;
        } else {
            if (P2Util::isHostBbsPink($aThreadList->host)) {
                $ptitle_url = "http://{$aThreadList->host}/{$aThreadList->bbs}/i/";
            } else {
                $ptitle_url = "http://c.2ch.net/test/-/{$aThreadList->bbs}/i";
            }
        }
    }
}
// }}}
// {{{ ページタイトル部分HTML設定
$ptitle_hs = htmlspecialchars($aThreadList->ptitle, ENT_QUOTES);
if ($aThreadList->spmode == "taborn") {
    $ptitle_ht = <<<EOP
    <a href="{$ptitle_url}"><b>{$aThreadList->itaj_hs}</b></a>(アボン中)
EOP;
} elseif ($aThreadList->spmode == "soko") {
Ejemplo n.º 2
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.º 3
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.º 4
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.º 5
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.º 6
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.º 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 {