Rev 51 | Rev 172 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 51 | Rev 64 | ||
|---|---|---|---|
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
2 | "http://www.w3.org/TR/html4/strict.dtd"> |
| 3 | <html lang="de"> |
3 | <html lang="de"> |
| 4 | <head> |
4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 6 | <title>Seri-o-meter</title> |
6 | <title>Seri-o-meter</title> |
| 7 | <?php
|
7 | <?php
|
| 8 | // require_once 'css/lessphp/lessc.inc.php';
|
8 | // require_once 'css/lessphp/lessc.inc.php';
|
| 9 | // lessc::ccompile('style.less', 'style-less.css');
|
9 | // lessc::ccompile('style.less', 'style-less.css');
|
| 10 | require_once 'css/least/LEAST.php'; |
10 | // require_once 'css/least/LEAST.php';
|
| 11 | de\pointedears\css\least\LEAST::compile('style.css', 'style-least.css'); |
11 | // de\pointedears\css\least\LEAST::compile('style.css', 'style-least.css');
|
| 12 | ?>
|
12 | ?>
|
| 13 | <link rel="stylesheet" href="style.css" type="text/css"> |
13 | <link rel="stylesheet" href="style.css" type="text/css"> |
| 14 | <script type="text/javascript"> |
14 | <script type="text/javascript"> |
| 15 | /* |
15 | /* |
| 16 | function setStyle(obj, style) |
16 | function setStyle(obj, style) |
| 17 | {
|
17 | {
|
| 18 | var styleProperties = Object.getOwnPropertyNames(style); |
18 | var styleProperties = Object.getOwnPropertyNames(style); |
| 19 | for (var i = styleProperties.length; i--;) |
19 | for (var i = styleProperties.length; i--;) |
| 20 | {
|
20 | {
|
| 21 | var prop = styleProperties[i]; |
21 | var prop = styleProperties[i]; |
| 22 | obj.style[prop] = style[prop]; |
22 | obj.style[prop] = style[prop]; |
| 23 | } |
23 | } |
| 24 | } |
24 | } |
| 25 | 25 | ||
| 26 | function editor() |
26 | function editor() |
| 27 | {
|
27 | {
|
| 28 | var div = document.createElement("div");
|
28 | var div = document.createElement("div");
|
| 29 | setStyle(div, {
|
29 | setStyle(div, {
|
| 30 | position: "fixed", |
30 | position: "fixed", |
| 31 | right: "0", |
31 | right: "0", |
| 32 | top: "0", |
32 | top: "0", |
| 33 | width: "200px", |
33 | width: "200px", |
| 34 | bottom: "0", |
34 | bottom: "0", |
| 35 | backgroundColor: "#ccc" |
35 | backgroundColor: "#ccc" |
| 36 | }); |
36 | }); |
| 37 | document.body.appendChild(div); |
37 | document.body.appendChild(div); |
| 38 | 38 | ||
| 39 | function findRules(selectorText) |
39 | function findRules(selectorText) |
| 40 | {
|
40 | {
|
| 41 | var slice = Array.prototype.slice; |
41 | var slice = Array.prototype.slice; |
| 42 | function toArray(obj) |
42 | function toArray(obj) |
| 43 | {
|
43 | {
|
| 44 | return slice.call(obj); |
44 | return slice.call(obj); |
| 45 | } |
45 | } |
| 46 | 46 | ||
| 47 | var rx = new RegExp("(^|\\s)" + selectorText.replace(/[^$.(){}\[\]]/, "\\$&") + "\\s*$");
|
47 | var rx = new RegExp("(^|\\s)" + selectorText.replace(/[^$.(){}\[\]]/, "\\$&") + "\\s*$");
|
| 48 | var hits = toArray(document.styleSheets).map(function (styleSheet) {
|
48 | var hits = toArray(document.styleSheets).map(function (styleSheet) {
|
| 49 | return toArray(styleSheet.cssRules || styleSheet.rules).filter(function (rule) {
|
49 | return toArray(styleSheet.cssRules || styleSheet.rules).filter(function (rule) {
|
| 50 | return rx.test(rule.selectorText); |
50 | return rx.test(rule.selectorText); |
| 51 | }); |
51 | }); |
| 52 | }).filter(function (hit) {
|
52 | }).filter(function (hit) {
|
| 53 | return hit.length > 0; |
53 | return hit.length > 0; |
| 54 | }); |
54 | }); |
| 55 | 55 | ||
| 56 | return Array.prototype.concat.apply([], hits); |
56 | return Array.prototype.concat.apply([], hits); |
| 57 | } |
57 | } |
| 58 | 58 | ||
| 59 | var afterRule = findRules(".heroes .o::after");
|
59 | var afterRule = findRules(".heroes .o::after");
|
| 60 | var rxBgImage = new RegExp( |
60 | var rxBgImage = new RegExp( |
| 61 | "{RADIALGRADIENT}\\(\\s*({POSITION}\\s*,\\s*)?({SHAPE}\\s*,\\s*)?{COLORSTOP}(\\s*,\\s*{COLORSTOP})+\\s*\\)"
|
61 | "{RADIALGRADIENT}\\(\\s*({POSITION}\\s*,\\s*)?({SHAPE}\\s*,\\s*)?{COLORSTOP}(\\s*,\\s*{COLORSTOP})+\\s*\\)"
|
| 62 | .replace(/\{RADIALGRADIENT\}/g, "(-(webkit|moz|o|ms)-)?radial-gradient")
|
62 | .replace(/\{RADIALGRADIENT\}/g, "(-(webkit|moz|o|ms)-)?radial-gradient")
|
| 63 | .replace(/\{POSITION\}/g, "{LENGTH}(\\s+{LENGTH})?")
|
63 | .replace(/\{POSITION\}/g, "{LENGTH}(\\s+{LENGTH})?")
|
| 64 | .replace(/\{SHAPE\}/g, "\\s*((circle|ellipse)(\\s+({EDGE}))?|{LENGTH}(\\s+{LENGTH}))")
|
64 | .replace(/\{SHAPE\}/g, "\\s*((circle|ellipse)(\\s+({EDGE}))?|{LENGTH}(\\s+{LENGTH}))")
|
| 65 | .replace(/\{EDGE\}/g, "cover|closest-corner|closest-side|farthest-corner|farthest-side")
|
65 | .replace(/\{EDGE\}/g, "cover|closest-corner|closest-side|farthest-corner|farthest-side")
|
| 66 | .replace(/\{COLORSTOP\}/g, "{COLOR}(\\s*{PERCENTAGE})?")
|
66 | .replace(/\{COLORSTOP\}/g, "{COLOR}(\\s*{PERCENTAGE})?")
|
| 67 | .replace(/\{LENGTH\}/g, "{NUMBER}{UNIT}")
|
67 | .replace(/\{LENGTH\}/g, "{NUMBER}{UNIT}")
|
| 68 | .replace(/\{COLOR\}/g, "({COLORNAME}|{RGB}|{RGBA})")
|
68 | .replace(/\{COLOR\}/g, "({COLORNAME}|{RGB}|{RGBA})")
|
| 69 | .replace(/\{RGB\}/g, "rgb\\s*\\(\\s*{COLORCOMP}(\\s*,\\s*{COLORCOMP}){2}\\s*\\)")
|
69 | .replace(/\{RGB\}/g, "rgb\\s*\\(\\s*{COLORCOMP}(\\s*,\\s*{COLORCOMP}){2}\\s*\\)")
|
| 70 | .replace(/\{RGBA\}/g, "rgba\\s*\\(\\s*{COLORCOMP}(\\s*,\\s*{COLORCOMP}){2}\\s*,\\s*{PERCENTAGE}\\s*\\)")
|
70 | .replace(/\{RGBA\}/g, "rgba\\s*\\(\\s*{COLORCOMP}(\\s*,\\s*{COLORCOMP}){2}\\s*,\\s*{PERCENTAGE}\\s*\\)")
|
| 71 | .replace(/\{COLORCOMP\}/g, "{NUMBER}%?")
|
71 | .replace(/\{COLORCOMP\}/g, "{NUMBER}%?")
|
| 72 | .replace(/\{COLORNAME\}/g, "black|transparent")
|
72 | .replace(/\{COLORNAME\}/g, "black|transparent")
|
| 73 | .replace(/\{PERCENTAGE\}/g, "{NUMBER}%?")
|
73 | .replace(/\{PERCENTAGE\}/g, "{NUMBER}%?")
|
| 74 | .replace(/\{NUMBER\}/g, "\\d+")
|
74 | .replace(/\{NUMBER\}/g, "\\d+")
|
| 75 | .replace(/\{UNIT\}/g, "(px|%|em|ex|pt)")
|
75 | .replace(/\{UNIT\}/g, "(px|%|em|ex|pt)")
|
| 76 | , "g"); |
76 | , "g"); |
| 77 | console.log(rxBgImage); |
77 | console.log(rxBgImage); |
| 78 | var value = afterRule[0].style.getPropertyValue("background-image");
|
78 | var value = afterRule[0].style.getPropertyValue("background-image");
|
| 79 | console.log(value); |
79 | console.log(value); |
| 80 | var backgroundImages = value.match(rxBgImage); |
80 | var backgroundImages = value.match(rxBgImage); |
| 81 | console.log(backgroundImages); |
81 | console.log(backgroundImages); |
| 82 | } |
82 | } |
| 83 | */ |
83 | */ |
| 84 | function net() |
84 | function net() |
| 85 | {
|
85 | {
|
| 86 | var map = {
|
86 | var map = {
|
| 87 | "gene-roddenberry's-andromeda": "andromeda", |
87 | "gene-roddenberry's-andromeda": "andromeda", |
| 88 | "battlestar-galactica-2004": "battlestar-galactica", |
88 | "battlestar-galactica-2004": "battlestar-galactica", |
| 89 | "battlestar-galactica-2004-de": "battlestar-galactica", |
89 | "battlestar-galactica-2004-de": "battlestar-galactica", |
| 90 | "buffy-the-vampire-slayer": "buffy", |
90 | "buffy-the-vampire-slayer": "buffy", |
| 91 | "lois-clark-the-new-adventures-of-superman": "lois-clark-the-new-adventures-of-superman-1993", |
91 | "lois-clark-the-new-adventures-of-superman": "lois-clark-the-new-adventures-of-superman-1993", |
| 92 | get: function (key) {
|
92 | get: function (key) {
|
| 93 | return this.hasOwnProperty(key) ? this[key] : key; |
93 | return this.hasOwnProperty(key) ? this[key] : key; |
| 94 | } |
94 | } |
| 95 | }; |
95 | }; |
| 96 | 96 | ||
| 97 | var f = function (e) {
|
97 | var f = function (e) {
|
| 98 | if (e && e.shiftKey && e.ctrlKey) |
98 | if (e && e.shiftKey && e.ctrlKey) |
| 99 | {
|
99 | {
|
| 100 | var key = map.get(this.textContent.toLowerCase() |
100 | var key = map.get(this.textContent.toLowerCase() |
| 101 | .replace(/[&:.,()–]/g, "").replace(/\s+/g, "-").replace("-de", ""));
|
101 | .replace(/[&:.,()–]/g, "").replace(/\s+/g, "-").replace("-de", ""));
|
| 102 | window.open("http://serienjunkies.org/serie/" + encodeURIComponent(key));
|
102 | window.open("http://serienjunkies.org/serie/" + encodeURIComponent(key));
|
| 103 | e.preventDefault(); |
103 | e.preventDefault(); |
| 104 | } |
104 | } |
| 105 | }; |
105 | }; |
| 106 | 106 | ||
| 107 | try |
107 | try |
| 108 | {
|
108 | {
|
| 109 | for (var a = document.links, i = a.length; i--;) |
109 | for (var a = document.links, i = a.length; i--;) |
| 110 | {
|
110 | {
|
| 111 | var e = a[i]; |
111 | var e = a[i]; |
| 112 | e.addEventListener("click", f, false);
|
112 | e.addEventListener("click", f, false);
|
| 113 | } |
113 | } |
| 114 | } |
114 | } |
| 115 | catch (e) {}
|
115 | catch (e) {}
|
| 116 | } |
116 | } |
| 117 | </script> |
117 | </script> |
| 118 | </head> |
118 | </head> |
| 119 | 119 | ||
| 120 | <body onload="net() // editor()"> |
120 | <body onload="net() // editor()"> |
| 121 | <h1 class="hidden">Seri-o-meter</h1> |
121 | <h1 class="hidden">Seri-o-meter</h1> |
| 122 | <?php // var_dump($serien); ?> |
122 | <?php // var_dump($serien); ?> |
| 123 | <table> |
123 | <table> |
| 124 | <?php
|
124 | <?php
|
| 125 | if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') |
125 | if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') |
| 126 | {
|
126 | {
|
| 127 | function strftime_portable ($format, $timestamp = null) |
127 | function strftime_portable ($format, $timestamp = null) |
| 128 | {
|
128 | {
|
| 129 | if ($timestamp === null) |
129 | if ($timestamp === null) |
| 130 | {
|
130 | {
|
| 131 | $timestamp = time(); |
131 | $timestamp = time(); |
| 132 | }
|
132 | }
|
| 133 | 133 | ||
| 134 | $format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format); |
134 | $format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format); |
| 135 | return strftime($format, $timestamp); |
135 | return strftime($format, $timestamp); |
| 136 | }
|
136 | }
|
| 137 | }
|
137 | }
|
| 138 | else
|
138 | else
|
| 139 | {
|
139 | {
|
| 140 | function strftime_portable ($format, $timestamp = null) |
140 | function strftime_portable ($format, $timestamp = null) |
| 141 | {
|
141 | {
|
| 142 | if ($timestamp === null) |
142 | if ($timestamp === null) |
| 143 | {
|
143 | {
|
| 144 | $timestamp = time(); |
144 | $timestamp = time(); |
| 145 | }
|
145 | }
|
| 146 | 146 | ||
| 147 | return strftime($format, $timestamp); |
147 | return strftime($format, $timestamp); |
| 148 | }
|
148 | }
|
| 149 | }
|
149 | }
|
| 150 | 150 | ||
| 151 | setlocale(LC_ALL, 'de_CH.UTF-8'); |
151 | setlocale(LC_ALL, 'de_CH.UTF-8'); |
| 152 | 152 | ||
| 153 | foreach ($serien as $name => &$serie) |
153 | foreach ($serien as $name => &$serie) |
| 154 | {
|
154 | {
|
| 155 | ?>
|
155 | ?>
|
| 156 | <tr> |
156 | <tr> |
| 157 | <td style="text-align: center"><?php
|
157 | <td style="text-align: center"><?php
|
| 158 | $recommended = ($name === $min_series); |
158 | $recommended = ($name === $min_series); |
| 159 | if ($recommended) { ?>→<?php } |
159 | if ($recommended) { ?>→<?php } |
| 160 | if (isset($serie['ignore']) && $serie['ignore']) |
160 | if (isset($serie['ignore']) && $serie['ignore']) |
| 161 | {
|
161 | {
|
| 162 | ?>→<span style="color: red; font-weight: bold">⃠</span><?php |
162 | ?>→<span style="color: red; font-weight: bold">⃠</span><?php |
| 163 | }
|
163 | }
|
| 164 | ?></td>
|
164 | ?></td>
|
| 165 | <th<?php if ($recommended) { ?> class="recommended"<?php } ?>><?php |
165 | <th<?php if ($recommended) { ?> class="recommended"<?php } ?>><?php |
| 166 | $ep_list = isset($serie['episode_list']); |
166 | $ep_list = isset($serie['episode_list']); |
| 167 | if ($ep_list) |
167 | if ($ep_list) |
| 168 | {
|
168 | {
|
| 169 | ?><a href="<?php |
169 | ?><a href="<?php |
| 170 | echo htmlspecialchars($serie['episode_list']); |
170 | echo htmlspecialchars($serie['episode_list']); |
| 171 | ?>" title="Episodenliste"><?php |
171 | ?>" title="Episodenliste"><?php |
| 172 | }
|
172 | }
|
| 173 | echo $name; |
173 | echo $name; |
| 174 | if ($ep_list) { ?></a><?php } |
174 | if ($ep_list) { ?></a><?php } |
| 175 | ?><br>
|
175 | ?><br>
|
| 176 | <span style="font-weight: normal"><?php
|
176 | <span style="font-weight: normal"><?php
|
| 177 | if (array_key_exists('channel', $serie)) echo $serie['channel']; |
177 | if (array_key_exists('channel', $serie)) echo $serie['channel']; |
| 178 | 178 | ||
| 179 | if (array_key_exists('showtimes', $serie)) |
179 | if (array_key_exists('showtimes', $serie)) |
| 180 | {
|
180 | {
|
| 181 | echo ', ' . $serie['showtimes']; |
181 | echo ', ' . $serie['showtimes']; |
| 182 | }
|
182 | }
|
| 183 | ?></span></th>
|
183 | ?></span></th>
|
| 184 | <td<?php if ($recommended) { ?> class="recommended"<?php } ?>> |
184 | <td<?php if ($recommended) { ?> class="recommended"<?php } ?>> |
| 185 | <div>Gesehen: <?php
|
185 | <div>Gesehen: <?php
|
| 186 | echo implode(', ', $serie['coverage']) . ' ('. $serie['count']; |
186 | echo implode(', ', $serie['coverage']) . ' ('. $serie['count']; |
| 187 | ?> von <?php $total = $serie['total']; echo $total; ?> Episoden)<?php |
187 | ?> von <?php $total = $serie['total']; echo $total; ?> Episoden)<?php |
| 188 | if (isset($serie['last_seen'])) |
188 | if (isset($serie['last_seen'])) |
| 189 | {
|
189 | {
|
| 190 | ?>; zuletzt am <?php |
190 | ?>; zuletzt am <?php |
| 191 | echo strftime_portable('%A, %e. %B %Y %H:%M %z', $serie['last_seen']); |
191 | echo strftime_portable('%A, %e. %B %Y %H:%M %z', $serie['last_seen']); |
| 192 | }
|
192 | }
|
| 193 | ?></div>
|
193 | ?></div>
|
| 194 | <div class="box"> |
194 | <div class="box"> |
| 195 | <div class="meter" |
195 | <div class="meter" |
| 196 | style="width: <?php
|
196 | style="width: <?php
|
| 197 | $percentage = $serie['percentage']; |
197 | $percentage = $serie['percentage']; |
| 198 | echo $percentage; ?>%" |
198 | echo $percentage; ?>%" |
| 199 | ></div> |
199 | ></div> |
| 200 | <?php
|
200 | <?php
|
| 201 | if (array_key_exists('seasons', $serie)) |
201 | if (array_key_exists('seasons', $serie)) |
| 202 | {
|
202 | {
|
| 203 | $offset = 0; |
203 | $offset = 0; |
| 204 | foreach ($serie['seasons'] as $key => $season) |
204 | foreach ($serie['seasons'] as $key => $season) |
| 205 | {
|
205 | {
|
| 206 | ?>
|
206 | ?>
|
| 207 | <div class="season" |
207 | <div class="season" |
| 208 | <?php
|
208 | <?php
|
| 209 | if (!is_numeric($key)) |
209 | if (!is_numeric($key)) |
| 210 | {
|
210 | {
|
| 211 | ?> title="<?php echo htmlspecialchars($key); ?>"<?php |
211 | ?> title="<?php echo htmlspecialchars($key); ?>"<?php |
| 212 | }
|
212 | }
|
| 213 | ?>
|
213 | ?>
|
| 214 | style="<?php
|
214 | style="<?php
|
| 215 | if ($key === 0) |
215 | if ($key === 0) |
| 216 | {
|
216 | {
|
| 217 | ?>border-left: none; <?php |
217 | ?>border-left: none; <?php |
| 218 | }
|
218 | }
|
| 219 | ?>left: <?php echo $offset; ?>%; |
219 | ?>left: <?php echo $offset; ?>%; |
| 220 | width: <?php echo $season / $total * 100; ?>%" |
220 | width: <?php echo $season / $total * 100; ?>%" |
| 221 | ><?php
|
221 | ><?php
|
| 222 | if (is_numeric($key)) |
222 | if (is_numeric($key)) |
| 223 | {
|
223 | {
|
| 224 | echo ($key + 1); |
224 | echo ($key + 1); |
| 225 | }
|
225 | }
|
| 226 | else
|
226 | else
|
| 227 | {
|
227 | {
|
| 228 | echo $key; |
228 | echo $key; |
| 229 | }
|
229 | }
|
| 230 | ?></div>
|
230 | ?></div>
|
| 231 | <?php
|
231 | <?php
|
| 232 | $offset += round($season / $total * 100, 1); |
232 | $offset += round($season / $total * 100, 1); |
| 233 | }
|
233 | }
|
| 234 | }
|
234 | }
|
| 235 | 235 | ||
| 236 | if (isset($serie['episodes'])) |
236 | if (isset($serie['episodes'])) |
| 237 | {
|
237 | {
|
| 238 | $prevNumber = null; |
238 | $prevNumber = null; |
| 239 | foreach ($serie['episodes'] as $episode => $description) |
239 | foreach ($serie['episodes'] as $episode => $description) |
| 240 | {
|
240 | {
|
| 241 | $episode_str = $episode; |
241 | $episode_str = $episode; |
| 242 | if (isset($serie['season_ranges']) && is_array($serie['season_ranges'])) |
242 | if (isset($serie['season_ranges']) && is_array($serie['season_ranges'])) |
| 243 | {
|
243 | {
|
| 244 | foreach ($serie['season_ranges'] as $season_key => $season_range) |
244 | foreach ($serie['season_ranges'] as $season_key => $season_range) |
| 245 | {
|
245 | {
|
| 246 | if ($episode >= $season_range[0] && $episode <= $season_range[1]) |
246 | if ($episode >= $season_range[0] && $episode <= $season_range[1]) |
| 247 | {
|
247 | {
|
| 248 | $episode_str = sprintf("%u (%ux%02u)", $episode, $season_key, $episode - $season_range[0] + 1); |
248 | $episode_str = sprintf("%u (%ux%02u)", $episode, $season_key, $episode - $season_range[0] + 1); |
| 249 | }
|
249 | }
|
| 250 | }
|
250 | }
|
| 251 | }
|
251 | }
|
| 252 | ?>
|
252 | ?>
|
| 253 | <div class="coverage" |
253 | <div class="coverage" |
| 254 | style="<?php
|
254 | style="<?php
|
| 255 | if (is_null($prevNumber) || $prevNumber !== $episode - 1) |
255 | if (is_null($prevNumber) || $prevNumber !== $episode - 1) |
| 256 | {
|
256 | {
|
| 257 | ?>border-left: 1px solid rgba(0, 218, 0, 0.5); <?php |
257 | ?>border-left: 1px solid rgba(0, 218, 0, 0.5); <?php |
| 258 | }
|
258 | }
|
| 259 | ?>
|
259 | ?>
|
| 260 | border-right: 1px solid rgba(0, 218, 0, 0.5); |
260 | border-right: 1px solid rgba(0, 218, 0, 0.5); |
| 261 | background-color: transparent; |
261 | background-color: transparent; |
| 262 | left: <?php echo ($episode - 1) / $total * 100; ?>%; |
262 | left: <?php echo ($episode - 1) / $total * 100; ?>%; |
| 263 | width: <?php echo 1 / $total * 100; ?>%" |
263 | width: <?php echo 1 / $total * 100; ?>%" |
| 264 | title="<?php
|
264 | title="<?php
|
| 265 | echo "{$episode_str}: " . htmlspecialchars($description); |
265 | echo "{$episode_str}: " . htmlspecialchars($description); |
| 266 | ?>"></div><?php |
266 | ?>"></div><?php |
| 267 | $prevNumber = $episode; |
267 | $prevNumber = $episode; |
| 268 | }
|
268 | }
|
| 269 | }
|
269 | }
|
| 270 | 270 | ||
| 271 | if (isset($serie['seen'])) |
271 | if (isset($serie['seen'])) |
| 272 | {
|
272 | {
|
| 273 | foreach ($serie['seen'] as $range) |
273 | foreach ($serie['seen'] as $range) |
| 274 | {
|
274 | {
|
| 275 | if (!is_array($range)) |
275 | if (!is_array($range)) |
| 276 | {
|
276 | {
|
| 277 | $range = array($range, $range); |
277 | $range = array($range, $range); |
| 278 | }
|
278 | }
|
| 279 | /*
|
279 | /*
|
| 280 | for ($i = $episode[0]; $i < $episode[1]; ++$i)
|
280 | for ($i = $episode[0]; $i < $episode[1]; ++$i)
|
| 281 | {
|
281 | {
|
| 282 | ?>
|
282 | ?>
|
| 283 | <div class="coverage"
|
283 | <div class="coverage"
|
| 284 | style="left: <?php echo ($episode[0] - 1) / $total * 100; ?>%;
|
284 | style="left: <?php echo ($episode[0] - 1) / $total * 100; ?>%;
|
| 285 | width: <?php echo ($episode[1] - $episode[0] + 1) / $total * 100; ?>%"
|
285 | width: <?php echo ($episode[1] - $episode[0] + 1) / $total * 100; ?>%"
|
| 286 | ></div>
|
286 | ></div>
|
| 287 | <?php
|
287 | <?php
|
| 288 | }
|
288 | }
|
| 289 | }
|
289 | }
|
| 290 | else
|
290 | else
|
| 291 | */
|
291 | */
|
| 292 | 292 | ||
| 293 | for ($episode = $range[0]; $episode <= $range[1]; ++$episode) |
293 | for ($episode = $range[0]; $episode <= $range[1]; ++$episode) |
| 294 | {
|
294 | {
|
| 295 | $episode_str = $episode; |
295 | $episode_str = $episode; |
| 296 | if (isset($serie['season_ranges']) && is_array($serie['season_ranges'])) |
296 | if (isset($serie['season_ranges']) && is_array($serie['season_ranges'])) |
| 297 | {
|
297 | {
|
| 298 | foreach ($serie['season_ranges'] as $season_key => $season_range) |
298 | foreach ($serie['season_ranges'] as $season_key => $season_range) |
| 299 | {
|
299 | {
|
| 300 | if ($episode >= $season_range[0] && $episode <= $season_range[1]) |
300 | if ($episode >= $season_range[0] && $episode <= $season_range[1]) |
| 301 | {
|
301 | {
|
| 302 | $episode_str = sprintf("%u (%ux%02u)", $episode, $season_key, $episode - $season_range[0] + 1); |
302 | $episode_str = sprintf("%u (%ux%02u)", $episode, $season_key, $episode - $season_range[0] + 1); |
| 303 | }
|
303 | }
|
| 304 | }
|
304 | }
|
| 305 | }
|
305 | }
|
| 306 | ?>
|
306 | ?>
|
| 307 | <div class="coverage" |
307 | <div class="coverage" |
| 308 | style="left: <?php echo ($episode - 1) / $total * 100; ?>%; |
308 | style="left: <?php echo ($episode - 1) / $total * 100; ?>%; |
| 309 | width: <?php echo 1 / $total * 100; ?>%" |
309 | width: <?php echo 1 / $total * 100; ?>%" |
| 310 | <?php
|
310 | <?php
|
| 311 | if (isset($serie['episodes']) && array_key_exists($episode, $serie['episodes'])) |
311 | if (isset($serie['episodes']) && array_key_exists($episode, $serie['episodes'])) |
| 312 | {
|
312 | {
|
| 313 | ?>title="<?php |
313 | ?>title="<?php |
| 314 | echo "{$episode_str}: " . htmlspecialchars($serie['episodes'][$episode]); |
314 | echo "{$episode_str}: " . htmlspecialchars($serie['episodes'][$episode]); |
| 315 | ?>"<?php |
315 | ?>"<?php |
| 316 | }
|
316 | }
|
| 317 | ?>></div>
|
317 | ?>></div>
|
| 318 | <?php
|
318 | <?php
|
| 319 | }
|
319 | }
|
| 320 | }
|
320 | }
|
| 321 | }
|
321 | }
|
| 322 | ?>
|
322 | ?>
|
| 323 | <span class="percentage"><?php echo round($percentage, 1); ?>%</span> |
323 | <span class="percentage"><?php echo round($percentage, 1); ?>%</span> |
| 324 | </div> |
324 | </div> |
| 325 | </td> |
325 | </td> |
| 326 | </tr> |
326 | </tr> |
| 327 | <?php
|
327 | <?php
|
| 328 | }
|
328 | }
|
| 329 | ?>
|
329 | ?>
|
| 330 | </table> |
330 | </table> |
| 331 | </body> |
331 | </body> |
| 332 | </html> |
332 | </html> |