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


PHP NewsStory::getAllPublishedCount方法代码示例

本文整理汇总了PHP中NewsStory::getAllPublishedCount方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsStory::getAllPublishedCount方法的具体用法?PHP NewsStory::getAllPublishedCount怎么用?PHP NewsStory::getAllPublishedCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NewsStory的用法示例。


在下文中一共展示了NewsStory::getAllPublishedCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: lastStories

/**
 * Shows last x published 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 the story's ID, its title, the topic, the author, the number of hits
 * and two links. The first link is used to edit the story while the second is used to remove the story.
 * The table only contains the last X published 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 lastStories()
{
    global $xoopsModule, $xoopsModuleConfig, $dateformat;
    news_collapsableBar('laststories', 'toplaststories');
    echo "<img onclick='toggle('toptable'); toggleIcon('toptableicon');' id='toplaststories' name='toplaststories' src=" . XOOPS_URL . "/modules/news/images/close12.gif alt='' /></a>&nbsp;" . sprintf(_AM_LAST10ARTS, $xoopsModuleConfig['storycountadmin']) . "</h4>";
    echo "<div id='laststories'>";
    echo "<br />";
    echo "<div style='text-align: center;'>";
    $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
    $storyarray = NewsStory::getAllPublished($xoopsModuleConfig['storycountadmin'], $start, false, 0, 1);
    $storiescount = NewsStory::getAllPublishedCount($xoopsModuleConfig['storycountadmin'], 0, false, 0, 1);
    $pagenav = new XoopsPageNav($storiescount, $xoopsModuleConfig['storycountadmin'], $start, 'start', 'op=newarticle');
    $class = '';
    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_PUBLISHED . "</td><td align='center' class='nw'>" . _AM_HITS . "</td><td align='center'>" . _AM_ACTION . "</td></tr>";
    foreach ($storyarray as $eachstory) {
        $published = formatTimestamp($eachstory->published(), $dateformat);
        // $expired = ( $eachstory -> expired() > 0 ) ? formatTimestamp($eachstory->expired(),$dateformat) : '---';
        $topic = $eachstory->topic();
        $class = $class == 'even' ? 'odd' : 'even';
        echo "<tr class='" . $class . "'>";
        echo "<td align='center'><b>" . $eachstory->storyid() . "</b>\n        \t</td><td align='left'><a href='" . XOOPS_URL . "/modules/news/article.php?storyid=" . $eachstory->storyid() . "'>" . $eachstory->title() . "</a>\n        \t</td><td align='center'>" . $topic->topic_title() . "\n        \t</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'>" . $eachstory->counter() . "</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 "<div align='right'>" . $pagenav->renderNav() . '</div><br />';
    echo "<form action='index.php' method='post'>" . _AM_STORYID . " <input type='text' name='storyid' size='10' />\n    \t<select name='op'>\n    \t\t<option value='edit' selected='selected'>" . _AM_EDIT . "</option>\n    \t\t<option value='delete'>" . _AM_DELETE . "</option>\n    \t</select>\n\t\t<input type='hidden' name='returnside' value='1'>\n    \t<input type='submit' value='" . _AM_GO . "' />\n    \t</form>\n\t</div>";
    echo "</div><br />";
}
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:41,代码来源:index.php


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