Пример #1
0
function newSubmissions($action, $limit = 5, $start = 0)
{
    global $mydirname;
    switch ($action) {
        case 'newSubmissions':
            $articles = Bulletin::getAllSubmitted($mydirname);
            break;
        case 'autoStories':
            $articles = Bulletin::getAllAutoStory($mydirname);
            break;
        case 'Published':
            $articles = Bulletin::getAllPublished($mydirname, $limit, $start, 0, 0);
            break;
        case 'Expired':
            $articles = Bulletin::getAllExpired($mydirname, $limit, $start, 0, 0);
            break;
    }
    $ret = array();
    if (count($articles) > 0) {
        $i = 0;
        foreach ($articles as $article) {
            $ret[$i]['storyid'] = $article->getVar('storyid');
            $ret[$i]['title'] = RENDER_NEWS_TITLE($article);
            $ret[$i]['topic'] = $article->topic_title();
            $ret[$i]['uid'] = $article->getVar('uid');
            $ret[$i]['uname'] = $article->getUname();
            $ret[$i]['created'] = formatTimestamp($article->getVar('created'));
            $ret[$i]['published'] = formatTimestamp($article->getVar('published'));
            $ret[$i]['expired'] = $article->getVar('expired') > 0 ? formatTimestamp($article->getVar('expired')) : '---';
            $i++;
        }
    }
    return $ret;
}