function getRSSItems( &$items ) { // check module_read permission $module_handler =& xoops_gethandler( 'module' ) ; $module =& $module_handler->getByDirname( $this->mydirname ) ; $gperm_handler =& xoops_gethandler( 'groupperm' ) ; $can_read = $gperm_handler->checkRight( 'module_read' , $module->getVar('mid') , XOOPS_GROUP_ANONYMOUS ) ; if( ! $can_read ) return ; // check config (feed_as_backend) $config_handler =& xoops_gethandler( 'config' ) ; $mod_config =& $config_handler->getConfigsByCat( 0 , $module->getVar( 'mid' ) ) ; if( empty( $mod_config['feed_as_backend'] ) ) { return ; } $myts =& MyTextSanitizer::getInstance(); $articles = Bulletin::getAllPublished( $this->mydirname , 10 , 0 , 0 , 1 , true, true, true) ;//ver3.0 changed foreach( $articles as $article ) { $hometext = $article->getVar('hometext','n') ; if( function_exists( 'easiestml' ) ) { $hometext = easiestml( $hometext ) ; } $items[] = array( 'pubdate' => $article->getVar('published') , 'title' => htmlspecialchars(bulletin_utf8_encode($article->getVar('title', 'n')), ENT_QUOTES), 'category' => htmlspecialchars(bulletin_utf8_encode($article->newstopic->topic_title), ENT_QUOTES), 'link' => XOOPS_URL.'/modules/'.$this->mydirname.'/index.php?page=article&storyid='.$article->getVar('storyid') , 'guid' => XOOPS_URL.'/modules/'.$this->mydirname.'/index.php?page=article&storyid='.$article->getVar('storyid') , 'description' => bulletin_utf8_encode(htmlspecialchars(strip_tags($myts->xoopsCodeDecode($hometext)), ENT_QUOTES)), ) ; } }
$option['sel'] = ($i == $storynum) ? ' selected="selected"' : '' ; $option['option'] = $i ; $xoopsTpl->append('option', $option); }*/ } else { $xoopsTpl->assign('displaynav', false); } // Links from the calendar (if there is a date) if( !empty($caldate) && preg_match('/([0-9]{4})-([0-9]{2})-([0-9]{2})/', $caldate, $datearr) ){ $articles = Bulletin::getAllToday( $mydirname , $storynum, $start, $caldate, true , true); $xoopsTpl->assign('displaynav', false); }else{ // If the normal display $articles = Bulletin::getAllPublished( $mydirname , $storynum, $start, $storytopic, 1, true, true, true);//ver3.0 changed } $scount = count($articles); $gperm =& BulletinGP::getInstance($mydirname) ; // Loop of the article for ( $i = 0; $i < $scount; $i++ ) { $story = array(); $story['id'] = $articles[$i]->getVar('storyid'); $story['posttime'] = formatTimestamp($articles[$i]->getVar('published'), $bulletin_date_format); $story['text'] = $articles[$i]->getVar('hometext'); $story['topicid'] = $articles[$i]->getVar('topicid'); $story['topic'] = $articles[$i]->topic_title(); $story['title'] = $articles[$i]->getVar('title');
$relation_asign['date'] = formatTimestamp($relation->getVar('published'), $bulletin_date_format); $relation_asign['uid'] = $relation->getVar('uid'); $relation_asign['uname'] = $relation->getUname(); $relation_asign['realname'] = $relation->getRealname(); $relation_asign['topicid'] = $relation->getVar('topicid'); $relation_asign['topic'] = $relation->topic_title(); $relation_asign['counter'] = $relation->getVar('counter'); $relation_asign['comments'] = $relation->getVar('comments'); $relation_asign['dirname'] = $relation->getVar('dirname'); $relation_asign['url'] = XOOPS_URL . '/modules/' . $relation->getVar('dirname'); $xoopsTpl->append('relations', $relation_asign); } } // Recent Posts from Category if ($bulletin_disp_list_of_cat && $bulletin_stories_of_cat > 0) { $category_storeis = Bulletin::getAllPublished($mydirname, $bulletin_stories_of_cat, 0, $article->getVar('topicid'), 0, true, false, true); //ver3.0 changed foreach ($category_storeis as $category_story) { $category_story_asign['storyid'] = $category_story->getVar('storyid'); $category_story_asign['title'] = $category_story->getVar('title'); $category_story_asign['date'] = formatTimestamp($category_story->getVar('published'), $bulletin_date_format); $category_story_asign['uid'] = $category_story->getVar('uid'); $category_story_asign['uname'] = $category_story->getUname(); $category_story_asign['realname'] = $category_story->getRealname(); $category_story_asign['counter'] = $category_story->getVar('counter'); $category_story_asign['comments'] = $category_story->getVar('comments'); $xoopsTpl->append('category_storeis', $category_story_asign); } } // If you are using Tell A Frined module if ($bulletin_use_tell_a_frined) {
function newSubmissions($action, $limit = 5, $start = 0) { global $mydirname; switch ($action) { case 'newSubmissions': $articles = Bulletin::getAllSubmitted($mydirname); break; case 'autoStories': $articles = Bulletin::getAllAutoStory($mydirname); break; case 'Published': $articles = Bulletin::getAllPublished($mydirname, $limit, $start, 0, 0); break; case 'Expired': $articles = Bulletin::getAllExpired($mydirname, $limit, $start, 0, 0); break; } $ret = array(); if (count($articles) > 0) { $i = 0; foreach ($articles as $article) { $ret[$i]['storyid'] = $article->getVar('storyid'); $ret[$i]['title'] = RENDER_NEWS_TITLE($article); $ret[$i]['topic'] = $article->topic_title(); $ret[$i]['uid'] = $article->getVar('uid'); $ret[$i]['uname'] = $article->getUname(); $ret[$i]['created'] = formatTimestamp($article->getVar('created')); $ret[$i]['published'] = formatTimestamp($article->getVar('published')); $ret[$i]['expired'] = $article->getVar('expired') > 0 ? formatTimestamp($article->getVar('expired')) : '---'; $i++; } } return $ret; }
<?php require_once XOOPS_ROOT_PATH.'/class/template.php'; $myts =& MyTextSanitizer::getInstance(); if (function_exists('mb_http_output')) { mb_http_output('pass'); } $tpl = new XoopsTpl(); $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(0); if (!$tpl->is_cached("db:{$mydirname}_rss.html")) { $articles = Bulletin::getAllPublished( $mydirname , 10 , 0 , 0 , 1 , true , true ,true ) ;//ver3.0 changed if (is_array($articles)) { $tpl->assign('channel_title', bulletin_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); $tpl->assign('channel_link', XOOPS_URL.'/'); $tpl->assign('channel_desc', bulletin_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES))); // $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss')); $tpl->assign('channel_lastbuild', date( 'r' ) ) ; // GIJ $tpl->assign('channel_webmaster', $xoopsConfig['adminmail']); $tpl->assign('channel_editor', $xoopsConfig['adminmail']); $tpl->assign('channel_category', 'News'); $tpl->assign('channel_generator', 'XOOPS'); $tpl->assign('channel_language', _LANGCODE); $tpl->assign('image_url', XOOPS_URL.'/images/logo.gif'); $dimention = getimagesize(XOOPS_ROOT_PATH.'/images/logo.gif'); if (empty($dimention[0])) { $width = 88; } else { $width = ($dimention[0] > 144) ? 144 : $dimention[0];
<?php require_once XOOPS_ROOT_PATH . '/class/template.php'; $myts =& MyTextSanitizer::getInstance(); if (function_exists('mb_http_output')) { mb_http_output('pass'); } $tpl = new XoopsTpl(); $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(0); if (!$tpl->is_cached("db:{$mydirname}_rss.html")) { $articles = Bulletin::getAllPublished($mydirname, 10, 0); if (is_array($articles)) { $tpl->assign('channel_title', bulletin_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); $tpl->assign('channel_link', XOOPS_URL . '/'); $tpl->assign('channel_desc', bulletin_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES))); // $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss')); $tpl->assign('channel_lastbuild', date('r')); // GIJ $tpl->assign('channel_webmaster', $xoopsConfig['adminmail']); $tpl->assign('channel_editor', $xoopsConfig['adminmail']); $tpl->assign('channel_category', 'News'); $tpl->assign('channel_generator', 'XOOPS'); $tpl->assign('channel_language', _LANGCODE); $tpl->assign('image_url', XOOPS_URL . '/images/logo.gif'); $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.gif'); if (empty($dimention[0])) { $width = 88; } else { $width = $dimention[0] > 144 ? 144 : $dimention[0]; }