Пример #1
0
    if (!isset($aThread->unum)) {
        if ($aThreadList->spmode == "recent" or $aThreadList->spmode == "res_hist" or $aThreadList->spmode == "taborn") {
            $aThread->unum = -0.1;
        } else {
            $aThread->unum = $_conf['sort_zero_adjust'];
        }
    }
    // }}}
    // 勢いのセット
    $aThread->setDayRes($nowtime);
    // 生存数set
    if ($aThread->isonline) {
        $online_num++;
    }
    // リストに追加
    $aThreadList->addThread($aThread);
    unset($aThread);
    //$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('FORLOOP_HIP');
}
unset($lines);
//$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('FORLOOP');
//$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('FOOT');
// 既にdat落ちしているスレは自動的にあぼーんを解除する
autoTAbornOff($aThreadList, $ta_keys);
// ソート
if (!empty($GLOBALS['wakati_words'])) {
    $now_sort = 'title';
    $sort_mode = 'similarity';
} else {
    $sort_mode = $now_sort;
}
Пример #2
0
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);
        }
    }
}