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;
}
Exemplo n.º 2
0
    //print_r($topicMatch);
}
//print_r($topicMatch);
function stripBody($msg)
{
    $msg = str_replace('href=', 'removed-href=', $msg);
    //strip links
    $msg = str_replace('<br>', '<br />', $msg);
    $msg = preg_replace('|(<br ?/?>\\s+)+|su', '<br />', $msg);
    $msg = preg_replace('|(<br ?/?>\\s*)$|su', '', $msg);
    return $msg;
}
foreach ($topicMatch as $key => $message) {
    $date = explode('/', explode(' ', $message[2])[0]);
    $time = explode(' ', $message[2])[1];
    $datetime = implode('-', array($date[2], $date[0], $date[1])) . ' ' . $time . ':00';
    $newMessage = array();
    $newMessage['id'] = null;
    $newMessage['username'] = $message[1];
    $newMessage['time'] = $message[2];
    $newMessage['body'] = stripBody($message[3]);
    $newMessage['sig'] = $message[5];
    $newMessage['avatar'] = str_replace('\\', '', $message[7]);
    $messages[] = $newMessage;
    //print_r($message);
}
//print_r($messages);
$result = array();
$result['messages'] = $messages;
$result['topicTitle'] = $topicTitle;
echo json_encode($result);
        var windowSizeAdjustment = 100;
        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) {