當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。