예제 #1
0
    include_once XOOPS_ROOT_PATH.'/header.php';
    
    //DNPROSSI - ADDED
    $xoopsTpl->assign('newsmodule_url', NW_MODULE_URL);
    
    $xoopsTpl->assign('column_width', intval(1/$column_count*100));
	if ($xoopsModuleConfig['ratenews']) {
		$xoopsTpl->assign('rates', true);
		$xoopsTpl->assign('lang_ratingc', _MA_NW_RATINGC);
		$xoopsTpl->assign('lang_ratethisnews', _MA_NW_RATETHISNEWS);
	} else {
		$xoopsTpl->assign('rates', false);
	}

	$xt = new nw_NewsTopic();
    $alltopics =& $xt->getTopicsList(true,$xoopsModuleConfig['restrictindex']);
    $smarty_topics = array();
    $topicstories = array();

    foreach ($alltopics as $topicid => $topic) {
		$allstories = nw_NewsStory::getAllPublished($xoopsModuleConfig['storyhome'], 0, $xoopsModuleConfig['restrictindex'], $topicid);
    	$storieslist=array();
    	foreach ($allstories as $thisstory) {
    		$storieslist[]=$thisstory->storyid();
    	}
		$filesperstory = $sfiles->getCountbyStories($storieslist);
		foreach ($allstories as $thisstory) {
			$filescount = array_key_exists($thisstory->storyid(),$filesperstory) ? $filesperstory[$thisstory->storyid()] : 0;
			$story = $thisstory->prepare2show($filescount);
			$story['topic_title'] = $thisstory->textlink();
			$story['topic_separator'] =  ( $thisstory->textlink() != '' ) ? _MA_NW_SP : '';