<?php } ?> <h2 class="basicnews-title"> <a title="<?php echo $items->title; ?> " target="<?php echo $options->item_link_target; ?> " href="<?php echo $items->link; ?> "><?php echo YTools::truncate($items->title, $options->item_title_max_characs); ?> </a> </h2> <?php if ($options->item_desc_display == 1) { ?> <p class="basicnews-desc"><?php echo Ytools::truncate($items->description, $options->item_desc_max_characs); ?> </p> <?php } ?>
public function itemImages($item){ $_images4 = array(); if (is_int($item)){ $item = $this->getItem($item); } if (!isset($this->_images4[$item->id])){ $this->_images4[$item->id] = array(); // image extract if (strpos($item->images, '{')!==false || strpos($item->images, '[')!==false){ $json = json_decode($item->images, true); if (isset($json['image_intro'])){ if (YTools::isUrl($json['image_intro']) || file_exists($json['image_intro'])){ array_push($this->_images4[$item->id], $json['image_intro']); } } if (isset($json['image_fulltext'])){ if (YTools::isUrl($json['image_fulltext']) || file_exists($json['image_fulltext'])){ array_push($this->_images4[$item->id], $json['image_fulltext']); } } } if (!isset($item->image_extracted)){ $item_images = YTools::extractImages($item->introtext); $item->image_extracted = true; } if (isset($item_images) && count($item_images)){ // get first exists image foreach ($item_images as $i => $image_url) { if (YTools::isUrl($image_url) || file_exists($image_url)){ array_push($this->_images4[$item->id], $image_url); } } } } return $this->_images4[$item->id]; }
} ?> </div> <?php } // description display ?> </div> <?php if ((int) $params->get('item_readmore_display', 1)) { ?> <div class="item-readmore"> <a href="<?php echo $item['link']; ?> " <?php echo YTools::parseTarget($params->get('item_link_target')); ?> > <?php echo $params->get('item_readmore_text', 'Read mored'); ?> </a> </div> <?php } // readmore display ?> </div>
<?php /** * @package Sj Basic News * @version 2.5 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL * @copyright (c) 2012 YouTech Company. All Rights Reserved. * @author YouTech Company http://www.smartaddons.com * */ defined('_JEXEC') or die; defined('DS') or define('DS', DIRECTORY_SEPARATOR); defined('_YTOOLS') or (include_once 'core' . DS . 'sjimport.php'); // set current module for working YTools::setModule($module); YTools::stylesheet('style.css'); include_once "core" . DS . 'helper.php'; $layout_name = $params->get('layout') ? $params->get('layout') : 'default'; $cacheid = md5(serialize(array($layout_name, $module->module))); $cacheparams = new stdClass(); $cacheparams->cachemode = 'id'; $cacheparams->class = 'sj_basic_new_helper'; $cacheparams->method = 'getList'; $cacheparams->methodparams = array($params, $module); $cacheparams->modeparams = $cacheid; $list = JModuleHelper::moduleCache($module, $params, $cacheparams); include JModuleHelper::getLayoutPath($module->module, $layout_name);
if ($options->show_main_image == 1) { ?> <li class="normal-image" style="float: right; margin-left: 3px; margin-top:5px; padding:0 0; background:none"> <a href="<?php echo $options->link_normal_image ? $item['link'] : "#"; ?> " target = "<?php echo $options->target; ?> " style="background: none !important; text-transform: none;"><img src="<?php if ($options->item_thumbnail_mode == 'none') { echo $item['thumb']; } else { echo YTools::resize($item['thumb'], $options->small_thumb_width, $options->small_thumb_height, $options->item_thumbnail_mode); } ?> " title="<?php echo Ytools::truncate($item['title'], $options->limittitle); ?> " border="none" alt="<?php echo Ytools::truncate($item['title'], $options->limittitle); ?> " width="<?php echo $options->small_thumb_width; ?> px;" height="<?php echo $options->small_thumb_height; ?> px"/></a>
<img src="<?php echo $tip['item']['image_urls']; ?> " alt="<?php echo $tip['item']['title']; ?> " <?php echo $tooltip_image_style; ?> /> </div> <?php } ?> <div class="yt_item_description"><?php echo YTools::truncate($tip['item']['description'], $options->item_description_max_characters); ?> </div> </div> </div> </div> <?php } ?> </div> <?php } if (!empty($options->posttext)) { ?> <div class="yt_footertext" <?php echo $mod_style_width;
?> "> <?php if ($options->item_image_linkable == 1) { ?> <a href="<?php echo $item['link']; ?> " target="<?php echo $options->item_link_target; ?> "><?php } ?> <img src="<?php echo YTools::resize($item['image'], $image_config); ?> " title="<?php echo $item['title']; ?> " alt="<?php echo $item['title']; ?> " height="<?php echo $options->item_image_height; ?> px" width="<?php echo $options->item_image_width; ?> px"/> <?php
public function getItemMultiImage(&$item, $params) { if (is_int($item)) { $item =& $this->getItem($item); } $elements = isset($params['media_elements']) ? trim($params['media_elements']) : 'image'; if (!isset($this->_images4[$item->id])) { $this->_images4[$item->id] = array(); if (!isset($item->app)) { // set application refer $item->app =& $this->_getZooApplication(); is_string($item->params) && ($item->params = $item->app->parameter->create($item->params)); is_string($item->elements) && ($item->elements = $item->app->data->create($item->elements)); } $media_elements = $this->_parseValues($elements); // $media_elements['_current'] = count($media_elements); $item_elements = $item->getElements(); if ($item_elements) { foreach ($item_elements as $element) { $element_class = get_class($element); $eclass_suffix = substr($element_class, 7); $eclass_suffix = strtolower($eclass_suffix); if (array_key_exists($eclass_suffix, $media_elements)) { if (!is_array($media_elements[$eclass_suffix])) { $media_elements[$eclass_suffix] = array(); } if ($element->hasValue('file')) { $tmp_url = $element->get('file'); if (YTools::isUrl($tmp_url) || file_exists($tmp_url)) { array_push($media_elements[$eclass_suffix], $tmp_url); } } } } foreach ($media_elements as $element_images) { if (is_array($element_images) && count($element_images)) { foreach ($element_images as $i => $image_url) { array_push($this->_images4[$item->id], $element_images[$i]); } } } } if ($this->getItemDescription($item, $params)) { $inline_images = YTools::extractImages($item->description); if (!empty($inline_images)) { foreach ($inline_images as $i => $image_url) { if (YTools::isUrl($image_url) || file_exists($image_url)) { array_push($this->_images4[$item->id], $inline_images[$i]); } } } } } return $this->_images4[$item->id]; }
/** * Resize image * @param string $image - Image true path * @param int $width - resize to this width * @param int $height = resize to this height. If null, fit image by 'width'. * @param string $mode - Resize mode * @param int $image_type - IMAGETYPE_PNG, IMAGETYPE_GIF, ... */ static function resize($image, $width, $height, $mode = 'stretch', $image_type = null) { // YTools::dump( func_get_args() ); // var_dump($image,$width, $height, $mode='stretch', $image_type );die; $config = array(); if (isset($mode)) { $config['function'] = 'resize_' . $mode; } if (isset($image_type)) { $config['output_image_type'] = $image_type; } return parent::resize($image, $width, $height, $config); }
public function getOutputCache(){ //if (is_null($this->outputCache)){ $this->outputCache = YTools::getModuleCache(); //} return $this->outputCache; }
public function itemImages(&$item) { if (is_int($item)) { $item = $this->getItem($item); } if (!isset($this->_images4[$item->id])) { $this->_images4[$item->id] = array(); // image extract if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'src' . DS . md5("Image" . $item->id) . '.jpg')) { array_push($this->_images4[$item->id], 'media/k2/items/src/' . md5("Image" . $item->id) . '.jpg'); } if (!isset($item->image_extracted)) { $item_images = YTools::extractImages($item->description); $item->image_extracted = true; } if (isset($item_images) && count($item_images)) { // get first exists image foreach ($item_images as $i => $image_url) { if (YTools::isUrl($image_url) || file_exists($image_url)) { array_push($this->_images4[$item->id], $image_url); } } } } return $this->_images4[$item->id]; }
</div> <script type="text/javascript"> //<![CDATA[ $jsmart(document).ready(function($){ $('<?php echo "#{$uniqueid}"; ?> ').jsmart_moduletabs({ sj_module: '<?php echo YTools::getModule()->module; ?> ', sj_module_id: '<?php echo YTools::getModule()->id; ?> ', ajax_url : '<?php echo JURI::current(); ?> ', ajaxUpdate: function(element, options){ var loading = $('.ajax_loading', element); if (loading.length){ // show ajax indicator var category_id = $(element).attr('title').replace('sj_module_2load:', ''); ajax_options = { sj_module_2load: category_id, sj_module_id: options.sj_module_id,