Location: PHPKode > projects > phpGrabComics > www/admin/desktop.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

*/

$cache_limiter = session_cache_limiter("nocache");

// set the default comics if there is no user-defined input
if(!isset($_GET["comic_array"]) or !is_array($_GET["comic_array"]) or empty($_GET["comic_array"]))
{
	$_GET["comic_array"] = Array("9to5","andycapp","bc","calvinandhobbes","crock","dilbert","heathcliff","marmaduke","snoopy","userfriendly");
}

if(!isset($_GET["bg_color"]) or empty($bg_color))
{
	$bg_color = "#3A6EA5";
}
else
	$bg_color = $_GET["bg_color"];

include_once("dir.php");
include_once($dir . "inc/prepend.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($authenticated == True) 
{ 
	$auth_link = "&user=" . $_SESSION["user"] . "&psw=". $_SESSION["psw"]; 
}
else
	$auth_link = "";

echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>phpGrabComics for desktop 1.5</title>
<meta name="keywords" content="phpGrabComics, Baravalle, dilbert, calvin, hobbes, vauro, snoopy, altan, bobo, clemente, fontanarrosa, forattini, daily, strips, comics, grab, open source, free software" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="Global" />
<meta name="copyright" content="&copy; 2001,2002,2003,2004,2005 Andres Baravalle" />
<script type="text/javascript">
<!-- <![CDATA[
function ChangeBackgroundImage(comic)
{
	document.background.src= "<?php echo $full_web_dir; ?>" + "/../index.php?comic_array[]=" + comic + "<?php echo $auth_link; ?>&show=1&save=0";
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


<?php
$tmp = "var comics = new Array(";

for($a=0;$a<sizeof($phpgrabcomics);$a++)
{
	$tmp .= '"'.$phpgrabcomics[$a]->unix_name.'"';
	if(($a+1)<sizeof($phpgrabcomics))
		$tmp .= ',';
}

$tmp .= ");";
echo $tmp;
?>

var preloadImages = new Array();
// ]]> -->
</script>
</head>
<body style="background-color:<?php echo $bg_color; ?>;"> 
<?php
admin::checkPerm();
if ($authenticated == True and !isset($_GET["logout"]))
{
?> 
<div id="phpgrabcomics2" style="visibility: hidden; text-align: right"><a href="javascript:MM_showHideLayers('phpgrabcomics','','show');MM_showHideLayers('phpgrabcomics3','','show');MM_showHideLayers('phpgrabcomics2','','hide');" target="_self" style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;font-weight: bold; color:#CC0000">phpGrabComics</a></div> 
<div id="phpgrabcomics" style="vertical-align: middle; text-align: center"> 
	<table cellspacing="0" cellpadding="4" width="100%" > 
		<tr> 
			<td>&nbsp;</td> 
			<td width="32" rowspan="2" style="text-align: right; vertical-align: top"><table cellpadding="2" cellspacing="2"> 
					<?php
					for($a=0;$a<sizeof($phpgrabcomics);$a++)
					{
					?>
					<tr> 
						<td style="background-color: #FFFFFF; text-align: center" width="32"><a 
                        href="javascript:ChangeBackgroundImage('<?php echo $phpgrabcomics[$a]->unix_name; ?>')" target="_self"><img src="<?php echo $modules_folder . "/" . $phpgrabcomics[$a]->unix_name; ?>.png" 
                        alt="<?php echo $phpgrabcomics[$a]->name; ?>" width="32" height="32" 
                        border="0" /></a></td> 
					</tr> 
					<?php
					}
					?>					
				</table></td> 
		</tr> 
		<tr> 
			<td><div align="center"> 
					<table cellspacing="2" cellpadding="4"> 
						<tr> 
							<td width="600" style="background-color: #FFFFFF;  text-align:center"><a href="<?php echo $full_web_dir ."/../index.php"; ?>"><img src="<?php echo $full_web_dir . "/../index.php?comic_array[]=" . $phpgrabcomics[0]->unix_name . $auth_link . "&amp;show=1&amp;save=0"; ?>" alt="phpGrabComics" name="background" border="0" id="background" /></a></td> 
						</tr> 
						<tr> 
							<td style="background-color: #FFFFFF; text-align:center"><table width="100%"> 
									<tr> 
										<td width="190" style="text-align:left"><a href="<?php echo $full_web_dir ."/../index.php"; ?>"><img src="<?php echo $banners_file . "/phpgrabcomics_3.png"; ?>" alt="phpGrabComics" width="190" height="75" border="0" /></a></td> 
										<td width="150" style="text-align:left"><img src="<?php echo $full_web_dir ."/../sourceforge.php"; ?>" alt="sourceforge" width="88" height="31" border="0" style="margin-left: 20px" /></td> 
										<td style="text-align:right" nowrap="nowrap"><div id="phpgrabcomics3"><a href="javascript:location.reload()" target="_self" style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;font-weight: bold; color:#CC0000">grab
													comics!</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:MM_showHideLayers('phpgrabcomics','','hide');MM_showHideLayers('phpgrabcomics3','','hide');MM_showHideLayers('phpgrabcomics2','','show');" style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;font-weight: bold; color:#CC0000" target="_self">exit</a></div></td> 
									</tr> 
								</table></td> 
						</tr> 
					</table> 
				</div></td> 
		</tr> 
	</table> 
</div> 
<script type="text/javascript">
<!-- <![CDATA[

for(var c=0;c<comics.length;c++)
{
	preloadImages[c] = new Image;
	preloadImages[c].src = "<?php echo $full_web_dir; ?>" + "/comic/" + comics[c];
}

// ]]> -->
</script> 
<?php
}
else
{
echo _NO_AUTH;
}
?>
</body>
</html>
Return current item: phpGrabComics