| Current Path : /home/purehotels/www/templates/purehotels/html/com_k2/Press/ |
| Current File : /home/purehotels/www/templates/purehotels/html/com_k2/Press/category.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;
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('id', 'alias', 'title', 'introtext', 'fulltext')));
$query->from($db->quoteName('#__k2_items'));
$query->where($db->quoteName('id') . ' = '. $db->quote(83));
$db->setQuery($query);
$press = $db->loadObject();
$gallery ='';
$json = 'media/k2/gallerychamp/item'.$press->id.'/ordering.json';
if(file_exists($json)){
$ordering = json_decode(file_get_contents($json));
$ordering = $ordering->ordering;
$gallery = $ordering;
}
?>
<article class="article article-1">
<?php if ( count($gallery) == 1 ): ?>
<div class="main-image">
<?php
$image = new JImage('media/k2/gallerychamp/item'.$press->id.'/main/'.$gallery[0]);
$image = $image->createThumbs('1100x400', JImage::CROP_RESIZE)[0]->getPath();
?>
<img src="<?php echo $image; ?>" alt="" width="100%">
<div class="image-bottom-tag"></div>
</div>
<?php endif; ?>
<div class="content">
<h2 class="title"><?php echo $press->title; ?></h2>
<div class="pressContact">
<?php echo $press->introtext; ?>
</div>
<?php if((isset($this->leading) || isset($this->primary) || isset($this->secondary) || isset($this->links)) && (count($this->leading) || count($this->primary) || count($this->secondary) || count($this->links))): ?>
<div class="pressItems">
<?php if(isset($this->leading) && count($this->leading)): ?>
<?php foreach($this->leading as $key=>$item): ?>
<?php
$this->item=$item;
echo $this->loadTemplate('item');
?>
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php endif; ?>
<!-- Pagination -->
<?php if($this->pagination->getPagesLinks()): ?>
<div class="k2Pagination">
<?php if($this->params->get('catPagination')) echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
</div>
</article>