Загрузка данных
<?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
// Create shortcuts to some parameters.
$params = $this->item->params;
$images = json_decode($this->item->images);
$urls = json_decode($this->item->urls);
$canEdit = $params->get('access-edit');
$user = JFactory::getUser();
$info = $params->get('info_block_position', 0);
JLoader::register('fieldattach', 'components/com_fieldsattach/helpers/fieldattach.php');
JLoader::register('imagemaker', 'templates/probel/html/imagemaker.php');
JLoader::register('geturbisfield', 'templates/probel/html/getfielder.php');
$aparttit = '';
$aparttit = geturbisfield::fieldvalue($this->item->id, 5, false);
$topordown = fieldattach::getValue($this->item->id, 9, false);
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
if($this->item->catid == 60) $doc->addStyleSheet($this->baseurl.'/templates/probel/css/stylewtb.css');
$settit = '';
if(!isset($doc->_metaTags['name']['browser_title'])){
$doc->setTitle($this->item->title . ' | ' . $app->get('sitename'));
$globalDesc = $app->get('MetaDesc');
if ($doc->getDescription() == '' || $doc->getDescription() == $globalDesc) {
$cleanText = strip_tags($this->item->text);
$cleanText = str_replace(array("\r", "\n", "\t"), ' ', $cleanText);
$cleanText = trim(preg_replace('/\s+/', ' ', $cleanText));
// 1. Берем кусок чуть больше лимита
$tempDesc = mb_substr($cleanText, 0, 155);
// 2. Обрезаем по последнему пробелу, чтобы не рвать слова
$finalDesc = mb_substr($tempDesc, 0, mb_strrpos($tempDesc, ' '));
// 3. Добавляем аккуратную концовку
$doc->setDescription($finalDesc . '... Подробности на ' . $app->get('sitename'));
}
$settit = $this->item->category_title . ': ' . $this->item->title;
} else {
$settit = $doc->_metaTags['name']['browser_title'];
};
/*
$desc = $doc->getDescription();
$desc = str_ireplace('{YEAR}', date('Y'),$desc);
$doc->setDescription($desc);
*/
?>
<section id="single-item" class="item-page products-area <?php echo $this->pageclass_sfx?>">
<?php if ($params->get('show_title')) : ?>
<div class="row">
<div class="col-sm-12">
<div class="section-title">
<h1 class="<?php echo $this->pageclass_sfx?>"><?php echo str_ireplace('|', '<br />', $this->item->title); ?></h1>
<?php if($params->get('show_publish_date')){
echo '<small>'.date('d/m/Y', strtotime($this->item->created)).' | <span class="fa fa-eye"></span> '.$this->item->hits.' просмотров</small>';
}
?>
</div>
</div>
</div>
<?php endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<div class="row">
<div class="col-md-12 itemgallery <?php echo $this->pageclass_sfx?>">
<?php
$mainimage = imagemaker::makeimage($this->item->id, 950, 550, 'realimage', $this->item->title);
$dopfoto = imagemaker::makeimage($this->item->id, 950, 620, 'gallery', $this->item->title);
$bigimage = imagemaker::makeimage($this->item->id, 600, 350, 2, $this->item->title);
if(!empty($mainimage)){
$document = JFactory::getDocument();
$document->addCustomTag('<meta property="og:type" content="article" />');
$document->addCustomTag('<meta property="og:title" content="'.$settit.'" />');
$document->addCustomTag('<meta property="og:image" content="'.JURI::base().$mainimage.'" />');
// $document->addCustomTag('<meta property="og:image:width" content="250" />');
// $document->addCustomTag('<meta property="og:image:height" content="250" />');
$document->addCustomTag('<meta property="og:description" content="'.$document->getDescription().'" />');
$document->addCustomTag('<meta name="twitter:card" content="summary_large_image" />');
$document->addCustomTag('<meta name="twitter:description" content="'.$document->getDescription().'" />');
$document->addCustomTag('<meta name="twitter:title" content="'.$settit.'" />');
$document->addCustomTag('<meta name="twitter:image" content="'.JURI::base().$mainimage.'" />');
}
if(!empty($mainimage) && $topordown != '4' && $topordown != '1' && $topordown != '3'){ ?>
<div id="singleimage" class="singleblogimage">
<a class="popup-image" href="<?php echo $mainimage;?>">
<img src="<?php echo $mainimage;?>" /></a>
</div>
<?php }
if($topordown == '1' ){
if(!empty($dopfoto)){ ?>
<div class="itemgallery <?php echo $this->pageclass_sfx?>">
<?php echo $dopfoto;?>
<div class="clear"><br/></div>
</div>
<?php }
}
?>
<div class="datanews">
<?php
/*
$this->item->text = str_ireplace('2024 г', date('Y').' г',$this->item->text);
$this->item->text = str_ireplace('2025 г', date('Y').' г',$this->item->text);
$this->item->text = str_ireplace('2026 г', date('Y').' г',$this->item->text);
$this->item->text = str_ireplace('2027 г', date('Y').' г',$this->item->text);
$this->item->text = str_ireplace('2024 г', date('Y').' г',$this->item->text);
$this->item->text = str_ireplace('2025 г', date('Y').' г',$this->item->text);
$this->item->text = str_ireplace('2026 г', date('Y').' г',$this->item->text);
$this->item->text = str_ireplace('2027 г', date('Y').' г',$this->item->text);
*/
echo $this->item->text; ?>
</div>
<?php if (isset ($this->item->toc)) : ?>
<?php echo $this->item->toc; ?>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayContent; ?>
</div>
<?php
if($topordown != '4' && $topordown != '1' ){
if(!empty($dopfoto)){ ?>
<div class="col-md-12 itemgallery <?php echo $this->pageclass_sfx?>">
<?php echo $dopfoto;?>
</div>
<?php }
}
?>
<?php $map = fieldattach::getFieldValue($this->item->id, 5, false);
if(!empty($map)) { ?>
<div class="col-md-12 <?php echo $this->pageclass_sfx?>">
<div class="itemmap">
<?php echo $map; ?>
</div>
</div>
<?php } ?>
<?php if($this->item->catid != '4'){ ?>
<div class="col-md-12">
<hr>
<p class="greycolor">Поделись с друзьями!</p>
<script src="https://yastatic.net/es5-shims/0.0.2/es5-shims.min.js"></script>
<script src="https://yastatic.net/share2/share.js"></script>
<div class="ya-share2" data-size="m" data-services="collections,vkontakte,facebook,odnoklassniki,twitter,linkedin,viber,whatsapp,telegram"></div>
<p class="greycolor hidden-xs"><br/>Обнаружили ошибку? Выделите текст и нажмите Ctrl + Enter<br/></p>
</div>
<?php } ?>
<?php
// читайте также ///////////////////////////////////
$infra = fieldattach::getValue($this->item->id, 118, false);
if(empty($infra)) {
$db = JFactory::getDBO();
$query = '';
$ctid= $this->item->catid;
if($ctid == '375' || $ctid == '290') {
$query = 'SELECT * FROM #__content WHERE state = 1 AND catid = '.$this->item->catid.' ORDER BY created DESC LIMIT 11';
$db->setQuery( $query );
$result = $db->loadObjectList();
}
elseif($ctid == '346' || $ctid == '348' || $ctid == '362' || $ctid == '363' || $ctid == '364' || $ctid == '365' || $ctid == '366' || $ctid == '368') {
$query = 'SELECT * FROM #__content WHERE state = 1 AND catid = '.$this->item->catid.' ORDER BY RAND() LIMIT 11';
$db->setQuery( $query );
$result = $db->loadObjectList();
}
if(!empty($result)){
// Кнопка "Следующая статья" (pagination) удалена отсюда, чтобы не мешать вовлечению
echo '<div class="clear"></div>';
?>
<div class="col-md-12 products-area lookmore-area">
<h3><span>Вам также понравится:</span></h3>
<div class="katslide-list">
<?php
foreach ($result as $item) {
$itemimage = '';
$itemimage = imagemaker::makeimage($item->id, 460, 345, 3, $item->title);
$item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->id, $item->catid));
if(!empty($itemimage) && $item->id != $this->item->id){
?>
<div class="slidereadmore">
<div class="insideitem equalhi">
<div class="katitemimage">
<a href="<?php echo $item->link;?>">
<?php echo $itemimage;?>
</a>
</div>
<div class="katitemtext">
<div class="itemtitle itemtitlebidder">
<a href="<?php echo $item->link;?>"><?php echo $item->title;?></a>
</div>
</div>
</div>
</div>
<?php }
}
?>
</div>
</div>
<?php
echo '</div>';
/////////////////////////////////////////
}
} elseif(!empty($infra)) {
// Кнопка "Следующая статья" удалена и из альтернативного вывода
?>
<div class="clear"></div>
<div class="subregionz">
<?php echo '<div class="col-md-12"><h3>Вам также понравится:</h3></div>';
$relatedarr = array();
$relatedarr = explode(',', $infra);
$relatedarr = array_reverse($relatedarr);
$num = 0;
echo '<div class="col-md-12">';
foreach ($relatedarr as $ids){
$num++;
$article = JTable::getInstance("content");
$article->load($ids);
$infraitem = $article;
$infralink = JRoute::_(ContentHelperRoute::getArticleRoute($infraitem->id, $infraitem->catid));
echo '<div class="tag-item col-md-12 col-sm-12 col-xs-12">';
echo '<a href="'.$infralink.'">'.$infraitem->title.'</a></div>';
}
?>
</div>
</div>
<?php }
// читайте также ///////////////////////////////////
?>
<?php
// МИГРАЦИЯ БАННЕРА ТУРОВ НА САМЫЙ НИЗ СТРАНИЦЫ
if($this->item->catid != '4'){
JModelLegacy::addIncludePath(JPATH_ROOT . '/components/com_banners/models', 'BannersModel');
JLoader::register('BannerHelper', JPATH_ROOT . '/components/com_banners/helpers/banner.php');
$model = JModelLegacy::getInstance('Banners', 'BannersModel', array('ignore_request' => true));
$model->setState('filter.client_id', 0);
$model->setState('filter.category_id', 385);
$model->setState('list.limit', 1);
$model->setState('list.start', 0);
$model->setState('filter.ordering', 'random');
$banners = $model->getItems();
if ($banners){
$model->impress();
if(isset($banners[0]) && !empty($banners[0])){
$this->banner = $banners[0];
$this->setLayout('banners');
echo '<div class="col-md-12">'.$this->loadTemplate().'</div>';
}
}
}
?>
<?php if($this->item->catid != '4'){ ?>
<div class="col-md-12">
<?php
jimport('joomla.application.module.helper');
$modules = JModuleHelper::getModules('reklamny-blok-niz');
foreach ($modules as $module) {
echo JModuleHelper::renderModule($module);
}
?>
</div>
<?php } ?>
</div>
</section>
<div class="clear"><br/></div>
<?php
$userId = JFactory::getUser()->get('id');
if(!$user->get('guest')){ ?>
<style>
.hidewhenlogin{
display: none !important;
}
</style>
<?php } ?>
<?php
if($this->item->id == 8151){
if($userId && !$user->get('guest')){
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
$customFields = FieldsHelper::getFields('com_users.user', $user, true);
?>
<div class="modal fade" id="callprava" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Заказать платный пакет</h4>
</div>
<div class="modal-body">
<div class="formholder metalform">
<form method="post" action="#" class="webforms" enctype="multipart/form-data">
<div class="formholder">
<h4 class="pockettitle"></h4>
<p><?php echo $user->name;?></p>
<hr style="border-color: #ccc;">
<?php /*
<div xmlns="http://www.w3.org/1999/xhtml" class="line">
<div class="name">Наименование организации, УНП:</div>
<input type="text" name="data-tovar" placeholder="" class="input"></input></div>
*/ ?>
<input type="hidden" name="data-tovar" value="Запрос платного пакета от <?php echo $user->name.' ('.$user->email.')';?>">
<div xmlns="http://www.w3.org/1999/xhtml" class="line required">
<div class="name">Контактное лицо:</div>
<input type="text" name="data-imya" value="<?php echo $customFields[1]->value;?>" placeholder="" class="input"></input></div>
<div xmlns="http://www.w3.org/1999/xhtml" class="line required">
<div class="name">Контактный телефон:</div>
<input type="text" name="data-telefon" placeholder="" value="<?php echo $customFields[2]->value;?>" class="input telbox"></input></div>
<div xmlns="http://www.w3.org/1999/xhtml" class="line required">
<div class="name">Электронная почта:</div>
<input type="text" name="data-mail" placeholder="" value="<?php echo $user->email;?>" class="input"></input></div>
<br/>
<br/>
<input type="hidden" name="data-comment" class="data-comment" value="">
<input type="hidden" name="data-stranica" class="data-stranica" value="">
<input type="hidden" name="data-tema" class="data-tema" value="Купить платный пакет">
<div class="submit"><button type="submit" class="button subbutton btn btn-primary">ОТПРАВИТЬ</button></div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php } else echo '<style>.hidewhenlogout{display: none !important;}</style>';
}
?>
<style>.hidewhenlogout{display: none !important;}</style>