Browse files

* Fixed width issue with secondary icons (bookmarks)

* Added sd/hd icons for snatched shows, falls back to tick if cannot determine quality
* Added /intranet/comingseasons.php - a script that uses the sickbeard api to list upcoming season start dates
* Added season start dates to default bookmarks
  • Loading branch information...
1 parent 3b6a660 commit 9859b98b2cffec4b43411e7c50e0cf78b82f2978 @dbaines committed Apr 23, 2012
View
40 index.php
@@ -88,19 +88,28 @@
if (substr($episode->date,0,10) == $todaysDate && $episode->status == "Snatched") :
- echo "<li>";
+ // Check Quality Snatched
+ if ($episode->{quality} == "SD TV") :
+ $quality = "sd";
+ elseif ($episode->{quality} == "HD TV") :
+ $quality = "hd";
+ endif;
- # Sickbeard Popups
- if($config ['sickPopups']) :
- echo "<span class='showPopup'>";
- echo "<img src='".$sickbeardURL."/showPoster/?show=".$episode->{'tvdbid'}."&which=poster' class='showposter' />";
- echo "</span>";
- endif;
+ echo "<li class=".$quality.">";
+
+ # Sickbeard Popups
+ if($config ['sickPopups']) :
+ echo "<span class='showPopup'>";
+ echo "<img src='".$sickbeardURL."/showPoster/?show=".$episode->{'tvdbid'}."&which=poster' class='showposter' />";
+ echo "</span>";
+ endif;
+
+ # Show name and number
+ echo "<strong class='showname'>".$episode->{'show_name'}." <small>".$episode->{'season'}."x".$episode->{'episode'}."</small></strong>";
+ echo "</li>";
- # Show name and number
- echo "<strong class='showname'>".$episode->{'show_name'}." <small>".$episode->{'season'}."x".$episode->{'episode'}."</small></strong>";
- echo "</li>";
endif;
+
}
echo "</ul>";
@@ -269,10 +278,15 @@
<?php if ( !empty($config['bookmarks']) ) {
foreach ($config['bookmarks'] as $bookmark) {
+
+ // Check for custom icon, otherwise use favicon from website
+ if($bookmark['icon']) {
+ $icon = $bookmark['icon'];
+ } else {
+ $icon = $bookmark['url']."/favicon.ico";
+ }
- //var_dump($bookmark);
- // echo $bookmark['label'];
- echo "<a href='".$bookmark['url']."' target='_blank' class='actionButton small icon'><span style='background-image: url(".$bookmark['url']."/favicon.ico);'>".$bookmark['label']."</span></a>";
+ echo "<a href='".$bookmark['url']."' target='_blank' class='actionButton small icon'><span style='background-image: url(".$icon.");'>".$bookmark['label']."</span></a>";
}
}
View
58 intranet/comingseasons.php
@@ -0,0 +1,58 @@
+<?php
+
+// Include Settings
+include("serverconfig.php");
+
+// Edit Settings
+$username = $config['sickbeardUsername'];
+$password = $config['sickbeardPassword'];
+$ip = $config['sickbeardURL'].":".$config['sickbeardPort'];
+$api = $config['sickbeardAPI'];
+// End Settings
+
+// Check if username is available, set URL
+if($username) {
+ $feed = "http://".$username.":".$password."@".$ip."/api/".$api."/?cmd=future&sort=date&type=later";
+} else {
+ $feed = "http://".$ip."/api/".$api."/?cmd=future&sort=date&type=later";
+}
+$sbJSON = json_decode(file_get_contents($feed));
+?>
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Season Start Dates</title>
+ <link rel="stylesheet" href="style.css" />
+ <link rel="shortcut icon" href="images/wifi.png" />
+ </head>
+ <body>
+ <h1>Season Start Dates</h1>
+ <div class="seasonStarts">
+ <?php
+ echo "<ul>";
+ // Run through each feed item
+ foreach($sbJSON->{data}->{later} as $show) {
+ // Only grab shows of episode 1
+ if($show->{episode} == "1") {
+ // Reformat date
+ $newDate = date("l, j F Y", strtotime($show->{airdate}));
+ // Show Details
+ echo "<li>";
+
+ if($config ['sickPopups']) :
+ echo "<span class='showPopup'>";
+ echo "<img src='http://".$ip."/showPoster/?show=".$show->{'tvdbid'}."&which=poster' class='showposter' />";
+ echo "</span>";
+ endif;
+
+ echo "<strong>".$show->{show_name} . "</strong><br />Season " . $show->{season} . " Starts " .$newDate;
+ echo "</li>";
+ }
+ }
+ echo "</ul>";
+ ?>
+ </div>
+ <script src="js/jquery.js"></script>
+ <script src="js/scripts.js"></script>
+ </body>
+</html>
View
BIN intranet/images/hd.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN intranet/images/sd.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN intranet/images/tv.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 intranet/js/scripts.js
@@ -26,7 +26,7 @@ $(function() {
popup.css("top",-newHeight);
});
- $(".sickbeardShows li").hover(function() {
+ $(".sickbeardShows li, .seasonStarts li").hover(function() {
var popup = $(this).find(".showPopup");
// reset position
View
5 intranet/serverconfig-example.php
@@ -64,8 +64,9 @@
"url" => "http://www.nzbmatrix.com",
),
1 => array(
- "label" => "Google",
- "url" => "http://www.google.com.au",
+ "label" => "Season Start Dates",
+ "url" => "intranet/comingseasons.php",
+ "icon" => "intranet/images/tv.png",
),
),
View
16 intranet/style.css
@@ -47,7 +47,7 @@ h2 {padding-bottom: 10px;}
.actionButton.sabnzb span {background-image: url("images/sab.png");}
.actionButton.utorrent span {background-image: url("images/utorrent.png");}
- .secondaryButtons {padding-top: 30px;}
+ .secondaryButtons {padding-top: 30px; width: 696px;}
.actionButton.icon span {background-position: 0 50%; background-repeat: no-repeat; padding-left: 25px;}
.actionButton.iconTrailer span {background-image: url("images/trailers.png");}
@@ -62,20 +62,28 @@ h2 {padding-bottom: 10px;}
.sickbeardShows {float: right; width: 205px; padding-bottom: 10px; margin-top: -35px;}
.sickbeardShows h3 {padding-bottom: 10px;}
.sickbeardShows ul,
- .sickbeardShows li {list-style: none; padding: 0; margin: 0;}
- .sickbeardShows li {padding: 10px 0; border-top: 1px solid rgba(0,0,0,0.1); position: relative;}
+ .sickbeardShows li,
+ .seasonStarts ul,
+ .seasonStarts li {list-style: none; padding: 0; margin: 0;}
+ .sickbeardShows li,
+ .seasonStarts li {padding: 10px 0; border-top: 1px solid rgba(0,0,0,0.1); position: relative;}
.sickbeardShows .showep {font-size: 80%;}
.showPopup {position: absolute; width: auto; left: -146px; top: -72px; background: rgba(0,0,0,0.9); display: none; box-shadow: 0 0 20px rgba(0,0,0,0.2); z-index: 5;}
.showPopup:after {content: ""; width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 10px solid rgba(0,0,0,0.9); position: absolute; margin-top: -5px; top: 50%; right: -10px; display: block;}
.showPopupBlurb {color: #fff; text-shadow: none; font-size: 85%; padding: 10px; display: block;}
- .sickbeardShows li:hover .showPopup {display: block;}
+ .sickbeardShows li:hover .showPopup,
+ .seasonStarts li:hover .showPopup {display: block;}
.showposter {height: 180px; padding: 5px; float: left;}
.snatchedShows li {background: url("images/tick.png") left no-repeat; padding-left: 25px;}
.snatchedShows strong {color: #346d90; font-weight: normal;}
.snatchedShows .showPopup {top: -80px;}
+ /* If we know what quality was snatched, show a relevant icon */
+ .snatchedShows li.sd {background-image: url("images/sd.png");}
+ .snatchedShows li.hd {background-image: url("images/hd.png");}
+
/* =========================================================
DOWNLOAD DETAILS

0 comments on commit 9859b98

Please sign in to comment.