%PDF- %PDF-
| Direktori : /home/bitrix/www/local/templates/UB/components/bitrix/blog.blog/.default/ |
| Current File : //home/bitrix/www/local/templates/UB/components/bitrix/blog.blog/.default/template.php |
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?
if(count($arResult["POST"])>0)
{
?><!--noindex--><?
foreach($arResult["POST"] as $ind => $CurPost)
{
?>
<article class="post hentry" id="blg-post-<?=$CurPost["ID"]?>">
<header class="post-header">
<h3 class="content-title"><?=$CurPost["TITLE"]?></h3>
<?if ($arParams["SHOW_RATING"] == "Y"):?>
<div class="blog-post-rating rating_vote_graphic">
<?
$APPLICATION->IncludeComponent(
"bitrix:rating.vote", $arParams["RATING_TYPE"],
Array(
"ENTITY_TYPE_ID" => "BLOG_POST",
"ENTITY_ID" => $CurPost["ID"],
"OWNER_ID" => $CurPost["arUser"]["ID"],
"USER_VOTE" => $arResult["RATING"][$CurPost["ID"]]["USER_VOTE"],
"USER_HAS_VOTED" => $arResult["RATING"][$CurPost["ID"]]["USER_HAS_VOTED"],
"TOTAL_VOTES" => $arResult["RATING"][$CurPost["ID"]]["TOTAL_VOTES"],
"TOTAL_POSITIVE_VOTES" => $arResult["RATING"][$CurPost["ID"]]["TOTAL_POSITIVE_VOTES"],
"TOTAL_NEGATIVE_VOTES" => $arResult["RATING"][$CurPost["ID"]]["TOTAL_NEGATIVE_VOTES"],
"TOTAL_VALUE" => $arResult["RATING"][$CurPost["ID"]]["TOTAL_VALUE"],
"PATH_TO_USER_PROFILE" => $arParams["~PATH_TO_USER"],
),
$component,
array("HIDE_ICONS" => "Y")
);?>
</div>
<?endif;?>
<div class="blog-entry-meta">
<div class="blog-entry-meta-date">
<i class="fa fa-clock-o"></i>
<span class="blog-entry-meta-date-month"><?=$CurPost["DATE_PUBLISH_DATE"]?></span>
</div>
<?
if(!empty($CurPost["CATEGORY"]))
{
?>
<div class="blog-entry-meta-tags">
<i class="fa fa-tags"></i>
<noindex>
<?
echo "<span>".GetMessage("BLOG_BLOG_BLOG_CATEGORY")."</span>";
$i=0;
foreach($CurPost["CATEGORY"] as $v) {
if($i!=0) echo ",";
?> <a href="<?=$v["urlToCategory"]?>" rel="nofollow"><?=$v["NAME"]?></a><?
$i++;
}
?>
</noindex>
</div>
<?
}
?>
<?if($CurPost["ENABLE_COMMENTS"] == "Y"):?>
<div class="blog-entry-meta-comments">
<i class="fa fa-comments"></i>
<a href="<?=$CurPost["urlToPost"]?>#comments" class="blog-entry-meta-comments">
<?=GetMessage("BLOG_BLOG_BLOG_COMMENTS")?> <?=IntVal($CurPost["NUM_COMMENTS"]);?>
</a>
</div>
<?endif;?>
<div class="blog-entry-meta-like">
<?if ($arParams["SHOW_RATING"] == "Y"):?>
<?
$APPLICATION->IncludeComponent(
"bitrix:rating.vote", $arParams["RATING_TYPE"],
Array(
"ENTITY_TYPE_ID" => "BLOG_POST",
"ENTITY_ID" => $CurPost["ID"],
"OWNER_ID" => $CurPost["arUser"]["ID"],
"USER_VOTE" => $arResult["RATING"][$CurPost["ID"]]["USER_VOTE"],
"USER_HAS_VOTED" => $arResult["RATING"][$CurPost["ID"]]["USER_HAS_VOTED"],
"TOTAL_VOTES" => $arResult["RATING"][$CurPost["ID"]]["TOTAL_VOTES"],
"TOTAL_POSITIVE_VOTES" => $arResult["RATING"][$CurPost["ID"]]["TOTAL_POSITIVE_VOTES"],
"TOTAL_NEGATIVE_VOTES" => $arResult["RATING"][$CurPost["ID"]]["TOTAL_NEGATIVE_VOTES"],
"TOTAL_VALUE" => $arResult["RATING"][$CurPost["ID"]]["TOTAL_VALUE"],
"PATH_TO_USER_PROFILE" => $arParams["~PATH_TO_USER"],
),
$component,
array("HIDE_ICONS" => "Y")
);?>
<?endif;?>
</div>
</div>
</header>
<div class="post-content" id="post-cut-content-<?=$CurPost["ID"]?>">
<?=$CurPost["TEXT_FORMATED"]?>
<?if(!empty($CurPost["arImages"]))
{
foreach($CurPost["arImages"] as $val)
{
?><span><img src="<?=$val["small"]?>" alt="" border="0" data-bx-image="<?=$val["full"]?>"></span><?
}
}?>
</div>
<?
if ($CurPost["CUT"] == "Y")
{
?>
<div class="post-content" id="post-body-content-<?=$CurPost["ID"]?>" data-load="N" style="display: none;"></div>
<div class="blog-divider-profile">
<div class="blog-divider-profile-more" id="blog-more-show-<?=$CurPost["ID"]?>"><a href="javascript:void(0)"
onclick="loadPostBody('<?=$arResult['BLOG']['URL']?>','<?=$CurPost["ID"]?>')"><i class="fa fa-chevron-circle-down"></i></a></div>
<div class="blog-divider-profile-more" id="blog-more-hide-<?=$CurPost["ID"]?>" style="display: none"><a href="javascript:void(0)"
onclick="hidePostBody('<?=$CurPost["ID"]?>')"><i class="fa fa-chevron-circle-up"></i></a></div>
</div>
<?
}
else
{
?><div class="blog-divider-profile"></div><?
}
?>
</article>
<?
}
?>
<!--/noindex-->
<div style="padding-top:15px; float:right;">
<a href="<?=str_replace('#blog#', $arResult['BLOG']['URL'], $arParams['PATH_TO_BLOG'])?>" class="btn-small btn-color"><?=GetMessage("READ_THE_ENTIRE_BLOG")?></a>
</div>
<?
}
?>
<script type="text/javascript">
function hidePostBody(post) {
$('#post-body-content-'+post).hide();
$('#blog-more-hide-'+post).hide();
$('#post-cut-content-'+post).show()
$('#blog-more-show-'+post).show();
}
function loadPostBody(blog,post)
{
if ($('#post-body-content-'+post).attr('data-load')=='N') {
BX.ajax({
url: '/local/components/UB/ub.ajax.get_post_body/ajax.php?blog='+blog+'&post_id='+post,
method: 'GET',
dataType: 'html',
emulateOnload: true,
start: true,
cache: false,
onsuccess: function(data){
$('#post-body-content-'+post).attr('data-load','Y');
$('#post-body-content-'+post).html(data);
$('#post-cut-content-'+post).hide()
$('#blog-more-show-'+post).hide();
$('#post-body-content-'+post).show();
$('#blog-more-hide-'+post).show();
}
});
}
else {
$('#post-cut-content-'+post).hide()
$('#blog-more-show-'+post).hide();
$('#post-body-content-'+post).show();
$('#blog-more-hide-'+post).show();
}
}
</script>