Source

Selador / menue.php

Full commit
<?php


/* menue.php - Front-end code for main page menu
 *
 * Copyright (C) 2006, 2007, 2008 Kevin Read, Simone Schaefer
 *
 * This file is part of Selador, a browser-based fantasy strategy game
 *
 * This program is distributed under the terms of the GNU Affero General Public License.
 *
 *
 *   Selador is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU Affero General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   any later version.
 *
 *   Selador 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 Affero General Public License for more details.
 *
 *   You should have received a copy of the GNU Affero General Public License
 *   along with Selador.  If not, see <http://www.gnu.org/licenses/>.
 **/

@session_start ();
if (!function_exists ("dynamic_link_outer"))
{
	function dynamic_link_outer ($url, &$localurl)
	{
		if (strstr ($localurl, $url))
			echo "<a class=\"aktiv\" href=\"".$url."\">";
		else
			echo "<a href=\"".$url."\">";
	}
}

if (isset ($_SERVER['HTTP_REFERER']))
{
	$url = parse_url ($_SERVER['HTTP_REFERER']);

	if (!isset ($_SESSION['ref']) &&  !strpos ($url['host'], "selador"))
		$_SESSION['ref'] = $_SERVER['HTTP_REFERER'];
}

if (isset ($_GET['q']))
	$_SESSION['q'] = $_GET['q'];

$loctime = @localtime();

if (isset ($_GET['inviter']))
{
	$_SESSION['invited_by'] = (int)$_GET['inviter'];
}

if (isset ($_GET['email']))
{
	$_SESSION['email'] = $_GET['email'];
}

$tmp_localfile = basename ($_SERVER['PHP_SELF']);


?>


<body>
	<div id="zentriert">
		<div id="banner">
			<div id='bannertitle'>
				<a href="uebersicht.php"><img src="styles/new/schriftzug.png" title="&Uuml;bersicht"></a>
			</div>
			<div id="menu">
				<ul class="level1">
					<?php
					$classes = array(
								"index" => ' class="menue"',
								"login" => ' class="menue"',
								"newuser" => ' class="menue"',
								"about" => ' class="menue"',
								"screenshots" => ' ="menue"',
								"halloffame" => ' class="menue"',
								"forum" => ' class="menue"'
							);
					if (strstr($_SERVER['PHP_SELF'], 'index.php'))
						$classes["index"] = ' class="menue-aktiv"';
					if (strstr($_SERVER['PHP_SELF'], 'login.php'))
						$classes["login"] = ' class="menue-aktiv"';
					if (strstr($_SERVER['PHP_SELF'], 'newuser.php'))
						$classes["newuser"] = ' class="menue-aktiv"';
					if (strstr($_SERVER['PHP_SELF'], 'about.php'))
						$classes["about"] = ' class="menue-aktiv"';
					if (strstr($_SERVER['PHP_SELF'], 'screenshots.php'))
						$classes["screenshots"] = ' class="menue-aktiv"';
					if (strstr($_SERVER['PHP_SELF'], 'halloffame.php'))
						$classes["halloffame"] = ' class="menue-aktiv"';

					//$class= ' class="submenu"';
					?>

					<li><a href="index.php" <?php echo $classes['index'] ?>>Startseite</a></li>
					<li><a href="login.php" <?php echo $classes['login'] ?>>Einloggen</a></li>
					<li><a href="newuser.php" <?php echo $classes['newuser'] ?>>Anmelden</a></li>
					<li><a href="about.php"<?php echo $classes['about'] ?>>Mehr Infos</a></li>
					<li><a href="screenshots.php"<?php echo $classes['screenshots'] ?>>Screenshots</a></li>
					<li><a href="halloffame.php"<?php echo $classes['halloffame'] ?>>Hall Of Fame</a></li>
					<li><a href="http://forum.selador.de" target="_blank">Forum</a></li>
				</ul>
			</div>
		</div>