Exemplo n.º 1
0
function displayComingSoon () {
	global $sickbeardurl;

	if(strrpos($sickbeardurl, "/") < strlen($sickbeardurl)) {
		$sickbeardurl .= "/";
	}

	$html = getComingSoon();
	$body = stripBody($html);
	$body = stripInnerWrapper($body);
	//$body = changeLinks($body);
	
	if(!empty($_GET["style"]) && (($_GET["style"] == "s") || ($_GET["style"] == "m"))) {
		$reldir = (($_GET["style"] == "m") ? "../" : "");
		$body = str_replace("src=\"".$sickbeardurl."showPoster/", "src=\"".$reldir."sickbeardposter.php", $body);
		$body = str_replace("src=\"/sickbeard/showPoster/", "src=\"".$reldir."sickbeardposter.php", $body);
		$body = str_replace("src=\"/showPoster/", "src=\"".$reldir."sickbeardposter.php", $body);
	}
	$body = str_replace("src=\"/sickbeard/", "src=\"".$sickbeardurl, $body);
	$body = str_replace("href=\"/sickbeard/", "href=\"".$sickbeardurl, $body);
	$body = str_replace("src=\"/home/", "src=\"".$sickbeardurl."home/", $body);
	$body = str_replace("href=\"/home/", "href=\"".$sickbeardurl."home/", $body);
	$body = str_replace("src=\"home/", "src=\"".$sickbeardurl."home/", $body);
	$body = str_replace("href=\"home/", "href=\"".$sickbeardurl."home/", $body);
	$body = str_replace("src=\"/images/", "src=\"".$sickbeardurl."images/", $body);
	$body = str_replace("href=\"/images/", "href=\"".$sickbeardurl."images/", $body);
	$body = str_replace("src=\"images/", "src=\"".$sickbeardurl."images/", $body);
	$body = str_replace("href=\"images/", "href=\"".$sickbeardurl."images/", $body);
	echo $body;
}
        var windowHeight = (window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight) - windowSizeAdjustment;
        if (windowHeight > 0) { 
          var objWrapper = document.getElementById("insideContent");
          objWrapper.style.height = windowHeight + 'px';
        }
      }
    -->
    </script>

ComingEpisodesSCRIPT;
}
if (!empty($_GET["display"])) {
    include_once "../config.php";
    $html = getComingSoon($sickbeardcomingepisodes);
    $body = stripBody($html);
    $body = stripInnerWrapper($body);
    $urldata = @parse_url($sickbeardcomingepisodes);
    if (empty($urldata)) {
        echo 'Sickbeard could not be reached. Please check if the URL is correct.';
    }
    $pos = strrpos($sickbeardcomingepisodes, "/");
    if ($pos < strlen($sickbeardcomingepisodes)) {
        $uri_full = substr($sickbeardcomingepisodes, 0, $pos + 1);
    } else {
        $uri_full = $sickbeardcomingepisodes;
    }
    $uri_domain = str_replace($urldata["path"], "", $sickbeardcomingepisodes);
    $regex = '/(<(img|a)\\s*(.*?)\\s*(src|href)=(?P<link>([\'"])\\s*\\S+?\\s*\\6)+?\\s*(.*?)\\s*>)/i';
    preg_match_all($regex, $body, $matches);
    foreach ($matches['link'] as $link) {
        $pos = strpos($link, "/");