first commit
This commit is contained in:
88
templates_user/__partials/article-entry-custom.php
Normal file
88
templates_user/__partials/article-entry-custom.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<? global $lang_id;?>
|
||||
|
||||
<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;
|
||||
?>
|
||||
<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>
|
||||
|
||||
<script class="footer" type="text/javascript" src="/libraries/minimasonry/minimasonry.js"></script>
|
||||
<script class="footer" type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var masonry;
|
||||
|
||||
function initializeMasonry() {
|
||||
var containerWidth = $('.blog-list-masonry').width() - 30;
|
||||
var columnWidth;
|
||||
|
||||
if ($(window).width() <= 991) {
|
||||
if (masonry) {
|
||||
masonry.destroy();
|
||||
masonry = null;
|
||||
$('.blog-list-masonry').removeAttr('style').find('.masonry-item').removeAttr('style');
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
columnWidth = containerWidth / 2;
|
||||
}
|
||||
masonry = new MiniMasonry({
|
||||
container: '.blog-list-masonry',
|
||||
baseWidth: columnWidth,
|
||||
surroundingGutter: false,
|
||||
gutterX: 30,
|
||||
gutterY: 30
|
||||
});
|
||||
}
|
||||
initializeMasonry();
|
||||
$(window).resize(function() {
|
||||
initializeMasonry();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user