<?php
/*
script: header.php
purpose: site header - contains all html, etc for the site header (ie content shown
					on all pages of the site - header, navigation, layout up to the point
					where individual pages appear
copyright: copyright 2004 Php Image Host. All Rights Reserved. You may modify this file for use on your
					site running a licenced copy of the Php Image Host scripts.
					You must not distribute this file or derivations of it.
Nullified By CrAcKlOvE

*/

// include and initialize the banner ad rotator.

require_once(dirname(__FILE__).'/classes/adrotator.class.php');
$ads = new adrotator($ace);

// tell the banner ad rotator to preload two ads (one for the top, and one for the bottom of each page)

$ads->preload(2);

// start of site html code
?>
<html>
<head>
<title><?php echo htmlspecialchars($config->sitename);?></title>
<link rel="stylesheet" type="text/css" href="styles.css" />
<script language="JavaScript" type="text/javascript" src="js.js"></script>

</head>
<body>
<div id="page">
<!-- header start -->
<div id="header">
	<div id="logo">
<!-- you can add your own logo here... by default, the site name is displayed as text -->
		<div style="padding-top: 50px;"><a href="<?php echo $config->siteurl;?>"><?php echo htmlspecialchars($config->sitename);?></a></div>
	</div>
	<div id="topbanner"><?php $ads->display();?></div>
</div>
<!-- header end -->
<!-- navigation bar start -->
<div class="navbar">
	<span class="navitem"><a class="navlink" href="index.php">Home</a></span>
<?php if( !$loggedin ){ ?>
	| <span class="navitem"><a class="navlink" href="login.php">Login</a></span>
	| <span class="navitem"><a class="navlink" href="join.php">Sign Up</a></span>
<?php } ?>
	| <span class="navitem"><a class="navlink" href="images.php">My Images</a></span>
	| <span class="navitem"><a class="navlink" href="galleries.php">My Galleries</a></span>
	| <span class="navitem"><a class="navlink" href="upload.php">Upload</a></span>
	| <span class="navitem"><a class="navlink" href="upgrade.php">Upgrade</a></span>
	| <span class="navitem"><a class="navlink" href="faq.php">Faq</a></span>
	| <span class="navitem"><a class="navlink" href="contact.php">Contact</a></span>
	| <span class="navitem"><a class="navlink" href="terms.php">Terms</a></span>
	| <span class="navitem"><a class="navlink" href="privacy-policy.php">Privacy Policy</a></span>
<?php if( $loggedin ){ ?>
	| <span class="navitem"><a class="navlink" href="login.php?logout=1">Logout</a></span>
<?php } ?>
</div>
<!-- navigation bar end-->

<!-- open div to contain content for each page -->
<div id="content">
<?php 
if( $user != 0 ){ 
	$ims = $user->images.' of '.($user->max_images == 0 ? 'unlimited' : $user->max_images);
	$bws = $user->bandwidth_used.'mb of '.($user->bandwidth == 0 ? 'unlimited' : $user->bandwidth.'mb');
	if( $user->bandwidth != 0 ) $bws = ceil($user->bandwidth_used/$user->bandwidth*100).'% ('.$bws.')';
	$sto = $user->storage_used.'mb of '.($user->storage == 0 ? 'unlimited' : $user->storage.'mb');
	if( $user->storage != 0 ) $sto = ceil($user->storage_used/$user->storage*100).'% ('.$sto.')';
	$ac = htmlspecialchars($user->type_name);
	if( $user->type_type == 'free' ) $ac = '<a href="upgrade.php">'.$ac.'</a>';
?>
<div class="userinfo">
Account Summary For <span class="uivalue"><?php echo $user->username;?></span>
(<?php echo $ac;?>):
Bandwidth Used: <span class="uivalue"><?php echo $bws;?></span>.
<br />
Space Used: <span class="uivalue"><?php echo $sto;?></span>.
Images Uploaded: <span class="uivalue"><?php echo $ims;?></span>.
<?php if( $user->bandwidth_used > $user->bandwidth && $user->bandwidth > 0 ){ ?>
<div style="text-align: center; padding-top: 4px;font-weight: bold; color: red;">
Monthly Bandwidth Limit Exceeded!
</div>
<?php } ?>
</div>
<?php }?>
