- Updated the SCSS file to add a bottom margin to article entries for better spacing. - Modified the article-entry template to include conditional links for pages with IDs 12 and 94, providing localized "Read more" and "Download now" options.
148 lines
7.3 KiB
PHP
148 lines
7.3 KiB
PHP
<? global $lang, $lang_id, $page;?>
|
|
<?
|
|
$this -> page_id;
|
|
$page_template = \front\factory\Pages::get_layout_id( $this -> page_id );
|
|
?>
|
|
|
|
|
|
<? if ( $page_template == 9 or $page_template == 38 ) : ?>
|
|
<div class="col-lg-6 mb-4 mb-lg-0">
|
|
<div class="article-entry article-entry-v2">
|
|
<?
|
|
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );
|
|
?>
|
|
<div class="img">
|
|
<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;?>">
|
|
<img src="<?= $this -> article['language']['main_image'] ? $this -> article['language']['main_image'] : \front\factory\Articles::get_image( $this -> article );?>" alt="">
|
|
</a>
|
|
</div>
|
|
<?
|
|
if ( $this -> article['tags'] ):
|
|
echo '<div class="article-tags">';
|
|
echo '<ul>';
|
|
foreach ( $this -> article['tags'] as $tag ):
|
|
echo '<li>';
|
|
echo '<a href="/tag,' . \S::seo( $tag ) . '">' . $tag . '</a>';
|
|
echo '</li>';
|
|
endforeach;
|
|
echo '</ul>';
|
|
echo '</div>';
|
|
endif;
|
|
?>
|
|
<div class="article-tags">
|
|
<?
|
|
global $mdb;
|
|
|
|
$results = $mdb -> query( 'SELECT page_id FROM pp_articles_pages WHERE article_id = ' . $this -> article['id'] . ' AND page_id NOT IN (12)' ) -> fetchAll();
|
|
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
|
|
{
|
|
$page_tmp = \front\factory\Pages::page_details( $row['page_id'] );
|
|
if ( $row['page_id'] == 18 )
|
|
$url_tmp = '/blog';
|
|
else
|
|
$url_tmp = \front\factory\Pages::lang_url( $page_tmp['id'], $lang_id );
|
|
echo '<a href="' . $url_tmp . '" class="item">' . $page_tmp['language']['title'] . '</a>';
|
|
}
|
|
?>
|
|
</div>
|
|
<div class="article-content">
|
|
<h3 class="article-title">
|
|
<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;?>" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $this -> article['language']['title'];?></a>
|
|
</h3>
|
|
<div class="entry">
|
|
<?
|
|
$content = $this -> article['language']['entry'];
|
|
$content = preg_replace( "/<img[^>]+\>/i", "", $content );
|
|
$content = preg_replace( "/<p[^>]*?><\/p>/", "", $content );
|
|
echo $content;
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<? else: ?>
|
|
<!-- blog -->
|
|
<? if ( $page[ 'id' ] == 11 ):?>
|
|
<div class="col-md-3">
|
|
<div class="article-entry partners">
|
|
<?
|
|
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );
|
|
?>
|
|
<div class="img">
|
|
<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="more" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>>
|
|
<img src="<?= $this -> article['language']['main_image'] ? $this -> article['language']['main_image'] : \front\factory\Articles::get_image( $this -> article );?>" alt="">
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?endif;?>
|
|
|
|
<!-- NEW -->
|
|
<? if ( $page[ 'id' ] == 61 or $page[ 'id' ] == 12 or $page['menu_id'] == 4 or $page['id'] == 17 or $page['id'] == 94 ):?>
|
|
<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="img">
|
|
<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;?>">
|
|
<img src="<?= $this -> article['language']['main_image'] ? $this -> article['language']['main_image'] : \front\factory\Articles::get_image( $this -> article );?>" alt="">
|
|
</a>
|
|
</div>
|
|
<?
|
|
if ( $this -> article['tags'] ):
|
|
echo '<div class="article-tags">';
|
|
echo '<ul>';
|
|
foreach ( $this -> article['tags'] as $tag ):
|
|
echo '<li>';
|
|
echo '<a href="/tag,' . \S::seo( $tag ) . '">' . $tag . '</a>';
|
|
echo '</li>';
|
|
endforeach;
|
|
echo '</ul>';
|
|
echo '</div>';
|
|
endif;
|
|
?>
|
|
<?php if ($page['id'] != 94) : ?>
|
|
<div class="article-tags">
|
|
<?
|
|
global $mdb;
|
|
|
|
$results = $mdb -> query( 'SELECT page_id FROM pp_articles_pages WHERE article_id = ' . $this -> article['id'] . ' AND page_id NOT IN (12)' ) -> fetchAll();
|
|
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
|
|
{
|
|
$page_tmp = \front\factory\Pages::page_details( $row['page_id'] );
|
|
if ( $row['page_id'] == 18 )
|
|
$url_tmp = '/blog';
|
|
else
|
|
$url_tmp = \front\factory\Pages::lang_url( $page_tmp['id'], $lang_id );
|
|
echo '<a href="' . $url_tmp . '" class="item">' . $page_tmp['language']['title'] . '</a>';
|
|
}
|
|
?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="article-content">
|
|
<h3 class="article-title">
|
|
<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;?>" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $this -> article['language']['title'];?></a>
|
|
</h3>
|
|
<div class="entry">
|
|
<?
|
|
$content = $this -> article['language']['entry'];
|
|
$content = preg_replace( "/<img[^>]+\>/i", "", $content );
|
|
$content = preg_replace( "/<p[^>]*?><\/p>/", "", $content );
|
|
echo $content;
|
|
?>
|
|
</div>
|
|
<? if($page[ 'id' ] == 12 ): ?>
|
|
<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;?>">
|
|
<span>Przeczytaj całość</span>
|
|
</a>
|
|
<? endif; ?>
|
|
<? if($page[ 'id' ] == 94 ): ?>
|
|
<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;?>">
|
|
<span>Pobierz teraz</span>
|
|
</a>
|
|
<? endif; ?>
|
|
</div>
|
|
</div>
|
|
<?endif;?>
|
|
<?endif;?>
|