<?php require_once "config.php"; require_once WWW_DIR . "/lib/adminpage.php"; require_once WWW_DIR . "/lib/tvinfo.php"; $page = new AdminPage(); $tvinfo = new TvInfo(); $page->title = "TV List"; $tname = ""; if (isset($_REQUEST['name']) && !empty($_REQUEST['name'])) { $tname = $_REQUEST['name']; } $tcount = $tvinfo->getCount($tname); $offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0; $tsearch = $tname != "" ? 'name=' . $tname . '&' : ''; $page->smarty->assign('pagertotalitems', $tcount); $page->smarty->assign('pageroffset', $offset); $page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE); $page->smarty->assign('pagerquerybase', WWW_TOP . "/tvinfo-list.php?" . $tsearch . "&offset="); $pager = $page->smarty->fetch("pager.tpl"); $page->smarty->assign('pager', $pager); $page->smarty->assign('name', $tname); $tvinfolist = $tvinfo->getRange($offset, ITEMS_PER_PAGE, $tname); $page->smarty->assign('tvinfolist', $tvinfolist); $page->content = $page->smarty->fetch('tvinfo-list.tpl'); $page->render();
<?php require_once WWW_DIR . "/lib/releases.php"; require_once WWW_DIR . "/lib/tvinfo.php"; if (!$users->isLoggedIn()) { $page->show403(); } if (!isset($_REQUEST["id"])) { $page->show404(); } $r = new Releases(); $rel = $r->getByGuid($_REQUEST["id"]); if (!$rel) { print "No tv info"; } else { print "<ul class=\"ui-tooltip-newznab\">\n"; print "<li>" . htmlentities($rel["tvtitle"], ENT_QUOTES) . "</li>\n"; print "<li>Aired on " . date("F j, Y", strtotime($rel["tvairdate"])) . "</li>\n"; print "</ul>"; if ($rel["tvinfoID"] > 0) { $t = new TvInfo(); $row = $t->getByID($rel["tvinfoID"]); if ($row && $row["cover"] == 1) { print "<img class=\"shadow\" src=\"" . WWW_TOP . "/covers/tv/" . $row["ID"] . ".jpg\" width=\"180\"/>"; } } }
<?php require_once "config.php"; require_once WWW_DIR . "/lib/adminpage.php"; require_once WWW_DIR . "/lib/tvinfo.php"; $page = new AdminPage(); $tvinfo = new TvInfo(); $id = 0; // set the current action $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view'; switch ($action) { case 'update': $tvinfo->refresh($_GET["id"]); if (isset($_GET['from']) && !empty($_GET['from'])) { header("Location:" . $_GET['from']); exit; } header("Location:" . WWW_TOP . "/tvinfo-edit.php?id=" . $_GET["id"]); exit; case 'submit': if ($_POST["id"] == "") { $imgbytes = ""; if ($_FILES['imagedata']['size'] > 0) { $fileName = $_FILES['imagedata']['name']; $tmpName = $_FILES['imagedata']['tmp_name']; $fileSize = $_FILES['imagedata']['size']; $fileType = $_FILES['imagedata']['type']; // // check the uploaded file is actually an image. // $file_info = getimagesize($tmpName);
<?php define('FS_ROOT', realpath(dirname(__FILE__))); require_once FS_ROOT . "/../../www/config.php"; require_once FS_ROOT . "/../../www/lib/framework/db.php"; require_once FS_ROOT . "/../../www/lib/tvinfo.php"; require_once FS_ROOT . "/../../www/lib/thetvdb.php"; require_once FS_ROOT . "/../../www/lib/releases.php"; require_once FS_ROOT . "/../../www/lib/site.php"; $db = new Db(); $t = new TvInfo(true); $tvdb = new TheTVDB(true); // // all entries with a blank description /* $rows = $db->query("select ID, releasetitle from tvinfo where description is null and ID in (select distinct tvinfoID from releases) order by ID desc"); */ // // all entries with no image or description $rows = $db->query("select ID, releasetitle from tvinfo\n where (cover=0 or coalesce(description,'') = '')\n and ID in (select distinct tvinfoID from releases)\n and localonly = 0\n order by releasetitle desc"); echo "Updating " . count($rows) . " entries \n"; foreach ($rows as $row) { $t->refresh($row["ID"]); echo "Refreshing " . $row["releasetitle"] . "\n"; } /* // process every tv release sat waiting with -1 $s = New Sites;
<?php define('FS_ROOT', realpath(dirname(__FILE__))); require_once FS_ROOT . "/../../www/config.php"; require_once FS_ROOT . "/../../www/lib/framework/db.php"; require_once FS_ROOT . "/../../www/lib/tvmaze.php"; require_once FS_ROOT . "/../../www/lib/tvinfo.php"; require_once FS_ROOT . "/../../www/lib/category.php"; /* * Get a sample of releases from tv category and test results against TVMaze SingleSearch * http://www.tvmaze.com/api */ $db = new DB(); $tvinfo = new TvInfo(); $tvmaze = new TVMaze(); $matches = $totalchecked = 0; $sql = sprintf("select distinct searchname from releases where categoryID in (%d, %d) limit 100", Category::CAT_TV_HD, Category::CAT_TV_SD); $rows = $db->query($sql); $cleannames = array(); foreach ($rows as $row) { $show = $tvinfo->parseNameEpSeason($row['searchname']); $cleannames[] = $show["cleanname"]; } foreach (array_unique($cleannames) as $row) { if ($row && starts_with_upper($row)) { $totalchecked++; $mazerow = $tvmaze->singleSearch($row); if ($mazerow) { echo sprintf("Y Show: %s | Maze: %s : %s%%\n", $row, $mazerow->name, $tvinfo->compare($row, $mazerow->name), $matches++); print_r($mazerow->externalIDs); } else {
/** * Process all TV related releases which will assign their series/episode data */ public function processTv() { if ($this->site->lookupanidb == 1) { $anidb = new AniDB($this->echooutput); $anidb->animetitlesUpdate(); $anidb->processAnimeReleases(); } $tvinfo = new TvInfo($this->echooutput); $tvinfo->processTvReleases($this->site); }
<?php require_once WWW_DIR . "/lib/tvinfo.php"; if (!$users->isLoggedIn()) { $page->show403(); } $tvinfo = new TvInfo(); $date = date("Y-m-d"); if (isset($_GET["date"])) { $date = $_GET["date"]; } $timestamp = strtotime($date); // make it 7 days before, 7 days after $start = $timestamp - 86400 * 7; for ($i = 0; $i <= 13; $i++) { $start = $start + 86400; $cal[] = date("Y-m-d", $start); } $prettydate = date("l, jS F Y", $timestamp); $prepretty = date("l, jS F Y", $timestamp - 86400); $nxtpretty = date("l, jS F Y", $timestamp + 86400); $predaydata = $tvinfo->getCalendar(date("Y-m-d", $timestamp - 86400)); $nxtdaydata = $tvinfo->getCalendar(date("Y-m-d", $timestamp + 86400)); $daydata = $tvinfo->getCalendar($date); $page->smarty->assign('date', $prettydate); $page->smarty->assign('predate', $prepretty); $page->smarty->assign('nxtdate', $nxtpretty); $page->smarty->assign('daydata', $daydata); $page->smarty->assign('predata', $predaydata); $page->smarty->assign('nxtdata', $nxtdaydata); $page->smarty->assign('cal', $cal);
<?php require_once "config.php"; require_once WWW_DIR . "/lib/adminpage.php"; require_once WWW_DIR . "/lib/tvinfo.php"; $page = new AdminPage(); if (isset($_GET['id'])) { $tvinfo = new TvInfo(); $tvinfo->delete($_GET['id']); } $referrer = $_SERVER['HTTP_REFERER']; header("Location: " . $referrer);
<?php define('FS_ROOT', realpath(dirname(__FILE__))); require_once FS_ROOT . "/../../www/config.php"; require_once FS_ROOT . "/../../www/lib/framework/db.php"; require_once FS_ROOT . "/../../www/lib/tvinfo.php"; $t = new TvInfo(); $db = new Db(); $shows = $db->query("select name from releases where categoryID IN (select ID from category where parentID = 5000) limit 0, 50"); foreach ($shows as $show) { $res = $t->parseNameEpSeason($show['name']); $res['release'] = $show['name']; print_r($res); }
require_once WWW_DIR . "/lib/releases.php"; require_once WWW_DIR . "/lib/releasefiles.php"; require_once WWW_DIR . "/lib/releasecomments.php"; require_once WWW_DIR . "/lib/releaseextra.php"; require_once WWW_DIR . "/lib/tvinfo.php"; require_once WWW_DIR . "/lib/anidb.php"; require_once WWW_DIR . "/lib/predb.php"; if (!$users->isLoggedIn()) { $page->show403(); } if (isset($_GET["id"])) { $releases = new Releases(); $rc = new ReleaseComments(); $re = new ReleaseExtra(); $tvi = new TvInfo(); $data = $releases->getByGuid($_GET["id"]); if (!$data) { $page->show404(); } if ($page->isPostBack()) { $rc->addComment($data["ID"], $data["gid"], $_POST["txtAddComment"], $users->currentUserId(), $_SERVER['REMOTE_ADDR']); } $nfo = $releases->getReleaseNfo($data["ID"], false); $reVideo = $re->getVideo($data["ID"]); $reAudio = $re->getAudio($data["ID"]); $reSubs = $re->getSubs($data["ID"]); $comments = $rc->getCommentsByGid($data["gid"]); $tvinfo = ''; if ($data["tvinfoID"] != '') { $tvinfo = $tvi->getByID($data["tvinfoID"]);
<?php //run this once per day require "config.php"; require_once WWW_DIR . "/lib/tvinfo.php"; $tvinfo = new TvInfo(true); $tvinfo->updateSchedule(); $tvinfo->refreshMissingCovers();
<?php require_once WWW_DIR . "/lib/releases.php"; require_once WWW_DIR . "/lib/tvinfo.php"; require_once WWW_DIR . "/lib/category.php"; require_once WWW_DIR . "/lib/userseries.php"; $releases = new Releases(); $tvinfo = new TvInfo(); $cat = new Category(); $us = new UserSeries(); if (!$users->isLoggedIn()) { $page->show403(); } if (isset($_GET["id"]) && ctype_digit($_GET['id'])) { $category = -1; if (isset($_REQUEST["t"]) && ctype_digit($_REQUEST["t"])) { $category = $_REQUEST["t"]; } $catarray = array(); $catarray[] = $category; $rel = $releases->searchbytvinfoId($_GET["id"], '', '', 0, 1000, "", $catarray, -1); $tvinforow = $tvinfo->getByID($_GET['id']); $page->smarty->assign('tvinforow', $tvinforow); if (!$tvinforow) { $page->show404(); } elseif (!$rel) { $page->smarty->assign("nodata", "No releases for this series."); } else { $myshows = $us->getShow($users->currentUserId(), $_GET['id']); //sort releases by season, episode, date posted $season = $episode = $posted = array();