-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
170 lines (146 loc) · 12.2 KB
/
index.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php
include('lataa_ircpic123.php');
$gallerytitle = 'Random IRC pics';
$layout = 'masonry';
$pics_per_page = 30;
$starting_page = 1;
$columns_desktop = 5;
$columns_ipad = 2;
if ( isset( $_GET[ 'page' ] ) ) :
$starting_page = max(1, intval( $_GET['page'] ) );
endif;
$extensions = array( 'jpg', 'jpeg', 'png', 'gif', 'webp' );
$sort_order = 1;
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
if ( $_GET['get_thumb'] ) :
$url = $_GET['url'];
header('Content-type: image/jpeg');
$thumb = new Imagick( $url );
$thumb->resizeImage(500, 500, Imagick::FILTER_LANCZOS, 1, TRUE);
echo $thumb;
else :
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $gallerytitle; ?></title>
<link href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAYAAAA+VemSAAAUdklEQVR42u2dy2ucR9bGO33vVkvqbklWW2qsC8aWbMsWkrLxIoRxMAF/GGxiBb5k4cWQwCAPQogsZhHIX5DFLIZZhGBCGD5CFsFkFcKsQhiGMIT8ASEEk0UIgzFDCIPJV0+7nNixZfWlqp563/c58MNC7ss5p86j91ZVJ5eL3NbW1hZbrdbler3+Rq1We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2MCGUYSki1hNrUwCRVbAYf3x8fHfkJYFMW1xc7GB7Hu2xJbICah3b4CwsLAy3k0aMhk25sLOetqwVaQW1jRofeAO6JNn8/Pw6NqhWBwiRFlDLqOm+921Og6FFBPq8qKGaSCqoXdTwoe1O0mzoiojWpuh5qibjInZQo6hVtPg8sEtgls1c+K83Go09c0pyy/yF+z4XwaCJ7IIaRC2amtxHbfpXQMpsbW1tsdVqXa7X62+Yv3zvVCqVT8xfwa9MYm+bn38qFos/68aYGBTUDGoHNYRaQk2htlBjqLV2u335zJkzi5SiH8D+H/D7Tr2fiVtCAAAAAElFTkSuQmCC" rel="icon" type="image/x-icon">
<style type="text/css">
body {
margin: 0;
background-color: #131212;
text-align: center;
font-family: 'Helvetica', sans-serif;
}
body * {
color: #888;
}
<?php if ( 'full' === $layout ) : ?>
body img {
width: 100%;
height: auto;
}
<?php endif; ?>
<?php if ( 'masonry' === $layout ) : ?>
body {
margin: 5px;
}
.masonry {
column-count: <?php echo $columns_desktop; ?>;
column-gap: 0;
}
.masonry img {
background-color: #eee;
display: inline-block;
margin: 0 0 0px;
width: 100%;
}
@media(max-width: 1024px) {
.masonry {
column-count: <?php echo $columns_ipad; ?>;
}
}
@media(max-width: 500px) {
.masonry {
column-count: 1;
}
}
<?php endif; ?>
.nav svg {
position: relative;
top: 2px;
}
.nav a:hover {
opacity: .5;
}
header p,
footer p {
font-size: 14px;
}
</style>
</head>
<body>
<?php if ( 'full' === $layout ) : ?>
<header>
<p>Scroll down to see the photos.</p>
</header>
<?php endif; ?>
<?php if ( 'masonry' === $layout ) : ?>
<div class="masonry">
<?php endif;
$numpics = 0;
$scandir = scandir('../ircpics-archive/', $sort_order);
shuffle( $scandir );
foreach ( $scandir as $file ) :
foreach ( $extensions as $extension ) :
if ( strpos($file, '.'.$extension ) > 0 ) :
$numpics++;
// Check if image should be shown on current $starting_page
if ( $numpics > ( $starting_page -1 ) * $pics_per_page && $numpics <= $starting_page * $pics_per_page ) :
$caption = basename( $file, '.' . $extension );
?>
<?php if ( 'masonry' === $layout ) : ?><a href="https://peikko.us/ircpics-archive/<?php echo $file; ?>"><?php endif; ?><img class="gallery-image" src="<?php if ( 'masonry' === $layout ) : ?>https://peikko.us/ircpics-archive/<?php echo rawurlencode($file); ?><?php else : ?><?php echo rawurlencode($file); ?><?php endif; ?>" alt="<?php echo $caption; ?>" /><?php if ( 'masonry' === $layout ) : ?></a><?php endif;
break;
endif;
endif;
endforeach;
endforeach;
if ( 'masonry' === $layout ) : ?>
</div><!-- .masonry -->
<?php endif;
// Page navigation
if ( $numpics > $pics_per_page ) : ?>
<footer class="nav" style="display: none;">
<?php
$numpages = ceil($numpics / $pics_per_page);
if ($starting_page <= 1) : ?>
<svg xmlns="http://www.w3.org/2000/svg" fill="#333" width="16" height="16" viewBox="0 0 24 24"><path d="M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12-5.373-12-12-12-12 5.373-12 12zm7.58 0l5.988-5.995 1.414 1.416-4.574 4.579 4.574 4.59-1.414 1.416-5.988-6.006z"/></svg>
<?php else : ?>
<a href="<?php echo basename(__FILE__); ?>?page=<?php echo ($starting_page - 1); ?>"><svg xmlns="http://www.w3.org/2000/svg" fill="#888" width="16" height="16" viewBox="0 0 24 24"><path d="M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12-5.373-12-12-12-12 5.373-12 12zm7.58 0l5.988-5.995 1.414 1.416-4.574 4.579 4.574 4.59-1.414 1.416-5.988-6.006z"/></svg></a>
<?php endif; ?>
<?php echo ' ' . $starting_page .'/' . $numpages. ' ';
if ($starting_page >= $numpages) : ?>
<svg xmlns="http://www.w3.org/2000/svg" fill="#333" width="16" height="16" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-1.568 18.005l-1.414-1.415 4.574-4.59-4.574-4.579 1.414-1.416 5.988 5.995-5.988 6.005z"/></svg>
<?php else : ?>
<a href="<?php echo basename(__FILE__); ?>?page=<?php echo ($starting_page + 1); ?>"><svg xmlns="http://www.w3.org/2000/svg" fill="#888" width="16" height="16" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-1.568 18.005l-1.414-1.415 4.574-4.59-4.574-4.579 1.414-1.416 5.988 5.995-5.988 6.005z"/></svg></a>
<?php endif; ?>
</footer>
<?php endif; ?>
<?php endif; //if ( $_GET['get_thumb'] ) : ?>
<?php
$path = "../ircpics-archive/";
$filter = array(".", "..", "random_irc_pics.php");
$max_images = 20;
############################################################
$files = array();
$dir = opendir($path);
while (($file = readdir($dir)) !== false) {
if (!in_array($file, $filter)) {
$files[] = $file;
}
}
?>
<p style="opacity: .5;"><small>Random IRC Pics by <b>rolle</b> @ quakenet ~ <b><?php echo count($files); ?></b> files ~ <a href="https://www.pulina.fi">www.pulina.fi</a></small></p>
</body>
</html>