first commit
This commit is contained in:
63
templates_user/articles/news-list.php
Normal file
63
templates_user/articles/news-list.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<div id="news-list">
|
||||
<? if ( \S::is_array_fix( $this -> articles ) ): foreach ( $this -> articles as $article ):?>
|
||||
<div class="article-entry">
|
||||
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo( $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;?>" title="<?= $article['language']['title'];?>" <? if ( $article['language']['noindex'] ):?>rel="nofollow"<? endif;?>>
|
||||
|
||||
<img src="<?= $article['language']['main_image'] ? $article['language']['main_image'] : \front\factory\Articles::get_image( $article );?>" alt="">
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?
|
||||
if ( $article['tags'] ):
|
||||
echo '<div class="article-tags">';
|
||||
echo '<ul>';
|
||||
foreach ( $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 = ' . $article['id'] . ' AND page_id NOT IN (12) LIMIT 3' ) -> 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="<?= $article['language']['title'];?>" <? if ( $article['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $article['language']['title'];?></a>
|
||||
</h3>
|
||||
<div class="entry">
|
||||
<?
|
||||
$content = $article['language']['entry'];
|
||||
$content = preg_replace( "/<img[^>]+\>/i", "", $content );
|
||||
$content = preg_replace( "/<p[^>]*?><\/p>/", "", $content );
|
||||
echo $content;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user