<div class="container-home">
<h3 class="recent-articles heading_all_sections_top">
	<span>
		<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                                      <g id="Group_281" data-name="Group 281" transform="translate(1123 2420)">
                                        <g id="Document_Align_Left_16" data-name="Document Align Left 16" transform="translate(-1123 -2420)">
                                          <path id="Path_48" data-name="Path 48" d="M3,13c0,3.75,0,5.625.955,6.939a5,5,0,0,0,1.106,1.106C6.375,22,8.25,22,12,22s5.625,0,6.939-.955a5,5,0,0,0,1.106-1.106C21,18.625,21,16.75,21,13V11c0-.839,0-1.584-.011-2.25h-.07A12.414,12.414,0,0,1,19.1,8.679a5.75,5.75,0,0,1-4.78-4.78,12.408,12.408,0,0,1-.071-1.819v-.07C13.584,2,12.839,2,12,2c-3.75,0-5.625,0-6.939.955A5,5,0,0,0,3.955,4.061C3,5.375,3,7.25,3,11ZM8,7.25a.75.75,0,0,0,0,1.5h3a.75.75,0,0,0,0-1.5Zm0,4a.75.75,0,0,0,0,1.5h8a.75.75,0,0,0,0-1.5Zm0,4a.75.75,0,0,0,0,1.5h3a.75.75,0,0,0,0-1.5Z" fill="currentColor" fill-rule="evenodd"></path>
                                          <path id="Path_49" data-name="Path 49" d="M19.335,7.2a11.514,11.514,0,0,0,1.6.052,5.836,5.836,0,0,0-.89-3.189,5,5,0,0,0-1.106-1.106,5.835,5.835,0,0,0-3.189-.89,11.518,11.518,0,0,0,.052,1.6A4.25,4.25,0,0,0,19.335,7.2Z" fill="currentColor"></path>
                                        </g>
                                        <rect id="Rectangle_315" data-name="Rectangle 315" width="24" height="24" transform="translate(-1123 -2420)" fill="none"></rect>
                                      </g>
                                    </svg>
		{{LANG recent_articles}}
	</span>
	<?php if ($pt->config->all_create_articles == 'on') { ?>
		<a href="{{LINK create_article}}" class="btn btn-main pull-right" data-load="?link1=create_article">{{LANG create_article}} </a>
	<?php } ?>
</h3>
<div class="row marg">
<div class="col-md-7">
	<div class="box_light_black">
		<div class="subscriptions-list author-list articles-container">
			<div class="">
				<div class="wrapper_articles_all">
				{{POSTS}}
				</div>
			</div>
		</div>
		<?php if ($pt->posts_count > 0) { ?>
			<div class="watch-video-show-more desc" data-type="articles" onclick="PT_LoadPost('{{CATEGORY}}',this);">
             {{LANG show_more}}
			</div>
		<?php } ?>
	</div>
</div>
<div class="col-md-5">
	<div class="article-categories box_light_black">
		<div class="width-100">
			<form class="form search-articles-form" method="post" action="">
				<div class="form-group">
					<input type="text" class="form-control" placeholder="{{LANG search_articles}}" name="q">
					<button type="submit">
						<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>
					</button>
				</div>
			</form>
		</div>

		<h5 class="article_he">{{LANG categories}}</h5>
		<div class="pt_categories">
			<ul>
				<?php foreach ($pt->categories as $cat_id => $category): ?>
					<?php $count = $db->where('category',$cat_id)->getValue(T_POSTS,'COUNT(*)') ?>
					<li class="<?php echo(($pt->category == $cat_id) ? 'active' : '') ?>">
						<a href="<?php echo PT_Link("articles/category/$cat_id") ?>"  data-load="?link1=articles&category_id=<?php echo($cat_id) ?>">
							<span><?php echo $category; ?></span>
							<span class="count_number"><?php echo($count) ?></span>
						</a>
					</li>
				<?php endforeach; ?>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="ads-placment">{{WATCH_SIDEBAR_AD}}</div>
		<br>
		
		<h4>{{LANG most_popular}}</h4>
		<div>
			{{POPULAR_POSTS}}
			<div class="clear"></div>
		</div>
	</div>  
</div>
</div>
</div>

<script>
   jQuery(document).ready(function($) {
      $('.search-articles-form').submit(function(event) {
         var query = $(this).find('input').val();
         if (!query){
            $(this).find('input').addClass('danger-field-border');
            return false;
         }
         else if(query.length > 50){
            $(this).find('input').addClass('danger-field-border');
            return false;
         }
      });
   });
</script>