{include file="$gentemplates/$header_tpl"}
<div class="qa_main">
<h2 class="float_left">{$lang.section.blog}</h2>
<div class="float_right"">				
	<!-- AddThis Button BEGIN -->
	<div class="addthis_toolbox addthis_default_style">
	<a href="http://www.addthis.com/bookmark.php?v=250&amp;username=xa-4b69d5eb1f2c8cb0" class="addthis_button_compact">Share</a>
	<span class="addthis_separator">|</span>
	<a class="addthis_button_facebook"></a>
	<a class="addthis_button_myspace"></a>
	<a class="addthis_button_google"></a>
	<a class="addthis_button_twitter"></a>
	</div>
	<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4b69d5eb1f2c8cb0"></script>
	<!-- AddThis Button END -->
</div>
<p>&nbsp;</p>					
{*if $form.err && $form.inactive ne '1'}
	<p class="error_msg">*&nbsp;{$form.err}</p>
{/if*}
	
{include file="$gentemplates/blog_menu.tpl"}
			
{if $form.inactive eq '1'}
	<p class="error_msg">*&nbsp;{$form.err}</p>
{else}
	{if $form.blog_page ne '3'}
		<!--</div>-->
		<h3 class="p-b5">
			{if $form.blog_page eq '4'}{$lang.blog.blog_in_category} {$form.category_name}{else}{$blog_info.title}{/if}
			{if $form.is_user eq 1}
				<ins class="addfav-icon sub_icon" title="{$lang.blog.blog_menu_3}" onclick="javascript: location='{$site_root}/{$seo.blog}?sel=post'">&nbsp;</ins>
			{/if}	
			{if $form.is_user eq '1'}
				<ins style="{$default_right}: 35px;" class="delete-icon sub_icon" onclick="launchWindow('{$site_root}/{$seo.blog}','sel=del_blog_popup&id_blog={$blog_info.id}',500,200); return false;" title="{$lang.blog.delete_blog}">&nbsp;</ins>
				<ins style="{$default_right}: 70px;" class="edit-icon sub_icon" onclick="javascript: location='{$site_root}/{$seo.blog}?sel=edit_blog&id_blog={$blog_info.id}'" title="{$lang.blog.edit_blog}">&nbsp;</ins>
			{/if}
			{if $form.blog_page eq '4'}
				<ins style="{$default_right}: {if $form.is_user eq '1'}105{else}0{/if}px;" onclick="javascript:location.href='{$site_root}/{$seo.blog_all}';" class="blog-icon sub_icon" title="{$lang.blog.to_categories_list}">&nbsp;</ins>
			{/if}
		</h3>
	{/if}
    {if $blog ne 'empty' and $form.blog_page eq '4'}
        {include file="$gentemplates/pagination_top.tpl"}
		{section name=p loop=$blog}
        <div class="float_left" style="margin-top: 20px; width: 100%;">
            <div class="float_left" style="width: 120px;">
				<div class="float_left" style="margin-bottom: 5px;">
                    <a class="imgcanvas_container" href="{$blog[p].profile_link}" target="_blank">
    					<img src="{$blog[p].icon_path}" class="imgcanvas" alt="">
    				</a>
                </div>
                <a class="float_left" href="{$blog[p].profile_link}">{$blog[p].name}</a>						
			</div>
            <div>
				<div style="overflow:hidden;">
                <div class="float_left" style="margin-bottom: 10px;"><h3><a href="{$site_root}/blog.php?sel=view_user&id_blog={$blog[p].id}">{$blog[p].title}</a></h3></div>	
				
					<div class="float_right sharing soc">
						<table>
							<tr>{if $use_blog_sharing_tools_2}
								{literal}
								<td width="136">
									<a target="_blank" class="mrc__plugin_uber_like_button" href="http://connect.mail.ru/share" data-mrc-config="{'nt' : '1', 'cm' : '1', 'ck' : '1', 'sz' : '20', 'st' : '3'}">
										{/literal}{$lang.button.send}{literal}
									</a>
									<script src="http://cdn.connect.mail.ru/js/loader.js" type="text/javascript" charset="UTF-8"></script>
								</td>
								<td>
									<div style="padding-right: 8px;">
										<script type="text/javascript">
										var vk_text = "{/literal}{$lang.button.like}{literal}";
										<!--
										document.write(VK.Share.button(false,{type: "button", text: vk_text}));
										--></script>
									</div>
								</td>
								{/literal}
								{/if}
								{if $use_blog_sharing_tools_1}
								<td>
									<div class="fb-like" data-href="{$blog_posts[p].comments_link}" data-send="false" data-layout="button_count" data-width="150" data-show-faces="false"></div>
								</td>
								<td>
									<a href="https://twitter.com/share" class="twitter-share-button" data-url="{$blog_posts[p].comments_link}" data-count="horizontal" data-text="{$forum[f].subject}" data-via="" data-lang="en"></a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
								</td>
								<td>
									<span class="g">
										<g:plusone href="{$blog_posts[p].comments_link}"></g:plusone>
									</span>
								</td>
							{/if}
							</tr>
						</table>
					</div>
					
				</div>
                <div style="float:none;margin-bottom: 7px; height: 75px; overflow: hidden;"><div class="wysiwyg_content">{$blog[p].description}</div></div>    
                <div>{$lang.section.blog_create}:&nbsp;{$blog[p].date}</div>
            </div>	
        </div>
        {/section}
	{elseif $blog_posts ne 'empty'}
		{include file="$gentemplates/pagination_top.tpl"}
		{section name=p loop=$blog_posts}
			<div style="overflow:hidden;" id="{$blog_posts[p].id}">
			{if ($blog_posts[p].show eq 0 && $blog_info.is_user eq 1) || ($blog_posts[p].show eq 1)}			
				{if $form.blog_page eq 3 || $form.blog_page eq 4}
					<div class="float_left" style="width: 120px;">
						<a class="imgcanvas_container" href="{$blog_posts[p].profile_link}" target="_blank">
							<img src="{$blog_posts[p].comment_icon}" class="imgcanvas" alt="">
						</a>
					</div>
				{/if}
				<div class="float_left" style="width: {if $form.blog_page eq 3 || $form.blog_page eq 4}599px{else}100%{/if};">
					<div class="float_left">
						<h4>
							{if $form.blog_page eq 3}
								{$lang.blog.post_title}: <a href="{$blog_posts[p].add_comments_link}">{$blog_posts[p].title}</a>
							{else}
								<a href="{$blog_posts[p].add_comments_link}">{$blog_posts[p].title}</a>
							{/if}
						</h4>
						<p style="overflow:hidden;">
							{if $form.blog_page eq 3}
								<font class="float_left">{$lang.blog.post_author}:&nbsp;</font>
								<a href="{$blog_posts[p].profile_link}" class="float_left" target="_blank">{$blog_posts[p].name}</a>
							{else}
								{if $blog_posts[p].login}
									<font class="float_left">{$lang.blog.post_author}:&nbsp;</font>
									<a class="float_left" href="{$blog_posts[p].profile_link}">{$blog_posts[p].name}</a>
								{/if}
							{/if}
						</p>
						<p class="text_hidden" style="overflow:hidden;">
							<font class="float_left">{$lang.blog.posted_at}&nbsp;</font>
							<font class="float_left">{$blog_posts[p].creation_date}&nbsp;&nbsp;</font>
							<font class="float_left">{$blog_posts[p].creation_time}</font>
							{if $blog_posts[p].is_hidden eq 1}<font class="float_left">&nbsp;&nbsp;&nbsp;{$lang.blog.hidden_post}</font>{/if}
						</p>
					</div>		
					
					<div class="float_right sharing soc">						
						<table>
							<tr>{if $use_blog_sharing_tools_2}
								<td width="136">
									<a target="_blank" class="mrc__plugin_uber_like_button" href="http://connect.mail.ru/share" data-mrc-config="{literal}{'nt' : '1', 'cm' : '1', 'ck' : '1', 'sz' : '20', 'st' : '3'}{/literal}">
										{$lang.button.send}
									</a>
									<script src="http://cdn.connect.mail.ru/js/loader.js" type="text/javascript" charset="UTF-8"></script>
								</td>
								<td>
									<div style="padding-right: 8px;">
										<script type="text/javascript">
										var vk_text = "{$lang.button.like}";
										<!--
										document.write(VK.Share.button(false,{literal}{type: "button", text: vk_text}{/literal}));
										--></script>
									</div>
								</td>
								{/if}
								{if $use_blog_sharing_tools_1}
								<td>
									<div class="fb-like" data-href="{$blog_posts[p].add_comments_link}" data-send="false" data-layout="button_count" data-width="150" data-show-faces="false"></div>
								</td>
								<td>
									<a href="https://twitter.com/share" class="twitter-share-button" data-url="{$blog_posts[p].add_comments_link}" data-count="horizontal" data-text="{$blog_posts[p].title}" data-via="" data-lang="en"></a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
								</td>
								<td>
									<span class="g">
										<g:plusone href="{$blog_posts[p].add_comments_link}"></g:plusone>
									</span>
								</td>
							{/if}
							</tr>
						</table>						
					</div>
					
					<div class="blog_body">
						<div class="wysiwyg_content">{$blog_posts[p].body}</div>
						<p>
							{if $blog_posts[p].comments_count}
								<a href="{$blog_posts[p].comments_link}">{$blog_posts[p].comments_count} {$lang.blog.comments}</a>
							{else}
								<font class="text_hidden">{$lang.blog.no_comment}</font>
							{/if}
							&nbsp;&nbsp;
							{if $blog_posts[p].can_comment eq '1' || $blog_posts[p].is_user eq 1}|&nbsp;&nbsp;
								<a href="{$blog_posts[p].add_comments_link}">{$lang.blog.add_comment}</a>
							{/if}
							{if $form.blog_page eq 3}&nbsp;										
							{else}
								{if $blog_posts[p].is_user eq '1'}
									&nbsp;&nbsp;|&nbsp;&nbsp;
									<a href="#" onclick="javascript: location='{$blog_posts[p].edit_link}'" title="{$lang.blog.edit_post}" alt="{$lang.blog.edit_post}">{$lang.blog.edit_post}</a>&nbsp;&nbsp;|&nbsp;&nbsp;
									<a href="#" onclick="javascript: location='{$blog_posts[p].delete_link}'" title="{$lang.blog.delete_post}" alt="{$lang.blog.delete_post}">{$lang.blog.delete_post}</a>
								{/if}
							{/if}
						</p>
					</div>
				</div>
			{/if}
			</div>
			<p>&nbsp;</p>
		{/section}
	{else}
		<p class="error_msg">
			{if $form.blog_page eq '3'}{$lang.blog.no_friends}{elseif $form.blog_page eq '4'}{$lang.blog.there_are_no_post}{else}{$lang.blog.you_have_no_post}{/if}
		</p>
	{/if}
					
{/if}
{include file="$gentemplates/pagination_bottom.tpl"}
				
</div>
<script type="text/javascript">
{literal}
$(document).ready(function() {
	$("#close_popup").live("click", function(e){
						e.preventDefault();
						$('#mask').hide();
						$('.window').hide();
					})
});
{/literal}
</script>
{include file="$gentemplates/$footer_tpl"}