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 $query = "SELECT *" . "\n FROM #__newsfeeds" . "\n WHERE catid = '" . $catid . "'" . "\n AND published='1'" . "\n ORDER BY ordering"; $database->setQuery($query); $rows = $database->loadObjectList(); // current category info $query = "SELECT name, description, image, image_position" . "\n FROM #__categories" . "\n WHERE id = '" . $catid . "'" . "\n AND published = '1'" . "\n AND access <= '" . $my->gid . "'"; $database->setQuery($query); $database->loadObject($currentcat); } // Parameters $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('headings', 1); $params->def('back_button', $mainframe->getCfg('back_button')); $params->def('description_text', ''); $params->def('image', -1); $params->def('image_align', 'right'); $params->def('other_cat_section', 1); // Category List Display control $params->def('other_cat', 1); $params->def('cat_description', 1); $params->def('cat_items', 1); // Table Display control $params->def('headings', 1); $params->def('name', 1); $params->def('articles', '1'); $params->def('link', '1'); if ($catid) { $params->set('type', 'category'); } else { $params->set('type', 'section'); } // page description $currentcat->descrip = ''; if (@$currentcat->description != '') { $currentcat->descrip = $currentcat->description; } else { if (!$catid) { // show description if ($params->get('description')) { $currentcat->descrip = $params->get('description_text'); } } } // page image $currentcat->img = ''; $path = $mosConfig_live_site . '/images/stories/'; if (@$currentcat->image != '') { $currentcat->img = $path . $currentcat->image; $currentcat->align = $currentcat->image_position; } else { if (!$catid) { if ($params->get('image') != -1) { $currentcat->img = $path . $params->get('image'); $currentcat->align = $params->get('image_align'); } } } // page header $currentcat->header = ''; if (@$currentcat->name != '') { $currentcat->header = $currentcat->name; $pathway =& mosPathway::getInstance(); $pathway->addItem($currentcat->header, ''); } else { $currentcat->header = $params->get('header'); } // used to show table rows in alternating colours $tabclass = array('sectiontableentry1', 'sectiontableentry2'); $mainframe->SetPageTitle($menu->name); HTML_newsfeed::displaylist($categories, $rows, $catid, $currentcat, $params, $tabclass); }
function mosPathWay() { $pathway =& mosPathway::getInstance(); echo $pathway->makePathway(); }
/** * Enter description here... * * @param unknown_type $Itemid */ function setPathway($Itemid) { if ($Itemid) { $menu =& $this->getMenuByID($Itemid); if (!$menu) { return; } if ($menu->parent) { $this->setPathway($menu->parent); } $pathway =& mosPathway::getInstance(); $pathway->addItem($menu->name, $menu->link . "&Itemid={$Itemid}"); } }
<?php /** * @package Mambo * @author Mambo Foundation Inc see README.php * @copyright Mambo Foundation Inc. * See COPYRIGHT.php for copyright notices and details. * @license GNU/GPL Version 2, see LICENSE.php * 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.'); $pathway =& mosPathway::getInstance(); echo $pathway->makePathway();
function listWeblinks($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 web links section and that are published. */ $query = "SELECT *, COUNT(a.id) AS numlinks FROM #__categories AS cc" . "\n LEFT JOIN #__weblinks AS a ON a.catid = cc.id" . "\n WHERE a.published='1' AND a.approved='1' AND section='com_weblinks' AND cc.published='1' 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 $query = "SELECT id, url, title, description, date, hits, params FROM #__weblinks" . "\nWHERE catid = '{$catid}' AND published='1' AND approved='1' AND archived=0" . "\nORDER BY ordering"; $database->setQuery($query); $rows = $database->loadObjectList(); // current cate info $query = "SELECT name, description, image, image_position FROM #__categories" . "\n WHERE id = '{$catid}'" . "\n AND published = '1'"; $database->setQuery($query); $database->loadObject($currentcat); } // Parameters $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('headings', 1); $params->def('hits', $mainframe->getCfg('hits')); $params->def('item_description', 1); $params->def('other_cat_section', 1); $params->def('other_cat', 1); $params->def('description', 1); $params->def('description_text', T_('From the list below choose one of our web link categories, then select a URL to visit the site.')); $params->def('image', '-1'); $params->def('weblink_icons', ''); $params->def('image_align', 'right'); $params->def('back_button', $mainframe->getCfg('back_button')); if ($catid) { $params->set('type', 'category'); } else { $params->set('type', 'section'); } // page description $currentcat->descrip = ''; if (@$currentcat->description != '') { $currentcat->descrip = $currentcat->description; } else { if (!$catid) { // show description if ($params->get('description')) { $currentcat->descrip = $params->get('description_text'); } } } // page image $currentcat->img = ''; $path = $mosConfig_live_site . '/images/stories/'; if (@$currentcat->image != '') { $currentcat->img = $path . $currentcat->image; $currentcat->align = $currentcat->image_position; } else { if (!$catid) { if ($params->get('image') != -1) { $currentcat->img = $path . $params->get('image'); $currentcat->align = $params->get('image_align'); } } } // page header $currentcat->header = ''; if (@$currentcat->name != '') { $currentcat->header = $currentcat->name; $pathway =& mosPathway::getInstance(); $pathway->addItem($currentcat->name, ''); } else { $currentcat->header = $params->get('header'); } // used to show table rows in alternating colours $tabclass = array('sectiontableentry1', 'sectiontableentry2'); HTML_weblinks::displaylist($categories, $rows, $catid, $currentcat, $params, $tabclass); }
function showItem($uid, $gid, &$access, $pop, $option, $now) { global $database, $mainframe; global $mosConfig_offset, $mosConfig_live_site, $mosConfig_MetaTitle, $mosConfig_MetaAuthor; if ($access->canEdit) { $xwhere = ''; } else { $xwhere = "AND (a.state = '1' OR a.state = '-1')" . "\n\tAND (publish_up = '0000-00-00 00:00:00' OR publish_up <= '{$now}')" . "\n\tAND (publish_down = '0000-00-00 00:00:00' OR publish_down >= '{$now}')"; } global $acl; $viewAccess = ($gid >= $acl->get_group_id('Registered', 'ARO') ? 1 : 0) + ($gid >= $acl->get_group_id('Author', 'ARO') ? 1 : 0); $query = "SELECT a.*, ROUND(v.rating_sum/v.rating_count) AS rating, v.rating_count, u.name AS author, u.usertype, cc.name AS category, s.name AS section, g.name AS groups" . "\n FROM #__content AS a" . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope='content'" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" . "\n WHERE a.id='" . $uid . "' " . $xwhere . "\n AND a.access <= " . $viewAccess; $database->setQuery($query); $row = new mosExtendedContent(); if ($database->loadObject($row)) { $pathway =& mosPathway::getInstance(); $pathway->addItem($row->category, categoryURL($row->sectionid, $row->catid)); $pathway->addItem($row->title, ''); $params =& new mosParameters($row->attribs); $params->set('intro_only', 0); $params->def('back_button', $mainframe->getCfg('back_button')); if ($row->sectionid == 0) { $params->set('item_navigation', 0); } else { $params->set('item_navigation', $mainframe->getCfg('item_navigation')); } // loads the links for Next & Previous Button if ($params->get('item_navigation')) { $query = "SELECT a.id" . "\n FROM #__content AS a" . "\n WHERE a.catid = " . $row->catid . "" . "\n AND a.state = {$row->state} AND ordering < {$row->ordering}" . ($access->canEdit ? "" : "\n AND a.access <= '" . $gid . "'") . "\n AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '" . $now . "' )" . "\n AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '" . $now . "' )" . "\n ORDER BY a.ordering DESC" . "\n LIMIT 1"; $database->setQuery($query); $row->prev = $database->loadResult(); $query = "SELECT a.id" . "\n FROM #__content AS a" . "\n WHERE a.catid = " . $row->catid . "" . "\n AND a.state = {$row->state} AND ordering > {$row->ordering}" . ($access->canEdit ? "" : "\n AND a.access <= '" . $gid . "'") . "\n AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '" . $now . "' )" . "\n AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '" . $now . "' )" . "\n ORDER BY a.ordering" . "\n LIMIT 1"; $database->setQuery($query); $row->next = $database->loadResult(); } // page title $mainframe->setPageTitle($row->title); if ($mosConfig_MetaTitle == '1') { $mainframe->addMetaTag('title', $row->title); } if ($mosConfig_MetaAuthor == '1') { $mainframe->addMetaTag('author', $row->author); } show($row, $params, $gid, $access, $pop, $option); #if (file_exists("mosmodule/eminimalls.php")) { include("mosmodule/eminimalls.php"); } if (file_exists("mosmodule/chitikapro.php")) { include "mosmodule/chitikapro.php"; } } else { mosNotAuth(); return; } }