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


PHP EB::AclHelper方法代码示例

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


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

示例1: _buildQuery

 /**
  * Method to build the query for the tags
  *
  * @access private
  * @return string
  */
 public function _buildQuery($browsingMode = false)
 {
     // Get the WHERE and ORDER BY clauses for the query
     $where = $this->_buildQueryWhere($browsingMode);
     $orderby = $this->_buildQueryOrderBy();
     $db = EB::db();
     if ($browsingMode) {
         $query = array();
         $query[] = 'SELECT a.*, b.`content_id` AS `featured` FROM ' . $db->qn('#__users') . ' AS a ';
         $query[] = 'LEFT JOIN ' . $db->qn('#__easyblog_featured') . ' AS b ';
         $query[] = 'ON a.`id` = b.`content_id` AND b.`type`=' . $db->Quote('blogger');
         $query[] = $where;
         $query[] = $orderby;
         $query = implode(' ', $query);
     } else {
         $aclQuery = EB::AclHelper()->genIsbloggerSQL();
         $query = 'select count( p.id ) as `totalPost`, COUNT( DISTINCT(g.content_id) ) as `featured`,';
         $query .= ' a.*';
         $query .= '	from `#__users` as a';
         $query .= ' 	left join `#__easyblog_post` as p on a.`id` = p.`created_by`';
         $query .= ' 		and `p`.`published` = ' . $db->Quote(EASYBLOG_POST_PUBLISHED);
         $query .= ' 		and p.`state` = ' . $db->Quote(EASYBLOG_POST_NORMAL);
         $query .= ' 	left join `#__easyblog_featured` AS `g` ON a.`id`= g.`content_id` AND g.`type`= ' . $db->Quote('blogger');
         $query .= ' where (' . $aclQuery . ')';
         $query .= $where;
         $query .= ' group by a.`id`';
         $query .= $orderby;
     }
     return $query;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:36,代码来源:bloggers.php

示例2: _buildQuery

 /**
  * Method to build the query for the tags
  *
  * @access private
  * @return string
  */
 public function _buildQuery($bloggerOnly = false)
 {
     // Get the WHERE and ORDER BY clauses for the query
     $where = $this->_buildQueryWhere();
     $orderby = $this->_buildQueryOrderBy();
     $db = EB::db();
     if ($bloggerOnly) {
         $aclQuery = EB::AclHelper()->genIsbloggerSQL();
         $query = 'select a.* FROM `#__users` AS `a`';
         $query .= $where;
         $query .= $where ? ' and (' : ' where (';
         $query .= $aclQuery . ')';
     } else {
         $query = 'SELECT * FROM ' . $db->nameQuote('#__users');
         $query .= $where;
     }
     $query .= $orderby;
     return $query;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:25,代码来源:users.php

示例3: getBloggers

 /**
  * Retrieves a list of bloggers from the site
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function getBloggers($sort = 'latest', $limit = 0, $filter = 'showallblogger', $search = '', $inclusion = array(), $exclusion = array(), $featuredOnly = '')
 {
     $db = EB::db();
     $config = EB::config();
     $nameDisplayFormat = $config->get('layout_nameformat');
     $limit = $limit == 0 ? $this->getState('limit') : $limit;
     $limitstart = $this->input->get('limitstart', $this->getState('limitstart'), 'int');
     $limitSQL = ' LIMIT ' . $limitstart . ',' . $limit;
     $excludedQuery = '';
     $excluded = $config->get('layout_exclude_bloggers');
     // check if there is exclusion from the backend settings OR from the parameter
     if (!empty($excluded) || !empty($exclusion)) {
         $tmp = explode(',', $excluded);
         if (!empty($excluded) && !empty($exclusion)) {
             $tmp = array_merge($tmp, $exclusion);
         }
         $values = array();
         foreach ($tmp as $id) {
             $values[] = $db->Quote($id);
         }
         $excludedQuery = ' AND a.`id` NOT IN (' . implode(',', $values) . ')';
     }
     //inclusion blogger
     $includedQuery = '';
     if (!empty($inclusion)) {
         $values = array();
         foreach ($inclusion as $id) {
             $values[] = $db->Quote($id);
         }
         $includedQuery = ' AND a.id IN (' . implode(',', $values) . ')';
     }
     $searchQuery = '';
     if (!empty($search)) {
         $searchQuery .= ' AND ';
         switch ($nameDisplayFormat) {
             case 'name':
                 $searchQuery .= '`name` LIKE ' . $db->Quote('%' . $search . '%');
                 break;
             case 'username':
                 $searchQuery .= '`username` LIKE ' . $db->Quote('%' . $search . '%');
                 break;
             default:
                 $searchQuery .= '`nickname` LIKE ' . $db->Quote('%' . $search . '%');
                 break;
         }
     }
     $aclQuery = EB::AclHelper()->genIsbloggerSQL();
     // $query  = 'select count( p.id ) as `totalPost`, MAX(p.`created`) as `latestPostDate`, COUNT( DISTINCT(g.content_id) ) as `featured`,';
     $query = 'select SQL_CALC_FOUND_ROWS count( p.id ) as `totalPost`, MAX(p.`created`) as `latestPostDate`, COUNT( DISTINCT(g.content_id) ) as `featured`,';
     $query .= ' a.`id`, b.`nickname`, a.`name`, a.`username`, a.`registerDate`, a.`lastvisitDate`, b.`permalink`';
     $query .= '	from `#__users` as a';
     $query .= ' 	left join `#__easyblog_post` as p on a.`id` = p.`created_by`';
     $query .= ' 	inner JOIN `#__easyblog_users` AS `b` ON p.`created_by` = b.`id`';
     $query .= ' 	left join `#__easyblog_featured` AS `g` ON a.`id`= g.`content_id` AND g.`type`= ' . $db->Quote('blogger');
     $query .= ' where (' . $aclQuery . ')';
     $query .= ' and `p`.`published` = ' . $db->Quote(EASYBLOG_POST_PUBLISHED);
     $query .= ' and p.`state` = ' . $db->Quote(EASYBLOG_POST_NORMAL);
     if ($featuredOnly) {
         $query .= ' and a.`id` = g.`content_id`';
     }
     $query .= $excludedQuery;
     $query .= $includedQuery;
     $query .= $searchQuery;
     $query .= ' group by a.`id`';
     if ($filter == 'showbloggerwithpost') {
         $query .= ' having (count(p.id) > 0)';
     }
     switch ($sort) {
         case 'featured':
             $query .= ' ORDER BY `featured` DESC';
             break;
         case 'latestpost':
             $query .= '	ORDER BY `latestPostDate` DESC';
             break;
         case 'latest':
             $query .= '	ORDER BY a.`registerDate` DESC';
             break;
         case 'postcount':
             $query .= '	ORDER BY `totalPost` DESC';
             break;
         case 'active':
             $query .= ' ORDER BY a.`lastvisitDate` DESC';
             break;
         case 'alphabet':
             if ($nameDisplayFormat == 'name') {
                 $query .= '	ORDER BY a.`name` ASC';
             } else {
                 if ($nameDisplayFormat == 'username') {
                     $query .= '	ORDER BY a.`username` ASC';
                 } else {
                     $query .= '	ORDER BY b.`nickname` ASC';
                 }
//.........这里部分代码省略.........
开发者ID:knigherrant,项目名称:decopatio,代码行数:101,代码来源:blogger.php

示例4: getTotalAuthors

 /**
  * Retrieves the total number of authors
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function getTotalAuthors()
 {
     $db = EB::db();
     $aclQuery = EB::AclHelper()->genIsbloggerSQL();
     $query = 'select count(1)';
     $query .= ' from `#__users` as a';
     $query .= ' where a.`block` = ' . $db->Quote('0');
     $query .= ' and (' . $aclQuery . ')';
     $db->setQuery($query);
     $result = $db->loadResult();
     return $result;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:20,代码来源:stats.php


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