Ejemplo n.º 1
0
             $aThread->host = $aThreadList->host;
             $aThread->bbs = $aThreadList->bbs;
             break;
         case "palace":
             // スレの殿堂
             $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;
Ejemplo n.º 2
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.º 3
0
Archivo: info_i.php Proyecto: poppen/p2
// メイン
//=================================================================
$aThread = new Thread();
// hostを分解してidxファイルのパスを求める
$aThread->setThreadPathInfo($host, $bbs, $key);
$key_line = $aThread->getThreadInfoFromIdx();
$aThread->getDatBytesFromLocalDat();
// $aThread->length をset
//$aThread->readDatInfoFromFile();
if (!($aThread->itaj = P2Util::getItaName($aThread->host, $aThread->bbs))) {
    $aThread->itaj = $aThread->bbs;
}
$hc['itaj'] = $aThread->itaj;
if (!$aThread->ttitle) {
    if (isset($ttitle_en)) {
        $aThread->setTtitle(base64_decode($ttitle_en));
    } else {
        $aThread->setTitleFromLocal();
    }
}
if (!$ttitle_en) {
    if ($aThread->ttitle) {
        $ttitle_en = base64_encode($aThread->ttitle);
        //$ttitle_urlen = rawurlencode($ttitle_en);
    }
}
if (!is_null($aThread->ttitle_hc)) {
    $hc['ttitle_name'] = $aThread->ttitle_hc;
} else {
    $hc['ttitle_name'] = "スレッドタイトル未取得";
}
Ejemplo n.º 4
0
//=================================================================
// メイン
//=================================================================
$aThread = new Thread();
// hostを分解してidxファイルのパスを求める
$aThread->setThreadPathInfo($host, $bbs, $key);
$key_line = $aThread->getThreadInfoFromIdx();
$aThread->getDatBytesFromLocalDat();
// $aThread->length をset
if (!($aThread->itaj = P2Util::getItaName($aThread->host, $aThread->bbs))) {
    $aThread->itaj = $aThread->bbs;
}
$hc['itaj'] = $aThread->itaj;
if (!$aThread->ttitle) {
    if (isset($ttitle_en)) {
        $aThread->setTtitle(UrlSafeBase64::decode($ttitle_en));
    } else {
        $aThread->setTitleFromLocal();
    }
}
if (!$ttitle_en) {
    if ($aThread->ttitle) {
        $ttitle_en = UrlSafeBase64::encode($aThread->ttitle);
        //$ttitle_urlen = rawurlencode($ttitle_en);
    }
}
if ($ttitle_en) {
    $ttitle_en_q = '&amp;ttitle_en=' . $ttitle_en;
} else {
    $ttitle_en_q = '';
}