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


PHP Channel::create_pagination方法代码示例

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


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

示例1: search

 function search()
 {
     $address = '';
     $tagdata = $this->EE->TMPL->tagdata;
     $prec = !$this->EE->TMPL->fetch_param('prec') ? '' : ',' . $this->EE->TMPL->fetch_param('prec');
     $prefix = !$this->EE->TMPL->fetch_param('prefix') ? '' : ',' . $this->EE->TMPL->fetch_param('prefix');
     $orderby = !$this->EE->TMPL->fetch_param('orderby') ? false : ($this->EE->TMPL->fetch_param('orderby') == 'distance' ? false : $this->EE->TMPL->fetch_param('orderby'));
     $sort = !$this->EE->TMPL->fetch_param('sort') ? 'asc' : $this->EE->TMPL->fetch_param('sort');
     $this->EE->TMPL->tagparams['limit'] = !$this->EE->TMPL->fetch_param('limit') ? 99999 : $this->EE->TMPL->fetch_param('limit');
     $address_fields = !$this->EE->TMPL->fetch_param('address_fields') ? false : $this->EE->TMPL->fetch_param('address_fields');
     $debug = !$this->EE->TMPL->fetch_param('debug') ? false : true;
     //@delete
     $reverse_geocoding = !$this->EE->TMPL->fetch_param('reverse_geocoding') ? '' : ',' . $this->EE->TMPL->fetch_param('reverse_geocoding');
     if (isset($_POST) and count($_POST) > 0 or isset($_GET) and count($_GET) > 0) {
         $zipLongitude = $this->EE->security->xss_clean($this->EE->input->get_post('long'));
         $zipLatitude = $this->EE->security->xss_clean($this->EE->input->get_post('lat'));
         $unit = $this->EE->security->xss_clean($this->EE->input->get_post('unit'));
         //@add to site description
         if ($address_fields) {
             foreach (explode('|', $address_fields) as $field_name) {
                 $address = $this->EE->input->get_post($field_name) ? $address . $this->EE->security->xss_clean($this->EE->input->get_post($field_name)) . ', ' : '';
             }
         } else {
             $address = $this->EE->security->xss_clean($this->EE->input->get_post('address'));
             if (is_array($address)) {
                 $address = implode(",", $address);
             }
         }
         $address = $prefix . $address;
         $radius = $this->EE->security->xss_clean($this->EE->input->get_post('radius'));
     } else {
         $zipLongitude = $this->EE->TMPL->fetch_param('long') != '' ? $this->EE->TMPL->fetch_param('long') : "";
         $zipLatitude = $this->EE->TMPL->fetch_param('lat') != '' ? $this->EE->TMPL->fetch_param('lat') : '';
         $unit = $this->EE->TMPL->fetch_param('unit') != '' ? $this->EE->TMPL->fetch_param('unit') : 'ml';
         $address = $this->EE->TMPL->fetch_param('address') != '' ? $this->EE->TMPL->fetch_param('address') : '';
         $radius = $this->EE->TMPL->fetch_param('radius') != '' ? $this->EE->TMPL->fetch_param('radius') : $this->default_radius;
     }
     $radius = $radius == '' ? $this->default_radius : $radius;
     $earth_radius = $unit == 'km' ? 6371 : 3959;
     //earth_radius
     if (($zipLongitude == "" or $zipLatitude == "") and $address == "") {
         $zipLongitude = $this->default_long;
         $zipLatitude = $this->default_lat;
         $address = $this->default_address;
     }
     $entry_id = '';
     $points = array();
     $entry_id = rtrim($entry_id, '|');
     $channel = new Channel();
     $LD = '\\{';
     $RD = '\\}';
     $SLASH = '\\/';
     $variable = "entries";
     $return_data = "";
     if (isset($_POST['categories'])) {
         $this->EE->TMPL->tagparams['category'] = (isset($this->EE->TMPL->tagparams['category']) ? $this->EE->TMPL->tagparams['category'] : '') . '|' . implode("|", $this->EE->security->xss_clean($_POST['categories']));
     }
     if (preg_match("/" . LD . $variable . ".*?" . RD . "(.*?)" . LD . '\\/' . $variable . RD . "/s", $tagdata, $entries)) {
         $channel->EE->TMPL->tagdata = $entries[1];
         if ($channel->EE->TMPL->fetch_param('related_categories_mode') == 'yes') {
             return $channel->related_entries();
         }
         $channel->initialize();
         $channel->uri = $channel->query_string != '' ? $channel->query_string : 'index.php';
         if ($channel->enable['custom_fields'] == TRUE) {
             $channel->fetch_custom_channel_fields();
         }
         if ($channel->enable['member_data'] == TRUE) {
             $channel->fetch_custom_member_fields();
         }
         if ($channel->enable['pagination'] == TRUE) {
             if (version_compare(APP_VER, '2.4', '>=')) {
                 $channel->add_pagination_data();
             } else {
                 $channel->fetch_pagination_data();
             }
         }
         $save_cache = FALSE;
         $channel->EE->TMPL->tagparams['dynamic'] = 'no';
         //$zipLongitude.$zipLatitude.$address
         if ($channel->EE->config->item('enable_sql_caching') == 'y') {
             if (FALSE == ($channel->sql = $channel->fetch_cache())) {
                 $save_cache = TRUE;
             } else {
                 if ($channel->EE->TMPL->fetch_param('dynamic') != 'no') {
                     if (preg_match("#(^|\\/)C(\\d+)#", $channel->query_string, $match) or in_array($channel->reserved_cat_segment, explode("/", $channel->query_string))) {
                         $channel->cat_request = TRUE;
                     }
                 }
             }
             if (FALSE !== ($cache = $channel->fetch_cache('pagination_count'))) {
                 if (FALSE !== $channel->fetch_cache('field_pagination')) {
                     if (FALSE !== ($pg_query = $channel->fetch_cache('pagination_query'))) {
                         $channel->paginate = TRUE;
                         $channel->field_pagination = TRUE;
                         $channel->create_pagination(trim($cache), $channel->EE->db->query(trim($pg_query)));
                     }
                 } else {
                     $channel->create_pagination(trim($cache));
                 }
//.........这里部分代码省略.........
开发者ID:thomasvandoren,项目名称:teentix-site,代码行数:101,代码来源:mod.mx_google_map.php

示例2: _entries

 /**
  *	List of Entires for an Author, Sub-Processing for entries() method
  *
  *	@access		private
  *	@param		array
  *	@return		string
  */
 private function _entries($params = array())
 {
     /**	----------------------------------------
     		/**	Execute?
     		/**	----------------------------------------*/
     if ($this->entry_id == '') {
         return FALSE;
     }
     /**	----------------------------------------
     		/**	Invoke Channel/Weblog class
     		/**	----------------------------------------*/
     if (APP_VER < 2.0) {
         if (!class_exists('Weblog')) {
             require PATH_MOD . 'weblog/mod.weblog' . EXT;
         }
         $channel = new Weblog();
     } else {
         if (!class_exists('Channel')) {
             require PATH_MOD . 'channel/mod.channel.php';
         }
         $channel = new Channel();
     }
     // --------------------------------------------
     //  Invoke Pagination for EE 2.4 and Above
     // --------------------------------------------
     if (APP_VER >= '2.4.0') {
         ee()->load->library('pagination');
         $channel->pagination = new Pagination_object('Channel');
         // Used by pagination to determine whether we're coming from the cache
         $channel->pagination->dynamic_sql = FALSE;
     }
     /**	----------------------------------------
     		/**	Pass params
     		/**	----------------------------------------*/
     ee()->TMPL->tagparams['entry_id'] = $this->entry_id;
     ee()->TMPL->tagparams['inclusive'] = '';
     if (isset($params['dynamic']) and $params['dynamic'] == "off") {
         if (APP_VER < 2.0) {
             ee()->TMPL->tagparams['dynamic'] = 'off';
         } else {
             ee()->TMPL->tagparams['dynamic'] = 'no';
         }
     }
     /**	----------------------------------------
     		/**	Pre-process related data
     		/**	----------------------------------------*/
     ee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(ee()->TMPL->tagdata);
     ee()->TMPL->var_single = array_merge(ee()->TMPL->var_single, ee()->TMPL->related_markers);
     /**	----------------------------------------
     		/**	Execute needed methods
     		/**	----------------------------------------*/
     if (APP_VER < 2.0) {
         $channel->fetch_custom_weblog_fields();
     } else {
         $channel->fetch_custom_channel_fields();
     }
     $channel->fetch_custom_member_fields();
     // --------------------------------------------
     //  Pagination Tags Parsed Out
     // --------------------------------------------
     if (APP_VER >= '2.4.0') {
         $channel->pagination->get_template();
     } else {
         $channel->fetch_pagination_data();
     }
     if (APP_VER >= '2.4.0') {
         $channel->pagination->cfields = $channel->cfields;
         $channel->pagination->build();
     } else {
         $channel->create_pagination();
     }
     /**	----------------------------------------
     		/**	Grab entry data
     		/**	----------------------------------------*/
     //$channel->create_pagination();
     $channel->build_sql_query();
     if ($channel->sql == '') {
         return $this->no_results();
     }
     $channel->query = ee()->db->query($channel->sql);
     if (APP_VER < 2.0) {
         $channel->query->result = $channel->query->result_array();
     }
     if (!isset($channel->query) or $channel->query->num_rows() == 0) {
         return $this->no_results();
     }
     if (APP_VER < 2.0) {
         if (!class_exists('Typography')) {
             require PATH_CORE . 'core.typography' . EXT;
         }
         $channel->TYPE = new Typography();
         $channel->TYPE->convert_curly = FALSE;
     } else {
//.........这里部分代码省略.........
开发者ID:TAGraves,项目名称:Compendium-Prototype,代码行数:101,代码来源:mod.user.backup.php


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