当前位置: 首页>>代码示例>>PHP>>正文


PHP P2Util::getItaName方法代码示例

本文整理汇总了PHP中P2Util::getItaName方法的典型用法代码示例。如果您正苦于以下问题:PHP P2Util::getItaName方法的具体用法?PHP P2Util::getItaName怎么用?PHP P2Util::getItaName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在P2Util的用法示例。


在下文中一共展示了P2Util::getItaName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: lineToRes

 /**
  * 書き込みログの line 一行をパースして、ResArticleオブジェクトを返す
  *
  * @access  public
  * @param   array    $aline
  * @return  object ResArticle
  */
 function lineToRes($aline, $order)
 {
     $ResArticle = new ResArticle();
     $resar = explode('<>', rtrim($aline));
     $ResArticle->name = $resar[0];
     $ResArticle->mail = $resar[1];
     $ResArticle->daytime = $resar[2];
     $ResArticle->msg = $resar[3];
     $ResArticle->ttitle = $resar[4];
     $ResArticle->host = $resar[5];
     $ResArticle->bbs = $resar[6];
     if (!($ResArticle->itaj = P2Util::getItaName($ResArticle->host, $ResArticle->bbs))) {
         $ResArticle->itaj = $ResArticle->bbs;
     }
     $ResArticle->key = $resar[7];
     $ResArticle->resnum = isset($resar[8]) ? $resar[8] : null;
     $ResArticle->order = $order;
     return $ResArticle;
 }
开发者ID:poppen,项目名称:p2,代码行数:26,代码来源:res_hist.class.php

示例2: readLines

 /**
  * 書き込みログの lines をパースして読み込む
  *
  * @param  array    $lines
  * @return void
  */
 public function readLines(array $lines)
 {
     $n = 1;
     foreach ($lines as $aline) {
         $aResArticle = new ResArticle();
         $resar = explode('<>', $aline);
         $aResArticle->name = $resar[0];
         $aResArticle->mail = $resar[1];
         $aResArticle->daytime = $resar[2];
         $aResArticle->msg = $resar[3];
         $aResArticle->ttitle = $resar[4];
         $aResArticle->host = $resar[5];
         $aResArticle->bbs = $resar[6];
         if (!($aResArticle->itaj = P2Util::getItaName($aResArticle->host, $aResArticle->bbs))) {
             $aResArticle->itaj = $aResArticle->bbs;
         }
         $aResArticle->key = $resar[7];
         $aResArticle->resnum = $resar[8];
         $aResArticle->order = $n;
         $this->addRes($aResArticle);
         $n++;
     }
 }
开发者ID:xingskycn,项目名称:p2-php,代码行数:29,代码来源:ResHist.php

示例3:

             $aThread->getThreadInfoFromExtIdxLine($l);
             $aThread->itaj = P2Util::getItaName($aThread->host, $aThread->bbs);
             if (!$aThread->itaj) {
                 $aThread->itaj = $aThread->bbs;
             }
             break;
         case "merge_favita":
             // お気に板をマージ
             $aThread->isonline = true;
             $aThread->key = $l['key'];
             $aThread->setTtitle($l['ttitle']);
             $aThread->rescount = $l['rescount'];
             $aThread->host = $l['host'];
             $aThread->bbs = $l['bbs'];
             $aThread->torder = $l['torder'];
             $aThread->itaj = P2Util::getItaName($aThread->host, $aThread->bbs);
             if (!$aThread->itaj) {
                 $aThread->itaj = $aThread->bbs;
             }
             break;
     }
     // subject (not spmode つまり普通の板)
 } else {
     $aThread->getThreadInfoFromSubjectTxtLine($l);
     $aThread->host = $aThreadList->host;
     $aThread->bbs = $aThreadList->bbs;
 }
 // メモリ節約(特にmerge_favita)のため
 $lines[$x] = null;
 // hostかbbsかkeyが不明ならスキップ
 if (!($aThread->host && $aThread->bbs && $aThread->key)) {
开发者ID:xingskycn,项目名称:p2-php,代码行数:31,代码来源:subject.php

示例4: readNew

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();
        }
//.........这里部分代码省略.........
开发者ID:nyarla,项目名称:fluxflex-rep2ex,代码行数:101,代码来源:read_new_k.php

示例5: geti

require_once './conf/conf.inc.php';
require_once P2_LIB_DIR . '/Thread.php';
require_once P2_LIB_DIR . '/ThreadRead.php';
$_login->authorize();
// ユーザ認証
//=====================================================
// 変数の設定
//=====================================================
$host = geti($_GET['host']);
$bbs = geti($_GET['bbs']);
$key = geti($_GET['key']);
$rc = geti($_GET['rc']);
$ttitle_en = geti($_GET['ttitle_en']);
$resnum = geti($_GET['resnum']);
$field = geti($_GET['field']);
$itaj = P2Util::getItaName($host, $bbs);
if (!$itaj) {
    $itaj = $bbs;
}
$ttitle_name = base64_decode($ttitle_en);
$GLOBALS['popup_filter'] = 1;
// 対象レスの対象フィールドから、検索ワードを取得する
$_GET['word'] = _getReadFilterWord($host, $bbs, $key, $resnum, $field);
// read.phpに処理を渡す
include $_conf['read_php'];
//===========================================================================
// 関数(このファイル内でのみ利用)
//===========================================================================
/**
 * 対象レスの対象フィールドから、検索ワードを取得する
 *
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:read_filter.php

示例6: _readNew

/**
 * スレッドの新着部分を読み込んで表示する
 */
function _readNew(&$aThread)
{
    global $_conf, $_newthre_num, $STYLE;
    global $spmode;
    $_newthre_num++;
    $hr = P2View::getHrHtmlK();
    //==========================================================
    // 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 (is_readable($aThread->keyidx)) {
        $lines = file($aThread->keyidx);
        $data = explode('<>', rtrim($lines[0]));
    }
    $aThread->getThreadInfoFromIdx();
    //$aThread->readDatInfoFromFile();
    // DATのダウンロード
    if (!(strlen(geti($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 = base64_encode($aThread->ttitle);
    $ttitle_en_q = "&amp;ttitle_en=" . $ttitle_en;
    $bbs_q = "&amp;bbs=" . $aThread->bbs;
    $key_q = "&amp;key=" . $aThread->key;
    $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>";
    }
    //$next_thre_ht = "<a href=\"#ntt{$next_thre_num}\">▼</a> ";
    $next_thre_ht = "<a class=\"button\" href=\"#ntt_bt{$_newthre_num}\">▼</a> ";
    if ($spmode) {
        $read_header_itaj_ht = sprintf(' (%s)', hs($aThread->itaj));
        if ($_conf['k_save_packet']) {
            $read_header_itaj_ht = mb_convert_kana($read_header_itaj_ht, 'rnsk');
        }
    }
    // スマートポップアップメニュー JavaScriptコード
    if ($_conf['enable_spm']) {
        // フォントサイズ等 conf_user_style.inc.php  をいじるとPCも変わるのでここで書き換え
        $STYLE['respop_color'] = "#FFFFFF";
        // ("#000") レスポップアップのテキスト色
        $STYLE['respop_bgcolor'] = "";
        // ("#ffffcc") レスポップアップの背景色
        $STYLE['respop_fontsize'] = '13px';
        $aThread->showSmartPopUpMenuJs();
    }
    P2Util::printInfoHtml();
    $ttitle_hs = hs($aThread->ttitle_hc);
    if ($_conf['k_save_packet']) {
        $ttitle_hs = mb_convert_kana($ttitle_hs, 'rnsk');
    }
    $read_header_ht = <<<EOP
\t<p id="ntt{$_newthre_num}" name="ntt{$_newthre_num}"><font color="{$STYLE['read_k_thread_title_color']}"><b>{$ttitle_hs}</b></font>{$read_header_itaj_ht} {$next_thre_ht}</p>
\t{$hr}

EOP;
    // {{{ ローカルDatを読み込んでHTML表示
    $aThread->resrange['nofirst'] = true;
    $GLOBALS['newres_to_show_flag'] = false;
    $read_cont_ht = '';
    if ($aThread->rescount) {
        //$aThread->datToHtml(); // dat を html に変換表示
//.........这里部分代码省略.........
开发者ID:poppen,项目名称:p2,代码行数:101,代码来源:read_new_i.php

示例7: setFav


//.........这里部分代码省略.........
        $data = explode('<>', $lines[0]);
    } else {
        $data = array_fill(0, 12, '');
        if (is_string($ttitle) && strlen($ttitle)) {
            $data[0] = p2h($ttitle, false);
        }
    }
    // {{{ スレッド.idx 記録
    if (($setfav == '0' || $setfav == '1') && $_conf['favlist_idx'] == $_conf['orig_favlist_idx']) {
        // お気にスレから外した結果、idxの意味がなくなれば削除する
        if ($setfav == '0' and !$data[3] && !$data[4] && $data[9] <= 1) {
            @unlink($idxfile);
        } else {
            $sar = array($data[0], $key, $data[2], $data[3], $data[4], $data[5], $setfav, $data[7], $data[8], $data[9], $data[10], $data[11], $data[12]);
            P2Util::recKeyIdx($idxfile, $sar);
        }
    }
    // }}}
    //==================================================================
    // favlist.idx
    //==================================================================
    if (!is_null($setnum) && $_conf['expack.misc.multi_favs']) {
        if (0 < $setnum && $setnum <= $_conf['expack.misc.favset_num']) {
            $favlist_idx = $_conf['pref_dir'] . sprintf('/p2_favlist%d.idx', $setnum);
        } else {
            $favlist_idx = $_conf['orig_favlist_idx'];
        }
    } else {
        $favlist_idx = $_conf['favlist_idx'];
    }
    // favlistファイルがなければ生成
    FileCtl::make_datafile($favlist_idx);
    // favlist読み込み
    $favlines = FileCtl::file_read_lines($favlist_idx, FILE_IGNORE_NEW_LINES);
    //================================================
    // 処理
    //================================================
    $neolines = array();
    $before_line_num = 0;
    $was_set = false;
    // 最初に重複要素を削除しておく
    if (!empty($favlines)) {
        $i = -1;
        foreach ($favlines as $l) {
            $i++;
            $lar = explode('<>', $l);
            // 重複回避
            if ($lar[1] == $key && $lar[11] == $bbs) {
                $before_line_num = $i;
                // 移動前の行番号をセット
                $was_set = true;
                continue;
                // keyのないものは不正データなのでスキップ
            } elseif (!$lar[1]) {
                continue;
            } else {
                $neolines[] = $l;
            }
        }
    }
    if ($setfav == 2) {
        $setfav = $was_set ? 0 : 1;
    }
    // 記録データ設定
    if ($setfav) {
        if (!function_exists('getSetPosLines')) {
            include P2_LIB_DIR . '/getsetposlines.inc.php';
        }
        $newdata = "{$data[0]}<>{$key}<>{$data[2]}<>{$data[3]}<>{$data[4]}<>{$data[5]}<>1<>{$data[7]}<>{$data[8]}<>{$data[9]}<>{$host}<>{$bbs}";
        $rec_lines = getSetPosLines($neolines, $newdata, $before_line_num, $setfav);
    } else {
        $rec_lines = $neolines;
    }
    $cont = '';
    if (!empty($rec_lines)) {
        foreach ($rec_lines as $l) {
            $cont .= $l . "\n";
        }
    }
    // 書き込む
    if (FileCtl::file_write_contents($favlist_idx, $cont) === false) {
        p2die('cannot write file.');
    }
    //================================================
    // お気にスレ共有
    //================================================
    if ($_conf['join_favrank'] && $_conf['favlist_idx'] == $_conf['orig_favlist_idx']) {
        if ($setfav == "0") {
            $act = "out";
        } elseif ($setfav == "1") {
            $act = "add";
        } else {
            return;
        }
        $itaj = P2Util::getItaName($host, $bbs);
        $post = array("host" => $host, "bbs" => $bbs, "key" => $key, "ttitle" => $data[0], "ita" => $itaj, "act" => $act);
        postFavRank($post);
    }
    return true;
}
开发者ID:xingskycn,项目名称:p2-php,代码行数:101,代码来源:setfav.inc.php

示例8: _setFavRank

/**
 * お気にスレ共有
 *
 * @access  private
 * @return  boolean|null
 */
function _setFavRank($host, $bbs, $key, $setfav, $ttitle)
{
    global $_conf;
    if (!$_conf['join_favrank']) {
        return null;
    }
    if ($setfav == '0') {
        $act = 'out';
    } elseif ($setfav == '1') {
        $act = 'add';
    } else {
        return null;
    }
    return _postFavRank(array('host' => $host, 'bbs' => $bbs, 'key' => $key, 'ttitle' => $ttitle, 'ita' => P2Util::getItaName($host, $bbs), 'act' => $act));
}
开发者ID:poppen,项目名称:p2,代码行数:21,代码来源:setFav.func.php

示例9: setThreadInfoFromLineWithThreadList

 /**
  * ThreadListの情報に応じて、ラインデータを取得セットする
  *
  * @return  void
  */
 function setThreadInfoFromLineWithThreadList($l, $aThreadList, $setItaj = true)
 {
     // spmode
     if ($aThreadList->spmode) {
         switch ($aThreadList->spmode) {
             case 'recent':
                 // 履歴
                 $this->setThreadInfoFromExtIdxLine($l);
                 if ($setItaj) {
                     if (!($this->itaj = P2Util::getItaName($this->host, $this->bbs))) {
                         $this->itaj = $this->bbs;
                     }
                 }
                 break;
             case 'res_hist':
                 // 書き込み履歴
                 $this->setThreadInfoFromExtIdxLine($l);
                 if ($setItaj) {
                     if (!($this->itaj = P2Util::getItaName($this->host, $this->bbs))) {
                         $this->itaj = $this->bbs;
                     }
                 }
                 break;
             case 'fav':
                 // お気に
                 $this->setThreadInfoFromExtIdxLine($l);
                 if ($setItaj) {
                     if (!($this->itaj = P2Util::getItaName($this->host, $this->bbs))) {
                         $this->itaj = $this->bbs;
                     }
                 }
                 break;
             case 'palace':
                 // スレの殿堂
                 $this->setThreadInfoFromExtIdxLine($l);
                 if ($setItaj) {
                     if (!($this->itaj = P2Util::getItaName($this->host, $this->bbs))) {
                         $this->itaj = $this->bbs;
                     }
                 }
                 break;
                 // read_new*では必要ないところ
             // read_new*では必要ないところ
             case 'taborn':
                 // スレッドあぼーん
                 $la = explode('<>', $l);
                 $this->key = $la[1];
                 $this->host = $aThreadList->host;
                 $this->bbs = $aThreadList->bbs;
                 break;
                 // read_new*では必要ないところ
             // read_new*では必要ないところ
             case 'soko':
                 // dat倉庫
                 $la = explode('<>', $l);
                 $this->key = $la[1];
                 $this->host = $aThreadList->host;
                 $this->bbs = $aThreadList->bbs;
                 break;
             case 'news':
                 // ニュースの勢い
                 $this->isonline = true;
                 $this->key = $l['key'];
                 $this->setTtitle($l['ttitle']);
                 $this->rescount = $l['rescount'];
                 $this->host = $l['host'];
                 $this->bbs = $l['bbs'];
                 if ($setItaj) {
                     if (!($this->itaj = P2Util::getItaName($this->host, $this->bbs))) {
                         $this->itaj = $this->bbs;
                     }
                 }
                 break;
         }
         // subject (not spmode つまり普通の板)
     } else {
         $this->setThreadInfoFromSubjectTxtLine($l);
         $this->host = $aThreadList->host;
         $this->bbs = $aThreadList->bbs;
         // itaj は省略している
     }
 }
开发者ID:poppen,项目名称:p2,代码行数:87,代码来源:Thread.php

示例10: elseif

    $threads_num = $threads_num_max;
} elseif ($sb_view == "edit") {
    $threads_num = $threads_num_max;
} elseif (isset($_GET['word'])) {
    $threads_num = $threads_num_max;
} elseif ($_conf['ktai']) {
    $threads_num = $threads_num_max;
}
//============================================================
// メイン
//============================================================
$aThreadList = new ThreadList();
// 板とモードのセット ===================================
if ($spmode) {
    if ($spmode == "taborn" or $spmode == "soko") {
        $aThreadList->setIta($host, $bbs, P2Util::getItaName($host, $bbs));
    }
    $aThreadList->setSpMode($spmode);
} else {
    // if (!$p2_setting['itaj']) { $p2_setting['itaj'] = P2Util::getItaName($host, $bbs); }
    $itaj = isset($p2_setting['itaj']) ? $p2_setting['itaj'] : null;
    $aThreadList->setIta($host, $bbs, $itaj);
    // スレッドあぼーんリスト読込
    $ta_keys = P2Util::getThreadAbornKeys($aThreadList->host, $aThreadList->bbs);
    //$ta_num = sizeOf($ta_keys);
}
// ソースリスト読込
$lines = $aThreadList->readList();
// お気にスレリスト 読込
if (file_exists($_conf['favlist_file'])) {
    $favlines = file($_conf['favlist_file']);
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:subject_new.php

示例11: readNew

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) {
//.........这里部分代码省略.........
开发者ID:unpush,项目名称:p2-php,代码行数:101,代码来源:read_new.php

示例12: get_thread_info

/**
 * スレッド情報を取得する
 *
 * @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;
//.........这里部分代码省略.........
开发者ID:xingskycn,项目名称:p2-php,代码行数:101,代码来源:get_info.inc.php

示例13: p2die

require_once P2_LIB_DIR . '/DataPhp.php';
require_once P2_LIB_DIR . '/P2Validate.php';
$_login->authorize();
// ユーザ認証
//==================================================
// 変数
//==================================================
if (empty($_GET['host'])) {
    p2die('host が指定されていません');
}
$host = $_GET['host'];
$bbs = geti($_GET['bbs']);
$key = geti($_GET['key']);
$rescount = (int) geti($_GET['rescount'], 1);
$popup = (int) geti($_GET['popup'], 0);
if (!($itaj = P2Util::getItaName($host, $bbs))) {
    $itaj = $bbs;
}
$ttitle_en = isset($_GET['ttitle_en']) ? $_GET['ttitle_en'] : '';
$ttitle_hs = null;
if (strlen($ttitle_en)) {
    $ttitle_hs = hs(P2Util::htmlEntityDecodeLite(base64_decode($ttitle_en)));
}
if (P2Validate::host($host) || $bbs && P2Validate::bbs($bbs) || $key && P2Validate::key($key)) {
    p2die('不正な引数です');
}
$keyidx = P2Util::getKeyIdxFilePath($host, $bbs, $key);
// フォームのオプション読み込み
require_once P2_LIB_DIR . '/post_options_loader.inc.php';
// 表示指定
$class_ttitle = '';
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:post_form_i.php

示例14: readNew

/**
 * スレッドの新着部分を読み込んで表示する
 */
function readNew(&$aThread)
{
    global $_conf, $_newthre_num, $STYLE;
    global $spmode;
    $_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 (is_readable($aThread->keyidx)) {
        $lines = file($aThread->keyidx);
        $data = explode('<>', rtrim($lines[0]));
    }
    $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 = base64_encode($aThread->ttitle);
    $ttitle_en_q = "&amp;ttitle_en=" . $ttitle_en;
    $bbs_q = "&amp;bbs=" . $aThread->bbs;
    $key_q = "&amp;key=" . $aThread->key;
    $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>";
    }
    //$next_thre_ht = "<a href=\"#ntt{$next_thre_num}\">▼</a> ";
    $next_thre_ht = "<a class=\"button\" href=\"#ntt_bt{$_newthre_num}\">▼</a> ";
    $itaj_hs = htmlspecialchars($aThread->itaj, ENT_QUOTES);
    if ($spmode) {
        $read_header_itaj_ht = " ({$itaj_hs})";
    }
    P2Util::printInfoHtml();
    $read_header_ht = <<<EOP
        <p id="ntt{$_newthre_num}" name="ntt{$_newthre_num}"><font color="{$STYLE['read_k_thread_title_color']}"><b>{$aThread->ttitle_hd}</b></font>{$read_header_itaj_ht} {$next_thre_ht}</p>

EOP;
    //==================================================================
    // ローカルDatを読み込んでHTML表示
    //==================================================================
    $aThread->resrange['nofirst'] = true;
    $GLOBALS['newres_to_show_flag'] = false;
    if ($aThread->rescount) {
        //$aThread->datToHtml(); // dat を html に変換表示
        require_once P2_LIB_DIR . '/showthread.class.php';
        require_once P2_IPHONE_LIB_DIR . '/showthreadk.class.php';
        $aShowThread =& new ShowThreadK($aThread);
        $read_cont_ht .= $aShowThread->getDatToHtml();
        unset($aShowThread);
    }
    //==================================================================
    // フッタ 表示
    //==================================================================
    //include $read_footer_inc;
    //----------------------------------------------
    // $read_footer_navi_new  続きを読む 新着レスの表示
    $newtime = date("gis");
    // リンクをクリックしても再読込しない仕様に対抗するダミークエリー
    $info_st = "情";
    $delete_st = "削";
    $prev_st = "前";
    $next_st = "次";
//.........这里部分代码省略.........
开发者ID:68,项目名称:rep2iphone,代码行数:101,代码来源:read_new_i.php

示例15: _readNew

/**
 * スレッドの新着部分を読み込んで表示する
 *
 * @return  void
 */
function _readNew(&$aThread)
{
    global $_conf, $_newthre_num, $STYLE, $sid_q;
    $_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 (file_exists($aThread->keyidx)) {
        $lines = file($aThread->keyidx);
        $data = explode('<>', rtrim($lines[0]));
    }
    $aThread->getThreadInfoFromIdx();
    // DATのダウンロード
    if (!(isset($GLOBALS['word']) && 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 = base64_encode($aThread->ttitle);
    $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;
    $prev_thre_ht = '';
    if ($prev_thre_num != 0) {
        $prev_thre_ht = "<a href=\"#ntt{$prev_thre_num}\">▲</a>";
    }
    $next_thre_ht = "<a href=\"#ntt{$next_thre_num}\">▼</a> ";
    // スマートポップアップメニュー
    if ($_conf['enable_spm']) {
        $aThread->showSmartPopUpMenuJs();
    }
    P2Util::printInfoHtml();
    // ヘッダ部分HTML
    $read_header_ht = <<<EOP
\t<table id="ntt{$_newthre_num}" class="toolbar" width="100%" style="padding:0px 10px 0px 0px;">
\t\t<tr>
\t\t\t<td align="left">
\t\t\t\t<h3 class="thread_title">{$aThread->ttitle_hs} </h3>
\t\t\t</td>
\t\t\t<td align="right">
\t\t\t\t{$prev_thre_ht}
\t\t\t\t{$next_thre_ht}
\t\t\t</td>
\t\t</tr>
\t</table>

EOP;
    //==================================================================
    // ローカルDatを読み込んでHTML表示
    //==================================================================
    $aThread->resrange['nofirst'] = true;
    $GLOBALS['newres_to_show_flag'] = false;
    if ($aThread->rescount) {
        // $aThread->datToHtml(); // dat を html に変換表示
        require_once P2_LIB_DIR . '/ShowThreadPc.php';
        $aShowThread = new ShowThreadPc($aThread);
        $res1 = $aShowThread->quoteOne();
        $read_cont_ht = $res1['q'];
        $read_cont_ht .= $aShowThread->getDatToHtml();
        unset($aShowThread);
    }
    //==================================================================
    // フッタ 表示
    //==================================================================
//.........这里部分代码省略.........
开发者ID:poppen,项目名称:p2,代码行数:101,代码来源:read_new.php


注:本文中的P2Util::getItaName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。