function showInfo($name, $language) { $Ad = new thetvdbcomAdapter(); $info = $Ad->getInfo($name, $language); if ($info === null) { die("<p>Sorry, there is no information available for '{$name}({$language})'</p>"); } BPS::setProperty("NewSeriesGUI", "loadBanner", str_replace("http://", "", $info->Banner)); $B = new Button("save\nseries", "./trinityDB/Serien/Serien.png"); $B->rmePCR("Serie", "-1", "newSeriesFromID", array("'{$info->Name}'", "'{$language}'", "'{$info->SeriesID}'"), "contentManager.loadFrame('contentLeft', 'Serie', transport.responseText);"); #$B->style("float:right;"); echo "\n\t\t\t<div style=\"margin-left:10px;width:765px;border-right-width:1px;border-right-style:solid;\" class=\"borderColor1\">\n\t\t\t\t{$B}\n\t\t\t\t<div style=\"height:20px;\"></div>\n\t\t\t\t<img src=\"" . DBImageGUI::imageLink("NewSeriesGUI", "loadBanner" . $info->SeriesID, "Banner") . "\" style=\"width:758px;height:140px;\" /><br />\n\t\t\t\t<p style=\"-moz-column-count: 3;-moz-column-gap: 1em;-moz-column-rule: 1px solid black;-webkit-column-count: 3;-webkit-column-gap: 1em;-webkit-column-rule: 1px solid black;\">" . $info->Overview . "</p>\n\t\t\t</div>"; }
function getHTML($id) { $this->loadMeOrEmpty(); $gui = new HTMLGUI2(); $gui->setObject($this); $gui->setName("Serie"); $gui->setShowAttributes(array("name", "sprache", "dir", "lastupdate", "genre", "description", "status", "quality", "RSSFilterID", "altFeedName1", "altFileName1")); #$gui->setType("adapter", "hidden"); #$gui->setType("lastupdate", "readonly"); #$gui->setType("siteID", "hidden"); #$gui->setType("url", "hidden"); $gui->setType("description", "textarea"); $gui->setLabel("sprache", "Language"); $gui->setLabel("lastupdate", "Last update"); $gui->setLabel("RSSFilterID", "RSS feed"); $gui->setLabel("altFileName1", "alt. file name"); $gui->setLabel("altFeedName1", "alt. feed name"); $gui->setFieldDescription("altFileName1", "This is useful if the filenames do not match the full series name. trinityDB will then look for both names on the harddrive. For example 'switch' instead of 'Switch Reloaded'."); $gui->setFieldDescription("altFeedName1", "This is useful if the feed names do not match the full series name. trinityDB will then look for both names in the feeds. For example 'Human.Target.2010' instead of 'Human Target (2010)'."); $gui->setParser("lastupdate", "SerieGUI::lastUpdateParser"); $gui->setType("quality", "select"); $gui->setOptions("quality", array_keys(self::getQualities()), array_values(self::getQualities())); $gui->setType("sprache", "select"); $gui->setOptions("sprache", array("en", "de"), array("english", "deutsch")); $gui->setStandardSaveButton($this); $gui->insertSpaceAbove("RSSFilterID"); $gui->selectWithCollection("RSSFilterID", new mRSSFilterGUI(), "RSSFilterName", "none"); $tab = new HTMLSideTable("right"); $B = new Button("Download\nepisodes", "./trinityDB/Serien/Updates.png"); #$B->rmePCR("Serie", $this->ID, "downloadEpisodes", array("'1'"), "Popup.display('Download-Status', transport);"); $B->popup("", "Download-Status", "Serie", $this->ID, "downloadEpisodes", array("'1'")); $S = new Button("Settings", "./images/i2/settings.png"); $S->type("icon"); $S->style("float:right;margin-right:-20px;"); $S->contextMenu("Serie", "download", "Settings"); $tab->addRow($S . $B); $B = new Button("Show\nepisodes", "./trinityDB/Serien/Folge.png"); $B->onclick("contentManager.loadFrame('contentLeft','mFolge',-1,0,'mFolgeGUI;SerieID:" . $this->getID() . "');"); $tab->addRow($B); #$B = new Button("Find new\nepisodes","./trinityDB/RSSFilter/RSSFilter.png"); #$B->rmePCR("Serie", $this->ID, "checkRSS", "", "Popup.display('Episoden-Status', transport);"); #$tab->addRow($B); $B = new Button("Check\nepisodes", "okCatch"); $B->rmePCR("Serie", $this->ID, "checkAllEpisodes", "", "Popup.display('Episoden-Status', transport);"); $tab->addRow($B); $Image = new Button("", DBImageGUI::imageLink("Serie", $this->getID(), "cover", false, true), "icon"); $Image->style("width:150px;"); $tab->addRow(array($Image)); return $tab . $gui->getEditHTML(); }
public function A($name) { if ($this->ID != "Textbausteine") { return; } return DBImageGUI::stringifyS("image/" . Util::ext($name), FileStorage::getFilesDir() . $this->ID . "/{$name}"); }
public function getCover($data) { $I = new DBImageGUI(); $I->getHTML("Serie:::" . $data["P0"] . ":::coverThumb"); }
public function download(Serie $S, $echo = false) { $tab = new HTMLTable(1); $mirrorPath = $this->getMirror(); $tab->addRow("Retrieving mirror list... using {$mirrorPath}"); $serverTime = $this->getServerTime(); $tab->addRow("Retrieving server time... {$serverTime}"); $S->changeA("lastupdate", $serverTime); if ($S->A("siteID") == 0) { $tab->addRow("Retrieving series information..."); $data = file_get_contents("{$mirrorPath}/api/GetSeries.php?seriesname=" . urlencode($S->A("name")) . "&language=" . $S->A("sprache")); if ($data === false) { throw new Exception("No data from {$mirrorPath}/api/GetSeries.php?seriesname=" . urlencode($S->A("name")) . "&language=" . $S->A("sprache")); } #die("DATA: $data"); $seriesInfo = new SimpleXMLElement($data, null, false); $seriesID = $seriesInfo->Series->seriesid; $S->changeA("siteID", $seriesID); #$S->changeA("description", $seriesInfo->Series->Overview); } else { $seriesID = $S->A("siteID"); } $tempFile = Util::getTempFilename("SerieID" . $S->getID(), "zip"); $tab->addRow("Downloading episodes information..."); $SZip = "{$mirrorPath}/api/{$this->apiKey}/series/{$seriesID}/all/" . $S->A("sprache") . ".zip"; if (!copy($SZip, $tempFile)) { Red::errorD("The download of {$SZip} failed!"); } try { $zip = new ZipArchive(); if ($zip->open($tempFile) === TRUE) { $zip->extractTo(dirname($tempFile) . "/SerieID" . $S->getID()); $zip->close(); $tab->addRow("Extracting data..."); } else { throw new ClassNotFoundException(""); } } catch (ClassNotFoundException $e) { if (!Util::isWindowsHost()) { $commandUnzip = "unzip -o {$tempFile} -d SerieID" . $S->getID(); } else { $commandUnzip = Util::getRootPath() . "trinityDB/Serien/unzip.exe -o {$tempFile} -d SerieID" . $S->getID(); } $tab->addRow("Extracting data...<br />{$commandUnzip}"); $sc = new SystemCommand(); $sc->setCommand("cd " . dirname($tempFile) . " && {$commandUnzip}"); $sc->execute(); } $e = 0; $u = 0; $file = dirname($tempFile) . "/SerieID" . $S->getID() . "/" . $S->A("sprache") . ".xml"; if (!file_exists($file)) { Red::errorD("Could not find the expected file {$file}. Please check if it was properly extracted from {$tempFile}."); } $episodesList = new SimpleXMLElement(file_get_contents($file)); $status = $episodesList->Series->Status; $S->changeA("description", $episodesList->Series->Overview); $S->changeA("status", $status); $S->changeA("genre", $episodesList->Series->Genre); foreach ($episodesList->Episode as $k => $v) { $AC = anyC::get("Folge", "SerieID", $S->getID()); $AC->addAssocV3("season", "=", $v->SeasonNumber); $AC->addAssocV3("episode", "=", $v->EpisodeNumber); $AC->lCV3(); if ($AC->numLoaded() > 1) { while ($F = $AC->getNextEntry()) { $F->deleteMe(); } } $F = new Factory("Folge"); $F->sA("SerieID", $S->getID()); $F->sA("season", $v->SeasonNumber); $F->sA("episode", $v->EpisodeNumber); if ($E = $F->exists(true)) { if ($v->lastupdated == $E->A("lastupdate")) { continue; } $E->changeA("name", $v->EpisodeName); $E->changeA("airDate", $v->FirstAired); $E->changeA("lastupdate", $v->lastupdated); $E->changeA("description", $v->Overview); $E->saveMe(true, false); $u++; continue; } $F->sA("episodeID", $v->id); $F->sA("name", $v->EpisodeName); $F->sA("airDate", $v->FirstAired); $F->sA("lastupdate", $v->lastupdated); $F->sA("description", $v->Overview); $F->sA("wanted", "1"); $F->store(true, false); $e++; } $tab->addRow("Loaded {$e} episodes"); $tab->addRow("Updated {$u} episodes"); if (mUserdata::getGlobalSettingValue("trinityDBdlCover", "0") == "1") { $bannerList = new SimpleXMLElement(dirname($tempFile) . "/SerieID" . $S->getID() . "/banners.xml", null, true); foreach ($bannerList as $banner) { if ($banner->BannerType . "" == "poster") { #echo $banner->BannerPath.""; $cover = file_get_contents("http://www.thetvdb.com/banners/" . $banner->BannerPath); $temp = Util::getTempFilename("cover", "jpg"); file_put_contents($temp, $cover); if ($S->A("dir") != "" and file_exists($S->A("dir"))) { file_put_contents($S->A("dir") . "/Folder.jpg", $cover); } $S->changeA("cover", DBImageGUI::stringifyS("image/jpg", $temp)); $S->changeA("coverThumb", DBImageGUI::stringifyS("image/png", $temp, 150, 220)); #$S->saveMe(); unlink($temp); $tab->addRow("Downloaded cover"); break; } } } $S->saveMe(true, false); if ($echo) { echo $tab; } }
$aC->addOrderV3("datum", "DESC"); $aC->setLimitV3("1"); $DL = $aC->getNextEntry(); $DL = new Download($DL->getID()); if (!isset($_GET["getLink"])) { $DL->makeDownload(); header("Location: " . $DL->getA()->url); exit; } else { die($DL->getA()->url); } } if (isset($_GET["a"])) { switch ($_GET["a"]) { case "DBImage": $DBI = new DBImageGUI(); $DBI->getHTML($_GET["id"]); break; case "putInCart": $CC = new CookieCart(); $CC->update($_GET["artikelID"], $_GET["menge"]); break; } } try { $domains = new Domains(); $domain = $domains->getMyDomain(); $ex = explode("\n", $domain->A("url")); if ($domain->A("umleitung") != null) { if ($domain->A("umleitung") == "1" and substr_count(str_replace(".uk", "", $_SERVER["HTTP_HOST"]), ".") == 1) { header("HTTP/1.1 301 Moved Permanently");