function autoStories() { global $xoopsDB, $xoopsConfig, $xoopsModule; $storyarray = NewsStory::getAllAutoStory(); if (count($storyarray) > 0) { echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">"; echo "<div style='text-align: center;'><b>" . _AM_AUTOARTICLES . "</b><br />\n"; echo "<table border='1' width='100%'><tr class='bg2'><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_PROGRAMMED . "</td><td align='center' class='nw'>" . _AM_EXPIRED . "</td><td align='center'>" . _AM_ACTION . "</td></tr>"; foreach ($storyarray as $autostory) { $topic = $autostory->topic(); $expire = $autostory->expired() > 0 ? formatTimestamp($autostory->expired()) : ''; echo "\r\n \t\t<tr><td align='center'><b>" . $autostory->storyid() . "</b>\r\n \t\t</td><td align='left'><a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/article.php?storyid=" . $autostory->storyid() . "'>" . $autostory->title() . "</a>\r\n \t\t</td><td align='center'>" . $topic->topic_title() . "\r\n \t\t</td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $autostory->uid() . "'>" . $autostory->uname() . "</a></td><td align='center' class='nw'>" . formatTimestamp($autostory->published()) . "</td><td align='center'>" . $expire . "</td><td align='center'><a href='index.php?op=edit&storyid=" . $autostory->storyid() . "'>" . _AM_EDIT . "</a>-<a href='index.php?op=delete&storyid=" . $autostory->storyid() . "'>" . _AM_DELETE . "</a>"; echo "</td></tr>\n"; } echo "</table>"; echo "</div>"; echo "</td></tr></table>"; echo "<br />"; } }
/** * Shows all automated stories * * Automated stories are stories that have a publication's date greater than "now" * 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, its title, the topic, the author, the * programmed date and time, the expiration's date and two links. The first link is * used to edit the story while the second is used to remove the story. * Unlike the other lists of this page, ALL the stories are visibles. */ function autoStories() { global $xoopsModule, $dateformat; $storyarray = NewsStory::getAllAutoStory(); $class = ''; if (count($storyarray) > 0) { news_collapsableBar('autostories', 'topautostories'); echo "<img onclick='toggle('toptable'); toggleIcon('toptableicon');' id='topautostories' name='topautostories' src=" . XOOPS_URL . "/modules/news/images/close12.gif alt='' /></a> " . _AM_AUTOARTICLES . "</h4>"; echo "<div id='autostories'>"; echo "<br />"; echo "<div style='text-align: center;'>\n"; 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_PROGRAMMED . "</td><td align='center' class='nw'>" . _AM_EXPIRED . "</td><td align='center'>" . _AM_ACTION . "</td></tr>"; foreach ($storyarray as $autostory) { $topic = $autostory->topic(); $expire = $autostory->expired() > 0 ? formatTimestamp($autostory->expired(), $dateformat) : ''; $class = $class == 'even' ? 'odd' : 'even'; echo "<tr class='" . $class . "'>"; echo "<td align='center'><b>" . $autostory->storyid() . "</b>\n \t\t</td><td align='left'><a href='" . XOOPS_URL . "/modules/news/article.php?storyid=" . $autostory->storyid() . "'>" . $autostory->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=" . $autostory->uid() . "'>" . $autostory->uname() . "</a></td><td align='center' class='nw'>" . formatTimestamp($autostory->published(), $dateformat) . "</td><td align='center'>" . $expire . "</td><td align='center'><a href='" . XOOPS_URL . "/modules/news/submit.php?returnside=1&op=edit&storyid=" . $autostory->storyid() . "'>" . _AM_EDIT . "</a>-<a href='" . XOOPS_URL . "/modules/news/admin/index.php?op=delete&storyid=" . $autostory->storyid() . "'>" . _AM_DELETE . "</a>"; echo "</td></tr>\n"; } echo "</table></div></div><br />"; } }