本文整理汇总了PHP中NewsStory::getArchive方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsStory::getArchive方法的具体用法?PHP NewsStory::getArchive怎么用?PHP NewsStory::getArchive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsStory
的用法示例。
在下文中一共展示了NewsStory::getArchive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mktime
if ($fromyear != 0 && $frommonth != 0) {
$xoopsTpl->assign('show_articles', true);
$xoopsTpl->assign('lang_articles', _NW_ARTICLES);
$xoopsTpl->assign('currentmonth', $months_arr[$frommonth]);
$xoopsTpl->assign('currentyear', $fromyear);
$xoopsTpl->assign('lang_actions', _NW_ACTIONS);
$xoopsTpl->assign('lang_date', _NW_DATE);
$xoopsTpl->assign('lang_views', _NW_VIEWS);
// must adjust the selected time to server timestamp
$timeoffset = $useroffset - $xoopsConfig['server_TZ'];
$monthstart = mktime(0 - $timeoffset, 0, 0, $frommonth, 1, $fromyear);
$monthend = mktime(23 - $timeoffset, 59, 59, $frommonth + 1, 0, $fromyear);
$monthend = $monthend > time() ? time() : $monthend;
$count = 0;
$news = new NewsStory();
$storyarray = $news->getArchive($monthstart, $monthend, $restricted);
$count = count($storyarray);
if (is_array($storyarray) && $count > 0) {
foreach ($storyarray as $article) {
$story = array();
$htmltitle = '';
if ($infotips > 0) {
$story['infotips'] = news_make_infotips($article->hometext());
$htmltitle = ' title="' . $story['infotips'] . '"';
}
$story['title'] = "<a href='" . XOOPS_URL . '/modules/news/index.php?storytopic=' . $article->topicid() . "'>" . $article->topic_title() . "</a>: <a href='" . XOOPS_URL . "/modules/news/article.php?storyid=" . $article->storyid() . "'" . $htmltitle . ">" . $article->title() . "</a>";
$story['counter'] = $article->counter();
$story['date'] = formatTimestamp($article->published(), $dateformat, $useroffset);
$story['print_link'] = XOOPS_URL . '/modules/news/print.php?storyid=' . $article->storyid();
$story['mail_link'] = 'mailto:?subject=' . sprintf(_NW_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_NW_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?storyid=' . $article->storyid();
$xoopsTpl->append('stories', $story);