当前位置: 首页>>代码示例>>PHP>>正文


PHP NewsStory::getAllAutoStory方法代码示例

本文整理汇总了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&amp;storyid=" . $autostory->storyid() . "'>" . _AM_EDIT . "</a>-<a href='index.php?op=delete&amp;storyid=" . $autostory->storyid() . "'>" . _AM_DELETE . "</a>";
            echo "</td></tr>\n";
        }
        echo "</table>";
        echo "</div>";
        echo "</td></tr></table>";
        echo "<br />";
    }
}
开发者ID:amjadtbssm,项目名称:website,代码行数:20,代码来源:index.php

示例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>&nbsp;" . _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&amp;op=edit&amp;storyid=" . $autostory->storyid() . "'>" . _AM_EDIT . "</a>-<a href='" . XOOPS_URL . "/modules/news/admin/index.php?op=delete&amp;storyid=" . $autostory->storyid() . "'>" . _AM_DELETE . "</a>";
            echo "</td></tr>\n";
        }
        echo "</table></div></div><br />";
    }
}
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:33,代码来源:index.php


注:本文中的NewsStory::getAllAutoStory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。