当前位置: 首页>>代码示例>>PHP>>正文


PHP JEVHelper::categoryAdmin方法代码示例

本文整理汇总了PHP中JEVHelper::categoryAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP JEVHelper::categoryAdmin方法的具体用法?PHP JEVHelper::categoryAdmin怎么用?PHP JEVHelper::categoryAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JEVHelper的用法示例。


在下文中一共展示了JEVHelper::categoryAdmin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: countIcalEventRepeatsByCreator

 function countIcalEventRepeatsByCreator($creator_id)
 {
     $user = JFactory::getUser();
     $db = JFactory::getDBO();
     $extrawhere = array();
     $extrajoin = array();
     $extrafields = "";
     // must have comma prefix
     $catwhere = "\n WHERE ev.catid IN(" . $this->accessibleCategoryList() . ")";
     $params = JComponentHelper::getParams("com_jevents");
     if ($params->get("multicategory", 0)) {
         $extrajoin[] = "\n #__jevents_catmap as catmap ON catmap.evid = rpt.eventid";
         $extrajoin[] = "\n #__categories AS catmapcat ON catmap.catid = catmapcat.id";
         $extrafields .= ", GROUP_CONCAT(DISTINCT catmap.catid SEPARATOR ',') as catids";
         $extrawhere[] = " catmapcat.access " . (version_compare(JVERSION, '1.6.0', '>=') ? ' IN (' . JEVHelper::getAid($user) . ')' : ' <=  ' . JEVHelper::getAid($user));
         $extrawhere[] = " catmap.catid IN(" . $this->accessibleCategoryList() . ")";
         $needsgroup = true;
         $catwhere = "\n WHERE 1 ";
     }
     $adminCats = JEVHelper::categoryAdmin();
     $where = '';
     if ($creator_id == 'ADMIN') {
         $where = "";
     } else {
         if ($adminCats && count($adminCats) > 0) {
             if ($params->get("multicategory", 0)) {
                 $adminCats = " OR catmap.catid IN(" . implode(",", $adminCats) . ")";
             } else {
                 $adminCats = " OR ev.catid IN(" . implode(",", $adminCats) . ")";
             }
             $where = " AND ( ev.created_by = " . $user->id . $adminCats . ")";
         } else {
             $where = " AND ev.created_by = '{$creator_id}' ";
         }
     }
     // State is managed by plugin
     $filters = jevFilterProcessing::getInstance(array("published", "justmine", "category", "startdate", "search"));
     $filters->setWhereJoin($extrawhere, $extrajoin);
     $extrajoin = count($extrajoin) ? " \n LEFT JOIN " . implode(" \n LEFT JOIN ", $extrajoin) : '';
     $extrawhere = count($extrawhere) ? ' AND ' . implode(' AND ', $extrawhere) : '';
     $query = "SELECT rpt.rp_id, ev.catid" . "\n FROM #__jevents_repetition as rpt " . "\n LEFT JOIN #__jevents_vevent as ev ON rpt.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_icsfile as icsf ON icsf.ics_id=ev.icsid" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . $extrajoin . $catwhere . $extrawhere . $where . "\n AND icsf.state=1" . "\n GROUP BY rpt.rp_id";
     $db->setQuery($query);
     $db->query();
     return $db->getNumRows();
 }
开发者ID:madseller,项目名称:coperio,代码行数:45,代码来源:dbmodel.php

示例2: countIcalEventRepeatsByCreator

 function countIcalEventRepeatsByCreator($creator_id)
 {
     $user =& JFactory::getUser();
     $db =& JFactory::getDBO();
     $adminCats = JEVHelper::categoryAdmin();
     $where = '';
     if ($creator_id == 'ADMIN') {
         $where = "";
     } else {
         if ($adminCats && count($adminCats) > 0) {
             //$adminCats = " OR (ev.state=0 AND ev.catid IN(".implode(",",$adminCats)."))";
             $adminCats = " OR ev.catid IN(" . implode(",", $adminCats) . ")";
             $where = " AND ( ev.created_by = " . $user->id . $adminCats . ")";
         } else {
             $where = " AND ev.created_by = '{$creator_id}' ";
         }
     }
     // State is managed by plugin
     $extrawhere = array();
     $extrajoin = array();
     $filters = jevFilterProcessing::getInstance(array("published", "justmine", "category", "startdate", "search"));
     $filters->setWhereJoin($extrawhere, $extrajoin);
     $extrajoin = count($extrajoin) ? " \n LEFT JOIN " . implode(" \n LEFT JOIN ", $extrajoin) : '';
     $extrawhere = count($extrawhere) ? ' AND ' . implode(' AND ', $extrawhere) : '';
     $query = "SELECT rpt.rp_id, ev.catid" . "\n FROM #__jevents_repetition as rpt " . "\n LEFT JOIN #__jevents_vevent as ev ON rpt.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_icsfile as icsf ON icsf.ics_id=ev.icsid" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . $extrajoin . "\n WHERE ev.catid IN(" . $this->accessibleCategoryList() . ")" . $extrawhere . $where . "\n AND icsf.state=1" . "\n GROUP BY rpt.rp_id";
     $db->setQuery($query);
     $db->query();
     return $db->getNumRows();
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:29,代码来源:dbmodel.php


注:本文中的JEVHelper::categoryAdmin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。