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


PHP NewsStory::getAllPublishedByAuthor方法代码示例

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


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

示例1: sprintf

$xoopsTpl->assign('lang_news_by_this_author', _MI_NEWSBYTHISAUTHOR);
$xoopsTpl->assign('author_id', $uid);
$xoopsTpl->assign('user_avatarurl', XOOPS_URL . '/uploads/' . $thisuser->getVar('user_avatar'));
$xoopsTpl->assign('author_name', $authname);
$xoopsTpl->assign('lang_date', _NW_DATE);
$xoopsTpl->assign('lang_hits', _NW_VIEWS);
$xoopsTpl->assign('lang_title', _NW_TITLE);
$xoopsTpl->assign('news_rating', news_getmoduleoption('ratenews'));
$xoopsTpl->assign('lang_rating', _NW_RATING);
$xoopsTpl->assign('author_name_with_link', sprintf("<a href='%s'>%s</a>", XOOPS_URL . '/userinfo.php?uid=' . $uid, $authname));
$oldtopic = -1;
$oldtopictitle = '';
$oldtopiccolor = '';
$articlelist = array();
$articlestpl = array();
$articlelist = $articles->getAllPublishedByAuthor($uid, $xoopsModuleConfig['restrictindex'], false);
$articlescount = count($articlelist);
$xoopsTpl->assign('articles_count', $articlescount);
$count_articles = $count_reads = 0;
if ($articlescount > 0) {
    foreach ($articlelist as $article) {
        if ($oldtopic != $article['topicid']) {
            if (count($articlestpl) > 0) {
                $topic_link = sprintf("<a href='%s'>%s</a>", XOOPS_URL . '/modules/news/index.php?storytopic=' . $oldtopic, $oldtopictitle);
                $xoopsTpl->append('topics', array('topic_id' => $oldtopic, 'topic_count_articles' => sprintf(_AM_NEWS_TOTAL, $count_articles), 'topic_count_reads' => $count_reads, 'topic_color' => $oldtopiccolor, 'topic_title' => $oldtopictitle, 'topic_link' => $topic_link, 'news' => $articlestpl));
            }
            $oldtopic = $article['topicid'];
            $oldtopictitle = $article['topic_title'];
            $oldtopiccolor = '#' . $myts->displayTarea($article['topic_color']);
            $articlestpl = array();
            $count_articles = $count_reads = 0;
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:newsbythisauthor.php


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