<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<div id="blog-posts-content">
<?
if(!empty($arResult["OK_MESSAGE"]))
{
	?>
	<div class="alert alert-block">
				<?
				foreach($arResult["OK_MESSAGE"] as $v)
				{
					?>
					<?=$v?><br />
					<?
				}
				?>
	</div>
	<?
}
if(!empty($arResult["MESSAGE"]))
{
	?>
	<div class="alert alert-block">
				<?
				foreach($arResult["MESSAGE"] as $v)
				{
					?>
					<?=$v?><br />
					<?
				}
				?>
	</div>
	<?
}
if(!empty($arResult["ERROR_MESSAGE"]))
{
	?>
	<div class="alert alert-block">
				<?
				foreach($arResult["ERROR_MESSAGE"] as $v)
				{
					?>
					<?=$v?><br />
					<?
				}
				?>
	</div>
	<?
}
if(count($arResult["POST"])>0)
{?><div class="media-group"><?
	foreach($arResult["POST"] as $ind => $CurPost)
	{
		$className = "blog-post";
		if($ind == 0)
			$className .= " blog-post-first";
		elseif(($ind+1) == count($arResult["POST"]))
			$className .= " blog-post-last";
		if($ind%2 == 0)
			$className .= " blog-post-alt";
		$className .= " blog-post-year-".$CurPost["DATE_PUBLISH_Y"];
		$className .= " blog-post-month-".IntVal($CurPost["DATE_PUBLISH_M"]);
		$className .= " blog-post-day-".IntVal($CurPost["DATE_PUBLISH_D"]);
		?>
			<div class="media">
				<div class="media-body">
					<h4 class="media-heading"><a href="<?=$CurPost["urlToPost"]?>" title="<?=$CurPost["TITLE"]?>"><?echo $CurPost["TITLE"]; ?></a></h4>
					<p class="date"><?=$CurPost["DATE_PUBLISH_FORMATED"]?></p>
					<?=$CurPost["TEXT_FORMATED"]?>
					<?
					if ($CurPost["CUT"] == "Y")
					{
						?><p><a class="blog-postmore-link" href="<?=$CurPost["urlToPost"]?>"><?=GetMessage("BLOG_BLOG_BLOG_MORE")?></a></p><?
					}
					?>
				</div>
			</div>
		<?
	}?>
	</div>
	<?if(strlen($arResult["NAV_STRING"])>0):?>
		<?echo $arResult["NAV_STRING"];?>
	<?endif?><?
}
elseif(!empty($arResult["BLOG"]))
	echo GetMessage("BLOG_BLOG_BLOG_NO_AVAIBLE_MES");
	
?>	
</div>