Exemplo n.º 1
0
/**
 * Display a list of the expired stories
 *
 * This list can be view in the module's admin when you click on the tab named "Post/Edit News"
 * Actually you can see the story's ID, the title, the topic, the author,
 * the creation and expiration's date and you have two links, one to delete
 * the story and the other to edit the story.
 * The table only contains the last X expired stories.
 * You can modify the number of visible stories with the module's option named
 * "Number of new articles to display in admin area".
 * As the number of displayed stories is limited, below this list you can find a text box
 * that you can use to enter a story's Id, then with the scrolling list you can select
 * if you want to edit or delete the story.
 */
function expStories()
{
    global $xoopsModule, $dateformat;
    $storyarray = NewsStory::getAllExpired(10, 0, 0, 1);
    if (count($storyarray) > 0) {
        $class = '';
        news_collapsableBar('expstories', 'topexpstories');
        echo "<img onclick='toggle('toptable'); toggleIcon('toptableicon');' id='topexpstories' name='topexpstories' src=" . XOOPS_URL . "/modules/news/images/close12.gif alt='' /></a>&nbsp;" . _AM_EXPARTS . "</h4>";
        echo "<div id='expstories'>";
        echo "<br />";
        echo "<div style='text-align: center;'>";
        echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'><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_CREATED . "</td><td align='center' class='nw'>" . _AM_EXPIRED . "</td><td align='center'>" . _AM_ACTION . "</td></tr>";
        foreach ($storyarray as $eachstory) {
            $created = formatTimestamp($eachstory->created(), $dateformat);
            $expired = formatTimestamp($eachstory->expired(), $dateformat);
            $topic = $eachstory->topic();
            // added exired value field to table
            $class = $class == 'even' ? 'odd' : 'even';
            echo "<tr class='" . $class . "'>";
            echo "<td align='center'><b>" . $eachstory->storyid() . "</b>\n\t        \t</td><td align='left'><a href='" . XOOPS_URL . "/modules/news/article.php?returnside=1&amp;storyid=" . $eachstory->storyid() . "'>" . $eachstory->title() . "</a>\n        \t\t</td><td align='center'>" . $topic->topic_title() . "\n        \t\t</td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $eachstory->uid() . "'>" . $eachstory->uname() . "</a></td><td align='center' class='nw'>" . $created . "</td><td align='center' class='nw'>" . $expired . "</td><td align='center'><a href='" . XOOPS_URL . "/modules/news/submit.php?returnside=1&amp;op=edit&amp;storyid=" . $eachstory->storyid() . "'>" . _AM_EDIT . "</a>-<a href='" . XOOPS_URL . "/modules/news/admin/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\t    \t" . _AM_STORYID . " <input type='text' name='storyid' size='10' />\n    \t\t<select name='op'>\n\t    \t\t<option value='edit' selected='selected'>" . _AM_EDIT . "</option>\n    \t\t\t<option value='delete'>" . _AM_DELETE . "</option>\n    \t\t</select>\n\t\t\t<input type='hidden' name='returnside' value='1'>\n    \t\t<input type='submit' value='" . _AM_GO . "' />\n    \t\t</form>\n\t\t</div>";
        echo "</div><br />";
    }
}
Exemplo n.º 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>";
}