本文整理汇总了PHP中Channel::fetch_custom_weblog_fields方法的典型用法代码示例。如果您正苦于以下问题:PHP Channel::fetch_custom_weblog_fields方法的具体用法?PHP Channel::fetch_custom_weblog_fields怎么用?PHP Channel::fetch_custom_weblog_fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel::fetch_custom_weblog_fields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prep_occurrences_output
//.........这里部分代码省略.........
} else {
if (!class_exists('Channel')) {
require PATH_MOD . '/channel/mod.channel' . EXT;
}
$channel = new Channel();
}
//default is 100 and that could limit events when there are very many to be shown
$channel->limit = 500;
// --------------------------------------------
// 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;
}
// -------------------------------------
// Prepare parameters
// -------------------------------------
ee()->TMPL->tagparams['entry_id'] = implode('|', $ids);
ee()->TMPL->tagparams['weblog'] = CALENDAR_EVENTS_CHANNEL_NAME;
ee()->TMPL->tagparams['channel'] = CALENDAR_EVENTS_CHANNEL_NAME;
// -------------------------------------
// Pre-process related data
// -------------------------------------
ee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data($tagdata);
ee()->TMPL->var_single = array_merge(ee()->TMPL->var_single, ee()->TMPL->related_markers);
ee()->TMPL->var_single['entry_id'] = 'entry_id';
// -------------------------------------
// 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();
}
// -------------------------------------
// Add occurrence_ prefix to custom fields
// -------------------------------------
foreach ($channel->cfields as $sid => $fields) {
foreach ($fields as $name => $fid) {
$channel->cfields[$sid]['occurrence_' . $name] = $fid;
unset($channel->cfields[$sid][$name]);
}
}
// -------------------------------------
// Querification
// -------------------------------------
$channel->build_sql_query();
if ($channel->sql == '') {
return $this->no_results();
}
$channel->query = ee()->db->query($channel->sql);
if ($channel->query->num_rows() == 0) {
//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');
return $this->no_results();
示例2: rank
//.........这里部分代码省略.........
require PATH_MOD . '/weblog/mod.weblog' . EXT;
}
$channel = new Weblog();
} else {
if (!class_exists('Channel')) {
require PATH_MOD . '/channel/mod.channel' . EXT;
}
$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;
}
// ----------------------------------------
// Pre-process related data
// ----------------------------------------
// TMPL class is coded so that only
// one method in the weblog class and one
// method in the search class are allowed
// to parse related entries tags. This is
// no doubt for performance reasons.
// ----------------------------------------
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();
}
// ----------------------------------------
// Build Weblog Data Query
// ----------------------------------------
$channel->build_sql_query();
// --------------------------------------------
// Transfer Pagination Variables Over to Channel object
// - Has to go after the building of the query as EE 2.4 does its Pagination work in there
// --------------------------------------------
if (APP_VER >= '2.4.0') {
$transfer = array('paginate' => 'paginate', 'total_pages' => 'total_pages', 'current_page' => 'current_page', 'offset' => 'offset', 'page_next' => 'page_next', 'page_previous' => 'page_previous', 'page_links' => 'pagination_links', 'total_rows' => 'total_rows', 'per_page' => 'per_page', 'per_page' => 'p_limit', 'offset' => 'p_page');
foreach ($transfer as $from => $to) {
$channel->{$to} = $channel->pagination->{$from};
}
}
// ----------------------------------------
// Empty?
// ----------------------------------------
if (trim($channel->sql) == '') {
if ($this->check_yes(ee()->TMPL->fetch_param('favorites_count'))) {
return $this->return_data = str_replace(LD . 'favorites_count' . RD, '0', ee()->TMPL->tagdata);
示例3: _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 {
//.........这里部分代码省略.........