本文整理汇总了PHP中FlexicontentFields::getFieldDisplay方法的典型用法代码示例。如果您正苦于以下问题:PHP FlexicontentFields::getFieldDisplay方法的具体用法?PHP FlexicontentFields::getFieldDisplay怎么用?PHP FlexicontentFields::getFieldDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlexicontentFields
的用法示例。
在下文中一共展示了FlexicontentFields::getFieldDisplay方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: if
<div class="lineinfo image_descr">
<?php if ($this->params->get('intro_use_image', 1) && $src) : ?>
<figure class="image<?php echo $this->params->get('intro_position') ? ' right' : ' left'; ?>">
<?php if ($this->params->get('intro_link_image', 1)) : ?>
<a href="<?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->categoryslug, 0, $item)); ?>" class="hasTip" title="<?php echo JText::_( 'FLEXI_READ_MORE_ABOUT' ) . '::' . htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8'); ?>">
<img src="<?php echo $thumb; ?>" alt="<?php echo htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8'); ?>" />
</a>
<?php else : ?>
<img src="<?php echo $thumb; ?>" alt="<?php echo htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8'); ?>" />
<?php endif; ?>
</figure>
<?php endif; ?>
<p>
<?php
FlexicontentFields::getFieldDisplay($item, 'text', $values=null, $method='display');
if ($this->params->get('intro_strip_html', 1)) :
echo flexicontent_html::striptagsandcut( $item->fields['text']->display, $this->params->get('intro_cut_text', 200) );
else :
echo $item->fields['text']->display;
endif;
?>
</p>
</div>
<!-- BOF under-description-line1 block -->
<?php if (isset($item->positions['under-description-line1'])) : ?>
<div class="lineinfo line3">
<?php foreach ($item->positions['under-description-line1'] as $field) : ?>
<span class="element">
<?php if ($field->label) : ?>
示例2: createItemsListHTML
//.........这里部分代码省略.........
$result = preg_match_all("/\\%\\%([^%]+)\\%\\%/", $relitem_html, $translate_matches);
$translate_strings = $result ? $translate_matches[1] : array('FLEXI_READ_MORE_ABOUT');
foreach ($translate_strings as $translate_string) {
$relitem_html = str_replace('%%' . $translate_string . '%%', JText::_($translate_string), $relitem_html);
}
foreach ($item_list as $result) {
// Check if related item is published and skip if not published
if ($result->state != 1 && $result->state != -5) {
continue;
}
$itemslug = $result->id . ":" . $result->alias;
$catslug = "";
// Check if removed from category or inside a noRoute category or inside a non-published category
// and use main category slug or other routable & published category slug
$catid_arr = explode(",", $result->catidlist);
$catalias_arr = explode(",", $result->cataliaslist);
for ($i = 0; $i < count($catid_arr); $i++) {
$itemcataliases[$catid_arr[$i]] = $catalias_arr[$i];
}
$rel_itemid = $result->id;
$rel_catid = !empty($result->rel_catid) ? $result->rel_catid : $result->catid;
if (isset($itemcataliases[$rel_catid]) && !in_array($rel_catid, $globalnoroute) && $globalcats[$rel_catid]->published) {
$catslug = $rel_catid . ":" . $itemcataliases[$rel_catid];
} else {
if (!in_array($result->catid, $globalnoroute) && $globalcats[$result->catid]->published) {
$catslug = $globalcats[$result->catid]->slug;
} else {
foreach ($catid_arr as $catid) {
if (!in_array($catid, $globalnoroute) && $globalcats[$catid]->published) {
$catslug = $globalcats[$catid]->slug;
break;
}
}
}
}
$result->slug = $itemslug;
$result->categoryslug = $catslug;
}
// Perform field's display replacements
if ($i_slave = $parentfield ? $parentitem->id . "_" . $parentfield->id : '') {
$fc_run_times['render_subfields'][$i_slave] = 0;
}
foreach ($custom_field_names as $i => $custom_field_name) {
if (isset($disallowed_fieldnames[$custom_field_name])) {
continue;
}
if ($custom_field_methods[$i] == 'label') {
continue;
}
if ($i_slave) {
$start_microtime = microtime(true);
}
$display_var = $custom_field_methods[$i] ? $custom_field_methods[$i] : 'display';
FlexicontentFields::getFieldDisplay($item_list, $custom_field_name, $custom_field_values = null, $display_var);
if ($i_slave) {
$fc_run_times['render_subfields'][$i_slave] += round(1000000 * 10 * (microtime(true) - $start_microtime)) / 10;
}
}
$tooltip_class = FLEXI_J30GE ? 'hasTooltip' : 'hasTip';
$display = array();
foreach ($item_list as $result) {
$url_read_more = JText::_(isset($_item_data->url_read_more) ? $_item_data->url_read_more : 'FLEXI_READ_MORE_ABOUT', 1);
$url_class = isset($_item_data->url_class) ? $_item_data->url_class : 'relateditem';
// Check if related item is published and skip if not published
if ($result->state != 1 && $result->state != -5) {
continue;
}
// a. Replace some custom made strings
$item_url = JRoute::_(FlexicontentHelperRoute::getItemRoute($result->slug, $result->categoryslug, 0, $result));
$item_title_escaped = htmlspecialchars($result->title, ENT_COMPAT, 'UTF-8');
$tooltip_title = flexicontent_html::getToolTip($url_read_more, $item_title_escaped, $translate = 0, $escape = 0);
$item_tooltip = ' class="' . $tooltip_class . ' ' . $url_class . '" title="' . $tooltip_title . '" ';
$display_text = $displayway ? $result->title : $result->id;
$display_text = !$addlink ? $display_text : '<a href="' . $item_url . '"' . ($addtooltip ? $item_tooltip : '') . ' >' . $display_text . '</a>';
$curr_relitem_html = $relitem_html;
$curr_relitem_html = str_replace('__item_url__', $item_url, $curr_relitem_html);
$curr_relitem_html = str_replace('__item_title_escaped__', $item_title_escaped, $curr_relitem_html);
$curr_relitem_html = str_replace('__item_tooltip__', $item_tooltip, $curr_relitem_html);
$curr_relitem_html = str_replace('__display_text__', $display_text, $curr_relitem_html);
// b. Replace item properties, e.g. {item->id}, (item->title}, etc
$null_field = null;
FlexicontentFields::doQueryReplacements($curr_relitem_html, $null_field, $result);
// c. Replace HTML display of various item fields
$err_mssg = 'Cannot replace field: "%s" because it is of not allowed field type: "%s", which can cause loop or other problem';
foreach ($custom_field_names as $i => $custom_field_name) {
$_field = @$result->fields[$custom_field_name];
$custom_field_display = '';
if ($is_disallowed_field = isset($disallowed_fieldnames[$custom_field_name])) {
$custom_field_display .= sprintf($err_mssg, $custom_field_name, @$_field->field_type);
} else {
$display_var = $custom_field_methods[$i] ? $custom_field_methods[$i] : 'display';
$custom_field_display .= @$_field->{$display_var};
}
$curr_relitem_html = str_replace($custom_field_reps[$i], $custom_field_display, $curr_relitem_html);
}
$display[] = trim($pretext . $curr_relitem_html . $posttext);
}
$display = $opentag . implode($separatorf, $display) . $closetag;
return $display;
}
示例3: display
/**
* Creates the RSS for the View
*
* @since 1.0
*/
function display($tpl = null)
{
$db = JFactory::getDBO();
$doc = JFactory::getDocument();
$app = JFactory::getApplication();
$params = $this->get('Params');
$doc->link = JRoute::_(FlexicontentHelperRoute::getCategoryRoute(JRequest::getVar('cid', null, '', 'int')));
$category = $this->get('Category');
// Prepare query to match feed data
JRequest::setVar('limit', $params->get('feed_limit'));
// Force a specific limit, this will be moved to the model
$params->set('orderby', $params->get('feed_orderby', 'rdate'));
$params->set('orderbycustomfield', $params->get('feed_orderbycustomfield', 1));
$params->set('orderbycustomfieldid', $params->get('feed_orderbycustomfieldid', 0));
$params->set('orderbycustomfielddir', $params->get('feed_orderbycustomfielddir', 'ASC'));
$params->set('orderbycustomfieldint', $params->get('feed_orderbycustomfieldint', 0));
$params->set('orderby_2nd', $params->get('feed_orderby', 'alpha'));
$params->set('orderbycustomfield_2nd', $params->get('feed_orderbycustomfield_2nd', 1));
$params->set('orderbycustomfieldid_2nd', $params->get('feed_orderbycustomfieldid_2nd', 0));
$params->set('orderbycustomfielddir_2nd', $params->get('feed_orderbycustomfielddir_2nd', 'ASC'));
$params->set('orderbycustomfieldint_2nd', $params->get('feed_orderbycustomfieldint_2nd', 0));
$model = $this->getModel();
$model->setState('limit', $params->get('feed_limit', $model->getState('limit')));
$rows = $this->get('Data');
$feed_summary = $params->get('feed_summary', 0);
$feed_summary_cut = $params->get('feed_summary_cut', 200);
$feed_use_image = $params->get('feed_use_image', 1);
$feed_link_image = $params->get('feed_link_image', 1);
$feed_image_source = $params->get('feed_image_source', '');
$feed_image_size = $params->get('feed_image_size', '');
$feed_image_method = $params->get('feed_image_method', 1);
$feed_image_width = $params->get('feed_image_width', 100);
$feed_image_height = $params->get('feed_image_height', 80);
// Retrieve default image for the image field
if ($feed_use_image && $feed_image_source) {
$query = 'SELECT attribs, name FROM #__flexicontent_fields WHERE id = ' . (int) $feed_image_source;
$db->setQuery($query);
$image_dbdata = $db->loadObject();
//$image_dbdata->params = FLEXI_J16GE ? new JRegistry($image_dbdata->params) : new JParameter($image_dbdata->params);
$img_size_map = array('l' => 'large', 'm' => 'medium', 's' => 'small', '' => '');
$img_field_size = $img_size_map[$feed_image_size];
$img_field_name = $image_dbdata->name;
}
// TODO render and add extra fields here ... maybe via special display function for feeds view
$extra_fields = $params->get('feed_extra_fields', '');
$extra_fields = array_unique(preg_split("/\\s*,\\s*/u", $extra_fields));
if ($extra_fields) {
foreach ($extra_fields as $fieldname) {
// Render given field for ALL ITEMS
FlexicontentFields::getFieldDisplay($rows, $fieldname, $values = null, $method = 'display');
}
}
foreach ($rows as $row) {
// strip html from feed item title
$title = $this->escape($row->title);
$title = html_entity_decode($title);
// url link to article
// & used instead of & as this is converted by feed creator
$link = JRoute::_(FlexicontentHelperRoute::getItemRoute($row->slug, $category->slug, 0, $row));
// strip html from feed item description text
$description = $feed_summary ? $row->introtext . $row->fulltext : $row->introtext;
$description = flexicontent_html::striptagsandcut($description, $feed_summary_cut);
if ($feed_use_image) {
// feed image is enabled
$src = '';
$thumb = '';
if ($feed_image_source) {
// case 1 use an image field
FlexicontentFields::getFieldDisplay($row, $img_field_name, null, 'display', 'module');
$img_field = $row->fields[$img_field_name];
if (!$img_field_size) {
$src = str_replace(JURI::root(), '', $img_field->thumbs_src['large'][0]);
} else {
$src = '';
$thumb = $img_field->thumbs_src[$img_field_size][0];
}
} else {
// case 2 extract from item
$src = flexicontent_html::extractimagesrc($row);
}
$RESIZE_FLAG = !$feed_image_source || !$img_field_size;
if ($src && $RESIZE_FLAG) {
// Resize image when src path is set and RESIZE_FLAG: (a) using image extracted from item main text OR (b) not using image field's already created thumbnails
$h = '&h=' . $feed_image_height;
$w = '&w=' . $feed_image_width;
$aoe = '&aoe=1';
$q = '&q=95';
$zc = $feed_image_method ? '&zc=' . $feed_image_method : '';
$ext = pathinfo($src, PATHINFO_EXTENSION);
$f = in_array($ext, array('png', 'ico', 'gif')) ? '&f=' . $ext : '';
$conf = $w . $h . $aoe . $q . $zc . $f;
$base_url = !preg_match("#^http|^https|^ftp|^/#i", $src) ? JURI::base(true) . '/' : '';
$thumb = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $base_url . $src . $conf;
} else {
// Do not resize image when (a) image src path not set or (b) using image field's already created thumbnails
//.........这里部分代码省略.........
示例4: strtolower
</span>
<?php
}
?>
<?php
if ($fcr_use_image && @$result->fc_item_id) {
// FLEXIcontent specific result
?>
<?php
$src = $thumb = '';
if (!empty($img_field_name)) {
FlexicontentFields::getFieldDisplay($fcitems[$i], $img_field_name, $values = null, $method = 'display');
$img_field =& $fcitems[$i]->fields[$img_field_name];
$src = str_replace(JURI::root(), '', @$img_field->thumbs_src[$img_field_size][0]);
} else {
$src = flexicontent_html::extractimagesrc($fcitems[$i]);
}
$RESIZE_FLAG = !$this->params->get('fcr_image') || !$this->params->get('fcr_image_size');
if ($src && $RESIZE_FLAG) {
// Resize image when src path is set and RESIZE_FLAG: (a) using image extracted from item main text OR (b) not using image field's already created thumbnails
$w = '&w=' . $this->params->get('fcr_width', 200);
$h = '&h=' . $this->params->get('fcr_height', 200);
$aoe = '&aoe=1';
$q = '&q=95';
$zc = $this->params->get('fcr_method') ? '&zc=' . $this->params->get('fcr_method') : '';
$ext = strtolower(pathinfo($src, PATHINFO_EXTENSION));
$f = in_array($ext, array('png', 'ico', 'gif')) ? '&f=' . $ext : '';
示例5: foreach
<?php
}
?>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
foreach ($items as $i => $item) {
if ($use_image) {
$src = '';
$thumb = '';
if ($image_source) {
FlexicontentFields::getFieldDisplay($item, $img_field_name, null, 'display', 'module');
$img_field = $item->fields[$img_field_name];
if (!$img_field_size) {
$src = str_replace(JURI::root(), '', $img_field->thumbs_src['large'][0]);
} else {
$thumb = $img_field->thumbs_src[$img_field_size][0];
}
} else {
$src = flexicontent_html::extractimagesrc($item);
}
$RESIZE_FLAG = !$image_source || !$img_field_size;
if ($src && $RESIZE_FLAG) {
// Resize image when src path is set and RESIZE_FLAG: (a) using image extracted from item main text OR (b) not using image field's already created thumbnails
$h = '&h=' . $image_height;
$w = '&w=' . $image_width;
$aoe = '&aoe=1';
示例6: getItemThumbs
function getItemThumbs(&$params, &$items, $uprefix = 'item', $rprefix = 'nav')
{
if (!$params->get($uprefix . '_use_image', 1)) {
return array();
}
if (empty($items)) {
return array();
}
if ($params->get($uprefix . '_image')) {
$img_size_map = array('l' => 'large', 'm' => 'medium', 's' => 'small', 'o' => 'original');
$img_field_size = $img_size_map[$params->get($uprefix . '_image_size', 'l')];
$img_field_name = $params->get($uprefix . '_image');
}
if (!empty($img_field_name)) {
//$_return = FlexicontentFields::renderFields( false, array_keys($items), array($img_field_name), FLEXI_ITEMVIEW, array('display_'.$img_field_size.'_src'));
FlexicontentFields::getFieldDisplay($items, $img_field_name, $values = null, 'display_' . $img_field_size . '_src', FLEXI_ITEMVIEW);
}
$thumbs = array();
foreach ($items as $item_id => $item) {
if (!empty($img_field_name)) {
//$src = str_replace(JURI::root(), '', @ $_return[$item_id][$img_field_name] );
$img_field =& $item->fields[$img_field_name];
$src = str_replace(JURI::root(), '', @$img_field->{'display_' . $img_field_size . '_src'});
} else {
$src = flexicontent_html::extractimagesrc($item);
}
$RESIZE_FLAG = !$params->get($uprefix . '_image') || !$params->get($uprefix . '_image_size');
if ($src && $RESIZE_FLAG) {
// Resize image when src path is set and RESIZE_FLAG: (a) using image extracted from item main text OR (b) not using image field's already created thumbnails
$w = '&w=' . $params->get($rprefix . '_width', 200);
$h = '&h=' . $params->get($rprefix . '_height', 200);
$aoe = '&aoe=1';
$q = '&q=95';
$zc = $params->get($rprefix . '_method') ? '&zc=' . $params->get($rprefix . '_method') : '';
$ext = strtolower(pathinfo($src, PATHINFO_EXTENSION));
$f = in_array($ext, array('png', 'ico', 'gif')) ? '&f=' . $ext : '';
$conf = $w . $h . $aoe . $q . $zc . $f;
$base_url = !preg_match("#^http|^https|^ftp|^/#i", $src) ? JURI::base(true) . '/' : '';
$thumb = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $base_url . $src . $conf;
} else {
// Do not resize image when (a) image src path not set or (b) using image field's already created thumbnails
$thumb = $src;
}
if ($thumb) {
$thumbs[$item_id] = $thumb;
}
}
return $thumbs;
}
示例7: getList
//.........这里部分代码省略.........
// The cost of the following code is minimal.
// The big time cost goes into rendering the fields ...
// We need to create the display of the fields before examining if they are empty.
// The hardcoded limit of max items skipped is 100.
if ($skip_items && count($skiponempty_fields)) {
$mod_fc_run_times['empty_fields_filter'] = $modfc_jprof->getmicrotime();
// 0. Add ONLY skipfields to the list of fields to be rendered
$fields_list = implode(',', $skiponempty_fields);
//$skip_params = new JRegistry();
//$skip_params->set('fields',$fields_list);
foreach ($cat_items_arr as $catid => $cat_items) {
// 1. The filtered rows
$filtered_rows = array();
$order_count = array();
// 2. Get field values (we pass null parameters to only retrieve field values and not render (YET) the 'skip-onempty' fields
FlexicontentFields::getFields($cat_items, 'module', $skip_params = null);
// 3. Skip Items with empty fields (if this filter is enabled)
foreach ($cat_items as $i => $item) {
//echo "$i . {$item->title}<br/>";
// Check to initialize counter for this ordering
if (!isset($order_count[$item->fetching])) {
$order_count[$item->fetching] = 0;
}
// Check if enough encountered for this ordering
if ($order_count[$item->fetching] >= $count) {
continue;
}
// Initialize skip property ZERO for 'any' and ONE for 'all'
$skip_curritem = $onempty_fields_combination == 'any' ? 0 : 1;
// Now check for empty field display or empty field values, if so item must be skipped
foreach ($skiponempty_fields as $skipfield_name) {
if ($skip_items == 2) {
// We will check field's display
FlexicontentFields::getFieldDisplay($item, $skipfield_name, null, 'display', 'module');
$skipfield_data = @$item->fields[$skipfield_name]->display;
} else {
// We will check field's value
$skipfield_iscore = $item->fields[$skipfield_name]->iscore;
$skipfield_id = $item->fields[$skipfield_name]->id;
$skipfield_data = $skipfield_iscore ? $item->{$skipfield_name} : @$item->fieldvalues[$skipfield_id];
}
// Strip HTML Tags
if ($striptags_onempty_fields) {
$skipfield_data = strip_tags($skipfield_data);
}
// Decide if field is empty
$skipfield_isempty = is_array($skipfield_data) ? !count($skipfield_data) : !strlen(trim($skipfield_data));
if ($skipfield_isempty) {
if ($onempty_fields_combination == 'any') {
$skip_curritem = 1;
break;
}
} else {
if ($onempty_fields_combination == 'all') {
$skip_curritem = 0;
break;
}
}
}
if ($skip_curritem) {
//echo "Skip: $i . {$item->title}<br/>";
if (!isset($order_skipcount[$item->fetching])) {
$order_skipcount[$item->fetching] = 0;
}
$order_skipcount[$item->fetching]++;
continue;
示例8: implode
continue;
}
$fc_item_classes .= ' fc' . implode(' fc', $css_markups);
$ecss_markups = $item->ecss_markups[$grp];
$title_markups = $item->title_markups[$grp];
foreach ($css_markups as $mui => $css_markup) {
$markup_tags .= '<span class="fc_markup mu' . $css_markups[$mui] . $ecss_markups[$mui] . '">' . $title_markups[$mui] . '</span>';
}
}
$markup_tags .= '</span>';
$custom_link = null;
if ($intro_use_image) {
if (!empty($img_field_name)) {
// render method 'display_NNNN_src' to avoid CSS/JS being added to the page
/* $src = */
FlexicontentFields::getFieldDisplay($item, $img_field_name, $values = null, $method = 'display_' . $img_field_size . '_src');
$img_field =& $item->fields[$img_field_name];
$src = str_replace(JURI::root(), '', @$img_field->thumbs_src[$img_field_size][0]);
if ($intro_link_image_to && isset($img_field->value[0])) {
$custom_link = ($v = unserialize($img_field->value[0])) !== false ? @$v['link'] : @$img_field->value[0]['link'];
}
} else {
$src = flexicontent_html::extractimagesrc($item);
}
// Use default image form layout parameters
if (!$src && isset($intro_type_default_imgs[$item->typealias])) {
$src = $intro_type_default_imgs[$item->typealias];
}
if (!$src && isset($intro_type_default_imgs['_OTHER_'])) {
$src = $intro_type_default_imgs['_OTHER_'];
}
示例9: onDisplayFieldValue
//.........这里部分代码省略.........
// OPEN GRAPH: site name
if ($field->parameters->get('add_og_site_name')) {
$document->addCustomTag("<meta property=\"og:site_name\" content=\"" . JFactory::getApplication()->getCfg('sitename') . "\" />");
}
// OPEN GRAPH: title
if ($field->parameters->get('add_og_title')) {
$title = flexicontent_html::striptagsandcut($item->title);
$document->addCustomTag("<meta property=\"og:title\" content=\"{$title}\" />");
}
// OPEN GRAPH: description
if ($field->parameters->get('add_og_descr')) {
if ($item->metadesc) {
$document->addCustomTag('<meta property="og:description" content="' . $item->metadesc . '" />');
} else {
$text = flexicontent_html::striptagsandcut($item->text);
$document->addCustomTag("<meta property=\"og:description\" content=\"{$text}\" />");
}
}
// OPEN GRAPH: type
$og_type = (int) $field->parameters->get('add_og_type');
if ($og_type) {
if ($og_type > 2) {
$og_type = 1;
}
$og_type_names = array(1 => 'article', 2 => 'website');
$document->addCustomTag("<meta property=\"og:type\" content=\"" . $og_type_names[$og_type] . "\">");
}
// OPEN GRAPH: image (extracted from item's description text)
if ($field->parameters->get('add_og_image')) {
$og_image_field = $field->parameters->get('og_image_field');
$og_image_fallback = $field->parameters->get('og_image_fallback');
$og_image_thumbsize = $field->parameters->get('og_image_thumbsize');
if ($og_image_field) {
$imageurl = FlexicontentFields::getFieldDisplay($item, $og_image_field, null, 'display_' . $og_image_thumbsize . '_src', 'module');
if ($imageurl) {
$img_field = $item->fields[$og_image_field];
if (!$imageurl && $og_image_fallback == 1 || $imageurl && $og_image_fallback == 2 && $img_field->using_default_value) {
$imageurl = $this->_extractimageurl($item);
}
}
} else {
$imageurl = $this->_extractimageurl($item);
}
// Add image if fould, making sure it is converted to ABSOLUTE URL
if ($imageurl) {
$is_absolute = (bool) parse_url($imageurl, PHP_URL_SCHEME);
// preg_match("#^http|^https|^ftp#i", $imageurl);
$imageurl = $is_absolute ? $imageurl : JURI::root() . $imageurl;
$document->addCustomTag("<meta property=\"og:image\" content=\"{$imageurl}\" />");
}
}
// Add og-URL explicitely as this is required by facebook ?
if ($item_link) {
$document->addCustomTag("<meta property=\"og:url\" content=\"" . $item_link . "\" />");
}
// ****************************
// AddThis social SHARE buttons
// ****************************
$addthis_outside_toolbar = $field->parameters->get('addthis_outside_toolbar', 0);
$addthis_custom_code = $field->parameters->get('addthis_custom_code', false);
$addthis_custom_predefined = $field->parameters->get('addthis_custom_predefined', false);
$addthis_code = '';
if ($addthis_custom_code) {
$addthis_code = str_replace('_item_url_', $item_link, $addthis_custom_code);
$addthis_code = str_replace('_item_title_', htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8'), $addthis_code);
} else {
示例10: getData
function getData($number)
{
nextendimport('nextend.database.database');
$db = NextendDatabase::getInstance();
$data = array();
$query = 'SELECT ';
$query .= 'con.id ';
$query .= 'FROM #__content AS con ';
$query .= 'LEFT JOIN #__flexicontent_cats_item_relations AS fcat ON fcat.itemid = con.id ';
$query .= 'LEFT JOIN #__categories AS cat ON fcat.catid = cat.id ';
$where = array();
$category = array_map('intval', explode('||', $this->_data->get('sourcecategory', '')));
if (!in_array('0', $category) && !in_array('1', $category)) {
$where[] = 'fcat.catid IN (' . implode(',', $category) . ') ';
}
if ($this->_data->get('sourcepublished', 1)) {
$where[] = 'con.state = 1 ';
}
if ($this->_data->get('sourcefeatured', 0)) {
$where[] = 'con.featured = 1 ';
}
$language = $this->_data->get('sourcelanguage', '*');
if ($language) {
$where[] = 'con.language = ' . $db->quote($language) . ' ';
}
if (count($where)) {
$query .= ' WHERE ' . implode(' AND ', $where);
}
$query .= 'GROUP BY con.id ';
$order = NextendParse::parse($this->_data->get('order1', 'con.title|*|asc'));
if ($order[0]) {
$query .= 'ORDER BY ' . $order[0] . ' ' . $order[1] . ' ';
$order = NextendParse::parse($this->_data->get('order2', 'con.title|*|asc'));
if ($order[0]) {
$query .= ', ' . $order[0] . ' ' . $order[1] . ' ';
}
}
$query .= 'LIMIT 0, ' . $number . ' ';
$db->setQuery($query);
$result = $db->loadAssocList();
$lng = JFactory::getLanguage();
$adminapp = JFactory::$application;
$siteapp = JApplicationCms::getInstance('site');
$siteapp->loadLanguage($lng);
require_once JPATH_ADMINISTRATOR . DS . 'components/com_flexicontent/defineconstants.php';
JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_flexicontent' . DS . 'tables');
require_once JPATH_SITE . DS . 'components' . DS . 'com_flexicontent' . DS . 'helpers' . DS . 'permission.php';
require_once JPATH_SITE . DS . "components/com_flexicontent/classes/flexicontent.fields.php";
require_once JPATH_SITE . DS . "components/com_flexicontent/classes/flexicontent.helper.php";
require_once JPATH_SITE . '/components/com_flexicontent/models/item.php';
$app = JFactory::getApplication();
$user = JFactory::getUser();
$aid = FLEXI_J16GE ? $user->getAuthorisedViewLevels() : (int) $user->get('aid');
$itemmodel = FLEXI_J16GE ? new FlexicontentModelItem() : new FlexicontentModelItems();
for ($i = 0; $i < count($result); $i++) {
$data[$i] = array();
JFactory::$application = $siteapp;
$item = $itemmodel->getItem($result[$i]['id'], $check_view_access = false);
list($item) = FlexicontentFields::getFields($item, '', $item->parameters, $aid);
JFactory::$application = $adminapp;
$data[$i]['link'] = FlexicontentHelperRoute::getItemRoute($item->id, $item->catid);
foreach ($item->fields as $k => $field) {
$data[$i][$k] = FlexicontentFields::getFieldDisplay($item, $k, $values = null, $method = 'display');
}
}
JFactory::$application = $adminapp;
return $data;
}
示例11: if
</div>
<!-- EOF afterdescription block -->
<?php endif; ?>
<?php if (($this->params->get('show_tags', 1)) || ($this->params->get('show_category', 1))) : ?>
<!-- BOF item categories, tags -->
<div class="itemadditionnal group">
<?php if ($this->params->get('show_category', 1)) : ?>
<span class="categories">
<?php FlexicontentFields::getFieldDisplay($item, 'categories', $values=null, $method='display'); ?>
<span class="flexi label"><?php echo $this->fields['categories']->label; ?></span>
<span class="flexi value"><?php echo $this->fields['categories']->display; ?></span>
</span>
<?php endif; ?>
<?php FlexicontentFields::getFieldDisplay($item, 'tags', $values=null, $method='display'); ?>
<?php if ($this->params->get('show_tags', 1) && $this->fields['tags']->display) : ?>
<span class="tags">
<span class="flexi label"><?php echo $this->fields['tags']->label; ?></span>
<span class="flexi value"><?php echo $this->fields['tags']->display; ?></span>
</span>
<?php endif; ?>
</div>
<!-- EOF item categories, tags -->
<?php endif; ?>
<?php if ($this->params->get('comments') && !JRequest::getVar('print')) : ?>
<!-- BOF comments -->
<div class="comments group">
<?php
if ($this->params->get('comments') == 1) :