first commit

This commit is contained in:
2024-11-11 15:28:20 +01:00
commit 3f5649dbc7
6231 changed files with 999089 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<? global $lang;?>
<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'] );
if ( $this -> article['show_title'] ):
?>
<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>
<?
endif;
if ( $this -> article['show_date_add'] )
echo '<div class="date-add">' . $lang['data-dodania'] . ': ' . $this -> article['date_add'] . '</div>';
if ( $this -> article['show_date_modify'] )
echo '<div class="date-add">' . $lang['data-modyfikacji'] . ': ' . $this -> article['date_modify'] . '</div>';
?>
<div class="entry">
<?
if ( $this -> article['language']['entry'] )
{
echo $this -> article['language']['entry'];
if ( $this -> article['language']['text'] )
$more = true;
}
else
{
echo $this -> article['language']['text'];
$more = false;
}
?>
</div>
<? if ( $more ):?>
<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;?>><?= $lang['wiecej'];?></a>
<? endif;?>
</div>

View File

@@ -0,0 +1,19 @@
<? if ( is_array( $this -> files ) ):?>
<ul class="files">
<? foreach ( $this -> files as $file ):?>
<li>
<a href="/download.php?file=<?= $file['id'];?>&hash=<?= md5( $file['src'] );?>" title="<?= $file['name'];?>" target="_blank">
<?
if ( $file['name'] )
echo $file['name'];
else
{
$name = explode( '/', $file['src'] );
echo $name[ count( $name ) - 1 ];
}
?>
</a>
</li>
<? endforeach;?>
</ul>
<? endif;?>

View File

@@ -0,0 +1,182 @@
<? global $lang, $lang_id;?>
<div class="article">
<?
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );
if ( $this -> article['show_title'] )
echo '<h3 class="article-title">' . $this -> article['language']['title'] . '</h3>';
if ( $this -> article['social_icons'] ):
?>
<div class="social-icons">
<a class="fb" href="http://www.facebook.com/sharer.php?u=<?= \S::get_domain_url( $_SERVER['SERVER_NAME'] );?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" title="facebook" target="_blank" rel="nofollow">
<img src="/images/system/logo-facebook.jpg" alt="facebook" />
</a>
<a class="pinterest" href="http://pinterest.com/pin/create/button/?url=<?= \S::get_domain_url( $_SERVER['SERVER_NAME'] );?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" title="pinterest" target="_blank" rel="nofollow">
<img src="/images/system/logo-pinterest.jpg" alt="pinterest" />
</a>
<a class="twitter" href="http://twitter.com/share?url=<?= \S::get_domain_url( $_SERVER['SERVER_NAME'] );?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=600');return false;" title="twitter" target="_blank" rel="nofollow">
<img src="/images/system/logo-twitter.jpg" alt="twitter" />
</a>
<a class="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=<?= \S::get_domain_url( $_SERVER['SERVER_NAME'] );?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=850');return false;" title="linked in" target="_blank" rel="nofollow">
<img src="/images/system/logo-linkedin.jpg" alt="linkedin" />
</a>
<a class="gp" href="https://plus.google.com/share?url=<?= \S::get_domain_url( $_SERVER['SERVER_NAME'] );?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" title="google+" target="_blank" rel="nofollow">
<img src="/images/system/logo-google.jpg" alt="google+" />
</a>
</div>
<?
endif;
if ( $this -> article['show_date_add'] )
echo '<div class="date-add">' . $lang['data-dodania'] . ': ' . $this -> article['date_add'] . '</div>';
if ( $this -> article['show_date_modify'] )
echo '<div class="date-add">' . $lang['data-modyfikacji'] . ': ' . $this -> article['date_modify'] . '</div>';
if ( is_array( $this -> article['tags'] ) and !empty( $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;
?>
<? if ( $this -> article['repeat_entry'] ):?>
<div class="entry">
<?= $this -> article['language']['entry'];?>
</div>
<? endif;?>
<div class="text">
<?
$text = $this -> article['language']['text'];
/* artykuł wewnątrz innego artykułu */
preg_match_all( '/ARTYKUL:[0-9]*/', $this -> article['language']['text'], $articles_list );
if ( is_array( $articles_list[0] ) ) foreach( $articles_list[0] as $article_tmp )
{
$article_tmp = explode( ':', $article_tmp );
if ( $article_tmp[1] != $this -> article['id'] )
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', \front\view\Articles::article_full( $article_tmp[1], $lang_id ), $text );
else
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', '', $text );
}
/* galeria w innym miejscu niż na końcu */
if ( strpos( $this -> article['language']['text'], '[GALERIA]' ) !== false )
{
if ( is_array( $this -> article['images'] ) ):
$tpl = new \Tpl;
$tpl -> article = $this -> article;
$tpl -> images = $this -> article['images'];
$gallery = $tpl -> render( 'articles/article-gallery' );
endif;
$text = preg_replace('/(<p(.*)>\[GALERIA\]<\/p>|<div(.*)>\[GALERIA\]<\/div>)/', $gallery, $text );
}
/* załączniki w innym miejscu niż na końcu */
if ( strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) !== false )
{
if ( is_array( $this -> article['files'] ) ):
$tpl = new \Tpl;
$tpl -> article = $this -> article;
$tpl -> files = $this -> article['files'];
$files = $tpl -> render( 'articles/article-files' );
endif;
$text = preg_replace('/(<p(.*)>\[ZALACZNIKI\]<\/p>|<div(.*)>\[ZALACZNIKI\]<\/div>)/', $files, $text );
}
/* slider */
if ( strpos( $text, '[SLIDER]' ) !== false )
{
while ( strpos( $text, '[SLIDER]' ) !== false )
{
$text_tmp = explode( '[SLIDER]', $text );
$before = $text_tmp[0];
for ( $i = 1; $i < count( $text_tmp ); $i++ )
{
$temp = explode( '[/SLIDER]' , $text_tmp[$i] );
$code = $temp[0];
ob_start();
$images_tmp = explode( '|', $code );
if ( is_array( $images_tmp ) and !empty( $images_tmp ) ) foreach ( $images_tmp as $image_tmp )
{
$image = explode( ';', $image_tmp );
$images[] = $image;
}
$tpl = new \Tpl;
$tpl -> images = $images;
$tpl -> article_id = $this -> article['id'];
$tpl -> i = $i;
echo $tpl -> render( 'articles/slider' );
$out .= ob_get_contents();
ob_end_clean();
$out .= $temp[1];
}
$text = $before . $out;
}
}
$dom = new DomDocument('1.0', 'UTF-8');
$dom -> loadHTML( '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . $text );
$elements = $dom -> getElementsByTagName( 'img' );
foreach ( $elements as $element )
{
if ( strpos( $element -> getAttribute( 'class' ), 'zoom' ) !== false )
{
$element_tmp = $dom -> createElement( 'a', '' );
$element_tmp -> setAttribute( 'href', $element -> getAttribute( 'src' ) );
$element_tmp -> setAttribute( 'rel', 'article-' . $this -> article['id'] );
$element_tmp -> setAttribute( 'class', 'fancybox' );
$element_tmp_2 = $element -> cloneNode( false );
$element_tmp -> appendChild( $element_tmp_2 );
$element -> parentNode -> replaceChild( $element_tmp, $element );
}
}
echo $dom -> saveHTML();
?>
</div>
<?
if ( is_array( $this -> article['images'] ) and strpos( $this -> article['language']['text'], '[GALERIA]' ) === false ):
$tpl = new \Tpl;
$tpl -> article = $this -> article;
$tpl -> images = $this -> article['images'];
echo $tpl -> render( 'articles/article-gallery' );
endif;
if ( is_array( $this -> article['files'] ) and strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) === false ):
$tpl = new \Tpl;
$tpl -> article = $this -> article;
$tpl -> files = $this -> article['files'];
echo $tpl -> render( 'articles/article-files' );
endif;
?>
</div>
<link href="/libraries/fancyBox/jquery.fancybox.css" rel="stylesheet" type="text/css">
<link href="/libraries/fancyBox/helpers/jquery.fancybox-buttons.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/libraries/fancyBox/jquery.fancybox.js"></script>
<script type="text/javascript" src="/libraries/fancyBox/helpers/jquery.fancybox-buttons.js"></script>
<script type="text/javascript">
$( document ).ready(function()
{
$( ".gallery a.image" ).fancybox({
closeBtn : false,
helpers : {
buttons : {}
}
});
});
</script>

View File

@@ -0,0 +1,345 @@
<? if ( is_array( $this -> images ) ):?>
<div class="gallery <? if ( $this -> article['pixieset'] ):?>pixieset<? endif;?>">
<? if ( $this -> article['pixieset'] ):?>
<div class="buttons">
<a id="gallery-download-<?= $this -> article['id'];?>" class="btn btn-success"><?= \S::lang( 'pobierz-wszystkie' );?></a>
<? if ( $this -> article['pixieset'] == 2 ):?>
<a id="gallery-favorite-submit-<?= $this -> article['id'];?>" class="btn btn-info"><?= \S::lang( 'zatwierdz-wybrane-fotografie' );?></a>
<? endif;?>
</div>
<? endif;?>
<div class="row">
<? foreach ( $this -> images as $img ):?>
<div class="col-xs-12 col-sm-4 col-md-3">
<? if ( $this -> article['pixieset'] ):?>
<div class="image" download-link="/pixieset/<?= md5( $img['id'] . $img['src'] );?>" image-id="<?= $img['id'];?>" counter="<?= (int)++$i;?>" favorite="<?= !$img['favorite'] ? '0' : '1';?>">
<img class="lozad" data-src="<?= $img['src'];?>" alt="<?= $img['alt'];?>">
<div class="image-options">
<a href="/pixieset/<?= md5( $img['id'] . $img['src'] );?>" target="_blank" class="download">
<i class="fa fa-download"></i>
</a>
<? if ( $this -> article['pixieset'] == 2 ):?>
<a href="#" image-id="<?= $img['id'];?>" class="image-favorite" id="image-favorite-<?= $img['id'];?>"><i class="fa <?= !$img['favorite'] ? 'fa-heart-o' : 'fa-heart';?>"></i></a>
<? endif;?>
</div>
</div>
<? else:?>
<a class="image" rel="article-<?= $this -> article['id'];?>" href="<?= $img['src'];?>" title="">
<img class="lozad" data-src="<?= $img['src'];?>" alt="<?= $img['alt'];?>">
</a>
<? endif;?>
</div>
<? endforeach;?>
</div>
</div>
<? endif;?>
<? if ( $this -> article['pixieset'] ):?>
<div class="pixieset-image-big">
<a href="#" class="close" title="<?= \S::lang( 'zamknij' );?>">
<i class="fa fa-times"></i>
</a>
<div class="buttons">
<a href="#" class="download">
<i class="fa fa-download"></i>
</a>
<? if ( $this -> article['pixieset'] == 2 ):?>
<a href="#" class="favorite" image-id="">
<i class="fa fa-heart-o"></i>
</a>
<? endif;?>
</div>
<img src="#">
<a href="#" class="next">
<i class="fa fa-angle-right"></i>
</a>
<a href="#" class="prev">
<i class="fa fa-angle-left"></i>
</a>
</div>
<? endif;?>
<script class="footer" type="text/javascript" src="/libraries/jquery/lozad.js"></script>
<script class="footer" type="text/javascript">
var pixieset_image = $( '.pixieset-image-big' );
$( function()
{
const observer = lozad();
observer.observe();
<? if ( $this -> article['pixieset'] ):?>
$( 'body' ).on( click_event, '.gallery .image img', function()
{
var image_container = $( this ).parent( '.image' );
var src = $( this ).attr( 'data-src' );
var download_link = image_container.attr( 'download-link' );
<? if ( $this -> article['pixieset'] == 2 ):?>
var image_id = image_container.attr( 'image-id' );
var favorite_status = image_container.attr( 'favorite' );
<? endif;?>
pixieset_image.find( 'img' ).attr( 'src', src );
pixieset_image.find( '.download' ).attr( 'href', download_link );
<? if ( $this -> article['pixieset'] == 2 ):?>
pixieset_image.find( '.favorite' ).attr( 'image-id', image_id );
if ( favorite_status === '1' )
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
else
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
<? endif;?>
pixieset_image.show();
return false;
});
$( 'body' ).on( click_event, '.pixieset-image-big .close', function()
{
pixieset_image.hide();
return false;
});
$( 'body' ).on( click_event, '.pixieset-image-big .prev', function()
{
var src = pixieset_image.find( 'img' ).attr( 'src' );
var index = $( 'img[data-src="' + src+ '"]' ).parent( '.image' ).attr( 'counter' );
index = parseInt( index );
if ( index <= 1 )
var image_index = $( '.image[counter="<?= $i;?>"]' );
else
var image_index = $( '.image[counter="' + ( index - 1 ) + '"]' );
var image_current = image_index.children( 'img' );
var src = image_current.attr( 'data-src' );
var download_link = image_index.attr( 'download-link' );
pixieset_image.find( '.download' ).attr( 'href', download_link );
<? if ( $this -> article['pixieset'] == 2 ):?>
var image_id = image_index.attr( 'image-id' );
var favorite_status = image_index.attr( 'favorite' );
pixieset_image.find( '.favorite' ).attr( 'image-id', image_id );
if ( favorite_status === '1' )
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
else
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
<? endif;?>
var image = $( ".pixieset-image-big img" );
image.hide();
image.attr( 'src', src );
image.show();
return false;
});
$( 'body' ).on( click_event, '.pixieset-image-big .next', function()
{
var src = pixieset_image.find( 'img' ).attr( 'src' );
var index = $( 'img[data-src="' + src+ '"]' ).parent( '.image' ).attr( 'counter' );
index = parseInt( index );
if ( index >= <?= $i;?> )
var image_index = $( '.image[counter="1"]' );
else
var image_index = $( '.image[counter="' + ( index + 1 ) + '"]' );
var image_current = image_index.children( 'img' );
var src = image_current.attr( 'data-src' );
var download_link = image_index.attr( 'download-link' );
pixieset_image.find( '.download' ).attr( 'href', download_link );
<? if ( $this -> article['pixieset'] == 2 ):?>
var image_id = image_index.attr( 'image-id' );
var favorite_status = image_index.attr( 'favorite' );
pixieset_image.find( '.favorite' ).attr( 'image-id', image_id );
if ( favorite_status === '1' )
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
else
pixieset_image.find( '.favorite' ).children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
<? endif;?>
var image = $( ".pixieset-image-big img" );
image.hide();
image.attr( 'src', src );
image.show();
return false;
});
$( 'body' ).on( click_event, '#gallery-download-<?= $this -> article['id'];?>', function()
{
var button = $( this );
$.ajax(
{
type: 'POST',
cache: false,
url: '/ajax.php',
data:
{
a: 'pixieset_gallery_download',
hash: '<?= md5( $this -> article['id'] . $this -> article['date_add'] );?>'
},
beforeSend: function()
{
button.addClass( 'disabled' ).html( '<?= \S::lang( 'zaczekaj-trwa-tworzenie-pliku' );?>' );
},
success: function( response )
{
data = jQuery.parseJSON( response );
window.location = '/' + data.url;
button.removeClass( 'disabled' ).html( '<?= \S::lang( 'pobierz-wszystkie' );?>' );
}
});
});
<? endif;?>
<? if ( $this -> article['pixieset'] == 2 ):?>
$( 'body' ).on( click_event, '#gallery-favorite-submit-<?= $this -> article['id'];?>', function()
{
var button = $( this );
$.ajax(
{
type: 'POST',
cache: false,
url: '/ajax.php',
data:
{
a: 'pixieset_save_favorite_images',
hash: '<?= md5( $this -> article['id'] . $this -> article['date_add'] );?>'
},
beforeSend: function()
{
button.addClass( 'disabled' );
},
success: function( response )
{
data = jQuery.parseJSON( response );
if ( data.status === true )
{
$.alert(
{
title: '<?= ucfirst( \S::lang( 'informacja' ) );?>',
content: '<?= \S::lang( 'lista-wybranych-zdjec-zostala-zatwierdzona' );?>',
type: 'orange',
closeIcon: true,
closeIconClass: 'fa fa-close',
typeAnimated: true,
animation: 'opacity',
autoClose: 'confirm|10000',
columnClass: 'col-sm-8',
theme: 'modern',
buttons:
{
confirm:
{
text: '<?= \S::lang( 'zamknij' );?>',
btnClass: 'btn-blue',
keys: ['enter'],
action: function() {}
}
}
});
}
button.removeClass( 'disabled' );
}
});
});
$( 'body' ).on( click_event, '.image-favorite', function()
{
var button = $( this );
$.ajax(
{
type: 'POST',
cache: false,
url: '/ajax.php',
data:
{
a: 'pixieset_image_favorite',
hash: '<?= md5( $this -> article['id'] . $this -> article['date_add'] );?>',
image_id: button.attr( 'image-id' )
},
beforeSend: function()
{
button.addClass( 'disabled' );
},
success: function( response )
{
data = jQuery.parseJSON( response );
if ( data.status === false )
{
button.children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
button.parents( '.image' ).attr( 'favorite', '0' );
}
else
{
button.children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
button.parents( '.image' ).attr( 'favorite', '1' );
}
button.removeClass( 'disabled' );
}
});
return false;
});
$( 'body' ).on( click_event, '.pixieset-image-big .favorite', function()
{
var button = $( this );
var image_id = button.attr( 'image-id' );
$.ajax(
{
type: 'POST',
cache: false,
url: '/ajax.php',
data:
{
a: 'pixieset_image_favorite',
hash: '<?= md5( $this -> article['id'] . $this -> article['date_add'] );?>',
image_id: image_id
},
beforeSend: function()
{
button.addClass( 'disabled' );
},
success: function( response )
{
data = jQuery.parseJSON( response );
if ( data.status === false )
{
button.children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
$( '.image[image-id="' + image_id + '"]' ).attr( 'favorite', 0 );
$( '.image[image-id="' + image_id + '"]' ).find( '.image-favorite' ).children( 'i' ).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
}
else
{
button.children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
$( '.image[image-id="' + image_id + '"]' ).attr( 'favorite', 1 );
$( '.image[image-id="' + image_id + '"]' ).find( '.image-favorite' ).children( 'i' ).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
}
button.removeClass( 'disabled' );
}
});
return false;
});
<? endif;?>
});
</script>

View File

@@ -0,0 +1,26 @@
<? global $lang;?>
<div class="article-miniature">
<?
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );
?>
<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>
<?
if ( $this -> article['show_date_add'] )
echo '<div class="date-add">' . $lang['data-dodania'] . ': ' . $this -> article['date_add'] . '</div>';
if ( $this -> article['show_date_modify'] )
echo '<div class="date-add">' . $lang['data-modyfikacji'] . ': ' . $this -> article['date_modify'] . '</div>';
if ( $img = \front\factory\Articles::get_image( $this -> 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;?>" title="<?= $this -> article['language']['title'];?>" <? if ( $this -> article['language']['noindex'] ):?>rel="nofollow"<? endif;?>>
<div style="background: url( '/libraries/<?= $img;?>' ) no-repeat center;"></div>
</a>
<?
endif;
?>
</div>

View File

@@ -0,0 +1,182 @@
<? global $lang, $lang_id;?>
<div class="article">
<?
$this -> article['language']['seo_link'] ? $url = $this -> article['language']['seo_link'] : $url = 'a-' . $this -> article['id'] . '-' . \S::seo( $this -> article['language']['title'] );
if ( $this -> article['show_title'] )
echo '<h3 class="article-title">' . $this -> article['language']['title'] . '</h3>';
if ( $this -> article['social_icons'] ):
?>
<div class="social-icons">
<a class="fb" href="http://www.facebook.com/sharer.php?u=<?= \S::get_domain_url( $_SERVER['SERVER_NAME'] );?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" title="facebook" target="_blank" rel="nofollow">
<img src="/images/system/logo-facebook.jpg" alt="facebook" />
</a>
<a class="pinterest" href="http://pinterest.com/pin/create/button/?url=<?= \S::get_domain_url( $_SERVER['SERVER_NAME'] );?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" title="pinterest" target="_blank" rel="nofollow">
<img src="/images/system/logo-pinterest.jpg" alt="pinterest" />
</a>
<a class="twitter" href="http://twitter.com/share?url=<?= \S::get_domain_url( $_SERVER['SERVER_NAME'] );?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=600');return false;" title="twitter" target="_blank" rel="nofollow">
<img src="/images/system/logo-twitter.jpg" alt="twitter" />
</a>
<a class="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=<?= \S::get_domain_url( $_SERVER['SERVER_NAME'] );?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=850');return false;" title="linked in" target="_blank" rel="nofollow">
<img src="/images/system/logo-linkedin.jpg" alt="linkedin" />
</a>
<a class="gp" href="https://plus.google.com/share?url=<?= \S::get_domain_url( $_SERVER['SERVER_NAME'] );?>/<?= $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" title="google+" target="_blank" rel="nofollow">
<img src="/images/system/logo-google.jpg" alt="google+" />
</a>
</div>
<?
endif;
if ( $this -> article['show_date_add'] )
echo '<div class="date-add">' . $lang['data-dodania'] . ': ' . $this -> article['date_add'] . '</div>';
if ( $this -> article['show_date_modify'] )
echo '<div class="date-add">' . $lang['data-modyfikacji'] . ': ' . $this -> article['date_modify'] . '</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;
?>
<? if ( $this -> article['repeat_entry'] ):?>
<div class="entry">
<?= $this -> article['language']['entry'];?>
</div>
<? endif;?>
<div class="text">
<?
$text = $this -> article['language']['text'];
/* artykuł wewnątrz innego artykułu */
preg_match_all( '/ARTYKUL:[0-9]*/', $this -> article['language']['text'], $articles_list );
if ( is_array( $articles_list[0] ) ) foreach( $articles_list[0] as $article_tmp )
{
$article_tmp = explode( ':', $article_tmp );
if ( $article_tmp[1] != $this -> article['id'] )
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', \front\view\Articles::article_full( $article_tmp[1], $lang_id ), $text );
else
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', '', $text );
}
/* galeria w innym miejscu niż na końcu */
if ( strpos( $this -> article['language']['text'], '[GALERIA]' ) !== false )
{
if ( is_array( $this -> article['images'] ) ):
$tpl = new \Tpl;
$tpl -> article = $this -> article;
$tpl -> images = $this -> article['images'];
$gallery = $tpl -> render( 'articles/article-gallery' );
endif;
$text = preg_replace('/(<p(.*)>\[GALERIA\]<\/p>|<div(.*)>\[GALERIA\]<\/div>)/', $gallery, $text );
}
/* załączniki w innym miejscu niż na końcu */
if ( strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) !== false )
{
if ( is_array( $this -> article['files'] ) ):
$tpl = new \Tpl;
$tpl -> article_id = $this -> article['id'];
$tpl -> files = $this -> article['files'];
$files = $tpl -> render( 'articles/article-files' );
endif;
$text = preg_replace('/(<p(.*)>\[ZALACZNIKI\]<\/p>|<div(.*)>\[ZALACZNIKI\]<\/div>)/', $files, $text );
}
/* slider */
if ( strpos( $text, '[SLIDER]' ) !== false )
{
while ( strpos( $text, '[SLIDER]' ) !== false )
{
$text_tmp = explode( '[SLIDER]', $text );
$before = $text_tmp[0];
for ( $i = 1; $i < count( $text_tmp ); $i++ )
{
$temp = explode( '[/SLIDER]' , $text_tmp[$i] );
$code = $temp[0];
ob_start();
$images_tmp = explode( '|', $code );
if ( is_array( $images_tmp ) and !empty( $images_tmp ) ) foreach ( $images_tmp as $image_tmp )
{
$image = explode( ';', $image_tmp );
$images[] = $image;
}
$tpl = new \Tpl;
$tpl -> images = $images;
$tpl -> article_id = $this -> article['id'];
$tpl -> i = $i;
echo $tpl -> render( 'articles/slider' );
$out .= ob_get_contents();
ob_end_clean();
$out .= $temp[1];
}
$text = $before . $out;
}
}
$dom = new DomDocument('1.0', 'UTF-8');
$dom -> loadHTML( '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . $text );
$elements = $dom -> getElementsByTagName( 'img' );
foreach ( $elements as $element )
{
if ( strpos( $element -> getAttribute( 'class' ), 'zoom' ) !== false )
{
$element_tmp = $dom -> createElement( 'a', '' );
$element_tmp -> setAttribute( 'href', $element -> getAttribute( 'src' ) );
$element_tmp -> setAttribute( 'rel', 'article-' . $this -> article['id'] );
$element_tmp -> setAttribute( 'class', 'fancybox' );
$element_tmp_2 = $element -> cloneNode( false );
$element_tmp -> appendChild( $element_tmp_2 );
$element -> parentNode -> replaceChild( $element_tmp, $element );
}
}
echo $dom -> saveHTML();
?>
</div>
<?
if ( is_array( $this -> article['images'] ) and strpos( $this -> article['language']['text'], '[GALERIA]' ) === false ):
$tpl = new \Tpl;
$tpl -> article = $this -> article;
$tpl -> images = $this -> article['images'];
echo $tpl -> render( 'articles/article-gallery' );
endif;
if ( is_array( $this -> article['files'] ) and strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) === false ):
$tpl = new \Tpl;
$tpl -> article_id = $this -> article['id'];
$tpl -> files = $this -> article['files'];
echo $tpl -> render( 'articles/article-files' );
endif;
?>
<a href="javascript:history.go(-1);" class="btn btn-success"><?= $lang['wstecz'];?></a>
</div>
<link class="footer" href="/libraries/fancyBox/jquery.fancybox.css" rel="stylesheet" type="text/css">
<link class="footer" href="/libraries/fancyBox/helpers/jquery.fancybox-buttons.css" rel="stylesheet" type="text/css">
<script class="footer" type="text/javascript" src="/libraries/fancyBox/jquery.fancybox.js"></script>
<script class="footer" type="text/javascript" src="/libraries/fancyBox/helpers/jquery.fancybox-buttons.js"></script>
<script class="footer" type="text/javascript">
$( document ).ready(function()
{
$( ".gallery a.image" ).fancybox({
closeBtn : false,
helpers : {
buttons : {}
}
});
});
</script>

View File

@@ -0,0 +1,13 @@
<?
if ( is_array( $this -> articles ) ) foreach ( $this -> articles as $article )
{
if ( $article['password'] and !\S::get_session( 'article-' . $article['id'] . '-' . $article['password'] ) )
echo \front\view\Articles::password_view( [ 'article' => $article ] );
else
{
$tpl = new \Tpl;
$tpl -> page_id = $this -> page_id;
$tpl -> article = $article;
echo $tpl -> render( 'articles/article-entry' );
}
}

View File

@@ -0,0 +1,15 @@
<? global $lang;?>
<? if ( is_array( $this -> articles ) ): foreach( $this -> articles as $article ):?>
<div class="article-list">
<?
$article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo( $article['language']['title'] );
?>
<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>
<?
if ( $this -> articles[0]['show_date_add'] )
echo '<div class="date-add">' . ucfirst( $lang['data-dodania'] ) . ': ' . $this -> articles[0]['date_add'] . '</div>';
?>
</div>
<? endforeach; endif;?>

View File

@@ -0,0 +1,7 @@
<?php
if ( is_array( $this -> articles ) ) foreach ( $this -> articles as $article )
{
$tpl = new \Tpl;
$tpl -> article = $article;
echo $tpl -> render( 'articles/article-miniature' );
}

View File

@@ -0,0 +1,43 @@
<?
global $settings;
if ( is_array( $this -> settings ) ) foreach ( $this -> settings as $row )
{
$data = explode( ':', $row );
switch ( $data[0] ):
case 'dlugosc':
$dlugosc = $data[1];
break;
case 'szerokosc':
$szerokosc = $data[1];
break;
case 'wysokosc_mapy':
$wysokosc_mapy = $data[1];
break;
case 'szerokosc_mapy':
$szerokosc_mapy = $data[1];
break;
case 'zoom':
$zoom = $data[1];
break;
case 'opis':
$opis = $data[1];
break;
endswitch;
}
?>
<div id="map-<?= $this -> map_counter;?>" style="width: <?= $szerokosc_mapy;?>; height: <?= $wysokosc_mapy;?>"></div>
<script type="text/javascript">
var mymap<?= $this -> map_counter;?> = L.map('map-<?= $this -> map_counter;?>', {
center: [<?= $szerokosc;?>, <?= $dlugosc;?>],
zoom: <?= $zoom;?>,
scrollWheelZoom: false
});
var marker = L.marker([<?= $szerokosc;?>, <?= $dlugosc;?>]).addTo(mymap<?= $this -> map_counter;?>);
<? if ( $opis ):?>
marker.bindPopup("<?= $opis;?>").openPopup();
<? endif;?>
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=<?= $settings['google_map_key'];?>', {
maxZoom: 24,
id: 'mapbox.streets'
}).addTo(mymap<?= $this -> map_counter;?>);
</script>

View File

@@ -0,0 +1,75 @@
<? global $lang, $config, $settings;?>
<div id="news">
<div id="title">Aktualności</div>
<div class="col-xs-12 col-sm-6">
<div id="article-main">
<?
$this -> articles[0]['language']['seo_link'] ? $url = $this -> articles[0]['language']['seo_link'] : $url = 'a-' . $this -> articles[0]['id'] . '-' . \S::seo( $this -> articles[0]['language']['title'] );
if ( $this -> articles[0]['show_title'] ):
?>
<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 -> articles[0]['language']['title'];?>" <? if ( $this -> articles[0]['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $this -> articles[0]['language']['title'];?></a>
</h3>
<?
endif;
if ( $this -> articles[0]['show_date_add'] )
echo '<div class="date-add">' . $lang['data-dodania'] . ': ' . $this -> articles[0]['date_add'] . '</div>';
if ( $this -> articles[0]['show_date_modify'] )
echo '<div class="date-add">' . $lang['data-modyfikacji'] . ': ' . $this -> articles[0]['date_modify'] . '</div>';
?>
<div class="entry">
<?
if ( $this -> articles[0]['language']['entry'] )
{
echo $this -> articles[0]['language']['entry'];
if ( $this -> articles[0]['language']['text'] )
$more = true;
}
else
{
echo $this -> articles[0]['language']['text'];
$more = false;
}
?>
</div>
<? if ( $more ):?>
<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 -> articles[0]['language']['title'];?>" <? if ( $this -> articles[0]['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $lang['wiecej'];?></a>
<? endif;?>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<? for ( $i = 1; $i < $settings['news_limit']; $i++ ):?>
<? if ( !empty( $this -> articles[$i] ) ):?>
<div class="article-list">
<?
$this -> articles[$i]['language']['seo_link'] ? $url = $this -> articles[$i]['language']['seo_link'] : $url = 'a-' . $this -> articles[$i]['id'] . '-' . \S::seo( $this -> articles[$i]['language']['title'] );
if ( $this -> articles[$i]['show_title'] ):
?>
<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 -> articles[$i]['language']['title'];?>" <? if ( $this -> articles[$i]['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $this -> articles[$i]['language']['title'];?></a>
</h3>
<?
endif;
if ( $this -> articles[$i]['show_date_add'] )
echo '<div class="date-add">' . $lang['data-dodania'] . ': ' . $this -> articles[$i]['date_add'] . '</div>';
if ( $this -> articles[$i]['show_date_modify'] )
echo '<div class="date-add">' . $lang['data-modyfikacji'] . ': ' . $this -> articles[$i]['date_modify'] . '</div>';
?>
<? if ( $more ):?>
<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 -> articles[$i]['language']['title'];?>" <? if ( $this -> articles[$i]['language']['noindex'] ):?>rel="nofollow"<? endif;?>><?= $lang['wiecej'];?></a>
<? endif;?>
</div>
<? endif;?>
<? endfor;?>
</div>
</div>

View File

@@ -0,0 +1,43 @@
<div class="article-password" id="article-password-<?= $this -> article['id'];?>">
<div class="row">
<div class="col-12">
<?= \S::lang( 'ten-artykul-jest-chroniony-podaj-haslo-aby-odblokowac-zawartosc-artykulu' );?>
<form metho="POST" id="form-<?= $this -> article['id'];?>">
<input type="password" name="password" id="password-<?= $this -> article['id'];?>" required="required">
<input type="submit" class="btn btn-success" id="submit-<?= $this -> article['id'];?>" value="<?= \S::lang( 'odblokuj' );?>">
</form>
</div>
</div>
</div>
<script class="footer" type="text/javascript">
$( function()
{
$( 'body' ).on( click_event, '#submit-<?= $this -> article['id'];?>', function(e)
{
if ( $.trim( $( "#password-<?= $this -> article['id'];?>" ).val() ) !== '' )
{
e.preventDefault();
var password = $( '#password-<?= $this -> article['id'];?>' ).val();
$.ajax(
{
type: 'POST',
cache: false,
url: '/ajax.php',
data:
{
a: 'article_unlock',
password: password,
article_id: <?= $this -> article['id'];?>
},
success: function( data )
{
location.reload();
}
});
return false;
}
});
});
</script>

View File

@@ -0,0 +1,34 @@
<? if ( is_array( $this -> images ) ):?>
<div id="carousel-<?= $this -> article_id;?>-<?= $this -> i;?>" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<? for ( $i = 0; $i < count( $this -> images ); $i++ ):?>
<li data-target="#carousel-<?= $this -> article_id;?>-<?= $this -> i;?>" data-slide-to="<?= $i;?>" class="<? if ( $i == 0 ):?>active<? endif;?>"></li>
<? endfor;?>
</ol>
<div class="carousel-inner">
<? for ( $i = 0; $i < count( $this -> images ); $i++ ):?>
<div class="item <? if ( $i == 0 ):?>active<? endif;?>">
<img src="<?= $this -> images[$i][0];?>" alt="<?= $this -> images[$i][3];?>">
<? if ( $this -> images[$i][1] or $this -> images[$i][2] ):?>
<div class="carousel-caption">
<? if ( $this -> images[$i][1] ):?>
<h3><?= $this -> images[$i][1];?></h3>
<? endif;?>
<? if ( $this -> images[$i][2] ):?>
<p><?= $this -> images[$i][2];?></p>
<? endif;?>
</div>
<? endif;?>
</div>
<? endfor;?>
</div>
<a class="left carousel-control" href="#carousel-<?= $this -> article_id;?>-<?= $this -> i;?>" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-<?= $this -> article_id;?>-<?= $this -> i;?>" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
<? endif;?>

View File

@@ -0,0 +1,33 @@
<div id="tags">
<?php
if ( is_array( $this -> tags ) ) foreach ( $this -> tags as $tag )
if ( $max < $tag['c'] )
$max = $tag['c'];
$tags = \S::shuffle_assoc( $this -> tags );
if ( is_array( $tags ) ):
echo '<ul>';
foreach ( $tags as $tag ):
$percent = floor( ( $tag['c'] / $max ) * 100 );
switch ( $percent )
{
case ( $percent < 10 ): $class = 'tag1'; break;
case ( $percent >= 10 and $percent < 20 ): $class = 'tag2'; break;
case ( $percent >= 20 and $percent < 30 ): $class = 'tag3'; break;
case ( $percent >= 30 and $percent < 40 ): $class = 'tag4'; break;
case ( $percent >= 40 and $percent < 50 ): $class = 'tag5'; break;
case ( $percent >= 50 and $percent < 60 ): $class = 'tag6'; break;
case ( $percent >= 60 and $percent < 70 ): $class = 'tag7'; break;
case ( $percent >= 70 and $percent < 80 ): $class = 'tag8'; break;
case ( $percent >= 80 and $percent < 90 ): $class = 'tag9'; break;
case ( $percent >= 90 ): $class = 'tag10'; break;
}
echo '<li class="' . $class . '">';
echo '<a href="/tag,' . \S::seo( $tag['name'] ) . '">' . $tag['name'] . '</a>';
echo '</li>';
endforeach;
echo '</ul>';
endif;
?>
</div>