Example #1
0
        if (count($p) > 1) {
            $site = $p[0];
            $xml = $p[1];
            $xml_en = rawurlencode($xml);
            if (isset($p[2]) && $p[2] == 1) {
                $atom = 1;
                $atom_ht = '&atom=1';
                $type_ht = 'Atom';
                $cngtype_ht = '&setrss=rss';
            } else {
                $atom = 0;
                $atom_ht = '';
                $type_ht = 'RSS';
                $cngtype_ht = '&setrss=atom';
            }
            $site_ht = '&site_en=' . UrlSafeBase64::encode($site);
            echo <<<EOP
    <tr>
        <td><a href="{$editrss_php_ht}?xml={$xml_en}&amp;setrss=0" class="fav">★</a></td>
        <td><a href="subject_rss.php?xml={$xml_en}{$site_ht}{$atom_ht}">{$site}</a></td>
        <td>(<a class="te" href="{$editrss_php_ht}?xml={$xml_en}{$site_ht}{$cngtype_ht}">{$type_ht}</a>)</td>
        <td>[ <a class="te" href="{$editrss_php_ht}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=top">▲</a></td>
        <td><a class="te" href="{$editrss_php_ht}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=up">↑</a></td>
        <td><a class="te" href="{$editrss_php_ht}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=down">↓</a></td>
        <td><a class="te" href="{$editrss_php_ht}?xml={$xml_en}{$site_ht}{$atom_ht}&amp;setrss=bottom">▼</a> ]</td>
    </tr>

EOP;
        }
    }
    echo "</table>\n";
Example #2
0
$resid = $_GET['copy'];
$quote = !empty($_GET['inyou']);
if (isset($_SERVER['HTTP_REFERER'])) {
    $back_link = '<a href="' . htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES) . '" title="戻る">戻る</a> ';
}
//=================================================
// レス読み込み
//=================================================
$aThread = new ThreadRead();
$aThread->setThreadPathInfo($host, $bbs, $key);
if (file_exists($aThread->keydat)) {
    // スレッド情報
    $aThread->readDat($aThread->keydat);
    $one = $aThread->explodeDatLine($aThread->datlines[0]);
    $ttitle = trim($one[4]);
    $ttitle_en = UrlSafeBase64::encode($ttitle);
    $ttitle_ht = htmlspecialchars($ttitle, ENT_QUOTES);
    $url_txt = $aThread->getMotoThread(true);
    $url_k_txt = $aThread->getMotoThread();
    if ($quote) {
        $url_txt .= $resid;
        $url_k_txt .= $resid;
    }
    if ($url_txt != $url_k_txt) {
        $url_k_ht = "<input type=\"text\" name=\"url_k_txt\" value=\"{$url_k_txt}\"><br>";
    }
    // 投稿フォームへのリンク
    $post_url = "post_form.php?host={$host}&amp;bbs={$bbs}&amp;key={$key}";
    $post_url .= "&amp;rescount={$aThread->rescount}&amp;ttitle_en={$ttitle_en}&amp;b=k";
    $post_link = "<a href=\"{$post_url}\">レス</a> ";
    // 元スレへのリンク
Example #3
0
function readNew($aThread)
{
    global $_conf, $newthre_num, $STYLE;
    global $spmode, $word, $newtime;
    $orig_no_label = !empty($_conf['expack.iphone.toolbars.no_label']);
    $_conf['expack.iphone.toolbars.no_label'] = true;
    $newthre_num++;
    //==========================================================
    // idxの読み込み
    //==========================================================
    //hostを分解してidxファイルのパスを求める
    $aThread->setThreadPathInfo($aThread->host, $aThread->bbs, $aThread->key);
    //FileCtl::mkdirFor($aThread->keyidx); // 板ディレクトリが無ければ作る //この操作はおそらく不要
    $aThread->itaj = P2Util::getItaName($aThread->host, $aThread->bbs);
    if (!$aThread->itaj) {
        $aThread->itaj = $aThread->bbs;
    }
    // idxファイルがあれば読み込む
    if ($lines = FileCtl::file_read_lines($aThread->keyidx, FILE_IGNORE_NEW_LINES)) {
        $data = explode('<>', $lines[0]);
    } else {
        $data = array_fill(0, 12, '');
    }
    $aThread->getThreadInfoFromIdx();
    //==================================================================
    // DATのダウンロード
    //==================================================================
    if (!($word and file_exists($aThread->keydat))) {
        $aThread->downloadDat();
    }
    // DATを読み込み
    $aThread->readDat();
    $aThread->setTitleFromLocal();
    // ローカルからタイトルを取得して設定
    //===========================================================
    // 表示レス番の範囲を設定
    //===========================================================
    // 取得済みなら
    if ($aThread->isKitoku()) {
        $from_num = $aThread->readnum + 1 - $_conf['respointer'] - $_conf['before_respointer_new'];
        if ($from_num > $aThread->rescount) {
            $from_num = $aThread->rescount - $_conf['respointer'] - $_conf['before_respointer_new'];
        }
        if ($from_num < 1) {
            $from_num = 1;
        }
        //if (!$aThread->ls) {
        $aThread->ls = "{$from_num}-";
        //}
    }
    $aThread->lsToPoint();
    //==================================================================
    // ヘッダ 表示
    //==================================================================
    $motothre_url = $aThread->getMotoThread();
    $ttitle_en = UrlSafeBase64::encode($aThread->ttitle);
    $ttitle_en_q = '&amp;ttitle_en=' . $ttitle_en;
    $bbs_q = '&amp;bbs=' . $aThread->bbs;
    $key_q = '&amp;key=' . $aThread->key;
    $host_bbs_key_q = 'host=' . $aThread->host . $bbs_q . $key_q;
    $popup_q = '&amp;popup=1';
    $itaj_hd = htmlspecialchars($aThread->itaj, ENT_QUOTES, 'Shift_JIS');
    if ($spmode) {
        $read_header_itaj_ht = "({$itaj_hd})";
    } else {
        $read_header_itaj_ht = '';
    }
    if ($_conf['iphone']) {
        if ($read_header_itaj_ht !== '') {
            $read_header_itaj_ht = "<span class=\"btitle\">{$read_header_itaj_ht}</span>";
        }
        $read_header_ht = <<<EOP
<div class="ntoolbar mtoolbar mtoolbar_top" id="ntt{$newthre_num}">
<h2 class="ttitle">{$aThread->ttitle_hd} {$read_header_itaj_ht}</h2>
EOP;
        $read_header_ht .= '<div class="mover">';
        $read_header_ht .= toolbar_i_standard_button('img/gp2-down.png', '', sprintf('#ntt%d', $newthre_num + 1));
        $read_header_ht .= '</div>';
        $info_ht = P2Util::getInfoHtml();
        if (strlen($info_ht)) {
            $read_header_ht .= "<div class=\"info\">{$info_ht}</div>";
        }
        $read_header_ht .= '</div>';
    } else {
        P2Util::printInfoHtml();
        $read_header_ht = <<<EOP
<hr><div id="ntt{$newthre_num}" name="ntt{$newthre_num}"><font color="{$STYLE['mobile_read_ttitle_color']}"><b>{$aThread->ttitle_hd}</b></font> {$read_header_itaj_ht} <a href="#ntt_bt{$newthre_num}">▼</a></div><hr>
EOP;
    }
    //==================================================================
    // ローカルDatを読み込んでHTML表示
    //==================================================================
    $aThread->resrange['nofirst'] = true;
    $GLOBALS['newres_to_show_flag'] = false;
    $read_cont_ht = '';
    if ($aThread->rescount) {
        $aShowThread = new ShowThreadK($aThread, true);
        if ($_conf['iphone'] && $_conf['expack.spm.enabled']) {
            $read_cont_ht .= $aShowThread->getSpmObjJs();
        }
        $read_cont_ht .= $aShowThread->getDatToHtml();
        unset($aShowThread);
    }
    //==================================================================
    // フッタ 表示
    //==================================================================
    // 表示範囲
    if ($aThread->resrange['start'] == $aThread->resrange['to']) {
        $read_range_on = $aThread->resrange['start'];
    } else {
        $read_range_on = "{$aThread->resrange['start']}-{$aThread->resrange['to']}";
    }
    $read_range_ht = "{$read_range_on}/{$aThread->rescount}";
    // ツールバー部分HTML =======
    if ($spmode) {
        $toolbar_itaj_ht = "(<a href=\"{$_conf['subject_php']}?{$host_bbs_key_q}{$_conf['k_at_a']}\">{$itaj_hd}</a>)";
    } else {
        $toolbar_itaj_ht = '';
    }
    if ($_conf['iphone']) {
        if ($toolbar_itaj_ht !== '') {
            $toolbar_itaj_ht = "<span class=\"btitle\">{$toolbar_itaj_ht}</span>";
        }
        $read_footer_ht = <<<EOP
<div class="ntoolbar mtoolbar mtoolbar_bottom" id="ntt_btm{$newthre_num}">
<table><tbody><tr>
EOP;
        // 情報
        $read_footer_ht .= '<td>';
        $escaped_url = "info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}";
        $read_footer_ht .= toolbar_i_opentab_button('img/gp5-info.png', '', $escaped_url);
        $read_footer_ht .= '</td>';
        // 表示範囲
        $read_footer_ht .= "<td colspan=\"3\"><span class=\"large\">{$read_range_ht}</span></td>";
        // ツール
        $read_footer_ht .= '<td>';
        $escaped_url = "spm_k.php?{$host_bbs_key_q}&amp;ls={$aThread->ls}&amp;spm_default={$aThread->resrange['to']}{$_conf['k_at_a']}";
        $read_footer_ht .= toolbar_i_opentab_button('img/glyphish/icons2/20-gear2.png', '', $escaped_url);
        $read_footer_ht .= '</td>';
        // タイトル等
        $read_footer_ht .= <<<EOP
</tr></tbody></table>
<div class="ttitle"><a href="{$_conf['read_php']}?{$host_bbs_key_q}&amp;offline=1&amp;rescount={$aThread->rescount}{$_conf['k_at_a']}" target="_blank">{$aThread->ttitle_hd}</a> {$toolbar_itaj_ht}</div>
<div class="mover">
EOP;
        $read_footer_ht .= toolbar_i_standard_button('img/gp1-up.png', '', "#ntt{$newthre_num}");
        $read_footer_ht .= '</div></div>';
    } else {
        $read_footer_ht = <<<EOP
<div id="ntt_bt{$newthre_num}" name="ntt_bt{$newthre_num}" class="read_new_toolbar">
{$read_range_ht}
<a href="info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}">情</a>
<a href="spm_k.php?{$host_bbs_key_q}&amp;ls={$aThread->ls}&amp;spm_default={$aThread->resrange['to']}&amp;from_read_new=1{$_conf['k_at_a']}">特</a>
<br>
<a href="{$_conf['read_php']}?{$host_bbs_key_q}&amp;offline=1&amp;rescount={$aThread->rescount}{$_conf['k_at_a']}#r{$aThread->rescount}">{$aThread->ttitle_hd}</a> {$toolbar_itaj_ht} <a href="#ntt{$newthre_num}">▲</a>
</div>
<hr>

EOP;
    }
    // 透明あぼーんや表示数制限で新しいレス表示がない場合はスキップ
    if ($GLOBALS['newres_to_show_flag']) {
        echo $read_header_ht;
        echo $read_cont_ht;
        echo $read_footer_ht;
    }
    //==================================================================
    // key.idxの値設定
    //==================================================================
    if ($aThread->rescount) {
        $aThread->readnum = min($aThread->rescount, max(0, $data[5], $aThread->resrange['to']));
        $newline = $aThread->readnum + 1;
        // $newlineは廃止予定だが、旧互換用に念のため
        $sar = array($aThread->ttitle, $aThread->key, $data[2], $aThread->rescount, $aThread->modified, $aThread->readnum, $data[6], $data[7], $data[8], $newline, $data[10], $data[11], $aThread->datochiok);
        P2Util::recKeyIdx($aThread->keyidx, $sar);
        // key.idxに記録
    }
    $_conf['expack.iphone.toolbars.no_label'] = $orig_no_label;
}
Example #4
0
    /**
     * スマートポップアップメニューを生成するJavaScriptコードを生成する
     */
    public function getSpmObjJs($retry = false)
    {
        global $_conf, $STYLE;
        if (isset(self::$_spm_objects[$this->spmObjName])) {
            return $retry ? self::$_spm_objects[$this->spmObjName] : '';
        }
        $ttitle_en = UrlSafeBase64::encode($this->thread->ttitle);
        if ($_conf['expack.spm.filter_target'] == '' || $_conf['expack.spm.filter_target'] == 'read') {
            $_conf['expack.spm.filter_target'] = '_self';
        }
        $motothre_url = $this->thread->getMotoThread();
        $motothre_url = substr($motothre_url, 0, strlen($this->thread->ls) * -1);
        $_spmOptions = array('null', !$_conf['disable_res'] && $_conf['expack.spm.kokores'] ? $_conf['expack.spm.kokores_orig'] ? '2' : '1' : '0', $_conf['expack.spm.ngaborn'] ? $_conf['expack.spm.ngaborn_confirm'] ? '2' : '1' : '0', $_conf['expack.spm.filter'] ? '1' : '0', $this->am_on_spm ? '1' : '0', $_conf['expack.aas.enabled'] ? '1' : '0');
        $spmOptions = implode(',', $_spmOptions);
        // エスケープ
        $_spm_title = StrCtl::toJavaScript($this->thread->ttitle_hc);
        $_spm_url = addslashes($motothre_url);
        $_spm_host = addslashes($this->thread->host);
        $_spm_bbs = addslashes($this->thread->bbs);
        $_spm_key = addslashes($this->thread->key);
        $_spm_ls = addslashes($this->thread->ls);
        $code = <<<EOJS
<script type="text/javascript">
//<![CDATA[

EOJS;
        if (!count(self::$_spm_objects)) {
            $code .= sprintf("spmFlexTarget = '%s';\n", StrCtl::toJavaScript($_conf['expack.spm.filter_target']));
            if ($_conf['expack.aas.enabled']) {
                $code .= sprintf("var aas_popup_width = %d;\n", $_conf['expack.aas.default.width'] + 10);
                $code .= sprintf("var aas_popup_height = %d;\n", $_conf['expack.aas.default.height'] + 10);
            }
        }
        $code .= <<<EOJS
var {$this->spmObjName} = {
    'objName':'{$this->spmObjName}',
    'rc':'{$this->thread->rescount}',
    'title':'{$_spm_title}',
    'ttitle_en':'{$ttitle_en}',
    'url':'{$_spm_url}',
    'host':'{$_spm_host}',
    'bbs':'{$_spm_bbs}',
    'key':'{$_spm_key}',
    'ls':'{$_spm_ls}',
    'spmOption':[{$spmOptions}]
};
SPM.init({$this->spmObjName});
//]]>
</script>

EOJS;
        self::$_spm_objects[$this->spmObjName] = $code;
        return $code;
    }
Example #5
0
 /**
  * getCsrfId
  */
 public static function getCsrfId($salt = '')
 {
     global $_login;
     $key = $_login->user_u . $_login->pass_x . $_SERVER['HTTP_USER_AGENT'] . $salt;
     if (array_key_exists('login_microtime', $_SESSION)) {
         $key .= $_SESSION['login_microtime'];
     }
     return UrlSafeBase64::encode(sha1($key, true));
 }
Example #6
0
    /**
     * お気に板をプリントする for 携帯
     */
    public function printFavIta()
    {
        global $_conf;
        $show_flag = false;
        // favita読み込み
        if ($lines = FileCtl::file_read_lines($_conf['favita_brd'], FILE_IGNORE_NEW_LINES)) {
            if ($_conf['expack.misc.multi_favs']) {
                $favset_title = FavSetManager::getFavSetPageTitleHt('m_favita_set', 'お気に板');
            } else {
                $favset_title = 'お気に板';
            }
            echo "<div>{$favset_title}";
            if ($_conf['merge_favita']) {
                echo " (<a href=\"{$_conf['subject_php']}?spmode=merge_favita{$_conf['k_at_a']}{$_conf['m_favita_set_at_a']}\">まとめ</a>)";
            }
            echo " [<a href=\"editfavita.php{$_conf['k_at_q']}{$_conf['m_favita_set_at_a']}\">編集</a>]<hr>";
            $i = 0;
            foreach ($lines as $l) {
                $i++;
                if (preg_match("/^\t?(.+)\t(.+)\t(.+)\$/", $l, $matches)) {
                    $itaj = rtrim($matches[3]);
                    $itaj_view = p2h($itaj);
                    $itaj_en = UrlSafeBase64::encode($itaj);
                    if ($i <= 9) {
                        $accesskey_at = $_conf['k_accesskey_at'][$i];
                        $accesskey_st = $_conf['k_accesskey_st'][$i];
                    } else {
                        $accesskey_at = '';
                        $accesskey_st = '';
                    }
                    echo <<<EOP
<a href="{$_conf['subject_php']}?host={$matches[1]}&amp;bbs={$matches[2]}&amp;itaj_en={$itaj_en}{$_conf['k_at_a']}"{$accesskey_at}>{$accesskey_st}{$itaj_view}</a><br>
EOP;
                    //  [<a href="{$_SERVER['SCRIPT_NAME']}?host={$matches[1]}&amp;bbs={$matches[2]}&amp;setfavita=0&amp;view=favita{$_conf['k_at_a']}{$_conf['m_favita_set_at_a']}">削</a>]
                    $show_flag = true;
                }
            }
            echo "</div>";
        }
        if (empty($show_flag)) {
            echo "<p>お気に板はまだないようだ</p>";
        }
    }
Example #7
0
    // 引数エラー
    p2die('host が指定されていません');
} else {
    $host = $_GET['host'];
}
$bbs = isset($_GET['bbs']) ? $_GET['bbs'] : '';
$key = isset($_GET['key']) ? $_GET['key'] : '';
$rescount = isset($_GET['rescount']) ? intval($_GET['rescount']) : 1;
$popup = isset($_GET['popup']) ? intval($_GET['popup']) : 0;
$itaj = P2Util::getItaName($host, $bbs);
if (!$itaj) {
    $itaj = $bbs;
}
$itaj_hd = htmlspecialchars($itaj, ENT_QUOTES, 'Shift_JIS', false);
$ttitle_en = isset($_GET['ttitle_en']) ? $_GET['ttitle_en'] : '';
$ttitle = strlen($ttitle_en) > 0 ? UrlSafeBase64::decode($ttitle_en) : '';
$ttitle_hd = htmlspecialchars($ttitle, ENT_QUOTES);
$key_idx = P2Util::idxDirOfHostBbs($host, $bbs) . $key . '.idx';
// フォームのオプション読み込み
include P2_LIB_DIR . '/post_form_options.inc.php';
// 表示指定
if (!$_conf['ktai']) {
    $class_ttitle = ' class="thre_title"';
    $target_read = ' target="read"';
    $sub_size_at = ' size="40"';
} else {
    $class_ttitle = '';
    $target_read = '';
    $sub_size_at = '';
}
// {{{ スレ立てなら
Example #8
0
 public function setItaj($itaj)
 {
     $this->itaj = $itaj;
     $this->itaj_en = UrlSafeBase64::encode($this->itaj);
     $this->itaj_ht = p2h($this->itaj);
 }
Example #9
0
    }
} else {
    // マッチしたスレッドを表示
    $current_page = isset($_GET['P']) ? (int) $_GET['P'] : 1;
    $all_pages = ceil($subhits / $limit);
    $disp_range = sprintf('<li class="group">%d-%d/%s</li>', 1 + $limit * ($current_page - 1), min($limit * $current_page, $subhits), $htm['hits']);
    if ($current_page == 1 && $htm['category'] == 0 && $htm['board'] == 0) {
        echo "<li><a href=\"{$ix_base_url}&amp;ic=0\" class=\"align-r\">絞り込み</a></li>";
    }
    // 表示範囲
    echo $disp_range;
    foreach ($threads as $o => $t) {
        $ttitle_ht = strip_tags($t->title);
        $host_en = rawurlencode($t->host);
        $bbs_en = rawurlencode($t->bbs);
        $turl = sprintf('%s?host=%s&amp;bbs=%s&amp;key=%d&amp;ttitle_en=%s', $_conf['read_php'], $host_en, $bbs_en, $t->tkey, UrlSafeBase64::encode($ttitle_ht));
        /*
        $burl = sprintf('%s?host=%s&amp;bbs=%s&amp;itaj_en=%s&amp;word=%s',
                        $_conf['subject_php'],
                        $host_en,
                        $bbs_en,
                        UrlSafeBase64::encode($t->ita),
                        $htm['query_en']
                        );
        */
        printf('<li><a href="%s" target="_self">%s<br />' . '<span class="size-m weight-n">%s %s</span></a></li>', $turl, $ttitle_ht, date('y/m/d ', $t->tkey), $t->ita);
    }
    //echo $disp_range;
    // 次のページへのリンク
    if ($subhits && $subhits > $limit && $all_pages > $current_page) {
        if ($htm['board']) {
Example #10
0
function readNew($aThread)
{
    global $_conf, $newthre_num, $STYLE;
    global $word;
    static $favlist_titles = null;
    if ($_conf['expack.misc.multi_favs'] && is_null($favlist_titles)) {
        $favlist_titles = FavSetManager::getFavSetTitles('m_favlist_set');
        if (empty($favlist_titles)) {
            $favlist_titles = array();
        }
        if (!isset($favlist_titles[0]) || $favlist_titles[0] == '') {
            $favlist_titles[0] = 'お気にスレ';
        }
        for ($i = 1; $i <= $_conf['expack.misc.favset_num']; $i++) {
            if (!isset($favlist_titles[$i]) || $favlist_titles[$i] == '') {
                $favlist_titles[$i] = 'お気にスレ' . $i;
            }
        }
    }
    $newthre_num++;
    //==========================================================
    //  idxの読み込み
    //==========================================================
    // hostを分解してidxファイルのパスを求める
    $aThread->setThreadPathInfo($aThread->host, $aThread->bbs, $aThread->key);
    // FileCtl::mkdirFor($aThread->keyidx); // 板ディレクトリが無ければ作る // この操作はおそらく不要
    $aThread->itaj = P2Util::getItaName($aThread->host, $aThread->bbs);
    if (!$aThread->itaj) {
        $aThread->itaj = $aThread->bbs;
    }
    // idxファイルがあれば読み込む
    if ($lines = FileCtl::file_read_lines($aThread->keyidx, FILE_IGNORE_NEW_LINES)) {
        $data = explode('<>', $lines[0]);
    } else {
        $data = array_fill(0, 12, '');
    }
    $aThread->getThreadInfoFromIdx();
    //==================================================================
    // DATのダウンロード
    //==================================================================
    if (!($word and file_exists($aThread->keydat))) {
        $aThread->downloadDat();
    }
    // DATを読み込み
    $aThread->readDat();
    $aThread->setTitleFromLocal();
    // ローカルからタイトルを取得して設定
    //===========================================================
    // 表示レス番の範囲を設定
    //===========================================================
    // 取得済みなら
    if ($aThread->isKitoku()) {
        $from_num = $aThread->readnum + 1 - $_conf['respointer'] - $_conf['before_respointer_new'];
        if ($from_num > $aThread->rescount) {
            $from_num = $aThread->rescount - $_conf['respointer'] - $_conf['before_respointer_new'];
        }
        if ($from_num < 1) {
            $from_num = 1;
        }
        //if (!$aThread->ls) {
        $aThread->ls = "{$from_num}-";
        //}
    }
    $aThread->lsToPoint();
    //==================================================================
    // ヘッダ 表示
    //==================================================================
    $motothre_url = $aThread->getMotoThread(false, '');
    $ttitle_en = UrlSafeBase64::encode($aThread->ttitle);
    $ttitle_en_q = '&amp;ttitle_en=' . $ttitle_en;
    $bbs_q = '&amp;bbs=' . $aThread->bbs;
    $key_q = '&amp;key=' . $aThread->key;
    $host_bbs_key_q = 'host=' . $aThread->host . $bbs_q . $key_q;
    $popup_q = '&amp;popup=1';
    // require_once P2_LIB_DIR . '/read_header.inc.php';
    $prev_thre_num = $newthre_num - 1;
    $next_thre_num = $newthre_num + 1;
    if ($prev_thre_num != 0) {
        $prev_thre_ht = "<a href=\"#ntt{$prev_thre_num}\">▲</a>";
    } else {
        $prev_thre_ht = '';
    }
    $next_thre_ht = "<a id=\"ntta{$next_thre_num}\" href=\"#ntt{$next_thre_num}\">▼</a>";
    P2Util::printInfoHtml();
    // ヘッダ部分HTML
    $read_header_ht = <<<EOP
<table id="ntt{$newthre_num}" class="toolbar">
    <tr>
        <td class="lblock"><h3 class="thread_title">{$aThread->ttitle_hd}</h3></td>
        <td class="rblock">{$prev_thre_ht} {$next_thre_ht}</td>
    </tr>
</table>

EOP;
    //==================================================================
    // ローカルDatを読み込んでHTML表示
    //==================================================================
    $aThread->resrange['nofirst'] = true;
    $GLOBALS['newres_to_show_flag'] = false;
    if ($aThread->rescount) {
        $aShowThread = new ShowThreadPc($aThread, true);
        if ($_conf['expack.spm.enabled']) {
            $read_header_ht .= $aShowThread->getSpmObjJs();
        }
        $res1 = $aShowThread->quoteOne();
        $read_cont_ht = $res1['q'];
        $read_cont_ht .= $aShowThread->getDatToHtml();
        // レス追跡カラー
        if ($_conf['backlink_coloring_track']) {
            $read_cont_ht .= $aShowThread->getResColorJs();
        }
        // IDカラーリング
        if ($_conf['coloredid.enable'] > 0 && $_conf['coloredid.click'] > 0) {
            $read_header_ht .= $aShowThread->getIdColorJs();
        }
        // 外部ツール
        $pluswiki_js = '';
        if ($_conf['wiki.idsearch.spm.mimizun.enabled']) {
            require_once './plugin/mimizun/mimizun.class.php';
            $mimizun = new mimizun();
            $mimizun->host = $aThread->host;
            $mimizun->bbs = $aThread->bbs;
            if ($mimizun->isEnable()) {
                $pluswiki_js .= "WikiTools.addMimizun({$aShowThread->spmObjName});";
            }
        }
        if ($_conf['wiki.idsearch.spm.hissi.enabled']) {
            require_once './plugin/hissi/hissi.class.php';
            $hissi = new hissi();
            $hissi->host = $aThread->host;
            $hissi->bbs = $aThread->bbs;
            if ($hissi->isEnable()) {
                $pluswiki_js .= "WikiTools.addHissi({$aShowThread->spmObjName});";
            }
        }
        if ($_conf['wiki.idsearch.spm.stalker.enabled']) {
            require_once './plugin/stalker/stalker.class.php';
            $stalker = new stalker();
            $stalker->host = $aThread->host;
            $stalker->bbs = $aThread->bbs;
            if ($stalker->isEnable()) {
                $pluswiki_js .= "WikiTools.addStalker({$aShowThread->spmObjName});";
            }
        }
        if ($pluswiki_js) {
            $read_header_ht .= <<<EOP
<script type="text/javascript">
//<![CDATA[
{$pluswiki_js}
//]]>
</script>
EOP;
        }
        unset($aShowThread);
    }
    //==================================================================
    // フッタ 表示
    //==================================================================
    // $read_footer_navi_new  続きを読む 新着レスの表示
    $newtime = date("gis");
    // リンクをクリックしても再読込しない仕様に対抗するダミークエリー
    $info_st = '情報';
    $delete_st = '削除';
    $prev_st = '前';
    $next_st = '次';
    $dores_st = '書込';
    $read_footer_navi_new = "<a href=\"{$_conf['read_php']}?{$host_bbs_key_q}&amp;ls={$aThread->rescount}-&amp;nt={$newtime}#r{$aThread->rescount}\">新着レスの表\示</a>";
    if (!empty($_conf['disable_res'])) {
        $dores_ht = <<<EOP
          <a href="{$motothre_url}" target="_blank">{$dores_st}</a>
EOP;
    } else {
        $dores_ht = <<<EOP
        <a href="post_form.php?{$host_bbs_key_q}&amp;rescount={$aThread->rescount}{$ttitle_en_q}" target='_self' onclick="return OpenSubWin('post_form.php?{$host_bbs_key_q}&amp;rescount={$aThread->rescount}{$ttitle_en_q}{$popup_q}&amp;from_read_new=1',{$STYLE['post_pop_size']},1,0)">{$dores_st}</a>
EOP;
    }
    // ツールバー部分HTML =======
    // お気にマーク設定
    $itaj_hd = htmlspecialchars($aThread->itaj, ENT_QUOTES);
    $similar_q = '&amp;itaj_en=' . UrlSafeBase64::encode($aThread->itaj) . '&amp;method=similar&amp;word=' . rawurlencode($aThread->ttitle_hc);
    if ($_conf['expack.misc.multi_favs']) {
        $toolbar_setfav_ht = 'お気に[';
        $favdo = !empty($aThread->favs[0]) ? 0 : 1;
        $favdo_q = '&amp;setfav=' . $favdo;
        $favmark = $favdo ? '+' : '★';
        $favtitle = $favlist_titles[0] . ($favdo ? 'に追加' : 'から外す');
        $setnum_q = '&amp;setnum=0';
        $toolbar_setfav_ht .= <<<EOP
<span class="favdo set0"><a href="info.php?{$host_bbs_key_q}{$ttitle_en_q}{$favdo_q}{$setnum_q}" target="info" onclick="return setFavJs('{$host_bbs_key_q}{$ttitle_en_q}', '{$favdo}', {$STYLE['info_pop_size']}, 'read_new', this, '0');" title="{$favtitle}">{$favmark}</a></span>
EOP;
        for ($i = 1; $i <= $_conf['expack.misc.favset_num']; $i++) {
            $favdo = !empty($aThread->favs[$i]) ? 0 : 1;
            $favdo_q = '&amp;setfav=' . $favdo;
            $favmark = $favdo ? $i : '★';
            $favtitle = $favlist_titles[$i] . ($favdo ? 'に追加' : 'から外す');
            $setnum_q = '&amp;setnum=' . $i;
            $toolbar_setfav_ht .= <<<EOP
|<span class="favdo set{$i}"><a href="info.php?{$host_bbs_key_q}{$ttitle_en_q}{$favdo_q}{$setnum_q}" target="info" onclick="return setFavJs('{$host_bbs_key_q}{$ttitle_en_q}', '{$favdo}', {$STYLE['info_pop_size']}, 'read_new', this, '{$i}');" title="{$favtitle}">{$favmark}</a></span>
EOP;
        }
        $toolbar_setfav_ht .= ']';
    } else {
        $favdo = !empty($aThread->fav) ? 0 : 1;
        $favdo_q = '&amp;setfav=' . $favdo;
        $favmark = $favdo ? '+' : '★';
        $favtitle = $favdo ? 'お気にスレに追加' : 'お気にスレから外す';
        $toolbar_setfav_ht = <<<EOP
<span class="favdo"><a href="info.php?{$host_bbs_key_q}{$ttitle_en_q}{$favdo_q}" target="info" onclick="return setFavJs('{$host_bbs_key_q}{$ttitle_en_q}', '{$favdo}', {$STYLE['info_pop_size']}, 'read_new', this, '0');" title="{$favtitle}">お気に{$favmark}</a></span>
EOP;
    }
    $toolbar_right_ht = <<<EOTOOLBAR
            <a href="{$_conf['subject_php']}?{$host_bbs_key_q}" target="subject" title="板を開く">{$itaj_hd}</a>
            <a href="info.php?{$host_bbs_key_q}{$ttitle_en_q}" target="info" onclick="return OpenSubWin('info.php?{$host_bbs_key_q}{$ttitle_en_q}{$popup_q}',{$STYLE['info_pop_size']},1,0)" title="スレッド情報を表\示">{$info_st}</a>
            {$toolbar_setfav_ht}
            <span><a href="info.php?{$host_bbs_key_q}{$ttitle_en_q}&amp;dele=true" target="info" onclick="return deleLog('{$host_bbs_key_q}{$ttitle_en_q}', {$STYLE['info_pop_size']}, 'read_new', this);" title="ログを削除する">{$delete_st}</a></span>
<!--            <a href="info.php?{$host_bbs_key_q}{$ttitle_en_q}&amp;taborn=2" target="info" onclick="return OpenSubWin('info.php?{$host_bbs_key_q}{$ttitle_en_q}&amp;popup=2&amp;taborn=2',{$STYLE['info_pop_size']},0,0)" title="スレッドのあぼーん状態をトグルする">あぼん</a> -->
            <a href="{$motothre_url}" title="板サーバ上のオリジナルスレを表\示" onmouseover="showMotoLsPopUp(event, this)" onmouseout="hideMotoLsPopUp()">元スレ</a>
            <a href="{$_conf['subject_php']}?{$host_bbs_key_q}{$similar_q}" target="subject" title="タイトルが似ているスレッドを検索">似スレ</a>
EOTOOLBAR;
    // レスのすばやさ
    $spd_ht = "";
    if ($spd_st = $aThread->getTimePerRes() and $spd_st != "-") {
        $spd_ht = '<span class="spd" title="すばやさ=時間/レス">' . "" . $spd_st . "" . '</span>';
    }
    // datサイズ
    if (file_exists($aThread->keydat) && ($dsize_ht = filesize($aThread->keydat))) {
        $dsize_ht = sprintf('<span class="spd" title="%s">%01.1fKB</span> |', 'datサイズ', $dsize_ht / 1024);
    } else {
        $dsize_ht = '';
    }
    // IC2リンク、件数
    if ($_conf['expack.ic2.enabled'] && $_conf['expack.ic2.thread_imagelink']) {
        $spanid = 'ic2_count_' . sprintf('%u', crc32($aThread->keydat));
        $ic2navi = '<a href="iv2.php?field=memo&amp;key=' . rawurlencode($aThread->ttitle) . '" target="_blank">キャッシュ画像' . ($_conf['expack.ic2.thread_imagecount'] ? '<span id="ic2_count_' . sprintf('%u', crc32($aThread->keydat)) . '"></span>' : '') . '</a> ';
    }
    // フッタ部分HTML
    $read_footer_ht = <<<EOP
<table class="toolbar">
    <tr>
        <td class="lblock">{$res1['body']} | <a href="{$_conf['read_php']}?{$host_bbs_key_q}&amp;offline=1&amp;rescount={$aThread->rescount}#r{$aThread->rescount}">{$aThread->ttitle_hd}</a> | {$dores_ht} {$dsize_ht} {$spd_ht}</td>
        <td class="rblock">{$ic2navi}{$toolbar_right_ht}</td>
        <td class="rblock"><a href="#ntt{$newthre_num}">▲</a></td>
    </tr>
</table>

EOP;
    // 透明あぼーんで表示がない場合はスキップ
    if ($GLOBALS['newres_to_show_flag']) {
        echo '<div style="width:100%;">' . "\n";
        // ほぼIE ActiveXのGray()のためだけに囲ってある
        echo $read_header_ht;
        echo $read_cont_ht;
        echo $read_footer_ht;
        echo '</div>' . "\n\n";
        echo '<hr>' . "\n\n";
    }
    //==================================================================
    // key.idx の値設定
    //==================================================================
    if ($aThread->rescount) {
        $aThread->readnum = min($aThread->rescount, max(0, $data[5], $aThread->resrange['to']));
        $newline = $aThread->readnum + 1;
        // $newlineは廃止予定だが、旧互換用に念のため
        $sar = array($aThread->ttitle, $aThread->key, $data[2], $aThread->rescount, $aThread->modified, $aThread->readnum, $data[6], $data[7], $data[8], $newline, $data[10], $data[11], $aThread->datochiok);
        P2Util::recKeyIdx($aThread->keyidx, $sar);
        // key.idxに記録
    }
}
Example #11
0
    <th class="ti">新着</th>
    <th class="ti">レス</th>
    <th class="ti">No.</th>
    <th class="tl">タイトル</th>
    <th class="t">板</th>
    <th class="t">Birthday</th>
    <th class="ti">勢い</th>
</tr>
</thead>
<tbody>
<?php 
    $R = true;
    foreach ($threads as $o => $t) {
        $new = '';
        $turl = sprintf('%s?host=%s&amp;bbs=%s&amp;key=%d', $_conf['read_php'], $t->host, $t->bbs, $t->tkey);
        $burl = sprintf('%s?host=%s&amp;bbs=%s&amp;itaj_en=%s&amp;word=%s', $_conf['subject_php'], $t->host, $t->bbs, UrlSafeBase64::encode($t->ita), $htm['query_en']);
        if (P2Util::isHostMachiBbs($t->host)) {
            $ourl = sprintf('http://%s/bbs/read.cgi/%s/%s/', $t->host, $t->bbs, $t->tkey);
        } else {
            $ourl = sprintf('http://%s/test/read.cgi/%s/%s/', $t->host, $t->bbs, $t->tkey);
        }
        $iurl = P2Util::throughIme($ourl);
        $aThread = new Thread();
        $aThread->setThreadPathInfo($t->host, $t->bbs, $t->tkey);
        if ($aThread->getThreadInfoFromIdx() && $aThread->isKitoku()) {
            $rnum = max($t->resnum, $aThread->readnum);
            $nnum = max(0, $rnum - $aThread->readnum);
        } else {
            $rnum = $t->resnum;
            $nnum = '';
        }
Example #12
0
/**
 * スレッド情報を取得する
 *
 * @param   string  $host
 * @param   string  $bbs
 * @param   string  $key
 * @return  object  スレッド情報
 */
function get_thread_info($host, $bbs, $key)
{
    global $_conf;
    $group = P2Util::getHostGroupName($host);
    $info = new stdClass();
    $info->type = 'thread';
    $info->group = $group;
    $info->host = $host;
    $info->bbs = $bbs;
    $info->key = $key;
    $aThread = new Thread();
    // hostを分解してidxファイルのパスを求める
    $aThread->setThreadPathInfo($host, $bbs, $key);
    $key_line = $aThread->getThreadInfoFromIdx();
    // $aThread->length をset
    $aThread->getDatBytesFromLocalDat();
    // 板名を取得
    $aThread->itaj = P2Util::getItaName($host, $bbs);
    if (!$aThread->itaj) {
        if (isset($_GET['itaj_en'])) {
            $aThread->itaj = UrlSafeBase64::decode($_GET['itaj_en']);
        } else {
            $aThread->itaj = $bbs;
        }
    }
    $info->itaj = $aThread->itaj;
    // スレタイトルを取得
    if (!$aThread->ttitle) {
        if (isset($_GET['ttitle_en'])) {
            $aThread->setTtitle(UrlSafeBase64::decode($_GET['ttitle_en']));
        } else {
            $aThread->setTitleFromLocal();
        }
    }
    $info->ttitle = $aThread->ttitle;
    // お気にスレ登録状況を取得
    $favs = array();
    if ($_conf['expack.misc.multi_favs']) {
        $favlist_titles = FavSetManager::getFavSetTitles('m_favlist_set');
        for ($i = 0; $i <= $_conf['expack.misc.favset_num']; $i++) {
            if (!isset($favlist_titles[$i]) || $favlist_titles[$i] == '') {
                if ($i == 0) {
                    $favtitle = 'お気にスレ';
                } else {
                    $favtitle = "お気にスレ{$i}";
                }
            } else {
                $favtitle = $favlist_titles[$i];
            }
            $favs[$i] = array('title' => $favtitle, 'set' => !empty($aThread->favs[$i]));
        }
    } else {
        $favs[0] = array('title' => 'お気にスレ', 'set' => !empty($aThread->fav));
    }
    $info->favs = $favs;
    // 殿堂チェック
    $info->palace = false;
    if ($pallines = FileCtl::file_read_lines($_conf['palace_idx'], FILE_IGNORE_NEW_LINES)) {
        foreach ($pallines as $l) {
            $palarray = explode('<>', $l);
            if ($aThread->key == $palarray[1] && $aThread->bbs == $palarray[11]) {
                if (P2Util::getHostGroupName($palarray[10]) == $group) {
                    $info->palace = true;
                    break;
                }
            }
        }
    }
    // スレッドあぼーんチェック
    $info->taborn = false;
    $taborn_idx = P2Util::idxDirOfHostBbs($host, $bbs) . 'p2_threads_aborn.idx';
    if ($tabornlines = FileCtl::file_read_lines($taborn_idx, FILE_IGNORE_NEW_LINES)) {
        foreach ($tabornlines as $l) {
            $tabornarray = explode('<>', $l);
            if ($key == $tabornarray[1]) {
                $info->taborn = true;
                break;
            }
        }
    }
    // ログ関連
    $hasLog = false;
    if (file_exists($aThread->keydat)) {
        $info->keydat = $aThread->keydat;
        $info->length = $aThread->length;
        $hasLog = true;
    } else {
        $info->keydat = null;
        $info->length = -1;
    }
    if (file_exists($aThread->keyidx)) {
        $info->keyidx = $aThread->keyidx;
        $hasLog = true;
    } else {
        $info->keyidx = null;
    }
    if ($aThread->gotnum) {
        $info->gotnum = $aThread->gotnum;
    } elseif ($hasLog) {
        $info->gotnum = 0;
    } else {
        $info->gotnum = -1;
    }
    return $info;
}
Example #13
0
    /**
     * スマートポップアップメニューに必要なスレッド情報を格納したJavaScriptコードを取得
     */
    public function getSpmObjJs($retry = false)
    {
        global $_conf;
        if (isset(self::$_spm_objects[$this->spmObjName])) {
            return $retry ? self::$_spm_objects[$this->spmObjName] : '';
        }
        $ttitle_en = UrlSafeBase64::encode($this->thread->ttitle);
        $motothre_url = $this->thread->getMotoThread();
        $motothre_url = substr($motothre_url, 0, strlen($this->thread->ls) * -1);
        // エスケープ
        $_spm_title = StrCtl::toJavaScript($this->thread->ttitle_hc);
        $_spm_url = addslashes($motothre_url);
        $_spm_host = addslashes($this->thread->host);
        $_spm_bbs = addslashes($this->thread->bbs);
        $_spm_key = addslashes($this->thread->key);
        $_spm_ls = addslashes($this->thread->ls);
        $_spm_b = $_conf['view_forced_by_query'] ? "&b={$_conf['b']}" : '';
        $code = <<<EOJS
<script type="text/javascript">
//<![CDATA[
var {$this->spmObjName} = {
    'objName':'{$this->spmObjName}',
    'query':'&host={$_spm_host}&bbs={$_spm_bbs}&key={$_spm_key}&rescount={$this->thread->rescount}&ttitle_en={$ttitle_en}{$_spm_b}',
    'rc':'{$this->thread->rescount}',
    'title':'{$_spm_title}',
    'ttitle_en':'{$ttitle_en}',
    'url':'{$_spm_url}',
    'host':'{$_spm_host}',
    'bbs':'{$_spm_bbs}',
    'key':'{$_spm_key}',
    'ls':'{$_spm_ls}',
    'client':['{$_conf['b']}','{$_conf['client_type']}']
};
{$this->spmObjName}.show = (function(no,id,evt){SPM.show({$this->spmObjName},no,id,evt);});
{$this->spmObjName}.hide = SPM.hide; // (function(evt){SPM.hide(evt);});
//]]>
</script>

EOJS;
        self::$_spm_objects[$this->spmObjName] = $code;
        return $code;
    }
Example #14
0
    /**
     * お気に板をプリントする
     */
    public function printFavIta()
    {
        global $_conf, $matome_i, $STYLE;
        $menu_php_ht = p2h(isset($GLOBALS['menu_php_self']) ? $GLOBALS['menu_php_self'] : $_SERVER['SCRIPT_NAME']);
        echo <<<EOP
<div class="menu_cate">
  <b><a class="menu_cate" href="javascript:void(0);" onclick="showHide('c_favita');" target="_self">お気に板</a></b> [<a href="editfavita.php" target="subject">編集</a>]
EOP;
        // お気に板切り替え
        if ($_conf['expack.misc.multi_favs']) {
            echo "<br>\n";
            echo FavSetManager::makeFavSetSwitchElem('m_favita_set', 'お気に板', true, "replaceMenuItem('c_favita', 'm_favita_set', this.options[this.selectedIndex].value);");
        }
        if ($_conf['expack.misc.multi_favs']) {
            $favset_title = FavSetManager::getFavSetPageTitleHt('m_favita_set', 'お気に板');
        } else {
            $favset_title = 'お気に板';
        }
        echo "  <div class=\"itas\" id=\"c_favita\">\n";
        if ($_conf['merge_favita']) {
            echo <<<EOP
      <a href="{$_conf['subject_php']}?spmode=merge_favita{$_conf['m_favita_set_at_a']}">{$favset_title} (まとめ)</a><br>

EOP;
        }
        // favita読み込み
        $favitas = array();
        if ($lines = FileCtl::file_read_lines($_conf['favita_brd'], FILE_IGNORE_NEW_LINES)) {
            foreach ($lines as $l) {
                if (preg_match("/^\t?(.+)\t(.+)\t(.+)\$/", $l, $matches)) {
                    $favitas[] = array('host' => $matches[1], 'bbs' => $matches[2], 'itaj' => $matches[3]);
                }
            }
        }
        if ($favitas) {
            // 新着数を表示する場合・まとめてプリフェッチ
            if ($_conf['enable_menu_new'] && !empty($_GET['new'])) {
                if ($_conf['expack.use_pecl_http'] == 1) {
                    P2HttpExt::activate();
                    P2HttpRequestPool::fetchSubjectTxt($favitas);
                    $GLOBALS['expack.subject.multi-threaded-download.done'] = true;
                } elseif ($_conf['expack.use_pecl_http'] == 2) {
                    if (P2CommandRunner::fetchSubjectTxt('merge_favita', $_conf)) {
                        $GLOBALS['expack.subject.multi-threaded-download.done'] = true;
                    }
                }
            }
            foreach ($favitas as $favita) {
                extract($favita);
                $itaj_view = p2h($itaj);
                $itaj_en = UrlSafeBase64::encode($itaj);
                $itaj_js = addslashes($itaj_view);
                $p_htm['star'] = <<<EOP
<a href="{$menu_php_ht}?host={$host}&amp;bbs={$bbs}&amp;setfavita=0{$_conf['m_favita_set_at_a']}" target="_self" class="fav" title="「{$itaj_view}」をお気に板から外す" onclick="return window.confirm('「{$itaj_js}」をお気に板から外してよろしいですか?');">★</a>
EOP;
                //  onclick="return confirmSetFavIta('{$itaj_ht}');"
                // 新着数を表示する場合
                if ($_conf['enable_menu_new'] && !empty($_GET['new'])) {
                    $matome_i++;
                    $spmode = null;
                    // $shinchaku_num, $_newthre_num をセット
                    include P2_LIB_DIR . '/subject_new.inc.php';
                    if ($shinchaku_num > 0) {
                        $class_newres_num = ' class="newres_num"';
                    } else {
                        $class_newres_num = ' class="newres_num_zero"';
                    }
                    if ($_newthre_num) {
                        $newthre_ht = "{$_newthre_num}";
                    } else {
                        $newthre_ht = '';
                    }
                    echo <<<EOP
    {$p_htm['star']} <a href="{$_conf['subject_php']}?host={$host}&amp;bbs={$bbs}&amp;itaj_en={$itaj_en}" onclick="chMenuColor({$matome_i});">{$itaj_view}</a> <span id="newthre{$matome_i}" class="newthre_num">{$newthre_ht}</span> (<a href="{$_conf['read_new_php']}?host={$host}&amp;bbs={$bbs}" target="read" id="un{$matome_i}" onclick="chUnColor({$matome_i});"{$class_newres_num}>{$shinchaku_num}</a>)<br>

EOP;
                    // 新着数を表示しない場合
                } else {
                    echo <<<EOP
    {$p_htm['star']} <a href="{$_conf['subject_php']}?host={$host}&amp;bbs={$bbs}&amp;itaj_en={$itaj_en}">{$itaj_view}</a><br>

EOP;
                }
                flush();
            }
            // foreach
            // 空っぽなら
        } else {
            echo ' (空っぽ)';
        }
        echo "  </div>\n</div>\n";
    }
Example #15
0
/**
 * カンマ区切り+@区切りのリストからお気に板をセットする
 *
 * @param   string      $list
 * @param   int|null    $setnum
 * @return  bool
 */
function setFavItaByList($list, $setnum = null)
{
    global $_conf;
    // 記録データ設定
    $rec_lines = array();
    foreach (explode(',', $list) as $aList) {
        list($host, $bbs, $itaj_en) = explode('@', $aList);
        $rec_lines[] = "\t{$host}\t{$bbs}\t" . UrlSafeBase64::decode($itaj_en);
    }
    $script = <<<EOJS
<script type="text/javascript">
//<![CDATA[
if (parent.menu) {
    parent.menu.location.href = '{$_conf['menu_php']}?nr=1';
}
//]]>
</script>

EOJS;
    P2Util::pushInfoHtml($script);
    $cont = '';
    if (!empty($rec_lines)) {
        foreach ($rec_lines as $l) {
            $cont .= $l . "\n";
        }
    }
    // 書き込む
    if (FileCtl::file_write_contents(setFavItaGetBrdPath($setnum), $cont) === false) {
        p2die('cannot write file.');
    }
    return true;
}
Example #16
0
/**
 * フィードリストを表示する
 *
 * @param string $title
 * @param int    $no
 * @return void
 */
function menu_iphone_show_feed_list($title, $no = null)
{
    global $_conf;
    require_once P2EX_LIB_DIR . '/rss/common.inc.php';
    echo "<ul id=\"rss{$no}\" title=\"{$title}\">";
    $errors = array();
    if ($rss_list = FileCtl::file_read_lines($_conf['expack.rss.setting_path'], FILE_IGNORE_NEW_LINES)) {
        foreach ($rss_list as $rss_info) {
            $p = explode("\t", $rss_info);
            if (count($p) > 1) {
                $site = $p[0];
                $xml = $p[1];
                if (!empty($p[2])) {
                    $atom = 1;
                    $atom_q = '&atom=1';
                } else {
                    $atom = 0;
                    $atom_q = '';
                }
                $localpath = rss_get_save_path($xml);
                if (PEAR::isError($localpath)) {
                    $errors[] = array($site, $localpath->getMessage());
                } else {
                    $mtime = file_exists($localpath) ? filemtime($localpath) : 0;
                    $site_en = UrlSafeBase64::encode($site);
                    $xml_en = rawurlencode($xml);
                    $rss_q = sprintf('?xml=%s&site_en=%s%s&mt=%d', $xml_en, $site_en, $atom_q, $mtime);
                    $rss_q_ht = p2h($rss_q);
                    echo "<li><a href=\"subject_rss.php{$rss_q_ht}\" target=\"_self\">{$site}</a></li>";
                }
            }
        }
    }
    if (count($errors)) {
        echo '<li class="group">エラー</li>';
        foreach ($errors as $error) {
            echo "<li>{$error[0]} - {$error[1]}</li>";
        }
    }
    //echo '<li class="group">&nbsp;</li>';
    echo '<li><a href="editrss.php';
    if ($_conf['expack.misc.multi_favs']) {
        echo '?m_rss_set=' . $no;
    }
    echo '" class="align-r" target="_self">編集</a></li>';
    echo "</ul>\n";
}
EOP;
$read_navi_filter_btm = <<<EOP
<a href="read_filter_k.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['filter']}>{$_conf['k_accesskey_st']['filter']}{$find_st}</a>
EOP;
// }}}
//====================================================================
// 検索時の特別な処理
//====================================================================
if ($filter_hits !== NULL) {
    include P2_LIB_DIR . '/read_filter_k.inc.php';
}
//====================================================================
// HTMLプリント
//====================================================================
// {{{ ツールバー部分HTML
$similar_q = '&amp;itaj_en=' . UrlSafeBase64::encode($aThread->itaj) . '&amp;method=similar&amp;word=' . rawurlencode($aThread->ttitle_hc) . '&amp;refresh=1';
$itaj_hd = htmlspecialchars($aThread->itaj, ENT_QUOTES);
$toolbar_right_ht = <<<EOTOOLBAR
<a href="{$_conf['subject_php']}?{$host_bbs_key_q}{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['up']}>{$_conf['k_accesskey_st']['up']}{$itaj_hd}</a>
<a href="info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['info']}>{$_conf['k_accesskey_st']['info']}{$info_st}</a>
<a href="info.php?{$host_bbs_key_q}{$ttitle_en_q}&amp;dele=1{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['dele']}>{$_conf['k_accesskey_st']['dele']}{$delete_st}</a>
<a href="{$motothre_url}" target="_blank">{$moto_thre_st}</a>
<a href="{$_conf['subject_php']}?{$host_bbs_key_q}{$similar_q}{$_conf['k_at_a']}">{$siml_thre_st}</a>
EOTOOLBAR;
// }}}
//=====================================
//!empty($_GET['nocache']) and P2Util::header_nocache();
echo $_conf['doctype'];
echo <<<EOHEADER
<html>
<head>
Example #18
0
EOP;
}
//================================================================
// NOSCRIPT時のHTML表示
//================================================================
if ($lines) {
    // PC(NetFrontを除外)
    if (!$_conf['ktai'] && $_conf['favita_order_dnd'] && !P2Util::isNetFront()) {
        echo '<noscript>';
    }
    echo 'お気に板の並び替え';
    echo '<table>';
    foreach ($lines as $l) {
        if (preg_match('/^\\t?(.+?)\\t(.+?)\\t(.+?)$/', rtrim($l), $matches)) {
            $itaj = rtrim($matches[3]);
            $itaj_en = UrlSafeBase64::encode($itaj);
            $host = $matches[1];
            $bbs = $matches[2];
            $itaj_view = p2h($itaj);
            $itaj_q = '&amp;itaj_en=' . $itaj_en;
            echo <<<EOP
            <tr>
            <td><a href="{$_conf['subject_php']}?host={$host}&amp;bbs={$bbs}{$_conf['k_at_a']}">{$itaj_view}</a></td>
            <td>[ <a class="te" href="{$_SERVER['SCRIPT_NAME']}?host={$host}&amp;bbs={$bbs}{$itaj_q}&amp;setfavita=top{$_conf['k_at_a']}" title="一番上に移動">▲</a></td>
            <td><a class="te" href="{$_SERVER['SCRIPT_NAME']}?host={$host}&amp;bbs={$bbs}{$itaj_q}&amp;setfavita=up{$_conf['k_at_a']}" title="一つ上に移動">↑</a></td>
            <td><a class="te" href="{$_SERVER['SCRIPT_NAME']}?host={$host}&amp;bbs={$bbs}{$itaj_q}&amp;setfavita=down{$_conf['k_at_a']}" title="一つ下に移動">↓</a></td>
            <td><a class="te" href="{$_SERVER['SCRIPT_NAME']}?host={$host}&amp;bbs={$bbs}{$itaj_q}&amp;setfavita=bottom{$_conf['k_at_a']}" title="一番下に移動">▼</a> ]</td>
            <td>[<a href="{$_SERVER['SCRIPT_NAME']}?host={$host}&amp;bbs={$bbs}&amp;setfavita=0{$_conf['k_at_a']}">削除</a>]</td>
            </tr>
EOP;
        }
<?php

/**
 * rep2 - スレッド表示 -  フッタ部分 -  for read.php
 */
//=====================================================================
// ■フッタ
//=====================================================================
if ($_conf['bottom_res_form']) {
    $bbs = $aThread->bbs;
    $key = $aThread->key;
    $host = $aThread->host;
    $rescount = $aThread->rescount;
    $ttitle_en = UrlSafeBase64::encode($aThread->ttitle);
    $submit_value = '書き込む';
    $key_idx = $aThread->keyidx;
    // フォームのオプション読み込み
    require_once P2_LIB_DIR . '/post_form_options.inc.php';
    $htm['resform_ttitle'] = <<<EOP
<p><b class="thre_title">{$aThread->ttitle_hd}</b></p>
EOP;
    require_once P2_LIB_DIR . '/post_form.inc.php';
    // フォーム
    $res_form_ht = <<<EOP
<div id="kakiko">
{$htm['dpreview']}
{$htm['post_form']}
{$htm['dpreview2']}
</div>

EOP;
Example #20
0
 case 'ng_msg':
     $title_st = 'p2 - NGワード登録:メッセージ';
     if ($popup == 2) {
         $msg = 'NGワード(メッセージ)に <b>' . $aborn_str . '</b> を登録しました。';
     } else {
         $msg = 'NGワード(メッセージ)<br><input type="text" name="aborn_str"' . $input_size_at . ' value="' . $aborn_str . '">';
     }
     $edit_value = 'NGワード編集:メッセージ';
     break;
 case 'ng_id':
     $title_st = 'p2 - NGワード登録:ID';
     if ($popup == 2) {
         $msg = 'NGワード(ID)に <b>' . $aborn_str . '</b> を登録しました。';
     } elseif ($aborn_id != "") {
         $msg = 'NGワード(ID)に <b>' . $aborn_id . '</b> を登録してよろしいですか?';
         $aborn_str_en = UrlSafeBase64::encode($aborn_id);
     }
     $edit_value = 'NGワード編集:ID';
     break;
     // +Wiki:Beあぼーん
 // +Wiki:Beあぼーん
 case 'aborn_be':
     $title_st = 'p2 - あぼーんワード登録:BE';
     if ($popup == 2) {
         $msg = 'あぼーんワード(BE)に <b>' . $aborn_str . '</b> を登録しました。';
     } elseif ($aborn_id != "") {
         $msg = 'あぼーんワード(BE)に <b>' . $aborn_be . '</b> を登録してよろしいですか?';
         $aborn_str_en = base64_encode($aborn_be);
     }
     $edit_value = 'あぼーんワード編集:BE';
     break;
Example #21
0
<?php

/**
 * rep2 - 携帯版レスフィルタリング
 */
require_once __DIR__ . '/../init.php';
$_login->authorize();
// ユーザ認証
/**
 * スレッド情報
 */
$host = $_GET['host'];
$bbs = $_GET['bbs'];
$key = $_GET['key'];
$ttitle = UrlSafeBase64::decode($_GET['ttitle_en']);
$ttitle_back = isset($_SERVER['HTTP_REFERER']) ? '<a href="' . p2h($_SERVER['HTTP_REFERER']) . '" title="戻る">' . $ttitle . '</a>' : $ttitle;
$hidden_fields_ht = ResFilterElement::getHiddenFields($host, $bbs, $key);
if ($_conf['iphone']) {
    $word_field_ht = ResFilterElement::getWordField(array('autocorrect' => 'off', 'autocapitalize' => 'off'));
} else {
    $word_field_ht = ResFilterElement::getWordField();
}
$field_field_ht = ResFilterElement::getFieldField();
$method_field_ht = ResFilterElement::getMethodField();
$match_field_ht = ResFilterElement::getMatchField();
$include_field_ht = ResFilterElement::getIncludeField();
/**
 * 検索フォームを表示
 */
P2Util::header_nocache();
echo $_conf['doctype'];
Example #22
0
     // {{{ ブックマーク
 // }}}
 // {{{ ブックマーク
 case 'bookmark':
     if (isset($host) && isset($bbs) && isset($key) && isset($_REQUEST['resnum']) && isset($_REQUEST['bookmark'])) {
         if (!function_exists('setbookmark')) {
             include P2_LIB_DIR . '/setbookmark.inc.php';
         }
         if (is_numeric($_REQUEST['resnum'])) {
             $resnum = intval($_REQUEST['resnum']);
         } else {
             $resnum = null;
         }
         $set = (bool) $_REQUEST['bookmark'];
         if (isset($_REQUEST['ttitle_en'])) {
             $ttitle = UrlSafeBase64::decode($_REQUEST['ttitle_en']);
         } elseif (isset($_REQUEST['ttitle'])) {
             $ttitle = $_REQUEST['ttitle'];
         } else {
             $ttitle = null;
         }
         if (isset($_REQUEST['memo'])) {
             $memo = $_REQUEST['memo'];
         } else {
             $memo = null;
         }
         $r = setbookmark($host, $bbs, $key, $resnum, $set, $ttitle, $memo);
         if (empty($r)) {
             $r_msg = '0';
             // 失敗
         } elseif ($r == 1) {
Example #23
0
 public function setItaj($itaj)
 {
     $this->itaj = $itaj;
     $this->itaj_en = UrlSafeBase64::encode($this->itaj);
     $this->itaj_ht = htmlspecialchars($this->itaj, ENT_QUOTES);
 }
            echo '<td>&nbsp;</td>';
        }
    }
    echo '</tr>';
}
// }}}
// {{{ その他 - ボタン類
echo '<tr>';
// >>1
echo '<td>';
$escaped_url = "{$_conf['read_php']}?{$host_bbs_key_q}&amp;ls=1-{$rnum_range}{$offline_q}{$_conf['k_at_a']}";
echo toolbar_i_standard_button('img/glyphish/icons2/63-runner.png', '&gt;&gt;1', $escaped_url);
echo '</td>';
// 類似スレ検索
echo '<td>';
$escaped_url = "{$_conf['subject_php']}?{$host_bbs_key_q}&amp;itaj_en=" . UrlSafeBase64::encode($aThread->itaj) . '&amp;method=similar&amp;word=' . rawurlencode($aThread->ttitle_hc) . "&amp;refresh=1{$_conf['k_at_a']}";
echo toolbar_i_standard_button('img/glyphish/icons2/06-magnifying-glass.png', '類似スレ', $escaped_url);
echo '</td>';
// 殿堂入り
echo '<td>';
echo toolbar_i_palace_button('img/glyphish/icons2/108-badge.png', '殿堂入り', $thread_info);
echo '</td>';
// スレッドあぼーん
echo '<td>';
echo toolbar_i_aborn_button('img/glyphish/icons2/128-bone.png', 'あぼーん', $thread_info);
echo '</td>';
// ログ削除
echo '<td>';
if (file_exists($aThread->keydat)) {
    $escaped_url = "info.php?{$host_bbs_key_q}{$ttitle_en_q}&amp;dele=1{$_conf['k_at_a']}";
    echo toolbar_i_standard_button('img/glyphish/icons2/64-zap.png', 'ログ削除', $escaped_url);
Example #25
0
<form method="GET" action="{$_SERVER['SCRIPT_NAME']}">
<select name="edit_conf_user_group_en">
EOP;
    if ($_conf['iphone']) {
        echo '<optgroup label="rep2基本設定">';
    }
    foreach ($groups as $groupname) {
        if ($_conf['iphone']) {
            if ($groupname == 'tGrep') {
                echo '</optgroup><optgroup label="拡張パック設定">';
            } elseif ($groupname == 'subject-i') {
                echo '</optgroup><optgroup label="iPhone設定">';
            }
        }
        $group_ht = p2h($groupname);
        $group_en = UrlSafeBase64::encode($groupname);
        $selected = $selected_group == $groupname ? ' selected' : '';
        echo "<option value=\"{$group_en}\"{$selected}>{$group_ht}</option>";
    }
    if ($_conf['iphone']) {
        echo '</optgroup>';
    }
    echo <<<EOP
</select>
<input type="submit" value="の設定を編集">
{$_conf['detect_hint_input_ht']}{$_conf['k_input_ht']}
</form>
<hr>
<div class="center">
<a href="editpref.php{$_conf['k_at_q']}"{$_conf['k_accesskey_at']['up']}>{$_conf['k_accesskey_st']['up']}設定編集</a>
{$_conf['k_to_index_ht']}
Example #26
0
/**
 * スレッドあぼーん状態をトグルするツールバーボタン
 *
 * @param string $icon
 * @param string $label
 * @param object $info @see lib/get_info.inc.php: get_thread_info()
 * @return string
 */
function toolbar_i_aborn_button($icon, $label, $info)
{
    $attrs = ' onclick="return iutil.toolbarRunHttpCommand(this, event);"';
    if (!$info->taborn) {
        $attrs .= ' class="inactive"';
    }
    $uri = 'httpcmd.php?' . http_build_query(array('cmd' => 'taborn', 'host' => $info->host, 'bbs' => $info->bbs, 'key' => $info->key, 'ttitle_en' => UrlSafeBase64::encode($info->ttitle), 'taborn' => 2), '', '&amp;');
    return _toolbar_i_button($icon, $label, $uri, $attrs);
}
Example #27
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>';
    }
}
Example #28
0
        P2Util::pushInfoHtml($script);
        unset($site, $xml, $atom, $m, $matches, $fp);
        return;
    }
}
$setrss = isset($_REQUEST['setrss']) ? trim($_REQUEST['setrss']) : '';
$xml = isset($_REQUEST['xml']) ? trim($_REQUEST['xml']) : '';
$site = isset($_REQUEST['site']) ? trim($_REQUEST['site']) : '';
$site_en = isset($_REQUEST['site_en']) ? trim($_REQUEST['site_en']) : '';
$atom = empty($_REQUEST['atom']) ? 0 : 1;
// feedスキームをhttpスキームで置換
$xml = preg_replace('|^feed://|', 'http://', $xml);
// RSSのタイトル設定
if ($site === '') {
    if ($site_en !== '') {
        $site = UrlSafeBase64::decode($site_en);
    } else {
        $purl = @parse_url($xml);
        if (is_array($purl)) {
            if (array_key_exists('host', $purl)) {
                $site .= $purl['host'];
            }
            if (array_key_exists('path', $purl)) {
                $site .= '.' . basename($purl['path']);
            }
            if (array_key_exists('query', $purl)) {
                $site .= '?' . $purl['query'];
            }
        }
        $site = basename($xml);
        $rss = p2GetRSS($xml);
Example #29
0
// {{{ 削除
if (!empty($_GET['dele']) || isset($_POST['submit']) && $_POST['submit'] == $deletelog_st) {
    if ($host && $bbs) {
        require_once P2_LIB_DIR . '/dele.inc.php';
        if (isset($_POST['checkedkeys'])) {
            $dele_keys = $_POST['checkedkeys'];
        } else {
            $dele_keys = array($_GET['key']);
        }
        deleteLogs($host, $bbs, $dele_keys);
    }
    // }}}
    // お気に入りスレッド
} elseif (isset($_GET['setfav']) && !empty($_GET['key']) && $host && $bbs) {
    require_once P2_LIB_DIR . '/setfav.inc.php';
    setFav($host, $bbs, $_GET['key'], $_GET['setfav'], isset($_GET['ttitle_en']) ? UrlSafeBase64::decode($_GET['ttitle_en']) : null);
    // 殿堂入り
} elseif (isset($_GET['setpal']) && $_GET['key'] && $host && $bbs) {
    require_once P2_LIB_DIR . '/setpalace.inc.php';
    setPal($host, $bbs, $_GET['key'], $_GET['setpal']);
    // あぼーんスレッド解除
} elseif (isset($_POST['submit']) && $_POST['submit'] == $abornoff_st && $host && $bbs && $_POST['checkedkeys']) {
    require_once P2_LIB_DIR . '/settaborn_off.inc.php';
    settaborn_off($host, $bbs, $_POST['checkedkeys']);
    // スレッドあぼーん
} elseif (isset($_GET['taborn']) && !is_null($_GET['key']) && $host && $bbs) {
    require_once P2_LIB_DIR . '/settaborn.inc.php';
    settaborn($host, $bbs, $_GET['key'], $_GET['taborn']);
}
// お気に板をマージ
if ($spmode == 'merge_favita') {
Example #30
0
/**
 * 登録されているRSS一覧を表示(携帯用)
 */
function print_rss_list_k()
{
    global $_conf;
    $pageTitle = $_conf['expack.misc.multi_favs'] ? FavSetManager::getFavSetPageTitleHt('m_rss_set', 'RSS') : 'RSS';
    echo $pageTitle;
    echo '<hr>';
    $i = 1;
    if ($rss_list = FileCtl::file_read_lines($_conf['expack.rss.setting_path'], FILE_IGNORE_NEW_LINES)) {
        foreach ($rss_list as $rss_info) {
            $p = explode("\t", $rss_info);
            if (count($p) > 1) {
                $site = $p[0];
                $xml = $p[1];
                if (!empty($p[2])) {
                    $atom = 1;
                    $atom_q = '&atom=1';
                } else {
                    $atom = 0;
                    $atom_q = '';
                }
                if ($i <= 9) {
                    $accesskey_at = $_conf['k_accesskey_at'][$i];
                    $accesskey_st = "{$i} ";
                } else {
                    $accesskey_at = '';
                    $accesskey_st = '';
                }
                $localpath = rss_get_save_path($xml);
                if (PEAR::isError($localpath)) {
                    echo $accesskey_st . $site . ' ' . $localpath->getMessage() . "<br>\n";
                } else {
                    $mtime = file_exists($localpath) ? filemtime($localpath) : 0;
                    $site_en = UrlSafeBase64::encode($site);
                    $xml_en = rawurlencode($xml);
                    $rss_q = sprintf('?xml=%s&site_en=%s%s&mt=%d', $xml_en, $site_en, $atom_q, $mtime);
                    $rss_q_ht = p2h($rss_q);
                    echo "{$accesskey_st}<a href=\"subject_rss.php{$rss_q_ht}\"{$accesskey_at}>{$site}</a><br>\n";
                }
                $i++;
            }
        }
    }
}