| Current Path : /home/purehotels/public_html/templates/purehotels/html/com_k2/Campaigns/ |
| Current File : /home/purehotels/public_html/templates/purehotels/html/com_k2/Campaigns/category_item.php |
<?php
/**
* @version 2.6.x
* @package K2
* @author JoomlaWorks http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2014 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined('_JEXEC') or die;
// Define default image size (do not change)
K2HelperUtilities::setDefaultImage($this->item, 'itemlist', $this->params);
$gallery ='';
$json = 'media/k2/gallerychamp/item'.$this->item->id.'/ordering.json';
if(file_exists($json)){
$ordering = json_decode(file_get_contents($json));
$ordering = $ordering->ordering;
$gallery = $ordering;
}
if (strlen($gallery[0])){
$image = new JImage('media/k2/gallerychamp/item'.$this->item->id.'/main/'.$gallery[0]);
$image = $image->createThumbs('500x375', JImage::CROP_RESIZE)[0]->getPath();
}
$imageEmpty = new JImage('modules/mod_pure_frontpage/images/box_empty.jpg');
$imageEmpty = $imageEmpty->createThumbs('500x375', JImage::CROP_RESIZE)[0]->getPath();
$k2obj = new K2ModelItem();
$fields = $k2obj->getItemExtraFields($this->item->extra_fields, $this->item);
?>
<div class="grid-item">
<a id="<?php echo $this->item->alias; ?>" href="#data-<?php echo $this->item->alias; ?>">
<div class="relative">
<?php if ( strlen($image) ): ?>
<img src="<?php echo $image; ?>" alt="" width="100%" class="image">
<?php else: ?>
<img src="<?php echo $imageEmpty; ?>" alt="" width="100%" class="image">
<?php endif; ?>
<div class="hotel"><?php echo str_replace(' ', '<br>', $fields[0]->value); ?></div>
<div class="title">
<?php echo $this->item->title; ?>
</div>
<div class="text">
<?php echo $this->item->introtext; ?>
</div>
</div>
</a>
<div style="display:none">
<div id="data-<?php echo $this->item->alias; ?>">
<div class="title"> <?php echo $this->item->title; ?> </div>
<?php if ( strlen($image) ): ?>
<img src="<?php echo $image; ?>" alt="" width="100%" class="image">
<?php else: ?>
<img src="<?php echo $imageEmpty; ?>" alt="" width="100%" class="image">
<?php endif; ?>
<div class="text">
<?php echo $this->item->introtext; ?>
<?php echo $this->item->fulltext; ?>
</div>
</div>
</div>
<script type="text/javascript">
jQuery("a#<?php echo $this->item->alias; ?>").fancybox({
closeClick: false,
autoDimensions: true,
showCloseButton: true,
autoSize: false,
width: '500',
});
</script>
</div>