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