Ejemplo n.º 1
0
       		}
        	$columns[$k][] = $story;
        	$k++;
        	if ($k == $column_count) {
	            $k = 0;
        	}
		}
	}
	$xoopsTpl->assign('columns', $columns);
	unset($story);

	$totalcount = nw_NewsStory::countPublishedByTopic($xoopsOption['storytopic'], $xoopsModuleConfig['restrictindex']);
    if ( $totalcount > $scount ) {
        include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
		$pagenav = new XoopsPageNav($totalcount, $xoopsOption['storynum'], $start, 'start', 'storytopic='.$xoopsOption['storytopic']);
		if(nw_isbot()) { 		// A bot is reading the news, we are going to show it all the links so that he can read everything
        	$xoopsTpl->assign('pagenav', $pagenav->renderNav($totalcount));
        } else {
            $xoopsTpl->assign('pagenav', $pagenav->renderNav());
    	}
    } else {
        $xoopsTpl->assign('pagenav', '');
    }
} else {	// Affichage par sujets
    $xoopsOption['template_main'] = 'nw_news_by_topic.html';
    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));
Ejemplo n.º 2
0
	    $articletext = preg_split('/(\[pagebreak:|\[pagebreak)(.*)(\])/iU', $bodytext);
	    $arr_titles = array();
		$auto_summary = $article->auto_summary($bodytext, $arr_titles);
		$bodytext = str_replace('[summary]', $auto_summary, $bodytext);
		$articletext[$storypage] = str_replace('[summary]', $auto_summary, $articletext[$storypage]);
		$story['text'] = str_replace('[summary]', $auto_summary, $story['text']);
	} else {
		$articletext = explode('[pagebreak]', $bodytext);
	}

    $story_pages = count($articletext);

    if ($story_pages > 1) {
        include_once NW_MODULE_PATH . '/include/pagenav.php';
        $pagenav = new XoopsPageNav($story_pages, 1, $storypage, 'page', 'storyid='.$storyid);
        if(nw_isbot()) { 		// A bot is reading the articles, we are going to show him all the links to the pages
        	$xoopsTpl->assign('pagenav', $pagenav->renderNav($story_pages));
        } else {
			if(nw_getmoduleoption('enhanced_pagenav', NW_MODULE_DIR_NAME)) {
				$xoopsTpl->assign('pagenav', $pagenav->renderEnhancedSelect(true, $arr_titles));
			} else {
				$xoopsTpl->assign('pagenav', $pagenav->renderNav());
			}
    	}

        if ($storypage == 0) {
            $story['text'] = $story['text'].'<br />'.nw_getmoduleoption('advertisement', NW_MODULE_DIR_NAME).'<br />'.$articletext[$storypage];
        } else {
            $story['text'] = $articletext[$storypage];
        }
    } else {