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


PHP flexicontent_html::extractimagesrc方法代码示例

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


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

示例1: if

			<?php echo $markup_tags; ?>
			
			<?php if ( $header_shown ) : ?>
			</header>
			<?php endif; ?>


			<?php 
			if ($this->params->get('intro_use_image', 1)) :
				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] );
				else :
					$src = flexicontent_html::extractimagesrc($item);
				endif;
					
				$RESIZE_FLAG = !$this->params->get('intro_image') || !$this->params->get('intro_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		= '&amp;w=' . $this->params->get('intro_width', 200);
					$h		= '&amp;h=' . $this->params->get('intro_height', 200);
					$aoe	= '&amp;aoe=1';
					$q		= '&amp;q=95';
					$zc		= $this->params->get('intro_method') ? '&amp;zc=' . $this->params->get('intro_method') : '';
					$ext = pathinfo($src, PATHINFO_EXTENSION);
					$f = in_array( $ext, array('png', 'ico', 'gif') ) ? '&amp;f='.$ext : '';
					$conf	= $w . $h . $aoe . $q . $zc . $f;
					
					$base_url = (!preg_match("#^http|^https|^ftp|^/#i", $src)) ?  JURI::base(true).'/' : '';
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:category_items_html5.php

示例2: 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::_('index.php?option=com_flexicontent&view=flexicontent&rootcat=' . (int) $params->get('rootcat', FLEXI_J16GE ? 1 : 0));
     JRequest::setVar('limit', $params->get('feed_limit'));
     // Force a specific limit, this will be moved to the model
     $cats = $this->get('Feed');
     //$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_image_source = $params->get('feed_image_source', '');
     $feed_link_image = $params->get('feed_link_image', 1);
     $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[$image_size];
         $img_field_name = $image_dbdata->name;
     }
     foreach ($cats as $cat) {
         // strip html from feed item title
         $title = $this->escape($cat->title);
         $title = html_entity_decode($title);
         // url link to article
         // & used instead of &amp; as this is converted by feed creator
         $link = JRoute::_(FlexicontentHelperRoute::getCategoryRoute($cat->slug));
         // strip html from feed item description text
         $description = $cat->description;
         //$feed_summary ? $cat->description : '';
         $description = flexicontent_html::striptagsandcut($description, $feed_summary_cut);
         if ($feed_use_image) {
             // feed image is enabled
             // Get some variables
             $joomla_image_path = $app->getCfg('image_path', FLEXI_J16GE ? '' : 'images' . DS . 'stories');
             $joomla_image_url = str_replace(DS, '/', $joomla_image_path);
             $joomla_image_path = $joomla_image_path ? $joomla_image_path . DS : '';
             $joomla_image_url = $joomla_image_url ? $joomla_image_url . '/' : '';
             // **************
             // CATEGORY IMAGE
             // **************
             // category image params
             $show_cat_image = $params->get('show_description_image', 0);
             // we use different name for variable
             $cat_image_source = $params->get('cat_image_source', 2);
             // 0: extract, 1: use param, 2: use both
             $cat_link_image = $params->get('cat_link_image', 1);
             $cat_image_method = $params->get('cat_image_method', 1);
             $cat_image_width = $params->get('cat_image_width', 80);
             $cat_image_height = $params->get('cat_image_height', 80);
             $cat =& $category;
             $thumb = "";
             if ($cat->id && $show_cat_image) {
                 $cat->image = FLEXI_J16GE ? $params->get('image') : $cat->image;
                 $thumb = "";
                 $cat->introtext =& $cat->description;
                 $cat->fulltext = "";
                 if ($cat_image_source && $cat->image && JFile::exists(JPATH_SITE . DS . $joomla_image_path . $cat->image)) {
                     $src = JURI::base(true) . "/" . $joomla_image_url . $cat->image;
                     $h = '&amp;h=' . $cat_image_height;
                     $w = '&amp;w=' . $cat_image_width;
                     $aoe = '&amp;aoe=1';
                     $q = '&amp;q=95';
                     $zc = $cat_image_method ? '&amp;zc=' . $cat_image_method : '';
                     $ext = pathinfo($src, PATHINFO_EXTENSION);
                     $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
                     $conf = $w . $h . $aoe . $q . $zc . $f;
                     $thumb = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $src . $conf;
                 } else {
                     if ($cat_image_source != 1 && ($src = flexicontent_html::extractimagesrc($cat))) {
                         $h = '&amp;h=' . $feed_image_height;
                         $w = '&amp;w=' . $feed_image_width;
                         $aoe = '&amp;aoe=1';
                         $q = '&amp;q=95';
                         $zc = $feed_image_method ? '&amp;zc=' . $feed_image_method : '';
                         $ext = pathinfo($src, PATHINFO_EXTENSION);
                         $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
                         $conf = $w . $h . $aoe . $q . $zc . $f;
                         $base_url = !preg_match("#^http|^https|^ftp|^/#i", $src) ? JURI::base(true) . '/' : '';
                         $src = $base_url . $src;
                         $thumb = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $src . $conf;
                     }
                 }
             }
             if ($thumb) {
                 $description = "<a href='" . $link . "'><img src='" . $thumb . "' alt='" . $title . "' title='" . $title . "' align='left'/></a><p>" . $description . "</p>";
             }
//.........这里部分代码省略.........
开发者ID:noxidsoft,项目名称:flexicontent-cck,代码行数:101,代码来源:view.feed.php

示例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 &amp; 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 = '&amp;h=' . $feed_image_height;
                 $w = '&amp;w=' . $feed_image_width;
                 $aoe = '&amp;aoe=1';
                 $q = '&amp;q=95';
                 $zc = $feed_image_method ? '&amp;zc=' . $feed_image_method : '';
                 $ext = pathinfo($src, PATHINFO_EXTENSION);
                 $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;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
//.........这里部分代码省略.........
开发者ID:jakesyl,项目名称:flexicontent,代码行数:101,代码来源:view.feed.php

示例4: str_replace

		
		
		
		<?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 = '&amp;w=' . $this->params->get('fcr_width', 200);
            $h = '&amp;h=' . $this->params->get('fcr_height', 200);
            $aoe = '&amp;aoe=1';
            $q = '&amp;q=95';
            $zc = $this->params->get('fcr_method') ? '&amp;zc=' . $this->params->get('fcr_method') : '';
            $ext = strtolower(pathinfo($src, PATHINFO_EXTENSION));
            $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;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 {
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:28,代码来源:default_results.php

示例5: getCatThumb

 function getCatThumb(&$cat, &$params, $uprefix = 'cat', $rprefix = 'nav')
 {
     if (empty($cat->id) || !$params->get($uprefix . '_use_image', 1)) {
         return '';
     }
     // Joomla media folder
     $app = JFactory::getApplication();
     $joomla_image_path = $app->getCfg('image_path', FLEXI_J16GE ? '' : 'images' . DS . 'stories');
     $joomla_image_url = str_replace(DS, '/', $joomla_image_path);
     $joomla_image_path = $joomla_image_path ? $joomla_image_path . DS : '';
     $joomla_image_url = $joomla_image_url ? $joomla_image_url . '/' : '';
     $cat_image_source = $params->get($uprefix . '_image_source');
     $cat->image = $cat->parameters->get('image');
     $image_src = "";
     $cat->introtext =& $cat->description;
     $cat->fulltext = "";
     if ($cat_image_source && $cat->image && JFile::exists(JPATH_SITE . DS . $joomla_image_path . $cat->image)) {
         $src = JURI::base(true) . "/" . $joomla_image_url . $cat->image;
         $w = '&amp;w=' . $params->get($rprefix . '_width', 200);
         $h = '&amp;h=' . $params->get($rprefix . '_height', 200);
         $aoe = '&amp;aoe=1';
         $q = '&amp;q=95';
         $zc = $params->get($rprefix . '_method') ? '&amp;zc=' . $params->get($rprefix . '_method') : '';
         $ext = strtolower(pathinfo($src, PATHINFO_EXTENSION));
         $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
         $conf = $w . $h . $aoe . $q . $zc . $f;
         $image_src = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $src . $conf;
     } else {
         if ($cat_image_source != 1 && ($src = flexicontent_html::extractimagesrc($cat))) {
             // 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 = '&amp;w=' . $params->get($rprefix . '_width', 200);
             $h = '&amp;h=' . $params->get($rprefix . '_height', 200);
             $aoe = '&amp;aoe=1';
             $q = '&amp;q=95';
             $zc = $params->get($rprefix . '_method') ? '&amp;zc=' . $params->get($rprefix . '_method') : '';
             $ext = strtolower(pathinfo($src, PATHINFO_EXTENSION));
             $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
             $conf = $w . $h . $aoe . $q . $zc . $f;
             $base_url = !preg_match("#^http|^https|^ftp|^/#i", $src) ? JURI::base(true) . '/' : '';
             $image_src = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $base_url . $src . $conf;
         }
     }
     $cat->image_src = $image_src;
     return $image_src;
 }
开发者ID:nettdotkomm,项目名称:flexicontent-cck,代码行数:45,代码来源:fcpagenav.php

示例6: getCategoryData


//.........这里部分代码省略.........
         }
         if ($cid) {
             $cids = array($cid);
         }
     }
     if (empty($cids)) {
         $catconf = new stdClass();
         // Check if using a dynamic set of categories, that was decided by getItems()
         $dynamic_cids = $params->get('dynamic_catids', false);
         $static_cids = $params->get('catids', array());
         $cids = $dynamic_cids ? unserialize($dynamic_cids) : $static_cids;
         $cids = !is_array($cids) ? array($cids) : $cids;
         $catconf->orderby = $params->get('cats_orderby', 'alpha');
         $catconf->showtitle = $params->get('cats_showtitle', 0);
         $catconf->showdescr = $params->get('cats_showdescr', 0);
         $catconf->cuttitle = (int) $params->get('cats_cuttitle', 40);
         $catconf->cutdescr = (int) $params->get('cats_cutdescr', 200);
         $catconf->link_title = $params->get('cats_link_title');
         $catconf->show_image = $params->get('cats_show_image');
         $catconf->image_source = $params->get('cats_image_source');
         $catconf->link_image = $params->get('cats_link_image');
         $catconf->image_width = (int) $params->get('cats_image_width', 80);
         $catconf->image_height = (int) $params->get('cats_image_height', 80);
         $catconf->image_method = (int) $params->get('cats_image_method', 1);
         $catconf->show_default_image = (int) $params->get('cats_show_default_image', 0);
         // parameter not added yet
         $catconf->readmore = (int) $params->get('cats_readmore', 1);
     }
     if (empty($cids) || !count($cids)) {
         return false;
     }
     // initialize variables
     $orderby = '';
     if ($catconf->orderby) {
         $orderby = flexicontent_db::buildCatOrderBy($params, $catconf->orderby, $request_var = '', $config_param = '', $cat_tbl_alias = 'c', $user_tbl_alias = 'u', $default_order = '', $default_order_dir = '');
     }
     $query = 'SELECT c.id, c.title, c.description, c.params ' . (FLEXI_J16GE ? '' : ', c.image ') . ', CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as categoryslug' . ' FROM #__categories AS c' . (FLEXI_J16GE ? ' LEFT JOIN #__users AS u ON u.id = c.created_user_id' : '') . ' WHERE c.id IN (' . implode(',', $cids) . ')' . $orderby;
     $db->setQuery($query);
     $catdata_arr = $db->loadObjectList('id');
     if ($db->getErrorNum()) {
         JFactory::getApplication()->enqueueMessage(__FUNCTION__ . '(): SQL QUERY ERROR:<br/>' . nl2br($db->getErrorMsg()), 'error');
     }
     if (!$catdata_arr) {
         return false;
     }
     $joomla_image_path = $app->getCfg('image_path', FLEXI_J16GE ? '' : 'images' . DS . 'stories');
     foreach ($catdata_arr as $i => $catdata) {
         $catdata->params = new JRegistry($catdata->params);
         // Category Title
         $catdata->title = flexicontent_html::striptagsandcut($catdata->title, $catconf->cuttitle);
         $catdata->showtitle = $catconf->showtitle;
         // Category image
         $catdata->image = FLEXI_J16GE ? $catdata->params->get('image') : $catdata->image;
         $catimage = "";
         if ($catconf->show_image) {
             $catdata->introtext =& $catdata->description;
             $catdata->fulltext = "";
             if ($catconf->image_source && $catdata->image && JFile::exists(JPATH_SITE . DS . $joomla_image_path . DS . $catdata->image)) {
                 $src = JURI::base(true) . "/" . $joomla_image_path . "/" . $catdata->image;
                 $h = '&amp;h=' . $catconf->image_height;
                 $w = '&amp;w=' . $catconf->image_width;
                 $aoe = '&amp;aoe=1';
                 $q = '&amp;q=95';
                 $zc = $catconf->image_method ? '&amp;zc=' . $catconf->image_method : '';
                 $ext = strtolower(pathinfo($src, PATHINFO_EXTENSION));
                 $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
                 $conf = $w . $h . $aoe . $q . $zc . $f;
                 $catimage = JURI::base() . 'components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $src . $conf;
             } else {
                 if ($catconf->image_source != 1 && ($src = flexicontent_html::extractimagesrc($catdata))) {
                     $h = '&amp;h=' . $catconf->image_height;
                     $w = '&amp;w=' . $catconf->image_width;
                     $aoe = '&amp;aoe=1';
                     $q = '&amp;q=95';
                     $zc = $catconf->image_method ? '&amp;zc=' . $catconf->image_method : '';
                     $ext = strtolower(pathinfo($src, PATHINFO_EXTENSION));
                     $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
                     $conf = $w . $h . $aoe . $q . $zc . $f;
                     $base_url = !preg_match("#^http|^https|^ftp|^/#i", $src) ? JURI::base(true) . '/' : '';
                     $catimage = JURI::base() . 'components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $base_url . $src . $conf;
                 }
             }
             $catdata->image = $catimage;
         }
         // Category Description
         if (!$catconf->showdescr) {
             unset($catdata->description);
         } else {
             $catdata->description = flexicontent_html::striptagsandcut($catdata->description, $catconf->cutdescr);
         }
         // Category Links (title and image links)
         if ($catconf->link_title || $catconf->link_image || $catconf->readmore) {
             $catlink = JRoute::_(FlexicontentHelperRoute::getCategoryRoute($catdata->categoryslug));
             $catdata->titlelink = $catlink;
             $catdata->imagelink = $catlink;
         }
         $catdata->conf = $catconf;
     }
     return $catdata_arr;
 }
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:101,代码来源:helper.php

示例7: display


//.........这里部分代码省略.........
     $joomla_image_url = $joomla_image_url ? $joomla_image_url . '/' : '';
     // **************
     // CATEGORY IMAGE
     // **************
     // category image params
     $show_cat_image = $params->get('show_description_image', 0);
     // we use different name for variable
     $cat_image_source = $params->get('cat_image_source', 2);
     // 0: extract, 1: use param, 2: use both
     $cat_link_image = $params->get('cat_link_image', 1);
     $cat_image_method = $params->get('cat_image_method', 1);
     $cat_image_width = $params->get('cat_image_width', 80);
     $cat_image_height = $params->get('cat_image_height', 80);
     $cat = $category;
     $image = "";
     if ($cat) {
         if ($cat->id && $show_cat_image) {
             $cat->image = FLEXI_J16GE ? $params->get('image') : $cat->image;
             $image = "";
             $cat->introtext =& $cat->description;
             $cat->fulltext = "";
             if ($cat_image_source && $cat->image && JFile::exists(JPATH_SITE . DS . $joomla_image_path . $cat->image)) {
                 $src = JURI::base(true) . "/" . $joomla_image_url . $cat->image;
                 $h = '&amp;h=' . $cat_image_height;
                 $w = '&amp;w=' . $cat_image_width;
                 $aoe = '&amp;aoe=1';
                 $q = '&amp;q=95';
                 $zc = $cat_image_method ? '&amp;zc=' . $cat_image_method : '';
                 $ext = pathinfo($src, PATHINFO_EXTENSION);
                 $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
                 $conf = $w . $h . $aoe . $q . $zc . $f;
                 $image = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $src . $conf;
             } else {
                 if ($cat_image_source != 1 && ($src = flexicontent_html::extractimagesrc($cat))) {
                     $h = '&amp;h=' . $cat_image_height;
                     $w = '&amp;w=' . $cat_image_width;
                     $aoe = '&amp;aoe=1';
                     $q = '&amp;q=95';
                     $zc = $cat_image_method ? '&amp;zc=' . $cat_image_method : '';
                     $ext = pathinfo($src, PATHINFO_EXTENSION);
                     $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
                     $conf = $w . $h . $aoe . $q . $zc . $f;
                     $base_url = !preg_match("#^http|^https|^ftp|^/#i", $src) ? JURI::base(true) . '/' : '';
                     $src = $base_url . $src;
                     $image = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $src . $conf;
                 }
             }
             $cat->image_src = @$src;
             // Also add image category URL for developers
             if ($image) {
                 $image = '<img class="fccat_image" src="' . $image . '" alt="' . $this->escape($cat->title) . '" title="' . $this->escape($cat->title) . '"/>';
             } else {
                 //$image = '<div class="fccat_image" style="height:'.$cat_image_height.'px;width:'.$cat_image_width.'px;" ></div>';
             }
             if ($cat_link_image && $image) {
                 $image = '<a href="' . JRoute::_(FlexicontentHelperRoute::getCategoryRoute($cat->slug)) . '">' . $image . '</a>';
             }
         }
         $cat->image = $image;
     }
     // ******************************
     // SUBCATEGORIES (some templates)
     // ******************************
     // sub-category image params
     $show_cat_image = $params->get('show_description_image_subcat', 1);
     // we use different name for variable
开发者ID:jakesyl,项目名称:flexicontent,代码行数:67,代码来源:view.html.php

示例8: pathinfo

 if ($show_subcat_image) {
     $subcat->introtext =& $subcat->description;
     $subcat->fulltext = "";
     if ($subcat_image_source && $subcat->image && JFile::exists(JPATH_SITE . DS . $joomla_image_path . $subcat->image)) {
         $src = JURI::base(true) . "/" . $joomla_image_url . $subcat->image;
         $h = '&amp;h=' . $subcat_image_height;
         $w = '&amp;w=' . $subcat_image_width;
         $aoe = '&amp;aoe=1';
         $q = '&amp;q=95';
         $zc = $subcat_image_method ? '&amp;zc=' . $subcat_image_method : '';
         $ext = pathinfo($src, PATHINFO_EXTENSION);
         $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
         $conf = $w . $h . $aoe . $q . $zc . $f;
         $image = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $src . $conf;
     } else {
         if ($subcat_image_source != 1 && ($src = flexicontent_html::extractimagesrc($subcat))) {
             $h = '&amp;h=' . $subcat_image_height;
             $w = '&amp;w=' . $subcat_image_width;
             $aoe = '&amp;aoe=1';
             $q = '&amp;q=95';
             $zc = $subcat_image_method ? '&amp;zc=' . $subcat_image_method : '';
             $ext = pathinfo($src, PATHINFO_EXTENSION);
             $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
             $conf = $w . $h . $aoe . $q . $zc . $f;
             $base_url = !preg_match("#^http|^https|^ftp|^/#i", $src) ? JURI::base(true) . '/' : '';
             $image = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $base_url . $src . $conf;
         }
     }
     if ($image) {
         $image = '<img class="fcsubcat_image" src="' . $image . '" alt="' . $this->escape($subcat->title) . '" title="' . $this->escape($subcat->title) . '"/>';
     } else {
开发者ID:jakesyl,项目名称:flexicontent,代码行数:31,代码来源:default_categories.php

示例9: display


//.........这里部分代码省略.........
     $cat_default_image = $params->get('cat_default_image', '');
     if ($show_cat_image) {
         $h = '&amp;h=' . $cat_image_height;
         $w = '&amp;w=' . $cat_image_width;
         $aoe = '&amp;aoe=1';
         $q = '&amp;q=95';
         $zc = $cat_image_method ? '&amp;zc=' . $cat_image_method : '';
     }
     if ($cat_default_image) {
         $src = $this->baseurl . "/" . $joomla_image_url . $cat_default_image;
         $ext = strtolower(pathinfo($src, PATHINFO_EXTENSION));
         $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
         $conf = $w . $h . $aoe . $q . $zc . $f;
         $default_image = $phpThumbURL . $src . $conf;
         $default_image = '<img class="fccat_image" style="float:' . $cat_image_float . '" src="' . $default_image . '" alt="%s" title="%s"/>';
     } else {
         $default_image = '';
     }
     // Create category image/description/etc data
     $cat = $category;
     $image = "";
     if ($cat) {
         if ($cat->id && $show_cat_image) {
             $cat->image = $params->get('image');
             $cat->introtext =& $cat->description;
             $cat->fulltext = "";
             if ($cat_image_source && $cat->image && JFile::exists(JPATH_SITE . DS . $joomla_image_path . $cat->image)) {
                 $src = $this->baseurl . "/" . $joomla_image_url . $cat->image;
                 $ext = strtolower(pathinfo($src, PATHINFO_EXTENSION));
                 $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
                 $conf = $w . $h . $aoe . $q . $zc . $f;
                 $image = $phpThumbURL . $src . $conf;
             } else {
                 if ($cat_image_source != 1 && ($src = flexicontent_html::extractimagesrc($cat))) {
                     $ext = strtolower(pathinfo($src, PATHINFO_EXTENSION));
                     $f = in_array($ext, array('png', 'ico', 'gif')) ? '&amp;f=' . $ext : '';
                     $conf = $w . $h . $aoe . $q . $zc . $f;
                     $base_url = !preg_match("#^http|^https|^ftp|^/#i", $src) ? $this->baseurl . '/' : '';
                     $src = $base_url . $src;
                     $image = $phpThumbURL . $src . $conf;
                 }
             }
             $cat->image_src = @$src;
             // Also add image category URL for developers
             if ($image) {
                 $image = '<img class="fccat_image" src="' . $image . '" alt="' . $this->escape($cat->title) . '" title="' . $this->escape($cat->title) . '"/>';
             } else {
                 if ($default_image) {
                     $image = sprintf($default_image, $cat->title, $cat->title);
                 }
             }
             if ($cat_link_image && $image) {
                 $image = '<a href="' . JRoute::_(FlexicontentHelperRoute::getCategoryRoute($cat->slug)) . '">' . $image . '</a>';
             }
         }
         $cat->image = $image;
     }
     // ******************************
     // SUBCATEGORIES (some templates)
     // ******************************
     // sub-category image params
     $show_cat_image = $params->get('show_description_image_subcat', 1);
     // we use different name for variable
     $cat_image_source = $params->get('subcat_image_source', 2);
     // 0: extract, 1: use param, 2: use both
     $cat_link_image = $params->get('subcat_link_image', 1);
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:67,代码来源:view.html.php


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