Example #1
0
function drillURL($drilldown, $name=NULL) {
  $url = categoryURL() . "&drilldown=$drilldown";
  if($name) {
    $url .= "&desc=" . urlencode($name);
  }
  return $url;
}
Example #2
0
<?php
$docRoot = getenv("DOCUMENT_ROOT");

require_once $docRoot . "/mobi-config/mobi_web_constants.php";
require WEBROOT . "page_builder/page_header.php";
require LIBDIR . "mit_calendar.php";
require WEBROOT . "calendar/calendar_lib.php";

$category = MIT_Calendar::Category($_REQUEST['id']);
$categorys = MIT_Calendar::subCategorys($category);

if(count($categorys) == 0) {
  header("Location: " . categoryURL($category));
}

require "$page->branch/sub-categorys.html";
$page->output();

?>
Example #3
0
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;
    }
}