function showFeed($option, $feedid) { global $database, $mainframe, $mosConfig_absolute_path, $Itemid; // Adds parameter handling $menu =& new mosMenu($database); $menu->load($Itemid); $params =& new mosParameters($menu->params); $params->def('page_title', 1); $params->def('header', $menu->name); $params->def('pageclass_sfx', ''); $params->def('back_button', $mainframe->getCfg('back_button')); // Feed Display control $params->def('feed_image', 1); $params->def('feed_descr', 1); $params->def('item_descr', 1); $params->def('word_count', 0); if (!$params->get('page_title')) { $params->set('header', ''); } $_and = ''; if ($feedid) { $_and = "\n AND id='" . $feedid . "'"; } $query = "SELECT name, link, numarticles, cache_time" . "\n FROM #__newsfeeds" . "\n WHERE published='1'" . "\n AND checked_out='0'" . $_and . "\n ORDER BY ordering"; $database->setQuery($query); $newsfeeds = $database->loadObjectList(); $mainframe->SetPageTitle($menu->name); HTML_newsfeed::showNewsfeeds($newsfeeds, $params); }
function showFeed($feedid) { global $database, $mainframe, $mosConfig_absolute_path, $mosConfig_cachepath, $Itemid, $my; // check if cache directory is writeable $cacheDir = $mosConfig_cachepath . '/'; if (!is_writable($cacheDir)) { echo 'Cache Directory Unwriteable'; return; } require_once $mainframe->getPath('class'); $newsfeed = new mosNewsFeed($database); $newsfeed->load((int) $feedid); /* * Check if newsfeed is published */ if (!$newsfeed->published) { mosNotAuth(); return; } $category = new mosCategory($database); $category->load((int) $newsfeed->catid); /* * Check if newsfeed category is published */ if (!$category->published) { mosNotAuth(); return; } /* * check whether category access level allows access */ if ($category->access > $my->gid) { mosNotAuth(); return; } // full RSS parser used to access image information require_once $mosConfig_absolute_path . '/includes/domit/xml_domit_rss.php'; $LitePath = $mosConfig_absolute_path . '/includes/Cache/Lite.php'; // Adds parameter handling $menu = $mainframe->get('menu'); $params = new mosParameters($menu->params); $params->def('page_title', 1); $params->def('header', $menu->name); $params->def('pageclass_sfx', ''); $params->def('back_button', $mainframe->getCfg('back_button')); // Feed Display control $params->def('feed_image', 1); $params->def('feed_descr', 1); $params->def('item_descr', 1); $params->def('word_count', 0); // Encoding $params->def('utf8', 1); if (!$params->get('page_title')) { $params->set('header', ''); } $and = ''; if ($feedid) { $and = "\n AND id = {$feedid}"; } $mainframe->SetPageTitle($menu->name); HTML_newsfeed::showNewsfeeds($newsfeed, $LitePath, $cacheDir, $params); }
function showFeed($option, $feedid) { global $database, $mainframe, $mosConfig_absolute_path, $Itemid; require_once $mosConfig_absolute_path . "/includes/domit/xml_domit_rss_lite.php"; $cacheDir = $mosConfig_absolute_path . "/cache/"; $LitePath = $mosConfig_absolute_path . "/includes/Cache/Lite.php"; // Adds parameter handling $menu =& new mosMenu($database); $menu->load($Itemid); $params =& new mosParameters($menu->params); $params->def('page_title', 1); $params->def('header', $menu->name); $params->def('pageclass_sfx', ''); $params->def('back_button', $mainframe->getCfg('back_button')); if (!$params->get('page_title')) { $params->set('header', ''); } $and = ''; if ($feedid) { $and = "\n AND id='" . $feedid . "'"; } $query = "SELECT name, link, numarticles, cache_time" . "\n FROM #__newsfeeds" . "\n WHERE published='1'" . "\n AND checked_out='0'" . $and . "\n ORDER BY ordering"; $database->setQuery($query); $newsfeeds = $database->loadObjectList(); $mainframe->SetPageTitle($menu->name); HTML_newsfeed::showNewsfeeds($newsfeeds, $LitePath, $cacheDir, $params); }