<? global $lang;?>
<div class="col-12 col-sm-4">
  <div class="article-entry">
    <? $this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );?>
    <div class="entry">
      <a href="/<? if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() ) echo \S::get_session( 'current-lang' ) . '/';?><?= $url;?>" title="<?= $this -> article['language']['title'];?>"  <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>>
        <? if ( file_exists( substr( $img = \front\factory\Articles::get_image( $this -> article ), 1, strlen( $img ) ) ) ):?><img src="<?= $img;?>" alt="" /><? endif;?>
      </a>
    </div>
    <?
      if ( $this -> article['show_date_add'] )
        echo '<div class="date-add">' . ucfirst( $lang['data-dodania'] ) . ': ' . date( 'H:i d/m/Y', strtotime( $this -> article['date_add'] ) ) . '</div>';

      if ( $this -> article['show_date_modify'] )
        echo '<div class="date-add">' . ucfirst( $lang['data-modyfikacji'] ) . ': ' . date( 'H:i d/m/Y', strtotime( $this -> article['date_modify'] ) ) . '</div>';
      
      if ( $this -> article['show_title'] ):
      ?>
        <h3 class="article-title">
          <a href="/<? if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() ) echo \S::get_session( 'current-lang' ) . '/';?><?= $url;?>" title="<?= $this -> article['language']['title'];?>"  <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $this -> article['language']['title'];?></a>
        </h3>
      <?
      endif;
    ?>
    <div class="text">
      <?
        $content = $this -> article['language']['entry'];
        $content = preg_replace( "/<img[^>]+\>/i",  "",   $content );
        $content = preg_replace( "/<p[^>]*?><\/p>/", "",   $content );
        $content = trim( strip_tags( $content ) );
        echo mb_substr( $content, 0, 200, 'UTF-8' );
        if ( strlen( $content) > 200 ) 
          echo '...';
      ?>
    </div>
    <a href="/<?= $url;?>" class="btn" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $lang['wiecej'];?></a>
  </div>
</div>