예제 #1
0
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_VALID_MOS') or die('Restricted access');
// load the html drawing class
require_once $mainframe->getPath('front_html');
$feedid = intval(mosGetParam($_REQUEST, 'feedid', 0));
$catid = intval(mosGetParam($_REQUEST, 'catid', 0));
switch ($task) {
    case 'view':
        showFeed($feedid);
        break;
    default:
        listFeeds($catid);
        break;
}
function listFeeds($catid)
{
    global $mainframe, $database, $my;
    global $mosConfig_live_site;
    global $Itemid;
    /* Query to retrieve all categories that belong under the contacts section and that are published. */
    $query = "SELECT cc.*, a.catid, COUNT(a.id) AS numlinks" . "\n FROM #__categories AS cc" . "\n LEFT JOIN #__newsfeeds AS a ON a.catid = cc.id" . "\n WHERE a.published = 1" . "\n AND cc.section = 'com_newsfeeds'" . "\n AND cc.published = 1" . "\n AND cc.access <= " . (int) $my->gid . "\n GROUP BY cc.id" . "\n ORDER BY cc.ordering";
    $database->setQuery($query);
    $categories = $database->loadObjectList();
    $rows = array();
    $currentcat = NULL;
    if ($catid) {
        // url links info for category
예제 #2
0
* Mambo is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*/
/** ensure this file is being included by a parent file */
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
// load the html drawing class
require_once $mainframe->getPath('front_html');
$feedid = intval(mosGetParam($_REQUEST, 'feedid', 0));
$catid = intval(mosGetParam($_REQUEST, 'catid', 0));
switch ($task) {
    case 'view':
        showFeed($option, $feedid);
        break;
    default:
        listFeeds($option, $catid);
        break;
}
function listFeeds($option, $catid)
{
    global $mainframe, $database, $my;
    global $mosConfig_shownoauth, $mosConfig_live_site, $mosConfig_absolute_path;
    global $cur_template, $Itemid;
    /* Query to retrieve all categories that belong under the contacts section and that are published. */
    $query = "SELECT cc.*, a.catid, COUNT(a.id) AS numlinks" . "\n FROM #__categories AS cc" . "\n LEFT JOIN #__newsfeeds AS a ON a.catid = cc.id" . "\n WHERE a.published='1'" . "\n AND cc.section='com_newsfeeds'" . "\n AND cc.published='1'" . "\n AND cc.access <= '" . $my->gid . "'" . "\n GROUP BY cc.id" . "\n ORDER BY cc.ordering";
    $database->setQuery($query);
    $categories = $database->loadObjectList();
    $rows = array();
    $currentcat = NULL;
    if ($catid) {
        // url links info for category