// 未読数制限 if (isset($_GET['unum_limit'])) { $unum_limit = (int) $_GET['unum_limit']; } elseif (isset($_POST['unum_limit'])) { $unum_limit = (int) $_POST['unum_limit']; } else { $unum_limit = 0; } //================================================= // あぼーん&NGワード設定読み込み //================================================= $GLOBALS['ngaborns'] = NgAbornCtl::loadNgAborns(); //==================================================================== // メイン //==================================================================== $aThreadList = new ThreadList(); // 板とモードのセット =================================== $ta_keys = array(); if ($spmode) { if ($spmode == "taborn" or $spmode == "soko") { $aThreadList->setIta($host, $bbs, P2Util::getItaName($host, $bbs)); } $aThreadList->setSpMode($spmode); } else { $aThreadList->setIta($host, $bbs, P2Util::getItaName($host, $bbs)); // スレッドあぼーんリスト読込 $taborn_file = $aThreadList->getIdxDir() . 'p2_threads_aborn.idx'; if ($tabornlines = FileCtl::file_read_lines($taborn_file, FILE_IGNORE_NEW_LINES)) { $ta_num = sizeof($tabornlines); foreach ($tabornlines as $l) { $tarray = explode('<>', $l);
break; case 'merge_favita': P2HttpRequestPool::fetchSubjectTxt($favitas); $GLOBALS['expack.subject.multi-threaded-download.done'] = true; break; } } elseif ($_conf['expack.use_pecl_http'] == 2) { if (P2CommandRunner::fetchSubjectTxt($spmode, $_conf)) { $GLOBALS['expack.subject.multi-threaded-download.done'] = true; } } } //============================================================ // メイン //============================================================ $aThreadList = new ThreadList(); // {{{ 板とモードのセット $spmode_without_palace_or_favita = false; $ta_keys = array(); $ta_num = 0; if ($spmode) { if ($spmode == 'taborn' or $spmode == 'soko') { $aThreadList->setIta($host, $bbs, P2Util::getItaName($host, $bbs)); } if ($spmode != 'palace' && $spmode != 'merge_favita') { $spmode_without_palace_or_favita = true; } $aThreadList->setSpMode($spmode); } else { // if(!$p2_setting['itaj']){$p2_setting['itaj'] = P2Util::getItaName($host, $bbs);} $aThreadList->setIta($host, $bbs, $p2_setting['itaj']);
if (!($bInlogged = validUser())) { // Det ?r vi inte, fixa variabler och st?ng sessionen igen $iNumberThreads = $oConfiguration->getCustomValue("DefaultNumberThreads"); $iThreadTimestamp = 0; $a_iOldThreads = array(); session_destroy(); } else { // Det ?r vi, fixa variabler $iNumberThreads = $_SESSION['oUser']->getNumberThreads(); $iThreadTimestamp = $_SESSION['oUser']->getLastLogin(); $a_iOldThreads = $_SESSION['a_iOldThreads']; } $iNumberThreads = 200; echo "b" . timer() . "<br>"; // H?mta tr?dlistan $oTL = new ThreadList(); if (FALSE === ($a_oThreads = $oTL->getThreads($_GET['Sort'], $iNumberThreads, $iNumberThreads * ($_GET['Page'] - 1), $iThreadTimestamp, $a_iOldThreads))) { trigger_error("11: " . $oTL->getErrorMsg(), E_USER_WARNING); } echo "c" . timer() . "<br>"; // Bygg upp sidan //$oTemplate->set("title", $oConfiguration->getCustomValue("Title")); if ($bInlogged) { //$oTemplate->set("User_ID", $_SESSION['oUser']->getID()); //$oTemplate->set("User_Name", htmlspecialchars($_SESSION['oUser']->getName())); //$oTemplate->replace("Login_Outside", "Login_Inside"); } //$oTemplate->set("Page", $_GET['Page']); //$oTemplate->set("Page_Next", $_GET['Page'] + 1); //$oTemplate->set("Page_Prev", $_GET['Page'] - 1); //$oTemplate->set("Sort", $_GET['Sort']);
$bbs = geti($_GET['bbs'], geti($_POST['bbs'])); $spmode = geti($_GET['spmode'], geti($_POST['spmode'])); if ((!$host || !isset($bbs)) && !isset($spmode)) { p2die('必要な引数が指定されていません'); } if ($host && P2Validate::host($host) || $bbs && P2Validate::bbs($bbs) || $spmode && P2Validate::spmode($spmode)) { p2die('不正な引数です'); } $hr = P2View::getHrHtmlK(); //==================================================================== // メイン //==================================================================== register_shutdown_function('saveMatomeCache'); $GLOBALS['_read_new_html'] = ''; ob_start(); $aThreadList = new ThreadList(); // 板とモードのセット if ($spmode) { if ($spmode == "taborn" or $spmode == "soko") { $aThreadList->setIta($host, $bbs, P2Util::getItaName($host, $bbs)); } $aThreadList->setSpMode($spmode); } else { $aThreadList->setIta($host, $bbs, P2Util::getItaName($host, $bbs)); // スレッドあぼーんリスト読込 $ta_keys = P2Util::getThreadAbornKeys($host, $bbs); $ta_num = sizeOf($ta_keys); } // ソースリスト読込 $lines = $aThreadList->readList(); // ページヘッダ表示 ===================================
/** * @see ThreadList::readThreads() */ public function readThreads() { parent::readThreads(); foreach ($this->threads as $key => $thread) { if ($thread->lastPostTime > $this->maxLastPostTime) { $this->maxLastPostTime = $thread->lastPostTime; } if ($thread->isSticky || $thread->isAnnouncement) { $this->topThreads[] = $thread; unset($this->threads[$key]); if ($thread->isNew()) { $this->newTopThreads++; } } else { if ($thread->isNew()) { $this->newThreads++; } } } }
/** * Creates a new SubscribedThreadList object. */ public function __construct($daysPrune = 100) { $this->daysPrune = $daysPrune; parent::__construct(); }
require_once P2_LIB_DIR . '/setPalace.func.php'; setPalace($host, $bbs, $_GET['key'], $_GET['setpal']); // あぼーんスレッド解除 } elseif ((isset($_POST['submit']) and $_POST['submit'] == $abornoff_st) && $host && $bbs && !empty($_POST['checkedkeys'])) { require_once P2_LIB_DIR . '/settaborn_off.inc.php'; settaborn_off($host, $bbs, $_POST['checkedkeys']); // スレッドあぼーん } elseif (isset($_GET['taborn']) && !is_null($_GET['key']) && $host && $bbs) { require_once P2_LIB_DIR . '/settaborn.func.php'; settaborn($host, $bbs, $_GET['key'], $_GET['taborn']); } //============================================================ // メイン //============================================================ $ta_keys = array(); $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);} $aThreadList->setIta($host, $bbs, $p2_setting['itaj']); // スレッドあぼーんリスト読込 $ta_keys = P2Util::getThreadAbornKeys($aThreadList->host, $aThreadList->bbs); $ta_num = sizeOf($ta_keys); } // ソースリスト読込 $lines = $aThreadList->readList();
function getThreadList($service, $maxResults, $method = "") { $user = '******'; $pageToken = NULL; $opt_param = array(); $opt_param['includeSpamTrash'] = false; // $opt_param['maxResults'] = $maxResults; // $opt_param['maxResults'] = 5; $opt_param['labelIds'] = ['INBOX']; // $opt_param['labelIds'] = ['INBOX', 'CATEGORY_PERSONAL']; $threadsResponse = $service->users_threads->listUsersThreads($user, $opt_param); if ($threadsResponse->getThreads()) { $threadObject = null; if ($method == "simple") { // $threadObject = array(); $threadObject = new ThreadList(); foreach ($threadsResponse->getThreads() as $thread) { $threadObject->addThread(new ThreadsSimple($thread->getId(), html_entity_decode($thread->getSnippet()))); // array_push($threadObject, new ThreadsSimple($thread->getId(), html_entity_decode($thread->getSnippet()))); } } else { if ($method == "minimal") { $threadObject = array(); foreach ($threadsResponse->getThreads() as $thread) { // $messageResponse = $service->users_messages-> $threadItem = thread_get($service, $user, $thread->getId()); printPre($threadItem); } } else { if ($method == "full") { listThreads($service, $maxResults); } else { if ($method == "allthreads") { $threadObject = new ThreadList(); foreach ($threadsResponse->getThreads() as $thread) { // $messageResponse = $service->users_messages-> $threadItem = thread_get($service, $user, $thread->getId()); // $threadObject->addThread(new ThreadItem($threadItem)); printPre($threadItem); } } } } } if ($threadObject != null) { printPre($threadObject); } } }
// {{{ itaj 設定 $itaj = null; if ($p2_setting_cont = FileCtl::file_read_contents($p2_setting_txt)) { $p2_setting = @unserialize($p2_setting_cont); if (is_array($p2_setting) && array_key_exists('itaj', $p2_setting)) { $itaj = $p2_setting['itaj']; } } if ($itaj === null || $itaj === '') { $itaj = P2Util::getItaName($host, $bbs); } // }}} //============================================================ // メイン //============================================================ $aThreadList = new ThreadList(); // 板とモードのセット =================================== if ($spmode) { if ($spmode == 'taborn' or $spmode == 'soko') { $aThreadList->setIta($host, $bbs, $itaj); } $aThreadList->setSpMode($spmode); } else { $aThreadList->setIta($host, $bbs, $itaj); // スレッドあぼーんリスト読込 $taborn_file = $aThreadList->getIdxDir() . 'p2_threads_aborn.idx'; if ($tabornlines = FileCtl::file_read_lines($taborn_file, FILE_IGNORE_NEW_LINES)) { $ta_num = sizeof($tabornlines); foreach ($tabornlines as $l) { $data = explode('<>', $l); $ta_keys[$data[1]] = true;