Beispiel #1
0
$xoopsOption['template_main'] = 'news_article.html';
include_once XOOPS_ROOT_PATH . '/header.php';
$myts =& MyTextSanitizer::getInstance();
// set comment mode if not set
$article = new NewsStory($storyid);
if ($article->published() == 0 || $article->published() > time()) {
    redirect_header('index.php', 2, _NW_NOSTORY);
    exit;
}
$storypage = isset($HTTP_GET_VARS['page']) ? intval($HTTP_GET_VARS['page']) : 0;
// update counter only when viewing top page
if (empty($HTTP_GET_VARS['com_id']) && $storypage == 0) {
    $article->updateCounter();
}
$story['id'] = $storyid;
$story['posttime'] = formatTimestamp($article->created());
$story['title'] = $article->textlink() . " : " . $article->title();
$story['text'] = $article->hometext();
$bodytext = $article->bodytext();
if (trim($bodytext) != '') {
    $articletext = explode("[pagebreak]", $bodytext);
    $story_pages = count($articletext);
    if ($story_pages > 1) {
        include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
        $pagenav = new XoopsPageNav($story_pages, 1, $storypage, 'page', 'storyid=' . $storyid);
        $xoopsTpl->assign('pagenav', $pagenav->renderNav());
        //$xoopsTpl->assign('pagenav', $pagenav->renderImageNav());
        if ($storypage == 0) {
            $story['text'] = $story['text'] . '<br /><br />' . $articletext[$storypage];
        } else {
            $story['text'] = $articletext[$storypage];