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); }
/** * Moves the order of a record * @param integer The id of the record to move * @param integer The direction to reorder, +1 down, -1 up * @param string The current GET/POST option */ function orderNewsFeed($id, $inc, $option) { global $database; josSpoofCheck(); $limit = intval(mosGetParam($_REQUEST, 'limit', 0)); $limitstart = intval(mosGetParam($_REQUEST, 'limitstart', 0)); $catid = intval(mosGetParam($_REQUEST, 'catid', 0)); $row = new mosNewsFeed($database); $row->load((int) $id); $row->move($inc); mosRedirect('index2.php?option=' . $option); }