Exemplo n.º 1
0
    redirect_header($mydirurl . '/index.php', 2, _MD_NOSTORY);
    exit;
}
//Template
$xoopsOption['template_main'] = "{$mydirname}_article.html";
require_once XOOPS_ROOT_PATH . '/header.php';
$article = new Bulletin($mydirname, $storyid);
$gperm =& BulletinGP::getInstance($mydirname);
if (!$gperm->proceed4topic('can_read', $article->getVar('topicid'))) {
    redirect_header($mydirurl . '/index.php', 2, _NOPERM);
    exit;
}
$story['id'] = $storyid;
$story['posttime'] = formatTimestamp($article->getVar('published'), $bulletin_date_format);
$story['topicid'] = $article->getVar('topicid');
$story['topic'] = $article->topic_title();
$story['title'] = $article->getVar('title');
$story['text'] = $article->getVar('hometext');
$story['hits'] = $article->getVar('counter') + 1;
// To disp real view
$bodytext = $article->getVar('bodytext');
if ($bodytext != '') {
    $articletext = explode('[pagebreak]', $bodytext);
    $story_pages = count($articletext);
    $storypage = $story_pages - 1 >= $storypage ? $storypage : 0;
    // [pagebreak]If the content is configured in [pagebreak] multi-page articles
    if ($story_pages > 1) {
        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
        $pagenav = new XoopsPageNav($story_pages, 1, $storypage, 'storypage', 'page=article&storyid=' . $storyid);
        $xoopsTpl->assign('pagenav', $pagenav->renderNav());
        if ($storypage == 0) {
Exemplo n.º 2
0
if (!Bulletin::isPublishedExists($mydirname, $storyid)) {
    redirect_header($mydirurl . '/index.php', 2, _MD_NOSTORY);
    exit;
}
require_once XOOPS_ROOT_PATH . '/class/template.php';
$article = new Bulletin($mydirname, $storyid);
$gperm =& BulletinGP::getInstance($mydirname);
if (!$gperm->proceed4topic('can_read', $article->getVar('topicid'))) {
    //	redirect_header($mydirurl.'/index.php',2,_NOPERM);
    exit;
}
$datetime = formatTimestamp($article->getVar('published'), $bulletin_date_format);
$tpl = new XoopsTpl();
$tpl->xoops_setTemplateDir(XOOPS_ROOT_PATH . '/themes');
$tpl->xoops_setCaching(2);
$tpl->xoops_setCacheTime(0);
$tpl->assign('charset', _CHARSET);
$tpl->assign('sitename', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
$tpl->assign('sitename', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
$tpl->assign('slogan', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
$tpl->assign('xoops_version', htmlspecialchars(XOOPS_VERSION, ENT_QUOTES));
$tpl->assign('site_image', htmlspecialchars($bulletin_imgurl_on_print, ENT_QUOTES));
$tpl->assign('story_title', $article->getVar('title'));
$tpl->assign('story_date', $datetime);
$tpl->assign('story_topic', $article->topic_title());
$tpl->assign('story_hometext', $article->getVar('hometext'));
$tpl->assign('story_id', $storyid);
$tpl->assign('story_bodytext', $article->getDividedBodytext());
$tpl->assign('this_comes_from', sprintf(_MD_THISCOMESFROM, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
$tpl->assign($assing_array);
$tpl->display("db:{$mydirname}_print.html");