Location: PHPKode > projects > phpGrabComics > www/admin/archive.php
<?php
/*

Copyright © 2001, 2002, 2003, 2004, 2005 Andres Baravalle

This file is part of phpGrabComics.

phpGrabComics is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

phpGrabComics is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with phpGrabComics; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/
include_once("dir.php");
include_once($dir . "inc/prepend.php");
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><!-- InstanceBegin template="/Templates/accessible.dwt" codeOutsideHTMLIsLocked="true" -->
<head>

<?php
include_once($dir . "inc/head.php");
?>
<!-- #BeginEditable "doctitle" --> 
<?php
// include all the comics classes
include_once($dir . "inc/load_comics_classes.php");
// include PEAR classes
include_once($dir . "inc/load_PEAR_classes.php");
if(isset($phpgrabcomics_selected[0]))
{
	if(isset($_GET["show_img"]) and !empty($_GET["show_img"]))
	{
		$time = filemtime($GLOBALS["comics_folder"] ."/" .$phpgrabcomics_selected[0] . "/" . $_GET["show_img"]) - $phpgrabcomics_selected[0]->time_offset;
		
		if(!empty($time))
		{			
			$title = $comic_list[$phpgrabcomics_selected[0]]->name . " - " . gmdate("d M, Y", $time) ."";
		}
	}	
	
	if(empty($phpgrabcomics_selected[0]))
		$title = $phpgrabcomics_selected[0] . " Archive";
}

if(empty($title) and (!isset($_GET) or empty($_GET)))
	$title="Comics Archive Index";
elseif(empty($title))
	$title="Comics Archive";
?>
<!-- #EndEditable -->
<title>
<?php 
if($title!="")
	echo "phpGrabComics - " . $title;
else
{
	$title = "phpGrabComics";
	echo $title;
}
?>
</title>
</head>
<body> 
<div id="header"> 
	<div class="left" id="logo"><a href="../index.php"><img src="<?php echo $banners_file; ?>/phpgrabcomics_10.png" alt="phpGrabComics home page" width="85" height="85" style="vertical-align: middle; margin-right: 36px;" /></a><h1><?php echo $title; ?></h1></div> 
	<?php
	// disable search bar for sites other then the main one.
	if(!empty($atomz_code))
	{
	?>	
	<div class="right" id="title" style="vertical-align: top;">		
		<form method="get" action="../search.php">
			<p style="text-align:right"><br /><input size="15" name="sp-q" value="<?php if(isset($_REQUEST["sp-q"])) echo $_REQUEST["sp-q"]; ?>" />
				<input type="hidden" name="sp-a" value="<?php echo $atomz_code; ?>" style="font-size:12px;background-color:#FFFFCC" accesskey="s" />
				<input type="hidden" name="sp-p" value="all" />
				<input type="hidden" name="sp-f" value="iso-8859-1" />
				<input type="submit" value="Search" />				
			</p>
		</form>		
	</div> 
	<?php
	}
	?>
	<hr /> 
</div> 
<div id="body"> 
	<?php
	if (isset($_GET["show_source"]) and $_GET["show_source"]==1)
	{	
		echo "<br /><h2>Source of: ".$_SERVER["SCRIPT_NAME"]."</h2>\n<hr />\n";
		highlight_file($_SERVER["SCRIPT_FILENAME"]);
		printf("<hr /><br />". _LAST_MODIFIED . ": %s", gmdate("Y/M/d H:i:s",filemtime($_SERVER["SCRIPT_FILENAME"])));
	}
	else
	{
	?> 
	<!-- #BeginEditable "testo dentro il livello" -->
		<?php
		if($authenticated == True)
		{
			admin::checkFunc();			
			if(!isset($_GET) or empty($_GET))
			{
		?>				
				
				<?php						
				if(!empty($comic_list))
				{
					reset($comic_list);
					echo "<p>Archived comics are:</p><ul>";
					while(list($key,$val) = each($comic_list))
					{
						if(in_array($val->unix_name,$comics_updated))
						{
							$tmp = "<li>";
							$tmp .= "<a href=\"archive.php?comic_array[]=".$val->unix_name."&amp;list_strips=1\">".$val->name."</a>";
							$tmp .= "</li>";
							echo $tmp;
						}
					}
					echo "</ul>";
				}		
				else 
				{
						echo "<p>There are no archived comics yet.</p>";
				}				
			}
		}
		else
		{
			?>
			<p>phpGrabComics allows you to download and archive strips for your personal use. This feature is enabled for the administrator of the web site only, and downloaded strips are not public. </p>
			<p>Visit the web site of your favourite strip to see the daily strip and to access its archive, or install your personal copy of phpGrabComics. Installing your own copy of phpGrabComics allows you to have your archive with your favourite strips. 
			<?php		
		}
		?>		
  </p>
		<!-- #EndEditable --> 
	<?php
	}
	?> 
</div> 
<div id="footer"> 
	<hr /> 
	<div class="left" id="source"><a href="<?php echo $dir; ?>index.php"><img src="<?php echo $dir; ?>images/logo.png" id="show_source" width="32" height="48" alt="show source" /></a> <a href="<?php echo $_SERVER["SCRIPT_NAME"];?>?show_source=1">show source</a></div> 
	<div class="right" id="hosted"> <a href="http://sourceforge.net/projects/phpgrabcomics/"><img src="<?php echo $dir; ?>sourceforge.php" id="sourceforge" alt="SourceForge" /></a> phpGrabComics	project is hosted at <a href="http://sourceforge.net/projects/phpgrabcomics/">sourceforge.net</a>.</div> 
</div> 
</body>
<!-- InstanceEnd --></html>
<?php
include_once($dir . "inc/append.php");
?>
Return current item: phpGrabComics