本文整理汇总了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();
}
示例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();
}