本文整理匯總了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;