Пример #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;
}
Пример #2
0
function expStories()
{
    global $xoopsDB, $xoopsConfig, $xoopsModule;
    echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
    echo "<div style='text-align: center;'><b>" . _AM_EXPARTS . "</b><br />";
    $storyarray = NewsStory::getAllExpired(10, 0, 0, 1);
    echo "<table border='1' width='100%'><tr class='bg3'><td align='center'>" . _AM_STORYID . "</td><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_TOPIC . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center' class='nw'>" . _AM_PUBLISHED . "</td><td align='center' class='nw'>" . _AM_EXPIRED . "</td><td align='center'>" . _AM_ACTION . "</td></tr>";
    foreach ($storyarray as $eachstory) {
        $published = formatTimestamp($eachstory->published());
        $expired = formatTimestamp($eachstory->expired());
        $topic = $eachstory->topic();
        // added exired value field to table
        echo "\n            <tr><td align='center'><b>" . $eachstory->storyid() . "</b>\n            </td><td align='left'>" . RENDER_NEWS_TITLE($eachstory) . "</td><td align='center'>" . $topic->topic_title() . "\n            </td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $eachstory->uid() . "'>" . $eachstory->uname() . "</a></td><td align='center' class='nw'>" . $published . "</td><td align='center' class='nw'>" . $expired . "</td><td align='center'><a href='index.php?op=edit&amp;storyid=" . $eachstory->storyid() . "'>" . _AM_EDIT . "</a>-<a href='index.php?op=delete&amp;storyid=" . $eachstory->storyid() . "'>" . _AM_DELETE . "</a>";
        echo "</td></tr>\n";
    }
    echo "</table><br />";
    echo "<form action='index.php' method='post'>\n        " . _AM_STORYID . " <input type='text' name='storyid' size='10' />\n        <select name='op'>\n        <option value='edit' selected='selected'>" . _AM_EDIT . "</option>\n        <option value='delete'>" . _AM_DELETE . "</option>\n        </select>\n        <input type='submit' value='" . _AM_GO . "' />\n        </form>\n    </div>\n        ";
    echo "</td></tr></table>";
}