Dodanie stylów dla sekcji artykułu oraz usunięcie nieużywanego kodu dotyczącego informacji o ciasteczkach

This commit is contained in:
2025-03-12 22:59:02 +01:00
parent 060d5d3162
commit 61a12ae613
5 changed files with 260 additions and 216 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -2555,6 +2555,10 @@ a {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
>div {
width: 100%;
}
img { img {
max-width: 100%; max-width: 100%;
@@ -8086,4 +8090,12 @@ a {
} }
} }
} }
}
.article {
.slider {
list-style-type: none;
margin: 0;
padding: 0;
}
} }

View File

@@ -1,196 +1,196 @@
<? global $lang, $lang_id;?> <? global $lang, $lang_id; ?>
<? <?
$text = $this -> article['language']['text']; $text = $this->article['language']['text'];
$text = \front\factory\Articles::generateHeadersIds( $text ); $text = \front\factory\Articles::generateHeadersIds($text);
?> ?>
<div class="article article-<?= $this -> article['id'];?>"> <div class="article article-<?= $this->article['id']; ?>">
<? <?
if ( $main_img = $this -> article['language']['main_image'] ): if ($main_img = $this->article['language']['main_image']):
?>
<div class="main-image">
<img src="<?= $main_img;?>" alt="<?= htmlspecialchars( $this -> article['language']['title'] );?>">
</div>
<?
endif;
$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['show_table_of_contents'] ):?> <div class="main-image">
<? if ( $this -> article['language']['table_of_contents'] ):?> <img src="<?= $main_img; ?>" alt="<?= htmlspecialchars($this->article['language']['title']); ?>">
<div class="table-of-contents">
<div class="title">
<?= \S::lang( 'spis-tresci' );?>
</div>
<?= $this -> article['language']['table_of_contents'];?>
</div>
<? else:?>
<div class="table-of-contents">
<div class="title">
<?= \S::lang( 'spis-tresci' );?>
</div>
<?= \front\factory\Articles::generateTableOfContents( $text );?>
</div>
<? endif;?>
<? endif;?>
<? if ( $this -> article['repeat_entry'] ):?>
<div class="entry">
<?= $this -> article['language']['entry'];?>
</div> </div>
<? endif;?> <?
endif;
$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['show_table_of_contents']): ?>
<? if ($this->article['language']['table_of_contents']): ?>
<div class="table-of-contents">
<div class="title">
<?= \S::lang('spis-tresci'); ?>
</div>
<?= $this->article['language']['table_of_contents']; ?>
</div>
<? else: ?>
<div class="table-of-contents">
<div class="title">
<?= \S::lang('spis-tresci'); ?>
</div>
<?= \front\factory\Articles::generateTableOfContents($text); ?>
</div>
<? endif; ?>
<? endif; ?>
<? if ($this->article['repeat_entry']): ?>
<div class="entry">
<?= $this->article['language']['entry']; ?>
</div>
<? endif; ?>
<div class="text"> <div class="text">
<? <?
/* artykuł wewnątrz innego artykułu */ /* artykuł wewnątrz innego artykułu */
preg_match_all( '/ARTYKUL:[0-9]*/', $this -> article['language']['text'], $articles_list ); 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 ) if (is_array($articles_list[0])) foreach ($articles_list[0] as $article_tmp)
{ {
$article_tmp = explode( ':', $article_tmp ); $article_tmp = explode(':', $article_tmp);
if ( $article_tmp[1] != $this -> article['id'] ) 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 ); $text = str_replace('[ARTYKUL:' . $article_tmp[1] . ']', \front\view\Articles::article_full($article_tmp[1], $lang_id), $text);
else else
$text = str_replace( '[ARTYKUL:' . $article_tmp[1] . ']', '', $text ); $text = str_replace('[ARTYKUL:' . $article_tmp[1] . ']', '', $text);
} }
/* galeria w innym miejscu niż na końcu */ /* galeria w innym miejscu niż na końcu */
if ( strpos( $this -> article['language']['text'], '[GALERIA]' ) !== false ) if (strpos($this->article['language']['text'], '[GALERIA]') !== false)
{ {
if ( is_array( $this -> article['images'] ) ): if (is_array($this->article['images'])):
$tpl = new \Tpl; $tpl = new \Tpl;
$tpl -> article = $this -> article; $tpl->article = $this->article;
$tpl -> images = $this -> article['images']; $tpl->images = $this->article['images'];
$gallery = $tpl -> render( 'articles/article-gallery' ); $gallery = $tpl->render('articles/article-gallery');
endif; endif;
$text = preg_replace('/(<p(.*)>\[GALERIA\]<\/p>|<div(.*)>\[GALERIA\]<\/div>)/', $gallery, $text ); $text = preg_replace('/(<p(.*)>\[GALERIA\]<\/p>|<div(.*)>\[GALERIA\]<\/div>)/', $gallery, $text);
} }
/* załączniki w innym miejscu niż na końcu */ /* załączniki w innym miejscu niż na końcu */
if ( strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) !== false ) if (strpos($this->article['language']['text'], '[ZALACZNIKI]') !== false)
{ {
if ( is_array( $this -> article['files'] ) ): if (is_array($this->article['files'])):
$tpl = new \Tpl; $tpl = new \Tpl;
$tpl -> article = $this -> article; $tpl->article = $this->article;
$tpl -> files = $this -> article['files']; $tpl->files = $this->article['files'];
$files = $tpl -> render( 'articles/article-files' ); $files = $tpl->render('articles/article-files');
endif; endif;
$text = preg_replace('/(<p(.*)>\[ZALACZNIKI\]<\/p>|<div(.*)>\[ZALACZNIKI\]<\/div>)/', $files, $text ); $text = preg_replace('/(<p(.*)>\[ZALACZNIKI\]<\/p>|<div(.*)>\[ZALACZNIKI\]<\/div>)/', $files, $text);
} }
/* slider */ /* slider */
if ( strpos( $text, '[SLIDER]' ) !== false ) if (strpos($text, '[SLIDER]') !== false)
{
while (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++)
{ {
$text_tmp = explode( '[SLIDER]', $text ); $temp = explode('[/SLIDER]', $text_tmp[$i]);
$before = $text_tmp[0]; $code = $temp[0];
for ( $i = 1; $i < count( $text_tmp ); $i++ )
ob_start();
$images_tmp = explode('|', $code);
if (is_array($images_tmp) and !empty($images_tmp)) foreach ($images_tmp as $image_tmp)
{ {
$temp = explode( '[/SLIDER]' , $text_tmp[$i] ); $image = explode(';', $image_tmp);
$code = $temp[0]; $images[] = $image;
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'); $tpl = new \Tpl;
$dom -> loadHTML( '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . $text ); $tpl->images = $images;
$elements = $dom -> getElementsByTagName( 'img' ); $tpl->article_id = $this->article['id'];
foreach ( $elements as $element ) $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)
{ {
if ( strpos( $element -> getAttribute( 'class' ), 'zoom' ) !== false ) $element_tmp = $dom->createElement('a', '');
{ $element_tmp->setAttribute('href', $element->getAttribute('src'));
$element_tmp = $dom -> createElement( 'a', '' ); $element_tmp->setAttribute('rel', 'article-' . $this->article['id']);
$element_tmp -> setAttribute( 'href', $element -> getAttribute( 'src' ) ); $element_tmp->setAttribute('class', 'fancybox');
$element_tmp -> setAttribute( 'rel', 'article-' . $this -> article['id'] );
$element_tmp -> setAttribute( 'class', 'fancybox' );
$element_tmp_2 = $element -> cloneNode( false ); $element_tmp_2 = $element->cloneNode(false);
$element_tmp -> appendChild( $element_tmp_2 ); $element_tmp->appendChild($element_tmp_2);
$element -> parentNode -> replaceChild( $element_tmp, $element ); $element->parentNode->replaceChild($element_tmp, $element);
}
} }
}
echo $dom -> saveHTML(); echo $dom->saveHTML();
?> ?>
</div> </div>
<? <?
if ( is_array( $this -> article['images'] ) and strpos( $this -> article['language']['text'], '[GALERIA]' ) === false ): if (is_array($this->article['images']) and strpos($this->article['language']['text'], '[GALERIA]') === false):
$tpl = new \Tpl; $tpl = new \Tpl;
$tpl -> article = $this -> article; $tpl->article = $this->article;
$tpl -> images = $this -> article['images']; $tpl->images = $this->article['images'];
echo $tpl -> render( 'articles/article-gallery' ); echo $tpl->render('articles/article-gallery');
endif; endif;
if ( is_array( $this -> article['files'] ) and strpos( $this -> article['language']['text'], '[ZALACZNIKI]' ) === false ): if (is_array($this->article['files']) and strpos($this->article['language']['text'], '[ZALACZNIKI]') === false):
$tpl = new \Tpl; $tpl = new \Tpl;
$tpl -> article = $this -> article; $tpl->article = $this->article;
$tpl -> files = $this -> article['files']; $tpl->files = $this->article['files'];
echo $tpl -> render( 'articles/article-files' ); echo $tpl->render('articles/article-files');
endif; endif;
?> ?>
</div> </div>
<link class="footer" href="/libraries/fancyBox/jquery.fancybox.css" rel="stylesheet" type="text/css"> <link class="footer" href="/libraries/fancyBox/jquery.fancybox.css" rel="stylesheet" type="text/css">
@@ -198,31 +198,95 @@ $text = \front\factory\Articles::generateHeadersIds( $text );
<script class="footer" type="text/javascript" src="/libraries/fancyBox/jquery.fancybox.js"></script> <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" src="/libraries/fancyBox/helpers/jquery.fancybox-buttons.js"></script>
<script class="footer" type="text/javascript"> <script class="footer" type="text/javascript">
$( document ).ready(function() $(document).ready(function() {
{ <? if ($this->article['language']['table_of_contents']): ?>
$( ".gallery a.image" ).fancybox({
closeBtn : false,
helpers : {
buttons : {}
}
});
<? if ( $this -> article['language']['table_of_contents'] ):?>
window.addEventListener('DOMContentLoaded', () => { window.addEventListener('DOMContentLoaded', () => {
const observer = new IntersectionObserver(entries => { const observer = new IntersectionObserver(entries => {
entries.forEach(entry => { entries.forEach(entry => {
const id = entry.target.getAttribute('id'); const id = entry.target.getAttribute('id');
if ( entry.intersectionRatio > 0) { if (entry.intersectionRatio > 0) {
document.querySelector('.article-<?= $this -> article['id'];?> .table-of-contents li a[href$="#' + id + '"]').parentElement.classList.add('active'); document.querySelector('.article-<?= $this->article['id']; ?> .table-of-contents li a[href$="#' + id + '"]').parentElement.classList.add('active');
} else { } else {
document.querySelector('.article-<?= $this -> article['id'];?> .table-of-contents li a[href$="#' + id + '"]').parentElement.classList.remove('active'); document.querySelector('.article-<?= $this->article['id']; ?> .table-of-contents li a[href$="#' + id + '"]').parentElement.classList.remove('active');
} }
}); });
}); });
document.querySelectorAll( '.article-<?= $this -> article['id'];?> .text div[id]' ).forEach((div) => { document.querySelectorAll('.article-<?= $this->article['id']; ?> .text div[id]').forEach((div) => {
observer.observe(div); observer.observe(div);
}); });
}); });
<? endif;?> <? endif; ?>
});
$(document).ready(function() {
var $slider = $('.slider'),
$slides = $slider.find('li'),
slideCount = $slides.length,
currentIndex = 0;
// Ustawienie slidera na pełną szerokość dostępnego kontenera
$slider.css({
'position': 'relative',
'overflow': 'hidden',
'width': '100%',
'max-width': '400px',
'margin': '0 auto 25px',
'padding': '0',
'list-style': 'none',
'display': 'block'
});
$slides.css({
'display': 'block',
'width': '100%',
'box-sizing': 'border-box'
});
$slides.find('img').css({
'width': '100%',
'height': '100%',
'object-fit': 'contain'
});
// Zaczekaj na wczytanie wszystkich obrazów
var imagesLoaded = 0;
$slides.find('img').each(function() {
$(this).on('load', function() {
imagesLoaded++;
if (imagesLoaded === $slides.find('img').length) {
initSlider();
}
}).each(function() {
if (this.complete) $(this).trigger('load');
});
});
function initSlider() {
var slideHeight = $slides.first().outerHeight();
$slider.css('height', slideHeight);
$slides.css({
'position': 'absolute',
'width': '100%',
'left': '100%',
'top': '0'
}).eq(0).css('left', '0');
setInterval(showNextSlide, 3000);
}
function showNextSlide() {
var nextIndex = (currentIndex + 1) % slideCount;
$slides.eq(currentIndex).animate({
left: '-100%'
}, 1000);
$slides.eq(nextIndex).css('left', '100%').animate({
left: '0'
}, 1000);
currentIndex = nextIndex;
}
}); });
</script> </script>

View File

@@ -1,32 +0,0 @@
<!-- <div id="cookie-information">
<div class="container">
<div class="row">
<div class="col-xs-12">
Cliccando su <a href="#" onclick="cookie_close(); return false;">[ACCETTO]</a>, l'utente accetta di memorizzare i cookie sul dispositivo migliorando la navigazione ed ottendendo un'esperienza Web più personalizzata. Lutente puo modificare le impostazioni dei cookie in qualsiasi momento. <a href="#" onclick="cookie_close(); return false;">[ACCETTO]</a>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function cookie_close()
{
$.ajax(
{
type: 'POST',
cache: false,
url: '/ajax.php',
data:
{
a: 'cookie_close'
},
beforeSend: function()
{
$( '#cookie-information' ).remove();
},
success: function( data )
{
$( '#cookie-information' ).remove();
}
});
}
</script> -->