示例#1
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++;
            }
        }
    }
}
示例#2
0
 /**
  * spmodeを設定する
  */
 public function setSpMode($name)
 {
     global $_conf;
     $halfwidth = $_conf['ktai'] && !$_conf['iphone'];
     switch ($name) {
         case 'recent':
             $this->spmode = $name;
             $this->ptitle = $halfwidth ? '最近読んだスレ' : '最近読んだスレ';
             break;
         case 'res_hist':
             $this->spmode = $name;
             $this->ptitle = '書き込み履歴';
             break;
         case 'fav':
             $this->spmode = $name;
             $this->ptitle = $halfwidth ? 'お気にスレ' : 'お気にスレ';
             break;
         case 'taborn':
             $this->spmode = $name;
             $this->ptitle = $this->itaj . ($halfwidth ? ' (アボン中)' : ' (あぼーん中)');
             break;
         case 'soko':
             $this->spmode = $name;
             $this->ptitle = "{$this->itaj} (dat倉庫)";
             break;
         case 'palace':
             $this->spmode = $name;
             $this->ptitle = $halfwidth ? 'スレの殿堂' : 'スレの殿堂';
             break;
         case 'merge_favita':
             $this->spmode = $name;
             if ($_conf['expack.misc.multi_favs']) {
                 $this->ptitle = str_replace(array('&gt;', '&lt;', '&quot;', '&#039;'), array('>', '<', '"', "'"), FavSetManager::getFavSetPageTitleHt('m_favita_set', 'お気に板')) . ' (まとめ)';
             } else {
                 $this->ptitle = 'お気に板 (まとめ)';
             }
             break;
     }
 }
示例#3
0
        // match登録よりheadなげて聞いたほうがよさそうだが、ワンレスポンス増えるのが困る
        if (!strcasecmp($aThreadList->host, 'livesoccer.net')) {
            $ptitle_url .= 'index2.html';
        }
    }
    // あぼーん or 倉庫
} elseif ($aThreadList->spmode == 'taborn' || $aThreadList->spmode == 'soko') {
    $ptitle_url = $p2_subject_url;
    // 書き込み履歴
} elseif ($aThreadList->spmode == 'res_hist') {
    $ptitle_url = "./read_res_hist.php{$_conf['k_at_q']}#footer";
}
// }}}
// {{{ ページタイトル部分HTML設定
if ($aThreadList->spmode == 'fav' && $_conf['expack.misc.multi_favs']) {
    $ptitle_hd = FavSetManager::getFavSetPageTitleHt('m_favlist_set', $aThreadList->ptitle);
} else {
    $ptitle_hd = p2h($aThreadList->ptitle);
}
if ($aThreadList->spmode == 'taborn') {
    $ptitle_ht = <<<EOP
<a href="{$ptitle_url}"><b>{$aThreadList->itaj_hd}</b></a>(アボン中)
EOP;
} elseif ($aThreadList->spmode == 'soko') {
    $ptitle_ht = <<<EOP
<a href="{$ptitle_url}"><b>{$aThreadList->itaj_hd}</b></a>(dat倉庫)
EOP;
} elseif (!empty($ptitle_url)) {
    $ptitle_ht = <<<EOP
<a href="{$ptitle_url}" class="nobutton"><b>{$ptitle_hd}</b></a>
EOP;
示例#4
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>";
        }
    }
示例#5
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";
    }