コード例 #1
0
ファイル: sb_toolbar_k.funcs.php プロジェクト: poppen/p2
/**
 * 新着まとめ読み <a>
 *
 * @return  string  HTML
 */
function getShinchakuMatomeATag($aThreadList, $shinchaku_num)
{
    global $_conf;
    static $upper_toolbar_done_ = false;
    $shinchaku_matome_atag = '';
    // 倉庫なら新着まとめのリンクはなし
    if ($aThreadList->spmode == 'soko') {
        return $shinchaku_matome_atag = '';
    }
    $attrs = array();
    if (UA::isIPhoneGroup()) {
        $attrs['class'] = 'button';
    }
    // 上下あるツールバーの下だけにアクセスキーをつける
    if ($upper_toolbar_done_) {
        $attrs[$_conf['accesskey_for_k']] = $_conf['k_accesskey']['matome'];
    }
    $upper_toolbar_done_ = true;
    $qs = array('host' => $aThreadList->host, 'bbs' => $aThreadList->bbs, 'spmode' => $aThreadList->spmode, 'nt' => date('gis'), UA::getQueryKey() => UA::getQueryValue());
    $label = "{$_conf['k_accesskey']['matome']}.新まとめ";
    if ($shinchaku_num) {
        $shinchaku_matome_atag = P2View::tagA(UriUtil::buildQueryUri($_conf['read_new_k_php'], array_merge($qs, array('norefresh' => '1'))), hs("{$label}({$shinchaku_num})"), $attrs);
    } else {
        $shinchaku_matome_atag = P2View::tagA(UriUtil::buildQueryUri($_conf['read_new_k_php'], $qs), hs($label), $attrs);
    }
    return $shinchaku_matome_atag;
}
コード例 #2
0
ファイル: read_filter_k.funcs.php プロジェクト: poppen/p2
/**
 * フィルタ用に書き換えたフッタ変数を取得する
 * 
 * @access  public
 * @return  array  array(read_navi_previous_btm_ht, read_navi_next_btm_ht, read_footer_navi_new_btm_ht)
 */
function getResetReadNaviFooterK($aThread, $params)
{
    global $_conf;
    global $_filter_hits, $_filter_range;
    // $prev_st, $next_st, $filter_page, $res_filter
    extract($params);
    // {{{ 検索クエリ
    $filter_qs = array('detect_hint' => '◎◇', 'host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'offline' => 1, 'word' => $GLOBALS['word'], 'ls' => 'all', UA::getQueryKey() => UA::getQueryValue());
    foreach ($res_filter as $key => $value) {
        $filter_qs[$key] = $value;
    }
    // }}}
    if ($filter_page > 1) {
        $qs = array_merge($filter_qs, array('filter_page' => $filter_page - 1));
        $read_navi_previous_url = UriUtil::buildQueryUri($_conf['read_php'], $qs);
        $read_navi_previous_btm_ht = sprintf('<a %1$s="%2$s" href="%3$s">%2$s.%4$s</a>', hs($_conf['accesskey_for_k']), hs($_conf['k_accesskey']['prev']), hs($read_navi_previous_url), hs($prev_st));
    }
    if ($_filter_range['to'] < $_filter_hits) {
        $qs = array_merge($filter_qs, array('filter_page' => $filter_page + 1));
        $read_navi_next_url = UriUtil::buildQueryUri($_conf['read_php'], $qs);
        $read_navi_next_btm_ht = sprintf('<a %1$s="%2$s" href="%3$s">%2$s.%4$s</a>', hs($_conf['accesskey_for_k']), hs($_conf['k_accesskey']['next']), hs($read_navi_next_url), hs($next_st));
    }
    $read_footer_navi_new_btm_ht = '';
    /*
    // ※メモ:「6.新着」(新着レスの表示)と「3.新20」(最新N件)は異なる。
    $read_footer_navi_new_btm_ht = str_replace(
        " {$_conf['accesskey_for_k']}=\"{$_conf['k_accesskey']['next']}\"", '', $read_footer_navi_new_btm_ht
    );
    $read_footer_navi_new_btm_ht = str_replace(">{$_conf['k_accesskey']['next']}.", '>', $read_footer_navi_new_btm_ht);
    */
    return array('read_navi_previous_btm_ht' => $rread_navi_previous_btm_ht, 'read_navi_next_btm_ht' => $read_navi_next_btm_ht, 'read_footer_navi_new_btm_ht' => $read_footer_navi_new_btm_ht);
}
コード例 #3
0
ファイル: cookie.php プロジェクト: poppen/p2
/**
 * @return  string
 */
function _getCookieLocationUri()
{
    $qs = array('check_regist_cookie' => '1', 'regist_cookie' => intval(geti($_REQUEST['regist_cookie'])), UA::getQueryKey() => UA::getQueryValue());
    if (defined('SID') && strlen(SID)) {
        $qs[session_name()] = session_id();
    }
    return $next_uri = UriUtil::buildQueryUri('login.php', $qs);
}
コード例 #4
0
ファイル: sb_toolbar.funcs.php プロジェクト: poppen/p2
/**
 * @access  public
 * @return  string  HTML
 */
function getSbToolbarShinchakuMatomeHtml($aThreadList, $shinchaku_num)
{
    global $_conf;
    static $new_matome_i_ = 0;
    $new_matome_i_++;
    $shinchaku_matome_ht = '';
    // 倉庫でなければ
    if ($aThreadList->spmode != 'soko') {
        $shinchaku_num_ht = '';
        if ($shinchaku_num) {
            $shinchaku_num_ht = " (<span id=\"smynum{$new_matome_i_}\" class=\"matome_num\">{$shinchaku_num}</span>)";
        }
        $shinchaku_matome_ht = P2View::tagA(UriUtil::buildQueryUri($_conf['read_new_php'], array('host' => $aThreadList->host, 'bbs' => $aThreadList->bbs, 'spmode' => $aThreadList->spmode, 'norefresh' => 1, 'nt' => date('gis'), UA::getQueryKey() => UA::getQueryValue())), '新着まとめ読み' . $shinchaku_num_ht, array('id' => "smy{$new_matome_i_}", 'class' => 'matome', 'onClick' => 'chNewAllColor();'));
    }
    return $shinchaku_matome_ht;
}
コード例 #5
0
ファイル: edit_indexmenui.php プロジェクト: poppen/p2
    _setOrderIndexMenuK($_GET['code'], $_GET['set']);
} elseif (isset($_REQUEST['setfrom1'])) {
    P2Util::setConfUser('index_menu_k_from1', (int) $_REQUEST['setfrom1']);
    // デフォルトに戻す
} elseif (isset($_GET['setdef'])) {
    P2Util::setConfUser('index_menu_k', $conf_user_def['index_menu_k']);
    P2Util::setConfUser('index_menu_k_from1', $conf_user_def['index_menu_k_from1']);
}
// }}}
require_once P2_LIB_DIR . '/index_print_k.inc.php';
$setfrom1 = (int) (!$_conf['index_menu_k_from1']);
require_once P2_LIB_DIR . '/index.funcs.php';
$menuKLinkHtmls = getIndexMenuKLinkHtmls(getIndexMenuKIni(), $noLink = true);
$body_at = P2View::getBodyAttrK();
$hr = P2View::getHrHtmlK();
$index_uri = UriUtil::buildQueryUri('index.php', array(UA::getQueryKey() => UA::getQueryValue()));
//================================================================
// ヘッダHTML表示
//================================================================
P2Util::headerNoCache();
P2View::printDoctypeTag();
?>
<html lang="ja">
<head>
<?php 
P2View::printExtraHeadersHtml();
?>
    <title><?php 
eh($_conf['p2name']);
?>
 - 携帯TOPメニューの並び替え</title>
コード例 #6
0
ファイル: info_i.php プロジェクト: poppen/p2
/**
 * @return  string  HTML
 */
function _getOffRecentATag($aThread, $offrecent_accesskey, $ttitle_en)
{
    global $_conf;
    $preKey = '';
    if (UA::isK() && $offrecent_accesskey) {
        $preKey = $offrecent_accesskey . '.';
    }
    return P2View::tagA(UriUtil::buildQueryUri('info_i.php', array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'offrecent' => '1', 'popup' => (int) (bool) geti($_GET['popup']), 'ttitle_en' => $ttitle_en, UA::getQueryKey() => UA::getQueryValue())), sprintf('%s履歴から外す', hs($preKey)), array('title' => 'このスレを「最近読んだスレ」と「書き込み履歴」から外します', 'accesskey' => $offrecent_accesskey));
}
コード例 #7
0
ファイル: read_header.inc.php プロジェクト: poppen/p2
/**
 * 1- 101- 201- のリンクHTMLを取得する
 * _getHeadBarHtml() から呼ばれる
 *
 * @return  string  HTML
 */
function _getReadNaviRangeHtml($aThread, $rnum_range)
{
    global $_conf;
    static $cache_ = array();
    if (array_key_exists("{$aThread->host}/{$aThread->bbs}/{$aThread->key}", $cache_)) {
        return $cache_["{$aThread->host}/{$aThread->bbs}/{$aThread->key}"];
    }
    $read_navi_range_ht = '';
    for ($i = 1; $i <= $aThread->rescount; $i = $i + $rnum_range) {
        $ito = $i + $rnum_range - 1;
        $qs = array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'ls' => "{$i}-{$ito}", UA::getQueryKey() => UA::getQueryValue());
        if ($ito <= $aThread->gotnum) {
            $qs['offline'] = '1';
        }
        $url = UriUtil::buildQueryUri($_conf['read_php'], $qs);
        $read_navi_range_ht .= P2View::tagA($url, "{$i}-") . "\n";
    }
    return $cache_["{$aThread->host}/{$aThread->bbs}/{$aThread->key}"] = $read_navi_range_ht;
}
コード例 #8
0
ファイル: sb_header_k.inc.php プロジェクト: poppen/p2
// p2 -  サブジェクト - 携帯ヘッダ表示
// for subject.php
//===============================================================
// HTML表示用変数
//===============================================================
$newtime = date("gis");
// {{{ ページタイトル部分URL設定
$p2_subject_url = UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $aThreadList->host, 'bbs' => $aThreadList->bbs, UA::getQueryKey() => UA::getQueryValue()));
$ptitle_url = null;
// あぼーん or 倉庫
if ($aThreadList->spmode == 'taborn' or $aThreadList->spmode == 'soko') {
    $ptitle_url = $p2_subject_url;
    // 書き込み履歴
} elseif ($aThreadList->spmode == 'res_hist') {
    $ptitle_url = UriUtil::buildQueryUri('read_res_hist.php', array(UA::getQueryKey() => UA::getQueryValue()));
    // 通常 板
} 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;
コード例 #9
0
ファイル: post.php プロジェクト: poppen/p2
    $post = array($subject_k => $subject, $FROM_k => $FROM, $mail_k => $mail, $MESSAGE_k => $MESSAGE, $bbs_k => $bbs, $submit_k => $submit, $time_k => $time);
    if (P2Util::isHostJbbsShitaraba($host)) {
        $post[$dir_k] = $dir;
    }
    $qs_sid = $qs = array('host' => $host, 'bbs' => $bbs, UA::getQueryKey() => UA::getQueryValue());
    if (defined('SID') && strlen(SID)) {
        $qs_sid[session_name()] = session_id();
    }
    $location_url = UriUtil::buildQueryUri($_conf['subject_php'], $qs);
    $location_sid_url = UriUtil::buildQueryUri($_conf['subject_php'], $qs_sid);
} else {
    $post = array($FROM_k => $FROM, $mail_k => $mail, $MESSAGE_k => $MESSAGE, $bbs_k => $bbs, $key_k => $key, $submit_k => $submit, $time_k => $time);
    if (P2Util::isHostJbbsShitaraba($host)) {
        $post[$dir_k] = $dir;
    }
    $qs_sid = $qs = array('host' => $host, 'bbs' => $bbs, 'key' => $key, 'ls' => "{$rescount}-", 'refresh' => 1, 'nt' => $newtime, UA::getQueryKey() => UA::getQueryValue());
    if (defined('SID') && strlen(SID)) {
        $qs_sid[session_name()] = session_id();
    }
    $location_url = UriUtil::buildQueryUri($_conf['read_php'], $qs) . "#r{$rescount}";
    $location_sid_url = UriUtil::buildQueryUri($_conf['read_php'], $qs_sid) . "#r{$rescount}";
}
// {{{ 2chで●ログイン中ならsid追加
if (!empty($_POST['maru_kakiko']) and P2Util::isHost2chs($host) && file_exists($_conf['sid2ch_php'])) {
    // ログイン後、24時間以上経過していたら自動再ログイン
    if (file_exists($_conf['idpw2ch_php']) and filemtime($_conf['sid2ch_php']) < time() - 60 * 60 * 24) {
        require_once P2_LIB_DIR . '/login2ch.func.php';
        login2ch();
    }
    if ($r = _getSID2ch()) {
        $post['sid'] = $r;
コード例 #10
0
ファイル: read_res_hist.php プロジェクト: poppen/p2
    if (isset($_POST['checked_hists'])) {
        $checked_hists = $_POST['checked_hists'];
    } elseif (isset($_GET['checked_hists'])) {
        $checked_hists = $_GET['checked_hists'];
    }
    $checked_hists and deleMsg($checked_hists);
}
// 古いバージョンの形式であるデータPHP形式(p2_res_hist.dat.php, タブ区切り)の書き込み履歴を、
// dat形式(p2_res_hist.dat, <>区切り)に変換する
P2Util::transResHistLogPhpToDat();
//======================================================================
// メイン
//======================================================================
$karappoMsgHtml = 'p2 - 書き込み履歴内容は空っぽのようです。';
if (!$_conf['res_write_rec']) {
    $karappoMsgHtml .= sprintf('<p>現在、書き込み内容ログは記録しない設定になっています。<br>設定は、%sのページで変更可能\です。</p>', P2View::tagA(UriUtil::buildQueryUri('edit_conf_user.php', array(UA::getQueryKey() => UA::getQueryValue())), hs('設定編集'), array('target' => 'subject')));
}
// 特殊DAT読み
if (!file_exists($_conf['p2_res_hist_dat'])) {
    P2Util::printSimpleHtml($karappoMsgHtml);
    exit;
}
$res_hist_dat_size = filesize($_conf['p2_res_hist_dat']);
$logSizeSt = P2Util::getTranslatedUnitFileSize($res_hist_dat_size);
$maxLogSize = 0;
//1024*1024*10;
$maxLogSizeSt = P2Util::getTranslatedUnitFileSize($maxLogSize);
if ($maxLogSize and $res_hist_dat_size > $maxLogSize) {
    P2Util::printSimpleHtml(sprintf('書き込みログ容量(%s/%s)が大き過ぎるため、表\示できません。<br>
            %sのページより、書き込みログの一括削除を行って下さい。', hs($logSizeSt), hs($maxLogSizeSt), P2View::tagA($_conf['editpref_php'], hs('設定管理'), array('target' => 'subject'))));
    exit;
コード例 #11
0
ファイル: editpref.php プロジェクト: poppen/p2
/**
 * 設定ファイル編集ウインドウを開くHTMLを表示する
 *
 * @return  void
 */
function _printEditFileHtml($path_value, $submit_value)
{
    global $_conf;
    // アクティブ
    if (file_exists($path_value) && is_writable($path_value) || !file_exists($path_value) && is_writable(dirname($path_value))) {
        $onsubmit = '';
        $disabled = '';
        // 非アクティブ
    } else {
        $onsubmit = ' onsubmit="return false;"';
        $disabled = ' disabled';
    }
    $rows = 36;
    // 18
    $cols = 92;
    // 90
    // edit_aborn_word.php
    if (preg_match('/^p2_(aborn|ng)_(name|mail|id|msg)\\.txt$/', basename($path_value))) {
        $edit_php = 'edit_aborn_word.php';
        $target = '_self';
        $path_value = basename($path_value);
        $q_ar = array('path' => $path_value, UA::getQueryKey() => UA::getQueryValue());
        $url = $edit_php . '?' . UriUtil::buildQuery($q_ar);
        $html = P2View::tagA($url, $submit_value) . "\n";
        // editfile.php
    } else {
        $edit_php = 'editfile.php';
        $target = 'editfile';
        $html = <<<EOFORM
<form action="{$edit_php}" method="POST" target="{$target}" class="inline-form"{$onsubmit}>
\t{$_conf['k_input_ht']}
\t<input type="hidden" name="path" value="{$path_value}">
\t<input type="hidden" name="encode" value="Shift_JIS">
\t<input type="hidden" name="rows" value="{$rows}">
\t<input type="hidden" name="cols" value="{$cols}">
\t<input type="submit" value="{$submit_value}"{$disabled}>
</form>

EOFORM;
        // IE用にform HTML内のタグ間の空白を除去整形する
        if (strstr(geti($_SERVER['HTTP_USER_AGENT']), 'MSIE')) {
            $html = '&nbsp;' . preg_replace('{>\\s+<}', '><', $html);
        }
    }
    echo $html;
}
コード例 #12
0
ファイル: res_hist.class.php プロジェクト: poppen/p2
 /**
  * レス記事をHTML表示する 携帯用
  *
  * @access  public
  * @param   array
  * @return  void
  */
 function printArticlesHtmlK($datlines)
 {
     global $_conf;
     $hr = P2View::getHrHtmlK();
     $n = 0;
     foreach ($datlines as $aline) {
         $n++;
         if ($n < $this->resrange['start'] or $n > $this->resrange['to']) {
             continue;
         }
         $aline = rtrim($aline);
         $ResArticle = $this->lineToRes($aline, $n);
         $daytime_hs = hs($ResArticle->daytime);
         $ttitle = html_entity_decode($ResArticle->ttitle, ENT_COMPAT, 'Shift_JIS');
         $ttitle_hs = hs($ttitle);
         $msg_ht = $ResArticle->msg;
         // 大きさ制限
         if (empty($_GET['k_continue'])) {
             if ($_conf['ktai_res_size'] && strlen($msg_ht) > $_conf['ktai_res_size']) {
                 $msg_ht = substr($msg_ht, 0, $_conf['ktai_ryaku_size']);
                 // 末尾に<br>があれば取り除く(不完全なものも含めて)
                 $brtag = '<br>';
                 for ($i = 0; $i < strlen($brtag); $i++) {
                     if (substr($msg_ht, -1) == $brtag[strlen($brtag) - $i - 1]) {
                         $msg_ht = substr($msg_ht, 0, strlen($msg_ht) - 1);
                     }
                 }
                 $msg_ht .= ' ' . P2View::tagA(UriUtil::buildQueryUri('read_res_hist.php', array('from' => $ResArticle->order, 'end' => $ResArticle->order, 'k_continue' => '1', UA::getQueryKey() => UA::getQueryValue())), hs('略'));
             }
         }
         // 番号
         $res_ht = "[{$ResArticle->order}]";
         // 名前
         $array = explode('#', $ResArticle->name, 2);
         if (count($array) == 2) {
             $name_ht = sprintf('%s◆%s', $array[0], P2Util::mkTrip($array[1]));
         } else {
             $name_ht = hs($ResArticle->name);
         }
         $res_ht .= $name_ht . ':';
         // メール
         if ($ResArticle->mail) {
             $res_ht .= hs($ResArticle->mail) . ':';
         }
         // 日付とID
         $res_ht .= "{$daytime_hs}<br>\n";
         // 板名
         $res_ht .= P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $ResArticle->host, 'bbs' => $ResArticle->bbs, UA::getQueryKey() => UA::getQueryValue())), hs($ResArticle->itaj)) . ' / ';
         if ($ResArticle->key) {
             if (empty($ResArticle->resnum) || $ResArticle->resnum == 1) {
                 $ls_qs = array();
                 $footer_anchor = '#footer';
             } else {
                 $lf = max(1, $ResArticle->resnum - 0);
                 $ls_qs = array('ls' => "{$lf}-");
                 $footer_anchor = "#r{$lf}";
             }
             $time = time();
             $ttitle_qs = array_merge(array('host' => $ResArticle->host, 'bbs' => $ResArticle->bbs, 'key' => $ResArticle->key, UA::getQueryKey() => UA::getQueryValue(), 'nt' => time()), $ls_qs);
             $res_ht .= P2View::tagA(UriUtil::buildQueryUri($_conf['read_php'], $ttitle_qs) . $footer_anchor, "{$ttitle_hs} ");
         } else {
             $res_ht .= "{$ttitle_hs}\n";
         }
         // 削除
         // $res_ht = "<dt><input name=\"checked_hists[]\" type=\"checkbox\" value=\"{$ResArticle->order},,,,{$daytime_hs}\"> ";
         $from_q = isset($_GET['from']) ? '&amp;from=' . intval($_GET['from']) : '';
         $dele_ht = "[<a href=\"read_res_hist.php?checked_hists[]={$ResArticle->order},,,," . hs(urlencode($ResArticle->daytime)) . "{$from_q}{$_conf['k_at_a']}\">削除</a>]";
         $res_ht .= $dele_ht;
         $res_ht .= '<br>';
         // 内容
         $res_ht .= "{$msg_ht}{$hr}\n";
         if ($_conf['k_save_packet']) {
             $res_ht = mb_convert_kana($res_ht, 'rnsk');
         }
         echo $res_ht;
     }
 }
コード例 #13
0
ファイル: P2View.php プロジェクト: poppen/p2
 /**
  * @static
  * @access  public
  * @return  string
  */
 function getInputHiddenKTag()
 {
     return sprintf('<input type="hidden" name="%s" value="%s">', hs(UA::getQueryKey()), hs(UA::getQueryValue()));
 }
コード例 #14
0
ファイル: read_footer_k.inc.php プロジェクト: poppen/p2
/**
 * 書 <a>
 *
 * @return  string  HTML
 */
function _getDoResATag($aThread, $dores_st, $motothre_url)
{
    global $_conf;
    $dores_atag = null;
    if ($_conf['disable_res']) {
        $dores_atag = P2View::tagA($motothre_url, hs("{$_conf['k_accesskey']['res']}.{$dores_st}"), array('target' => '_blank', $_conf['accesskey_for_k'] => $_conf['k_accesskey']['res']));
    } else {
        $dores_atag = P2View::tagA(UriUtil::buildQueryUri('post_form.php', array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'rescount' => $aThread->rescount, 'ttitle_en' => base64_encode($aThread->ttitle), UA::getQueryKey() => UA::getQueryValue())), hs("{$_conf['k_accesskey']['res']}.{$dores_st}"), array($_conf['accesskey_for_k'] => $_conf['k_accesskey']['res']));
    }
    return $dores_atag;
}
コード例 #15
0
ファイル: menu.inc.php プロジェクト: poppen/p2
/**
 * 自動更新 meta refreshタグ
 *
 * @return  void
 */
function _printMetaRereshHtml()
{
    global $_conf;
    if ($_conf['menu_refresh_time']) {
        $refresh_time_s = $_conf['menu_refresh_time'] * 60;
        $qs = array('shownew' => 1, UA::getQueryKey() => UA::getQueryValue());
        if (defined('SID') && strlen(SID)) {
            $qs[session_name()] = session_id();
        }
        $refresh_url = UriUtil::buildQueryUri(UriUtil::getMyUri(), $qs);
        ?>
<meta http-equiv="refresh" content="<?php 
        eh($refresh_time_s);
        ?>
;URL=<?php 
        eh($refresh_url);
        ?>
">
        <?php 
    }
}
コード例 #16
0
ファイル: editfavita.php プロジェクト: poppen/p2
/**
 * @return  void  HTML出力
 */
function _printEditSortTrHtml($host, $bbs, $itaj)
{
    global $_conf;
    $itaj_en = base64_encode($itaj);
    ?>
    <tr>
    <td>
    <?php 
    echo P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $host, 'bbs' => $bbs, UA::getQueryKey() => UA::getQueryValue())), hs($itaj), array('title' => "{$host}/{$bbs}"));
    ?>
    </td>
    <td>[ 
    <?php 
    echo P2View::tagA(UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('host' => $host, 'bbs' => $bbs, 'itaj_en' => $itaj_en, 'setfavita' => 'top', 'csrfid' => P2Util::getCsrfId(), UA::getQueryKey() => UA::getQueryValue())), hs('▲'), array('class' => 'te', 'title' => '一番上に移動'));
    ?>
    </td>
    <td>
    <?php 
    echo P2View::tagA(UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('host' => $host, 'bbs' => $bbs, 'itaj_en' => $itaj_en, 'setfavita' => 'up', 'csrfid' => P2Util::getCsrfId(), UA::getQueryKey() => UA::getQueryValue())), hs('↑'), array('class' => 'te', 'title' => '一つ上に移動'));
    ?>
    </td>
    <td>
    <?php 
    echo P2View::tagA(UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('host' => $host, 'bbs' => $bbs, 'itaj_en' => $itaj_en, 'setfavita' => 'down', 'csrfid' => P2Util::getCsrfId(), UA::getQueryKey() => UA::getQueryValue())), hs('↓'), array('class' => 'te', 'title' => '一つ下に移動'));
    ?>
    </td>
    <td>
    <?php 
    echo P2View::tagA(UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('host' => $host, 'bbs' => $bbs, 'itaj_en' => $itaj_en, 'setfavita' => 'bottom', 'csrfid' => P2Util::getCsrfId(), UA::getQueryKey() => UA::getQueryValue())), hs('▼'), array('class' => 'te', 'title' => '一番下に移動'));
    ?>
     ]</td>
    <td>[<?php 
    echo P2View::tagA(UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('host' => $host, 'bbs' => $bbs, 'setfavita' => '0', 'csrfid' => P2Util::getCsrfId(), UA::getQueryKey() => UA::getQueryValue())), hs('削除'), array('title' => '削除'));
    ?>
]</td>
    </tr>
    <?php 
}
コード例 #17
0
ファイル: post_form_i.php プロジェクト: poppen/p2
    }
    $htm['subject'] = <<<EOP
<div class="row"><label><span{$class_ttitle}>タイトル</span></label><input type="text" id="subject" name="subject"{$sub_size_at} value="{$hs['subject']}"></div>
EOP;
    if ($_conf['ktai']) {
        //$htm['subject'] = "<a id=\"backButton\" class=\"button\" href=\"{$_conf['subject_php']}?host={$host}&amp;bbs={$bbs}{$_conf['k_at_a']}\">{$itaj}</a><br>" . $htm['subject'];
        $htm['back'] = "<a id=\"backButton\" class=\"button\" href=\"{$_conf['subject_php']}?host={$host}&amp;bbs={$bbs}{$_conf['k_at_a']}\">{$itaj}</a>";
    }
    $newthread_hidden_ht = '<input type="hidden" name="newthread" value="1">';
    // }}}
    // {{{ 書き込みなら
} else {
    //$ptitle = "{$itaj} - レス書き込み";
    $ptitle = "レス書き込み";
    $submit_value = "書き込む";
    $uri = UriUtil::buildQueryUri($_conf['read_php'], array('host' => $host, 'bbs' => $bbs, 'key' => $key, UA::getQueryKey() => UA::getQueryValue()));
    $html = $ttitle_hs ? $ttitle_hs : hs($uri);
    $htm['resform_ttitle'] = <<<EOP
<p><a id="backButton" class="button" href="{$uri_hs}"{$target_read}>{$html}</a></p>
EOP;
    $newthread_hidden_ht = '';
}
// }}}
$readnew_hidden_ht = !empty($_GET['from_read_new']) ? '<input type="hidden" name="from_read_new" value="1">' : '';
//==========================================================
// HTML 表示出力
//==========================================================
if (!$_conf['ktai']) {
    $body_on_load = <<<EOP
 onLoad="setFocus('MESSAGE'); checkSage();"
EOP;
コード例 #18
0
ファイル: sb_print_k.func.php プロジェクト: poppen/p2
/**
 * スレッド一覧を表示する (<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;
        }
    }
}
コード例 #19
0
ファイル: sb_footer_k.inc.php プロジェクト: poppen/p2
/**
 * @return  string  <a>
 */
function _getDatSokoATag($aThreadList)
{
    global $_conf;
    $dat_soko_atag = '';
    if (!$aThreadList->spmode or $aThreadList->spmode == 'taborn') {
        $uri = UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $aThreadList->host, 'bbs' => $aThreadList->bbs, 'norefresh' => '1', 'spmode' => 'soko', UA::getQueryKey() => UA::getQueryValue()));
        $dat_soko_atag = P2View::tagA($uri, hs('dat倉庫'));
    }
    return $dat_soko_atag;
}
コード例 #20
0
ファイル: edit_aborn_word.php プロジェクト: poppen/p2
    foreach ($formdata as $k => $v) {
        printf($row_format, $k, htmlspecialchars($v['word'], ENT_QUOTES), $v['ic'], $v['re'], htmlspecialchars($v['ht'], ENT_QUOTES), $v['hn'], htmlspecialchars($v['bbs'], ENT_QUOTES), htmlspecialchars($v['tt'], ENT_QUOTES), strlen($v['ht']) > 0 ? htmlspecialchars($v['ht'], ENT_QUOTES) : '--');
    }
    echo $htm['form_submit'];
}
// PCなら
if (!$_conf['ktai']) {
    echo '</table>' . "\n";
}
?>
</form>
<?php 
// 携帯なら
if (UA::isK()) {
    echo P2View::getHrHtmlK();
    echo P2View::tagA(UriUtil::buildQueryUri($_conf['editpref_php'], array(UA::getQueryKey() => UA::getQueryValue())), hs(sprintf('%s.設定編集', $_conf['k_accesskey']['up'])), array($_conf['accesskey_for_k'] => $_conf['k_accesskey']['up']));
    echo P2View::getBackToIndexKATag();
}
?>
</body></html>
<?php 
/*
 * Local Variables:
 * mode: php
 * coding: cp932
 * tab-width: 4
 * c-basic-offset: 4
 * indent-tabs-mode: nil
 * End:
 */
// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker:
コード例 #21
0
ファイル: ShowBrdMenuK.php プロジェクト: poppen/p2
    /**
     * お気に板をHTML表示する for 携帯
     *
     * @access  public
     * @return  void
     */
    function printFavItaHtml()
    {
        global $_conf;
        $csrfid = P2Util::getCsrfId();
        $hr = P2View::getHrHtmlK();
        $show_flag = false;
        if (file_exists($_conf['favita_path']) and $lines = file($_conf['favita_path'])) {
            echo 'お気に板 [<a href="editfavita.php?b=k">編集</a>]' . $hr;
            $i = 0;
            foreach ($lines as $l) {
                $i++;
                $l = rtrim($l);
                if (preg_match("/^\t?(.+)\t(.+)\t(.+)\$/", $l, $matches)) {
                    $itaj = rtrim($matches[3]);
                    $attr = array();
                    $key_num_st = '';
                    if ($i <= 9) {
                        $attr[$_conf['accesskey_for_k']] = $i;
                        $key_num_st = "{$i}.";
                    }
                    $atag = P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $matches[1], 'bbs' => $matches[2], 'itaj_en' => base64_encode($itaj), UA::getQueryKey() => UA::getQueryValue())), UA::isIPhoneGroup() ? hs($itaj) : hs("{$key_num_st}{$itaj}"), $attr);
                    if (UA::isIPhoneGroup()) {
                        echo '<li>' . $atag . '</li>';
                    } else {
                        echo $atag . '<br>';
                    }
                    //  [<a href="{$_SERVER['SCRIPT_NAME']}?host={$matches[1]}&amp;bbs={$matches[2]}&amp;setfavita=0&amp;csrfid={$csrfid}&amp;view=favita{$_conf['k_at_a']}">削</a>]
                    $show_flag = true;
                }
            }
            if (UA::isIPhoneGroup()) {
                ?>
</ul><?php 
            }
        }
        if (!$show_flag) {
            ?>
<p>お気に板はまだないようだ</p><?php 
        }
    }
コード例 #22
0
ファイル: index_print_k.inc.php プロジェクト: poppen/p2
/**
 * メニュー項目のリンクHTMLを取得する
 *
 * @access  private
 * @param   array   $menuKIni  メニュー項目 標準設定
 * @param   boolean $noLink    リンクをつけないのならtrue
 * @return  string  HTML
 */
function _getMenuKLinkHtml($code, $menuKIni, $noLink = false)
{
    global $_conf, $_login;
    static $accesskey_ = 0;
    // 無効なコード指定なら
    if (!isset($menuKIni[$code][0]) || !isset($menuKIni[$code][1])) {
        return false;
    }
    $accesskey = ++$accesskey_;
    if ($_conf['index_menu_k_from1']) {
        $accesskey = $accesskey + 1;
        if ($accesskey == 10) {
            $accesskey = 0;
        }
    }
    if ($accesskey > 9) {
        $accesskey = null;
    }
    $href = $menuKIni[$code][0] . '&user='******'&' . UA::getQueryKey() . '=' . UA::getQueryValue();
    $name = $menuKIni[$code][1];
    /*if (!is_null($accesskey)) {
          $name = $accesskey . '.' . $name;
      }*/
    if ($noLink) {
        $linkHtml = hs($name);
    } else {
        $accesskeyAt = is_null($accesskey) ? '' : " {$_conf['accesskey_for_k']}=\"{$accesskey}\"";
        $linkHtml = "<a href=\"" . hs($href) . '">' . hs($name) . "</a>";
    }
    // 特別 - #.ログ
    if ($code == 'res_hist') {
        $name = 'ログ';
        if ($noLink) {
            $logHt = hs($name);
        } else {
            $newtime = date('gis');
            $logHt = P2View::tagA(UriUtil::buildQueryUri('read_res_hist.php', array('nt' => $newtime, UA::getQueryKey() => UA::getQueryValue())), hs($name), array($_conf['accesskey_for_k'] => '#'));
        }
        $linkHtml .= ' </li><li>' . $logHt;
    }
    return $linkHtml;
}
コード例 #23
0
ファイル: login.php プロジェクト: poppen/p2
        $auth_ctl_html = sprintf('docomo端末ID認証登録済[%s]<br>', $atag);
    } else {
        if ($_login->pass_x) {
            $uri = UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('ctl_regist_docomo' => '1', 'regist_docomo' => '1', 'guid' => 'ON', UA::getQueryKey() => UA::getQueryValue()));
            $atag = sprintf('<a href="%s" utn>%s</a>', $uri, 'docomo端末IDで認証を登録');
            $auth_ctl_html = sprintf('[%s]<br>', $atag);
        }
    }
    // Cookie認証
} else {
    if ($_login->checkUserPwWithCid($_COOKIE['cid'])) {
        $atag = P2View::tagA(UriUtil::buildQueryUri('cookie.php', array('ctl_regist_cookie' => '1', UA::getQueryKey() => UA::getQueryValue())), '解除');
        $auth_cookie_html = sprintf('cookie認証登録済[%s]<br>', $atag);
    } else {
        if ($_login->pass_x) {
            $atag = P2View::tagA(UriUtil::buildQueryUri('cookie.php', array('ctl_regist_cookie' => '1', 'regist_cookie' => '1', UA::getQueryKey() => UA::getQueryValue())), 'cookieに認証を登録');
            $auth_cookie_html = sprintf('[%s]<br>', $atag);
        }
    }
}
// Cookie認証登録解除処理
_preExecCheckRegistCookie();
//=================================================================
// HTMLプリント
//=================================================================
$p_htm['body_onload'] = '';
if (!$_conf['ktai']) {
    $p_htm['body_onload'] = ' onLoad="setWinTitle();"';
}
$body_at = P2View::getBodyAttrK();
P2Util::headerNoCache();
コード例 #24
0
ファイル: sb_print.inc.php プロジェクト: poppen/p2
/**
 * スレッド一覧をHTML表示する (PC用 <tr>〜</tr>)
 *
 * @access  public
 * @return  void
 */
function sb_print($aThreadList)
{
    global $_conf, $sb_view, $p2_setting, $STYLE;
    $GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('sb_print()');
    if (!$aThreadList->threads) {
        echo '<tr><td> 該当サブジェクトはなかったぽ</td></tr>';
        $GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('sb_print()');
        return;
    }
    // 変数 ================================================
    // >>1 表示
    $onlyone_bool = false;
    if ($_conf['sb_show_one'] == 1 or $_conf['sb_show_one'] == 2 and ereg('news', $aThreadList->bbs) || $aThreadList->bbs == 'bizplus') {
        // spmodeは除く
        if (empty($aThreadList->spmode)) {
            $onlyone_bool = true;
        }
    }
    // チェックボックス
    $checkbox_bool = false;
    if ($aThreadList->spmode == 'taborn' || $aThreadList->spmode == 'soko') {
        $checkbox_bool = true;
    }
    // 板名
    $ita_name_bool = false;
    if ($aThreadList->spmode && $aThreadList->spmode != 'taborn' && $aThreadList->spmode != 'soko') {
        $ita_name_bool = true;
    }
    $norefresh_q = '&amp;norefresh=1';
    // ソート ==================================================
    // 現在のソート形式をclass指定でCSSカラーリング
    $class_sort_midoku = '';
    // 新着
    $class_sort_res = '';
    // レス
    $class_sort_no = '';
    // No.
    $class_sort_title = '';
    // タイトル
    $class_sort_ita = '';
    // 板
    $class_sort_spd = '';
    // すばやさ
    $class_sort_ikioi = '';
    // 勢い
    $class_sort_bd = '';
    // スレ立て日
    $class_sort_fav = '';
    // お気に入り
    if ($GLOBALS['now_sort']) {
        $nowsort_code = <<<EOP
\$class_sort_{$GLOBALS['now_sort']}=' class="now_sort"';
EOP;
        eval($nowsort_code);
    }
    $sortq_spmode = '';
    $sortq_host = '';
    $sortq_ita = '';
    // spmode時
    if ($aThreadList->spmode) {
        $sortq_spmode = "&amp;spmode={$aThreadList->spmode}";
    }
    // spmodeでない、または、spmodeがあぼーん or dat倉庫なら
    if (!$aThreadList->spmode || $aThreadList->spmode == "taborn" || $aThreadList->spmode == "soko") {
        $sortq_host = "&amp;host={$aThreadList->host}";
        $sortq_ita = "&amp;bbs={$aThreadList->bbs}";
    }
    $midoku_sort_ht = "<td class=\"tu\" nowrap><a{$class_sort_midoku} href=\"{$_conf['subject_php']}?sort=midoku{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\" style=\"white-space:nowrap;\"><nobr>新着</nobr></a></td>";
    //=====================================================
    // テーブルヘッダHTML表示
    //=====================================================
    echo '<tr class="tableheader">' . "\n";
    // 並替
    if ($sb_view == "edit") {
        echo '<td class="te">&nbsp;</td>';
    }
    // 新着
    if ($sb_view != "edit") {
        echo $midoku_sort_ht;
    }
    // レス数
    if ($sb_view != "edit") {
        echo "<td class=\"tn\" nowrap><a{$class_sort_res} href=\"{$_conf['subject_php']}?sort=res{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\">レス</a></td>";
    }
    // >>1
    if ($onlyone_bool) {
        echo '<td class="t">&nbsp;</td>';
    }
    // チェックボックス
    if ($checkbox_bool) {
        echo '<td class="tc"><input id="allbox" name="allbox" type="checkbox" onClick="checkAll();" title="すべての項目を選択、または選択解除"></td>';
    }
    // No.
    $title = empty($aThreadList->spmode) ? " title=\"2ch標準の並び順番号\"" : '';
    echo "<td class=\"to\"><a{$class_sort_no} href=\"{$_conf['subject_php']}?sort=no{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\"{$title}>No.</a></td>";
    // タイトル
    echo "<td class=\"tl\"><a{$class_sort_title} href=\"{$_conf['subject_php']}?sort=title{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\">タイトル</a></td>";
    // 板
    if ($ita_name_bool) {
        echo "<td class=\"t\"><a{$class_sort_ita} href=\"{$_conf['subject_php']}?sort=ita{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\">板</a></td>";
    }
    // すばやさ
    if ($_conf['sb_show_spd']) {
        echo "<td class=\"ts\"><a{$class_sort_spd} href=\"{$_conf['subject_php']}?sort=spd{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\">すばやさ</a></td>";
    }
    // 勢い
    if ($_conf['sb_show_ikioi']) {
        echo "<td class=\"ti\"><a{$class_sort_ikioi} href=\"{$_conf['subject_php']}?sort=ikioi{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\" title=\"一日あたりのレス数\">勢い</a></td>";
    }
    // スレ立て日
    echo "<td class=\"t\"><a{$class_sort_bd} href=\"{$_conf['subject_php']}?sort=bd{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\">スレ立て日</a></td>";
    // お気に入り
    if ($_conf['sb_show_fav'] and $aThreadList->spmode != "taborn") {
        echo "<td class=\"t\"><a{$class_sort_fav} href=\"{$_conf['subject_php']}?sort=fav{$sortq_spmode}{$sortq_host}{$sortq_ita}{$norefresh_q}\" target=\"_self\" title=\"お気にスレ\">☆</a></td>";
    }
    echo "\n</tr>\n";
    //=====================================================
    //テーブルボディ
    //=====================================================
    //spmodeがあればクエリー追加
    if ($aThreadList->spmode) {
        $spmode_q = "&amp;spmode={$aThreadList->spmode}";
    } else {
        $spmode_q = '';
    }
    $sid_q = defined('SID') && strlen(SID) ? '&amp;' . hs(SID) : '';
    $i = 0;
    foreach ($aThreadList->threads as $aThread) {
        $i++;
        $midoku_ari = '';
        $anum_ht = '';
        // #r1
        $offline_q = '';
        $bbs_q = "&amp;bbs=" . $aThread->bbs;
        $key_q = "&amp;key=" . $aThread->key;
        if ($aThreadList->spmode != 'taborn') {
            if (!$aThread->torder) {
                $aThread->torder = $i;
            }
        }
        // td欄 cssクラス
        if ($i % 2 == 0) {
            $class_t = ' class="t"';
            // 基本
            $class_te = ' class="te"';
            // 並び替え
            $class_tu = ' class="tu"';
            // 新着レス数
            $class_tn = ' class="tn"';
            // レス数
            $class_tc = ' class="tc"';
            // チェックボックス
            $class_to = ' class="to"';
            // オーダー番号
            $class_tl = ' class="tl"';
            // タイトル
            $class_ts = ' class="ts"';
            // すばやさ
            $class_ti = ' class="ti"';
            // 勢い
        } else {
            $class_t = ' class="t2"';
            $class_te = ' class="te2"';
            $class_tu = ' class="tu2"';
            $class_tn = ' class="tn2"';
            $class_tc = ' class="tc2"';
            $class_to = ' class="to2"';
            $class_tl = ' class="tl2"';
            $class_ts = ' class="ts2"';
            $class_ti = ' class="ti2"';
        }
        // 新着レス数 =============================================
        $unum_ht_c = "&nbsp;";
        // 既得済み
        if ($aThread->isKitoku()) {
            // $ttitle_en_q は節減省略
            $onclick_at = " onClick=\"return !deleLog('host={$aThread->host}{$bbs_q}{$key_q}{$sid_q}', {$STYLE['info_pop_size']}, 'subject', this);\"";
            $title_at = ' title="クリックするとログ削除"';
            $unum_ht_c = "<a class=\"un\" href=\"{$_conf['subject_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$spmode_q}&amp;dele=1\" target=\"_self\"{$onclick_at}{$title_at}>{$aThread->unum}</a>";
            $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;
                $dele_log_qs = $thread_qs = array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key);
                if (defined('SID') && strlen(SID)) {
                    $dele_log_qs[session_name()] = session_id();
                }
                $dele_log_q = UriUtil::buildQuery($dele_log_qs);
                $unum_ht_c = P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array_merge($thread_qs, array('spmode' => $aThreadList->spmode, 'dele' => '1', UA::getQueryKey() => UA::getQueryValue()))), hs($aThread->unum), array('id' => "un{$i}", 'class' => 'un_a', 'target' => '_self', 'title' => 'クリックするとログ削除', 'onClick' => sprintf("return !deleLog('%s', %s, 'subject', this);", str_replace("'", "\\'", $dele_log_q), $STYLE['info_pop_size'])));
            }
            // }}}
            // subject.txtにない時
            if (!$aThread->isonline) {
                // JavaScriptでの確認ダイアログあり
                $unum_ht_c = "<a class=\"un_n\" href=\"{$_conf['subject_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$spmode_q}&amp;dele=true\" target=\"_self\" onClick=\"if (!window.confirm('ログを削除しますか?')) {return false;} return !deleLog('host={$aThread->host}{$bbs_q}{$key_q}{$sid_q}', {$STYLE['info_pop_size']}, 'subject', this)\"{$title_at}>-</a>";
            }
        }
        $unum_ht = "<td{$class_tu}>" . $unum_ht_c . "</td>";
        // 総レス数
        $rescount_ht = "<td{$class_tn}>{$aThread->rescount}</td>";
        // {{{ 板名
        $ita_td_ht = '';
        if ($ita_name_bool) {
            $ita_name = $aThread->itaj ? $aThread->itaj : $aThread->bbs;
            $ita_atag = P2View::tagA(UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $aThread->host, 'bbs' => $aThread->bbs)), $ita_name, array('target' => '_self'));
            $ita_td_ht = "<td{$class_t} nowrap>{$ita_atag}</td>";
        }
        // }}}
        // お気に入り
        if ($_conf['sb_show_fav'] and $aThreadList->spmode != 'taborn') {
            $favmark = !empty($aThread->fav) ? '★' : '+';
            $favvalue = !empty($aThread->fav) ? 0 : 1;
            $favtitle = $favvalue ? 'お気にスレに追加' : 'お気にスレから外す';
            $setfav_q = '&amp;setfav=' . $favvalue;
            // $ttitle_en_q も付けた方がいいが、節約のため省略する
            $fav_ht = <<<EOP
<td{$class_t}><a class="fav" href="info.php?host={$aThread->host}{$bbs_q}{$key_q}{$setfav_q}" target="info" onClick="return setFavJs('host={$aThread->host}{$bbs_q}{$key_q}', '{$favvalue}', {$STYLE['info_pop_size']}, 'subject', this);" title="{$favtitle}">{$favmark}</a></td>
EOP;
        }
        // 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}\" target=\"_self\" onClick=\"return !openSubWin('info.php?host={$aThread->host}{$bbs_q}{$key_q}&amp;popup=1{$sid_q}',{$STYLE['info_pop_size']},0,0)\">{$torder_st}</a>";
        // title =================================================
        $chUnColor_ht = '';
        $rescount_q = "&amp;rc=" . $aThread->rescount;
        // dat倉庫 or 殿堂なら
        if ($aThreadList->spmode == "soko" || $aThreadList->spmode == "palace") {
            $rescount_q = '';
            $offline_q = "&amp;offline=1";
            $anum_ht = '';
        }
        // タイトル未取得or全角空白なら(IEで全角空白もリンククリックできないので)
        if (!$aThread->ttitle_ht or $aThread->ttitle_ht == ' ') {
            $aThread->ttitle_ht = "http://{$aThread->host}/test/read.cgi/{$aThread->bbs}/{$aThread->key}/";
        }
        if ($aThread->similarity) {
            $aThread->ttitle_ht .= sprintf(' <var>(%0.1f)</var>', $aThread->similarity * 100);
        }
        // 元スレ
        $moto_thre_ht = '';
        if ($_conf['sb_show_motothre']) {
            if (!$aThread->isKitoku()) {
                $moto_thre_ht = '<a class="thre_title" href="' . hs($aThread->getMotoThread()) . '">・</a> ';
            }
        }
        // 新規スレ
        if ($aThread->new) {
            $classtitle_q = ' class="thre_title_new"';
        } else {
            $classtitle_q = ' class="thre_title"';
        }
        // スレリンク
        if (!empty($_REQUEST['find_cont']) && strlen($GLOBALS['word_fm'])) {
            $word_q = "&amp;word=" . urlencode($GLOBALS['word']) . "&amp;method=" . urlencode($GLOBALS['sb_filter']['method']);
            $rescount_q = '';
            $offline_q = '&amp;offline=1';
            $anum_ht = '';
        } else {
            $word_q = '';
        }
        $thre_url = "{$_conf['read_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$rescount_q}{$offline_q}{$word_q}{$anum_ht}";
        if ($midoku_ari) {
            $chUnColor_ht = "chUnColor('{$i}');";
        }
        $change_color = " onClick=\"chTtColor('{$i}');{$chUnColor_ht}\"";
        // オンリー>>1
        if ($onlyone_bool) {
            $one_ht = "<td{$class_t}><a href=\"{$_conf['read_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$rescount_q}&amp;onlyone=true\">&gt;&gt;1</a></td>";
        } else {
            $one_ht = '';
        }
        // チェックボックス
        $checkbox_ht = '';
        if ($checkbox_bool) {
            $checked_ht = '';
            if ($aThreadList->spmode == "taborn") {
                if (!$aThread->isonline) {
                    $checked_ht = " checked";
                }
                // or ($aThread->rescount >= 1000)
            }
            $checkbox_ht = "<td{$class_tc}><input name=\"checkedkeys[]\" type=\"checkbox\" value=\"{$aThread->key}\"{$checked_ht}></td>";
        }
        // 並替
        $edit_ht = '';
        if ($sb_view == "edit") {
            $unum_ht = '';
            $rescount_ht = '';
            if ($aThreadList->spmode == "fav") {
                $setkey = "setfav";
            } elseif ($aThreadList->spmode == "palace") {
                $setkey = "setpal";
            }
            $narabikae_a = UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'spmode' => $aThreadList->spmode, 'sb_view' => 'edit'));
            $edit_ht = <<<EOP
\t\t<td{$class_te}>
\t\t\t<a class="te" href="{$narabikae_a}&amp;{$setkey}=top" target="_self">▲</a>
\t\t\t<a class="te" href="{$narabikae_a}&amp;{$setkey}=up" target="_self">↑</a>
\t\t\t<a class="te" href="{$narabikae_a}&amp;{$setkey}=down" target="_self">↓</a>
\t\t\t<a class="te" href="{$narabikae_a}&amp;{$setkey}=bottom" target="_self">▼</a>
\t\t</td>
EOP;
        }
        // すばやさ(= 時間/レス = レス間隔)
        $spd_ht = '';
        if ($_conf['sb_show_spd']) {
            if ($spd_st = $aThread->getTimePerRes()) {
                $spd_ht = "<td{$class_ts}>{$spd_st}</td>";
            }
        }
        // 勢い
        $ikioi_ht = '';
        if ($_conf['sb_show_ikioi']) {
            if ($aThread->dayres > 0) {
                // 0.0 とならないように小数点第2位で切り上げ
                $dayres = ceil($aThread->dayres * 10) / 10;
                $dayres_st = sprintf("%01.1f", $dayres);
            } else {
                $dayres_st = "-";
            }
            $ikioi_ht = "<td{$class_ti}>" . hs($dayres_st) . "</td>";
        }
        // スレ立て日
        //if (preg_match('/^\d{9,10}$/', $aThread->key) {
        if (631119600 < $aThread->key && $aThread->key < time() + 1000) {
            // 1990年-
            $birthday = date("y/m/d", $aThread->key);
            // (y/m/d H:i)
        } else {
            $birthday = '-';
        }
        $birth_ht = "<td{$class_t}>{$birthday}</td>";
        // スレッド一覧 table ボディ HTMLプリント <tr></tr>
        echo "<tr>\n{$edit_ht}\n{$unum_ht}\n{$rescount_ht}\n{$one_ht}\n{$checkbox_ht}\n<td{$class_to}>{$torder_ht}</td>\n<td{$class_tl} nowrap>{$moto_thre_ht}<a id=\"tt{$i}\" href=\"{$thre_url}\"{$classtitle_q}{$change_color}>{$aThread->ttitle_ht}</a></td>\n{$ita_td_ht}\n{$spd_ht}\n{$ikioi_ht}\n{$birth_ht}\n{$fav_ht}\n</tr>\n";
        ob_flush();
        flush();
    }
    $GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('sb_print()');
}
コード例 #25
0
ファイル: read_new_i.php プロジェクト: poppen/p2
/**
 * @return  string  HTML
 */
function _getReadATag($aThread)
{
    global $_conf;
    $ttitle_hs = hs($aThread->ttitle_hc);
    if ($_conf['k_save_packet']) {
        $ttitle_hs = mb_convert_kana($ttitle_hs, 'rnsk');
    }
    return $read_atag = P2View::tagA(UriUtil::buildQueryUri($_conf['read_php'], array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'offline' => '1', 'rescount' => $aThread->rescount, UA::getQueryKey() => UA::getQueryValue())) . '#r' . rawurlencode($aThread->rescount), $ttitle_hs);
}
コード例 #26
0
ファイル: ThreadRead.php プロジェクト: poppen/p2
 /**
  * @access  private
  * @return  string  HTML
  */
 function getMarutoriHtml()
 {
     global $_conf;
     $marutori_atag = P2View::tagA(UriUtil::buildQueryUri($_conf['read_php'], array('host' => $this->host, 'bbs' => $this->bbs, 'key' => $this->key, 'ls' => $this->ls, 'maru' => 'true', UA::getQueryKey() => UA::getQueryValue())), hs('●IDでp2に取り込む'));
     return "[{$marutori_atag}]";
 }
コード例 #27
0
ファイル: read_copy_k.php プロジェクト: poppen/p2
/**
 * @return  string  HTML
 */
function _getPostLinkATag($aThread, $ttitle_en)
{
    return $post_link_atag = P2View::tagA(UriUtil::buildQueryUri('post_form.php', array('host' => $aThread->host, 'bbs' => $aThread->bbs, 'key' => $aThread->key, 'rescount' => $aThread->rescount, 'ttitle_en' => $ttitle_en, UA::getQueryKey() => UA::getQueryValue())), '書');
}
コード例 #28
0
ファイル: conf_system.inc.php プロジェクト: poppen/p2
/**
 * 旧スタイルの携帯ビュー変数 $_conf['ktai'] 等をセット
 *
 * @return  void
 */
function _setOldStyleKtaiQuery()
{
    global $_conf;
    $b = UA::getQueryKey();
    // ?k=1は旧仕様。?b=kが新しい。
    // 後方互換用措置
    if (!empty($_GET['k']) || !empty($_POST['k'])) {
        $_REQUEST[$b] = $_GET[$b] = 'k';
    }
    // $_conf[$b]($_conf['b']) も使わないようにして、UA::getQueryValue()を利用する方向。
    $_conf[$b] = UA::getQueryValue();
    // $_conf['ktai'] は使わない方向。
    // UA::isK(), UA::isPC() を利用する。
    // 強制PCビュー指定(b=pc)
    if (UA::isPCByQuery()) {
        $_conf['ktai'] = false;
        // 強制携帯ビュー指定(b=k)
    } elseif (UA::isMobileByQuery()) {
        $_conf['ktai'] = true;
    }
    // ↓k_at_a, k_at_q, k_input_ht は使わない方向。
    // UA::getQueryKey(), UA::getQueryValue(), P2View::getInputHiddenKTag() を利用する。
    $_conf['k_at_a'] = '';
    $_conf['k_at_q'] = '';
    $_conf['k_input_ht'] = '';
    if ($_conf[$b]) {
        //output_add_rewrite_var($b, htmlspecialchars($_conf[$b], ENT_QUOTES));
        $b_hs = hs($_conf[$b]);
        $_conf['k_at_a'] = "&amp;{$b}={$b_hs}";
        $_conf['k_at_q'] = "?{$b}={$b_hs}";
        $_conf['k_input_ht'] = P2View::getInputHiddenKTag();
    }
}
コード例 #29
0
ファイル: ShowThreadK.php プロジェクト: poppen/p2
 /**
  * IDフィルタリングリンク変換
  *
  * @access  private
  * @return  string  HTML
  */
 function idfilter_callback($s)
 {
     global $_conf;
     $idstr = $s[0];
     // ID:xxxxxxxxxx
     $id = $s[1];
     // xxxxxxxxxx
     $idflag = '';
     // 携帯/PC識別子
     // IDは8桁または10桁(+携帯/PC識別子)と仮定して
     /*
     if (strlen($id) % 2 == 1) {
         $id = substr($id, 0, -1);
         $idflag = substr($id, -1);
     } elseif (isset($s[2])) {
         $idflag = $s[2];
     }
     */
     if (isset($this->thread->idcount[$id]) && $this->thread->idcount[$id] > 0) {
         $filter_url = UriUtil::buildQueryUri($_conf['read_php'], array('host' => $this->thread->host, 'bbs' => $this->thread->bbs, 'key' => $this->thread->key, 'ls' => 'all', 'offline' => '1', 'idpopup' => '1', 'field' => 'id', 'method' => 'just', 'match' => 'on', 'word' => $id, UA::getQueryKey() => UA::getQueryValue()));
         $num_ht = sprintf('(<a href="%s">%s</a>)', hs($filter_url), $this->thread->idcount[$id]);
         return "{$idstr}{$num_ht}";
     }
     return $idstr;
 }
コード例 #30
0
ファイル: setting.php プロジェクト: poppen/p2
    $client_host_st = '端末ホスト';
    $client_ip_st = '端末IPアドレス';
    $browser_ua_st = 'ブラウザUA';
    $p2error_st = 'rep2 エラー';
    $logout_st = 'ログアウト';
} else {
    $status_st = 'ステータス';
    $autho_user_st = '認証ユーザ';
    $client_host_st = '端末ホスト';
    $client_ip_st = '端末IPアドレス';
    $browser_ua_st = 'ブラウザUA';
    $p2error_st = 'rep2 エラー';
    $logout_st = 'ログアウト';
}
$login_uri = UriUtil::buildQueryUri('login.php', array(UA::getQueryKey() => UA::getQueryValue()));
$login2ch_uri = UriUtil::buildQueryUri('login2ch.php', array(UA::getQueryKey() => UA::getQueryValue()));
$body_onload = '';
if (UA::isPC()) {
    $body_onload = ' onLoad="setWinTitle();"';
}
$hr = P2View::getHrHtmlK();
$body_at = P2View::getBodyAttrK();
//=========================================================
// HTMLプリント
//=========================================================
P2Util::headerNoCache();
P2View::printDoctypeTag();
?>
<html lang="ja">
<head>
<?php