function fetchSummary($external_link_id)
 {
     $db =& Database::getInstance();
     $myts =& MyTextsanitizer::getInstance();
     $module_handler =& xoops_gethandler('module');
     $module =& $module_handler->getByDirname($this->mydirname);
     $storyid = intval($external_link_id);
     $mydirname = $this->mydirname;
     if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
         die('Invalid mydirname');
     }
     $mytrustdirpath = dirname(dirname(__FILE__));
     require_once dirname(dirname(__FILE__)) . '/class/bulletin.php';
     if (Bulletin::isPublishedExists($mydirname, $storyid)) {
         $article = new Bulletin($mydirname, $storyid);
         $subject4assign = $article->getVar('title');
         $summary = $article->getVar('hometext');
         if (function_exists('easiestml')) {
             $summary = easiestml($summary);
         }
         $summary4assign = htmlspecialchars(xoops_substr($this->unhtmlspecialchars(strip_tags($summary)), 0, 255), ENT_QUOTES);
     } else {
         $subject4assign = '';
         $summary4assign = '';
     }
     return array('dirname' => $mydirname, 'module_name' => $module->getVar('name'), 'subject' => $subject4assign, 'uri' => XOOPS_URL . '/modules/' . $mydirname . '/index.php?page=article&storyid=' . $storyid, 'summary' => $summary4assign);
 }
Beispiel #2
0
<?php

$storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0;
$storypage = isset($_GET['storypage']) ? intval($_GET['storypage']) : 0;
// If there are no articles
if (empty($storyid) || !Bulletin::isPublishedExists($mydirname, $storyid)) {
    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;
Beispiel #3
0
<?php

$storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0;
// If there are no articles
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);
Beispiel #4
0
<?php

$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0 ;

// If there are no articles
if( !Bulletin::isPublishedExists( $mydirname , $com_itemid) ){
	redirect_header($mydirurl.'/index.php',2,_MD_NOSTORY);
	exit();
}

$article = new Bulletin( $mydirname , $com_itemid);

$gperm =& BulletinGP::getInstance($mydirname) ;
if( ! $gperm->proceed4topic('can_read',$article->getVar('topicid')) ){
	redirect_header($mydirurl.'/index.php',2,_NOPERM);
	exit();
}

$com_replytext = _POSTEDBY.'&nbsp;<b>'.$article->getUname().'</b>&nbsp;'._DATE.'&nbsp;<b>'.formatTimestamp($article->getvar('published')).'</b><br /><br />'.$article->getVar('hometext');
$bodytext = $article->getDividedBodytext();
if ($bodytext != '') {
	$com_replytext .= '<br /><br />'.$bodytext.'';
}
$com_replytitle = $article->getVar('title');

$_GET['page'] = 'article';
require XOOPS_ROOT_PATH.'/include/comment_new.php';

?>