This repository has been archived by the owner on Sep 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
album.php
80 lines (73 loc) · 2.74 KB
/
album.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
session_start();
include "includes/constants.php";
include "includes/header.php";
include "includes/footer.php";
if(isset($_GET['url']) && $_GET['url'] !='')
{
$rssUrl = $_GET['url'];
$rss = simplexml_load_file($rssUrl . '?rss=media');
}
else
{
echo '
<div class="alert alert-danger position-absolute top-50 start-50 translate-middle text-center" role="alert">
Nebyla zadána žádná adresa URL!<br>
<div class="pt-3">
<a href="../" class="btn btn-danger">Domovská stránka</a>
</div>
</div>
';
die();
}
?>
<title><?php echo $rss->channel->title . " • " . SITE_NAME; ?></title>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a href="/"><img src="<?php echo LOGO_PATH; ?>" alt="Logo" width="30" height="24" class="d-inline-block align-text-top pe-2"></a>
<a class="navbar-brand" href="/"><?php echo SITE_NAME; ?></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Přepnout navigační lištu">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="/">Domů</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php">O projektu</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="#">Album</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Gallery -->
<div class="pt-4 pb-5">
<div id="lightgallery" class="container text-center main-box border rounded pt-3">
<?php
echo '<h2 class="pb-3">' . $rss->channel->title . '</h2>';
foreach ($rss->channel->item as $item) {
$thumbUrl = $item->children('media', true)->thumbnail->attributes();
$imgUrl = $item->children('media', true)->content->attributes();
echo '<a href="' . $imgUrl['url'] . '" data-sub-html="' . $item->title . '"><img class="p-1 image rounded-4" src="' . $thumbUrl['url'] . '"></img></a>';
}
?>
</div>
</div>
<!-- lightGallery Settings -->
<script type="text/javascript">
lightGallery(document.getElementById('lightgallery'), {
plugins: [lgZoom, lgThumbnail],
mode: 'lg-slide',
hideScrollbar: true
});
</script>
<?php
include "includes/footer.php";
?>