<?php header('Content-Type: text/html; charset=UTF-8'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Seri-o-meter</title>
<?php
// require_once 'css/lessphp/lessc.inc.php';
// lessc::ccompile('style.less', 'style-less.css');
// require_once 'css/least/LEAST.php';
// de\pointedears\css\least\LEAST::compile('style.css', 'style-least.css');
?>
<link rel="stylesheet" href="style.css" type="text/css">
<script type="text/javascript" src="/scripts/builder.php?src=object"></script>
<script type="text/javascript">
/*
function setStyle(obj, style)
{
var styleProperties = Object.getOwnPropertyNames(style);
for (var i = styleProperties.length; i--;)
{
var prop = styleProperties[i];
obj.style[prop] = style[prop];
}
}
function editor()
{
var div = document.createElement("div");
setStyle(div, {
position: "fixed",
right: "0",
top: "0",
width: "200px",
bottom: "0",
backgroundColor: "#ccc"
});
document.body.appendChild(div);
function findRules(selectorText)
{
var slice = Array.prototype.slice;
function toArray(obj)
{
return slice.call(obj);
}
var rx = new RegExp("(^|\\s)" + selectorText.replace(/[^$.(){}\[\]]/, "\\$&") + "\\s*$");
var hits = toArray(document.styleSheets).map(function (styleSheet) {
return toArray(styleSheet.cssRules || styleSheet.rules).filter(function (rule) {
return rx.test(rule.selectorText);
});
}).filter(function (hit) {
return hit.length > 0;
});
return Array.prototype.concat.apply([], hits);
}
var afterRule = findRules(".heroes .o::after");
var rxBgImage = new RegExp(
"{RADIALGRADIENT}\\(\\s*({POSITION}\\s*,\\s*)?({SHAPE}\\s*,\\s*)?{COLORSTOP}(\\s*,\\s*{COLORSTOP})+\\s*\\)"
.replace(/\{RADIALGRADIENT\}/g, "(-(webkit|moz|o|ms)-)?radial-gradient")
.replace(/\{POSITION\}/g, "{LENGTH}(\\s+{LENGTH})?")
.replace(/\{SHAPE\}/g, "\\s*((circle|ellipse)(\\s+({EDGE}))?|{LENGTH}(\\s+{LENGTH}))")
.replace(/\{EDGE\}/g, "cover|closest-corner|closest-side|farthest-corner|farthest-side")
.replace(/\{COLORSTOP\}/g, "{COLOR}(\\s*{PERCENTAGE})?")
.replace(/\{LENGTH\}/g, "{NUMBER}{UNIT}")
.replace(/\{COLOR\}/g, "({COLORNAME}|{RGB}|{RGBA})")
.replace(/\{RGB\}/g, "rgb\\s*\\(\\s*{COLORCOMP}(\\s*,\\s*{COLORCOMP}){2}\\s*\\)")
.replace(/\{RGBA\}/g, "rgba\\s*\\(\\s*{COLORCOMP}(\\s*,\\s*{COLORCOMP}){2}\\s*,\\s*{PERCENTAGE}\\s*\\)")
.replace(/\{COLORCOMP\}/g, "{NUMBER}%?")
.replace(/\{COLORNAME\}/g, "black|transparent")
.replace(/\{PERCENTAGE\}/g, "{NUMBER}%?")
.replace(/\{NUMBER\}/g, "\\d+")
.replace(/\{UNIT\}/g, "(px|%|em|ex|pt)")
, "g");
console.log(rxBgImage);
var value = afterRule[0].style.getPropertyValue("background-image");
console.log(value);
var backgroundImages = value.match(rxBgImage);
console.log(backgroundImages);
}
*/
var _getProperty;
function net()
{
var map = {
"gene-roddenberry's-andromeda": "andromeda",
"battlestar-galactica-2004": "battlestar-galactica",
"battlestar-galactica-2004-de": "battlestar-galactica",
"buffy-the-vampire-slayer": "buffy",
"lois-clark-the-new-adventures-of-superman": "lois-clark-the-new-adventures-of-superman-1993",
};
var translations = {
"akte-x": "the-x-files",
};
var f = function (e) {
if (e && e.shiftKey && e.ctrlKey)
{
var key = this.textContent.toLowerCase()
.replace(/[&:.,()–]/g, "").replace(/[\s·]+/g, "-")
.replace("-de", "");
if (typeof _getProperty == "undefined")
{
_getProperty = jsx.object.getProperty;
}
key = _getProperty(map, key, key);
if (e.altKey)
{
var baseURL = "http://serienjunkies.org/serie/";
}
else
{
key = _getProperty(translations, key, key).replace(/-/g, "_");
baseURL = "http://www.tubeplus.me/search/tv-shows/";
}
window.open(baseURL + encodeURIComponent(key));
e.preventDefault();
}
};
try
{
for (var a = document.links, i = a.length; i--;)
{
var e = a[i];
e.addEventListener("click", f, false);
}
}
catch (e) {}
}
</script>
</head>
<body onload="net() // editor()">
<h1 class="hidden">Seri-o-meter</h1>
<?php // var_dump($serien); ?>
<table
>
<?php
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
{
function strftime_portable
($format, $timestamp = null)
{
if ($timestamp === null)
{
$timestamp = time();
}
$format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format);
return strftime($format, $timestamp);
}
}
else
{
function strftime_portable
($format, $timestamp = null)
{
if ($timestamp === null)
{
$timestamp = time();
}
return strftime($format, $timestamp);
}
}
setlocale(LC_ALL
, 'de_CH.UTF-8');
$this->setLanguage('de');
$min_series = $this->min_series;
foreach ($this->serien as $name => $serie)
{
?>
<tr>
<td style="text-align: center">
<?php
$recommended = ($name === $min_series);
if ($serie->ignore)
{
?>▮▮
<?php
}
else if ($recommended)
{
?>→
<?php
}
?></td>
<th
<?php if ($recommended) { ?> class="recommended"
<?php } ?>>
<?php
$ep_list = $serie->episode_list;
if ($ep_list)
{
?><a href="
<?php
echo $this->escape($serie->episode_list);
?>" title="
<?php echo $this->escape($this->_
('Episode list')); ?>">
<?php
}
echo $serie->title;
if ($ep_list) { ?></a>
<?php }
?><br>
<span style="font-weight: normal">
<?php
if ($serie->channel) echo $serie->channel;
if ($serie->showtimes)
{
echo ', ' . $serie->showtimes;
}
?></span></th>
<td
<?php if ($recommended) { ?> class="recommended"
<?php } ?>>
<div>
<?php echo $this->_
('Watched:'); ?> <?php
$total = $serie->total;
echo $this->getCoverage($serie->seen)
. ' ('
. sprintf($this->_
('%s of %s episodes'), $serie->count, $total)
. ')';
if ($serie->last_seen)
{
?>; zuletzt am
<?php
$last_seen = strftime_portable
('%A, %e. %B %Y %H:%M %z', $serie->last_seen);
// var_dump($serie);
echo mb_detect_encoding($last_seen) == 'UTF-8' ?
$last_seen : utf8_encode($last_seen );
}
?></div>
<div class="box">
<div class="meter"
style="width:
<?php
$percentage = $serie->percentage;
echo $percentage; ?>%"
></div>
<?php
if ($serie->seasons)
{
$offset = 0;
foreach ($serie->seasons as $key => $season)
{
?>
<div class="season"
<?php
if (!is_numeric($key))
{
?> title="
<?php echo $this->escape($key); ?>"
<?php
}
?>
style="
<?php
if ($key === 0)
{
?>border-left: none;
<?php
}
?>left:
<?php echo $offset; ?>%;
width:
<?php echo $season / $total * 100; ?>%"
>
<?php
if (is_numeric($key))
{
echo ($key + 1);
}
else
{
echo $key;
}
?></div>
<?php
$offset += round($season / $total * 100, 1);
}
}
if ($serie->episodes)
{
$prevNumber = null;
foreach ($serie->episodes as $episode => $description)
{
$episode_str = $episode;
if (is_array($serie->season_ranges))
{
foreach ($serie->season_ranges as $season_key => $season_range)
{
if ($episode >= $season_range[0] && $episode <= $season_range[1])
{
$episode_str = sprintf("%u (%ux%02u)", $episode, $season_key, $episode - $season_range[0] + 1);
}
}
}
?>
<div class="coverage"
style="
<?php
if (is_null($prevNumber) || $prevNumber !== $episode - 1)
{
?>border-left: 1px solid rgba(0, 218, 0, 0.5);
<?php
}
?>
border-right: 1px solid rgba(0, 218, 0, 0.5);
background-color: transparent;
left:
<?php echo ($episode - 1) / $total * 100; ?>%;
width:
<?php echo 1 / $total * 100; ?>%"
title="
<?php
echo "{$episode_str}: " . $this->escape($description);
?>"></div>
<?php
$prevNumber = $episode;
}
}
if ($serie->seen)
{
foreach ($serie->seen as $range)
{
if (!is_array($range))
{
$range = array($range, $range);
}
/*
for ($i = $episode[0]; $i < $episode[1]; ++$i)
{
?>
<div class="coverage"
style="left: <?php echo ($episode[0] - 1) / $total * 100; ?>%;
width: <?php echo ($episode[1] - $episode[0] + 1) / $total * 100; ?>%"
></div>
<?php
}
}
else
*/
for ($episode = $range[0]; $episode <= $range[1]; ++$episode)
{
$episode_str = $episode;
if ($serie->season_ranges)
{
foreach ($serie->season_ranges as $season_key => $season_range)
{
if ($episode >= $season_range[0] && $episode <= $season_range[1])
{
$episode_str = sprintf("%u (%ux%02u)", $episode, $season_key, $episode - $season_range[0] + 1);
}
}
}
?>
<div class="coverage"
style="left:
<?php echo ($episode - 1) / $total * 100; ?>%;
width:
<?php echo 1 / $total * 100; ?>%"
<?php
if ($serie->episodes && array_key_exists($episode, $serie->episodes))
{
?>title="
<?php
echo "{$episode_str}: " . $this->escape($serie->episodes[$episode]);
?>"
<?php
}
?>></div>
<?php
}
}
}
?>
<span class="percentage">
<?php echo round($percentage, 1); ?>%</span>
</div>
</td>
</tr>
<?php
}
?>
</table>
</body>
</html>