Ejemplo n.º 1
0
/**
 * 指定したキーのスレッドログ(idx (,dat))を削除する
 *
 * 通常は、この関数を直接呼び出すことはない。deleteLogs() から呼び出される。
 *
 * @see deleteLogs()
 * @return  integer|false  削除できたら1, 削除対象がなければ2を返す。失敗があればfalse。
 */
function deleteThisKey($host, $bbs, $key)
{
    global $_conf;
    $anidx = P2Util::idxDirOfHostBbs($host, $bbs) . $key . '.idx';
    $adat = P2Util::datDirOfHostBbs($host, $bbs) . $key . '.dat';
    // Fileの削除処理
    // idx(個人用設定)
    if (file_exists($anidx)) {
        if (unlink($anidx)) {
            $deleted_flag = true;
        } else {
            $failed_flag = true;
        }
    }
    // datの削除処理
    if (file_exists($adat)) {
        if (unlink($adat)) {
            $deleted_flag = true;
        } else {
            $failed_flag = true;
        }
    }
    // 失敗があれば
    if (!empty($failed_flag)) {
        return false;
        // 削除できたら
    } elseif (!empty($deleted_flag)) {
        return 1;
        // 削除対象がなければ
    } else {
        return 2;
    }
}
Ejemplo n.º 2
0
/**
 * ■スレッドあぼーんを複数一括解除する
 */
function settaborn_off($host, $bbs, $taborn_off_keys)
{
    if (!$taborn_off_keys) {
        return;
    }
    // p2_threads_aborn.idx のパス取得
    $taborn_idx = P2Util::idxDirOfHostBbs($host, $bbs) . 'p2_threads_aborn.idx';
    // p2_threads_aborn.idx がなければ
    if (!file_exists($taborn_idx)) {
        p2die('あぼーんリストが見つかりませんでした。');
    }
    // p2_threads_aborn.idx 読み込み
    $taborn_lines = FileCtl::file_read_lines($taborn_idx, FILE_IGNORE_NEW_LINES);
    // 指定keyを削除
    foreach ($taborn_off_keys as $val) {
        $neolines = array();
        if ($taborn_lines) {
            foreach ($taborn_lines as $line) {
                $lar = explode('<>', $line);
                if ($lar[1] == $val) {
                    // key発見
                    // echo "key:{$val} のスレッドをあぼーん解除しました。<br>";
                    $kaijo_attayo = true;
                    continue;
                }
                if (!$lar[1]) {
                    continue;
                }
                // keyのないものは不正データ
                $neolines[] = $line;
            }
        }
        $taborn_lines = $neolines;
    }
    // 書き込む
    if (file_exists($taborn_idx)) {
        copy($taborn_idx, $taborn_idx . '.bak');
        // 念のためバックアップ
    }
    $cont = '';
    if (is_array($taborn_lines)) {
        foreach ($taborn_lines as $l) {
            $cont .= $l . "\n";
        }
    }
    if (FileCtl::file_write_contents($taborn_idx, $cont) === false) {
        p2die('cannot write file.');
    }
    /*
    if (!$kaijo_attayo) {
        // echo "指定されたスレッドは既にあぼーんリストに載っていないようです。";
    } else {
        // echo "あぼーん解除、完了しました。";
    }
    */
}
Ejemplo n.º 3
0
    require_once P2_LIB_DIR . '/settaborn.inc.php';
    settaborn($host, $bbs, $_GET['key'], $_GET['taborn']);
}
// お気に板をマージ
if ($spmode == 'merge_favita') {
    $favitas = array();
    $pre_subject_keys = array();
    $subject_keys = array();
    $sb_key_txts = array();
    if (file_exists($_conf['favita_brd'])) {
        foreach (file($_conf['favita_brd']) as $l) {
            if (preg_match("/^\t?(.+?)\t(.+?)\t.+?\$/", rtrim($l), $matches)) {
                $_host = $matches[1];
                $_bbs = $matches[2];
                $_id = $_host . '/' . $_bbs;
                $_idx_host_bbs_dir_s = P2Util::idxDirOfHostBbs($_host, $_bbs);
                $_sb_keys_txt = $_idx_host_bbs_dir_s . 'p2_sb_keys.txt';
                $_sb_keys_txt_a = $_idx_host_bbs_dir_s . 'p2_sb_keys_m.txt';
                $_sb_keys_txt_b = $_idx_host_bbs_dir_s . 'p2_sb_keys_m_b.txt';
                $favitas[$_id] = array('host' => $_host, 'bbs' => $_bbs);
                $pre_subject_keys[$_id] = getSubjectKeys($_sb_keys_txt, $_sb_keys_txt);
                foreach (getSubjectKeys($_sb_keys_txt_a, $_sb_keys_txt_b) as $_key => $_value) {
                    $pre_subject_keys[$_id][$_key] = $_value;
                }
                $subject_keys[$_id] = array();
                $sb_key_txts[$_id] = array($_sb_keys_txt_a, $_sb_keys_txt_b);
            }
        }
    }
    if ($_conf['merge_favita'] == 2) {
        $kitoku_only = true;
Ejemplo n.º 4
0
} else {
    $host = $_GET['host'];
}
$bbs = isset($_GET['bbs']) ? $_GET['bbs'] : '';
$key = isset($_GET['key']) ? $_GET['key'] : '';
$rescount = isset($_GET['rescount']) ? intval($_GET['rescount']) : 1;
$popup = isset($_GET['popup']) ? intval($_GET['popup']) : 0;
$itaj = P2Util::getItaName($host, $bbs);
if (!$itaj) {
    $itaj = $bbs;
}
$itaj_hd = htmlspecialchars($itaj, ENT_QUOTES, 'Shift_JIS', false);
$ttitle_en = isset($_GET['ttitle_en']) ? $_GET['ttitle_en'] : '';
$ttitle = strlen($ttitle_en) > 0 ? UrlSafeBase64::decode($ttitle_en) : '';
$ttitle_hd = htmlspecialchars($ttitle, ENT_QUOTES);
$key_idx = P2Util::idxDirOfHostBbs($host, $bbs) . $key . '.idx';
// フォームのオプション読み込み
include P2_LIB_DIR . '/post_form_options.inc.php';
// 表示指定
if (!$_conf['ktai']) {
    $class_ttitle = ' class="thre_title"';
    $target_read = ' target="read"';
    $sub_size_at = ' size="40"';
} else {
    $class_ttitle = '';
    $target_read = '';
    $sub_size_at = '';
}
// {{{ スレ立てなら
if (!empty($_GET['newthread'])) {
    $ptitle = "{$itaj_hd} - 新規スレッド作成";
Ejemplo n.º 5
0
/**
 * お気にスレをセットする
 *
 * @param   string      $host
 * @param   string      $bbs
 * @param   string      $key
 * @param   int|string  $setfavita  0(解除), 1(追加), 2(トグル), top, up, down, bottom
 * @param   string      $ttitle
 * @param   int|null    $setnum
 * @return  bool
 */
function setFav($host, $bbs, $key, $setfav, $ttitle = null, $setnum = null)
{
    global $_conf;
    //==================================================================
    // key.idx
    //==================================================================
    // idxfileのパスを求めて
    $idxfile = P2Util::idxDirOfHostBbs($host, $bbs) . $key . '.idx';
    // 板ディレクトリが無ければ作る
    // FileCtl::mkdirFor($idxfile);
    // 既にidxデータがあるなら読み込む
    if ($lines = FileCtl::file_read_lines($idxfile, FILE_IGNORE_NEW_LINES)) {
        $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;
}
Ejemplo n.º 6
0
// 変数設定
//============================================================
if (isset($_GET['from'])) {
    $sb_disp_from = $_GET['from'];
}
if (isset($_POST['from'])) {
    $sb_disp_from = $_POST['from'];
}
if (!isset($sb_disp_from)) {
    $sb_disp_from = 1;
}
// p2_setting 設定
if ($spmode) {
    $p2_setting_txt = $_conf['pref_dir'] . "/p2_setting_" . $spmode . ".txt";
} else {
    $idx_bbs_dir_s = P2Util::idxDirOfHostBbs($host, $bbs);
    $p2_setting_txt = $idx_bbs_dir_s . "p2_setting.txt";
    $sb_keys_b_txt = $idx_bbs_dir_s . "p2_sb_keys_b.txt";
    $sb_keys_txt = $idx_bbs_dir_s . "p2_sb_keys.txt";
    if (!empty($_REQUEST['norefresh']) || !empty($_REQUEST['word'])) {
        if ($prepre_sb_cont = @file_get_contents($sb_keys_b_txt)) {
            $prepre_sb_keys = unserialize($prepre_sb_cont);
        }
    } else {
        if ($pre_sb_cont = @file_get_contents($sb_keys_txt)) {
            $pre_sb_keys = unserialize($pre_sb_cont);
        }
    }
}
// p2_setting 読み込み
$p2_setting = sbLoadP2SettingTxt($p2_setting_txt);
Ejemplo n.º 7
0
/**
 * スレッド情報を取得する
 *
 * @param   string  $host
 * @param   string  $bbs
 * @param   string  $key
 * @return  object  スレッド情報
 */
function get_thread_info($host, $bbs, $key)
{
    global $_conf;
    $group = P2Util::getHostGroupName($host);
    $info = new stdClass();
    $info->type = 'thread';
    $info->group = $group;
    $info->host = $host;
    $info->bbs = $bbs;
    $info->key = $key;
    $aThread = new Thread();
    // hostを分解してidxファイルのパスを求める
    $aThread->setThreadPathInfo($host, $bbs, $key);
    $key_line = $aThread->getThreadInfoFromIdx();
    // $aThread->length をset
    $aThread->getDatBytesFromLocalDat();
    // 板名を取得
    $aThread->itaj = P2Util::getItaName($host, $bbs);
    if (!$aThread->itaj) {
        if (isset($_GET['itaj_en'])) {
            $aThread->itaj = UrlSafeBase64::decode($_GET['itaj_en']);
        } else {
            $aThread->itaj = $bbs;
        }
    }
    $info->itaj = $aThread->itaj;
    // スレタイトルを取得
    if (!$aThread->ttitle) {
        if (isset($_GET['ttitle_en'])) {
            $aThread->setTtitle(UrlSafeBase64::decode($_GET['ttitle_en']));
        } else {
            $aThread->setTitleFromLocal();
        }
    }
    $info->ttitle = $aThread->ttitle;
    // お気にスレ登録状況を取得
    $favs = array();
    if ($_conf['expack.misc.multi_favs']) {
        $favlist_titles = FavSetManager::getFavSetTitles('m_favlist_set');
        for ($i = 0; $i <= $_conf['expack.misc.favset_num']; $i++) {
            if (!isset($favlist_titles[$i]) || $favlist_titles[$i] == '') {
                if ($i == 0) {
                    $favtitle = 'お気にスレ';
                } else {
                    $favtitle = "お気にスレ{$i}";
                }
            } else {
                $favtitle = $favlist_titles[$i];
            }
            $favs[$i] = array('title' => $favtitle, 'set' => !empty($aThread->favs[$i]));
        }
    } else {
        $favs[0] = array('title' => 'お気にスレ', 'set' => !empty($aThread->fav));
    }
    $info->favs = $favs;
    // 殿堂チェック
    $info->palace = false;
    if ($pallines = FileCtl::file_read_lines($_conf['palace_idx'], FILE_IGNORE_NEW_LINES)) {
        foreach ($pallines as $l) {
            $palarray = explode('<>', $l);
            if ($aThread->key == $palarray[1] && $aThread->bbs == $palarray[11]) {
                if (P2Util::getHostGroupName($palarray[10]) == $group) {
                    $info->palace = true;
                    break;
                }
            }
        }
    }
    // スレッドあぼーんチェック
    $info->taborn = false;
    $taborn_idx = P2Util::idxDirOfHostBbs($host, $bbs) . 'p2_threads_aborn.idx';
    if ($tabornlines = FileCtl::file_read_lines($taborn_idx, FILE_IGNORE_NEW_LINES)) {
        foreach ($tabornlines as $l) {
            $tabornarray = explode('<>', $l);
            if ($key == $tabornarray[1]) {
                $info->taborn = true;
                break;
            }
        }
    }
    // ログ関連
    $hasLog = false;
    if (file_exists($aThread->keydat)) {
        $info->keydat = $aThread->keydat;
        $info->length = $aThread->length;
        $hasLog = true;
    } else {
        $info->keydat = null;
        $info->length = -1;
    }
    if (file_exists($aThread->keyidx)) {
        $info->keyidx = $aThread->keyidx;
        $hasLog = true;
    } else {
        $info->keyidx = null;
    }
    if ($aThread->gotnum) {
        $info->gotnum = $aThread->gotnum;
    } elseif ($hasLog) {
        $info->gotnum = 0;
    } else {
        $info->gotnum = -1;
    }
    return $info;
}
Ejemplo n.º 8
0
 /**
  * idxの保存ディレクトリを返す
  *
  * @param bool $dir_sep
  * @return string
  * @see P2Util::idxDirOfHost(), ThreadList::getIdxDir()
  */
 public function getIdxDir($dir_sep = true)
 {
     return P2Util::idxDirOfHostBbs($this->host, $this->bbs, $dir_sep);
 }
Ejemplo n.º 9
0
/**
 * スレッドあぼーんをオンオフする
 *
 * $set は、0(解除), 1(追加), 2(トグル)
 */
function settaborn($host, $bbs, $key, $set)
{
    global $_conf, $title_msg, $info_msg;
    //==================================================================
    // key.idx 読み込む
    //==================================================================
    // idxfileのパスを求めて
    $idx_host_bbs_dir_s = P2Util::idxDirOfHostBbs($host, $bbs);
    $idxfile = $idx_host_bbs_dir_s . $key . '.idx';
    // データがあるなら読み込む
    if ($lines = FileCtl::file_read_lines($idxfile, FILE_IGNORE_NEW_LINES)) {
        $data = explode('<>', $lines[0]);
    } else {
        $data = array_fill(0, 12, '');
    }
    //==================================================================
    // p2_threads_aborn.idxに書き込む
    //==================================================================
    // p2_threads_aborn.idx のパス取得
    $taborn_idx = $idx_host_bbs_dir_s . 'p2_threads_aborn.idx';
    // p2_threads_aborn.idx がなければ生成
    FileCtl::make_datafile($taborn_idx);
    // p2_threads_aborn.idx 読み込み;
    $taborn_lines = FileCtl::file_read_lines($taborn_idx, FILE_IGNORE_NEW_LINES);
    $neolines = array();
    $aborn_attayo = false;
    if ($taborn_lines) {
        foreach ($taborn_lines as $l) {
            $lar = explode('<>', $l);
            if ($lar[1] == $key) {
                $aborn_attayo = true;
                // 既にあぼーん中である
                if ($set == 0 or $set == 2) {
                    $title_msg_pre = "+ あぼーん 解除しますた";
                    $info_msg_pre = "+ あぼーん 解除しますた";
                }
                continue;
            }
            if (!$lar[1]) {
                continue;
            }
            // keyのないものは不正データ
            $neolines[] = $l;
        }
    }
    // 新規データ追加
    if ($set == 1 or !$aborn_attayo && $set == 2) {
        $newdata = "{$data[0]}<>{$key}<><><><><><><><>";
        $neolines ? array_unshift($neolines, $newdata) : ($neolines = array($newdata));
        $title_msg_pre = "○ あぼーん しますた";
        $info_msg_pre = "○ あぼーん しますた";
    }
    // 書き込む
    $cont = '';
    if (!empty($neolines)) {
        foreach ($neolines as $l) {
            $cont .= $l . "\n";
        }
    }
    if (FileCtl::file_write_contents($taborn_idx, $cont) === false) {
        p2die('cannot write file.');
    }
    $GLOBALS['title_msg'] = $title_msg_pre;
    $GLOBALS['info_msg'] = $info_msg_pre;
    return true;
}
Ejemplo n.º 10
0
/**
 * スレを殿堂入りにセットする
 *
 * @param   string      $host
 * @param   string      $bbs
 * @param   string      $key
 * @param   int|string  $setpal  0(解除), 1(追加), 2(トグル) top, up, down, bottom
 * @param   string      $ttitle
 * @return  bool
 */
function setPal($host, $bbs, $key, $setpal, $ttitle = null)
{
    global $_conf;
    // key.idx のパスを求めて
    $idxfile = P2Util::idxDirOfHostBbs($host, $bbs) . $key . '.idx';
    // 既に key.idx データがあるなら読み込む
    if ($lines = FileCtl::file_read_lines($idxfile, FILE_IGNORE_NEW_LINES)) {
        $data = explode('<>', $lines[0]);
    } else {
        $data = array_fill(0, 12, '');
        if (is_string($ttitle) && strlen($ttitle)) {
            $data[0] = p2h($ttitle, false);
        }
    }
    //==================================================================
    // p2_palace.idxに書き込む
    //==================================================================
    $lock = new P2Lock($_conf['palace_idx'], false);
    // palace_idx ファイルがなければ生成
    FileCtl::make_datafile($_conf['palace_idx']);
    // palace_idx 読み込み
    $pallines = FileCtl::file_read_lines($_conf['palace_idx'], FILE_IGNORE_NEW_LINES);
    $neolines = array();
    $pal_attayo = false;
    $before_line_num = 0;
    // {{{ 最初に重複要素を削除しておく
    if (!empty($pallines)) {
        $i = -1;
        foreach ($pallines as $l) {
            $i++;
            $lar = explode('<>', $l);
            // 重複回避
            if ($lar[1] == $key && $lar[11] == $bbs) {
                $pal_attayo = true;
                $before_line_num = $i;
                // 移動前の行番号をセット
                continue;
                // keyのないものは不正データなのでスキップ
            } elseif (!$lar[1]) {
                continue;
            } else {
                $neolines[] = $l;
            }
        }
    }
    // }}}
    if ($setpal == 2) {
        $setpal = $pal_attayo ? 0 : 1;
    }
    // 新規データ設定
    if ($setpal) {
        $newdata = "{$data[0]}<>{$key}<>{$data[2]}<>{$data[3]}<>{$data[4]}<>{$data[5]}<>{$data[6]}<>{$data[7]}<>{$data[8]}<>{$data[9]}<>{$host}<>{$bbs}";
        require_once P2_LIB_DIR . '/getsetposlines.inc.php';
        $rec_lines = getSetPosLines($neolines, $newdata, $before_line_num, $setpal);
    } else {
        $rec_lines = $neolines;
    }
    $cont = '';
    if (!empty($rec_lines)) {
        foreach ($rec_lines as $l) {
            $cont .= $l . "\n";
        }
    }
    // 書き込む
    if (FileCtl::file_write_contents($_conf['palace_idx'], $cont) === false) {
        p2die('cannot write file.');
    }
    return true;
}
Ejemplo n.º 11
0
Archivo: P2Util.php Proyecto: poppen/p2
 /**
  * failed_post_file のパスを取得する
  *
  * @access  public
  * @return  string
  */
 function getFailedPostFilePath($host, $bbs, $key = false)
 {
     // レス
     if ($key) {
         $filename = $key . '.failed.data.php';
         // スレ立て
     } else {
         $filename = 'failed.data.php';
     }
     return $failed_post_file = P2Util::idxDirOfHostBbs($host, $bbs) . $filename;
 }
Ejemplo n.º 12
0
            }
            break;
        }
    }
}
$paldo = $isPalace ? 0 : 1;
$pal_a_ht = "info.php?{$common_q}&amp;setpal={$paldo}{$popup_q}{$ttitle_en_q}{$_conf['k_at_a']}";
if ($isPalace) {
    $pal_ht = "<a href=\"{$pal_a_ht}\"{$btn_class}>★</a>";
} else {
    $pal_ht = "<a href=\"{$pal_a_ht}\"{$btn_class}>+</a>";
}
// }}}
// {{{ スレッドあぼーんチェック
// スレッドあぼーんリスト読込
$taborn_file = P2Util::idxDirOfHostBbs($host, $bbs) . 'p2_threads_aborn.idx';
if ($tabornlist = FileCtl::file_read_lines($taborn_file, FILE_IGNORE_NEW_LINES)) {
    foreach ($tabornlist as $l) {
        $tarray = explode('<>', $l);
        if ($aThread->key == $tarray[1]) {
            $isTaborn = true;
            break;
        }
    }
}
$taborndo_title_at = '';
if (!empty($isTaborn)) {
    $tastr1 = "あぼーん中";
    $tastr2 = "あぼーん解除する";
    $taborndo = 0;
} else {
Ejemplo n.º 13
0
 /**
  * readList
  *
  * @access  public
  * @return  array
  */
 function readList()
 {
     global $_conf;
     $GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('readList()');
     $lines = array();
     // spmodeの場合
     if ($this->spmode) {
         // ローカルの履歴ファイル 読み込み
         if ($this->spmode == "recent") {
             file_exists($_conf['recent_file']) and $lines = file($_conf['recent_file']);
             // ローカルの書き込み履歴ファイル 読み込み
         } elseif ($this->spmode == "res_hist") {
             file_exists($_conf['res_hist_idx']) and $lines = file($_conf['res_hist_idx']);
             // ローカルのお気にファイル 読み込み
         } elseif ($this->spmode == "fav") {
             file_exists($_conf['favlist_file']) and $lines = file($_conf['favlist_file']);
             // ニュース系サブジェクト読み込み
         } elseif ($this->spmode == "news") {
             unset($news);
             $news[] = array(host => "news2.2ch.net", bbs => "newsplus");
             // ニュース速報+
             $news[] = array(host => "news2.2ch.net", bbs => "liveplus");
             // ニュース実況
             $news[] = array(host => "book.2ch.net", bbs => "bizplus");
             // ビジネスニュース速報+
             $news[] = array(host => "live2.2ch.net", bbs => "news");
             // ニュース速報
             $news[] = array(host => "news3.2ch.net", bbs => "news2");
             // ニュース議論
             foreach ($news as $n) {
                 require_once P2_LIB_DIR . '/SubjectTxt.php';
                 $aSubjectTxt = new SubjectTxt($n['host'], $n['bbs']);
                 if (is_array($aSubjectTxt->subject_lines)) {
                     foreach ($aSubjectTxt->subject_lines as $l) {
                         if (preg_match("/^([0-9]+)\\.(dat|cgi)(,|<>)(.+) ?(\\(|()([0-9]+)(\\)|))/", $l, $matches)) {
                             //$this->isonline = true;
                             unset($al);
                             $al['key'] = $matches[1];
                             $al['ttitle'] = rtrim($matches[4]);
                             $al['rescount'] = $matches[6];
                             $al['host'] = $n['host'];
                             $al['bbs'] = $n['bbs'];
                             $lines[] = $al;
                         }
                     }
                 }
             }
             // p2_threads_aborn.idx 読み込み
         } elseif ($this->spmode == 'taborn') {
             $file = P2Util::getThreadAbornFile($this->host, $this->bbs);
             if (file_exists($file)) {
                 $lines = file($file);
             }
             // {{{ spmodeがdat倉庫の場合 @todo ページング用に数を制限できるようにしたい
         } elseif ($this->spmode == 'soko') {
             $dat_bbs_dir = P2Util::datDirOfHostBbs($this->host, $this->bbs, false);
             $idx_bbs_dir = P2Util::idxDirOfHostBbs($this->host, $this->bbs, false);
             $dat_pattern = '/([0-9]+)\\.dat$/';
             $idx_pattern = '/([0-9]+)\\.idx$/';
             // {{{ datログディレクトリを走査して孤立datにidx付加する
             $GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('dat');
             if ($cdir = dir($dat_bbs_dir)) {
                 // or die ("ログディレクトリがないよ!");
                 while ($entry = $cdir->read()) {
                     if (preg_match($dat_pattern, $entry, $matches)) {
                         $theidx = $idx_bbs_dir . DIRECTORY_SEPARATOR . $matches[1] . '.idx';
                         if (!file_exists($theidx)) {
                             if ($datlines = file($dat_bbs_dir . DIRECTORY_SEPARATOR . $entry)) {
                                 $firstdatline = rtrim($datlines[0]);
                                 if (strstr($firstdatline, '<>')) {
                                     $datline_sepa = '<>';
                                 } else {
                                     $datline_sepa = ',';
                                 }
                                 $d = explode($datline_sepa, $firstdatline);
                                 $atitle = $d[4];
                                 $gotnum = sizeof($datlines);
                                 $readnum = $gotnum;
                                 $anewline = $readnum + 1;
                                 $data = array($atitle, $matches[1], '', $gotnum, '', $readnum, '', '', '', $anewline, '', '', '');
                                 P2Util::recKeyIdx($theidx, $data);
                             }
                         }
                         // array_push($lines, $idl[0]);
                     }
                 }
                 $cdir->close();
             }
             $GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('dat');
             // }}}
             // {{{ idxログディレクトリを走査してidx情報を抽出してリスト化
             // オンラインも倉庫もまとめて抽出している。オンラインを外すのは subject.php で行っている。
             $GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('idx');
             if ($cdir = dir($idx_bbs_dir)) {
                 // or die ("ログディレクトリがないよ!");
                 $limit = 1000;
                 // ひとまず簡易制限
                 $i = 0;
                 while ($entry = $cdir->read()) {
                     if (preg_match($idx_pattern, $entry)) {
                         if ($idl = file($idx_bbs_dir . DIRECTORY_SEPARATOR . $entry)) {
                             array_push($lines, $idl[0]);
                             $i++;
                             if ($i >= $limit) {
                                 P2Util::pushInfoHtml("<p>p2 info: idxログ数が、表\示処理可能\数である{$limit}件をオーバーしています。</p>");
                                 break;
                             }
                         }
                     }
                 }
                 $cdir->close();
             }
             $GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('idx');
             // }}}
             // }}}
             // スレの殿堂の場合  // p2_palace.idx 読み込み
         } elseif ($this->spmode == "palace") {
             $palace_idx = $_conf['pref_dir'] . '/p2_palace.idx';
             file_exists($palace_idx) and $lines = file($palace_idx);
         }
         // オンライン上の subject.txt を読み込む(spmodeでない場合)
     } else {
         require_once P2_LIB_DIR . '/SubjectTxt.php';
         $aSubjectTxt = new SubjectTxt($this->host, $this->bbs);
         $lines = $aSubjectTxt->subject_lines;
     }
     $GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('readList()');
     return $lines;
 }