Exemplo n.º 1
0
<?php
	if (isset($_GET['ajax'])) {
		include 'functions.php';
		$showid = addslashes($_GET['showid']);
		$show = new Show($showid, NO_EPISODE_CHECK);
	} else {
		include 'header.php';
		$showid = addslashes($_GET['showid']);
		$show = new Show($showid);
	}
	if ($_GET['update'] == '1') # Force update
		$show->updateShow(1);
?>
				<div class="seriesdetails">
					<div class="imagecontainer">
						<a href="show.php?showid=<?=$show->getID()?>"><img class="thumbnail" alt="<?=$show->getTitle()?>" src="cache/<?=$show->getID()?>-poster.jpg" /></a>
					</div>
					<?=addSubscribeText($show->isSubscribed(), $show->getID(), 1)?> <a href="show.php?showid=<?=$show->getID()?>&amp;update=1" class="updatethis">Force Update</a>
					<h2><a id="showtitle" href="show.php?showid=<?=$show->getID()?>"><?=$show->getTitle()?></a></h2>
					<div class="plot"><?=$show->getPlot()?></div>
				</div>
				<?php
				if (!isset($_GET['ajax'])) { ?>
					<div class="fullcontent">
						<div class="contentleft">
							<?php 
								$seasonSplit = $show->splitSeasons();
								foreach ($seasonSplit[0] as $season) { if (!isset($season[0])) break; // PHP BUG?!?!
							?>
							<div class="contentbox normalbox seasons">
								<h3>Season <?php printf("%02d", $season[0]->getSeason())?> <a href="show.php?showid=<?=$season[0]->getShowID()?>" class="subscribe dldmissingeps"><span>Download missing episodes</span></a></h3>
#!/usr/bin/php
<?php 
include 'functions.php';
$q = mysql_query("SELECT showid FROM subscriptions");
$numSubscriptions = mysql_num_rows($q);
for ($i = 0; $i < $numSubscriptions; $i++) {
    $show = new Show(mysql_result($q, $i), NO_EPISODE_CHECK);
    $show->updateShow(FORCE_UPDATE);
}