本文整理汇总了PHP中NewsStory::getAllAutoStory方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsStory::getAllAutoStory方法的具体用法?PHP NewsStory::getAllAutoStory怎么用?PHP NewsStory::getAllAutoStory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsStory
的用法示例。
在下文中一共展示了NewsStory::getAllAutoStory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: autoStories
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 />";
}
}
示例2: autoStories
/**
* 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 />";
}
}