            <?php foreach($newsArray as $news): ?>
            
               <div class="item col-md-12 panel">
                   <div class="row title-wraper">
                       <div class="col-md-9 tittle"><h4><a href="<?php echo $news['link']; ?>" target="_blank"><?php echo $news['title'];?></a></h4></div>
                       <div class="col-md-3 date-wrap"><div class="list-group date-ls"><div class="list-group-item list-group-item-warning text-center"><span class="date"><?php echo $news['timestamp']['date']; ?> </span> <span class="badge time"><?php echo $news['timestamp']['time']; ?></span></div></div></div>
                   </div>
                   <div class="row">
                       <div class="col-md-2 image pag">
                           <img class="img-responsive  main-img" src="<?php 
                                 if(isset($news['img']) && !empty($news['img'])){
                                    echo (sizeof($news['img'])%2 == 0)? $news['img'][1] : $news['img'][0];
                                 }else echo "http://static.bbci.co.uk/frameworks/barlesque/2.64.0/desktop/3.5/img/blq-blocks_grey_alpha.png";
                           ?>">
                           <div class="spoiler">
                               <div class="spoiler-btn text-center">
                                   <span class="glyphicon glyphicon-eye-open"></span>
                                   <span class="glyphicon glyphicon-arrow-right"></span>
                                   <span class="glyphicon glyphicon-picture"></span>
                               </div>
                               <div class="spoiler-body collapse text-center">
                               <?php for($i=0; $i<sizeof($news['img']); $i++): ?>
                                   <a href="<?php echo $news['img'][$i]; ?>" target="_blank" >
                                    <img class="small" src="<?php echo $news['img'][$i]; ?>">
                                   </a>
                                <?php endfor; ?>   
                               </div>
                           </div>
                       </div>
                       <div class="col-md-10 full-text">
                            <div class="description"><p><?php echo $news['description']; ?></p><hr /></div>
                            <div class="text"><?php echo html_entity_decode($news['full_text']); ?></div>
                            <div class="category text-center col-xs-12">
                                <?php
                               
                                $delim = (sizeof($news['category']) > 1)? ", " : ""; 
                                foreach($news['category'] as $category): 
                                ?>
                                    <?php echo $category.$delim; ?>
                                <?php endforeach; ?>
                            </div>
                       </div>
                   </div>
               </div>
               <?php endforeach; ?>