Files
2024-11-21 14:26:28 +01:00

52 lines
2.5 KiB
PHP

<? global $lang, $config, $settings;?>
<div id="news">
<div class="row">
<div class="col-12">
<h2>
PORADNIK
</h2>
<h6>
Zapoznaj się z artykułami, które dla Ciebie przygotowaliśmy i dowiedz się więcej o świecie okien i drzwi.
</h6>
</div>
</div>
<div class="content">
<div class="row">
<? foreach ( $this -> articles as $article ):?>
<div class="col-lg-4">
<div class="article">
<? $article[ 'language' ][ 'seo_link' ] ? $url = $article[ 'language' ][ 'seo_link' ] : $url = 'a-' . $article[ 'id' ] . '-' . \S::seo( $article[ 'language' ][ 'title' ] );?>
<? if ( $img = \front\factory\Articles::get_image( $article ) ):?>
<a href="/<? if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language( \S::get_domain( $_SERVER[ 'HTTP_HOST' ] ) ) ) echo \S::get_session( 'current-lang' ) . '/';?><?= $url;?>" class="img">
<img src="<?= $img;?>" alt="">
</a>
<? else:?>
<a href="/<? if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language( \S::get_domain( $_SERVER[ 'HTTP_HOST' ] ) ) ) echo \S::get_session( 'current-lang' ) . '/';?><?= $url;?>" class="img"></a>
<? endif;?>
<div class="article-content">
<a class="title" href="/<? if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language( \S::get_domain( $_SERVER[ 'HTTP_HOST' ] ) ) ) echo \S::get_session( 'current-lang' ) . '/';?><?= $url;?>" title="<?= $article[ 'language' ][ 'title' ];?>" <? if ( $article[ 'language' ][ 'noindex' ] ):?>rel="nofollow"<? endif;?>><?= $article[ 'language' ][ 'title' ];?></a>
<div class="entry">
<?
$content = $article[ 'language' ][ 'entry' ];
$content = preg_replace( "/<img[^>]+\>/i", "", $content );
$content = preg_replace( "/<p[^>]*?><\/p>/", "", $content );
echo $content;
?>
</div>
<a class="more" href="/<? if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language( \S::get_domain( $_SERVER[ 'HTTP_HOST' ] ) ) ) echo \S::get_session( 'current-lang' ) . '/';?><?= $url;?>" title="<?= $article[ 'language' ][ 'title' ];?>" <? if ( $article[ 'language' ][ 'noindex' ] ):?>rel="nofollow"<? endif;?>>Czytaj dalej</a>
</div>
</div>
</div>
<? endforeach;?>
</div>
</div>
</div>