Example #1
0
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']) . '&amp;body=' . sprintf(_NW_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?storyid=' . $article->storyid();
            $xoopsTpl->append('stories', $story);