예제 #1
0
	$xoopsTpl->assign('lang_articles', _MA_NW_ARTICLES);
	$xoopsTpl->assign('currentmonth', $months_arr[$frommonth]);
	$xoopsTpl->assign('currentyear', $fromyear);
	$xoopsTpl->assign('lang_actions', _MA_NW_ACTIONS);
	$xoopsTpl->assign('lang_date', _MA_NW_DATE);
	$xoopsTpl->assign('lang_views', _MA_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 nw_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'] = nw_make_infotips($article->hometext());
				$htmltitle=' title="'.$story['infotips'].'"';
			}
	    	$seo_enabled = nw_getmoduleoption('nw_seo_enable', NW_MODULE_DIR_NAME);
			if ( $seo_enabled == 1 ) {
				$cat_path = nw_remove_accents($article->topic_title());
				$item_path = nw_remove_accents($article->title());
				$print_item = nw_remove_accents(_MA_NW_PRINTERFRIENDLY);
				$story['title'] = "<a href='" . NW_MODULE_URL . '/articles.cat.' . $article->topicid() . '/' . $cat_path . '' . "'>" . $article->topic_title() . "</a>: <a href='". NW_MODULE_URL ."/articles.item." . $article->storyid() . "/" . $item_path . "'" . $htmltitle . ">" . $article->title() . "</a>";