Source

Selador / allianz.php

Full commit
<?php

/* allianz.php - Front-end code for the "Allianz" page
 *
 * 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/>.
 **/

// This code is not typical for Selador stuff at all. It was supposed
// to be how we do things starting from 2008, but there never was enough
// time for this project to rebase the other stuff.

// Each tab of this page loads its own code from php/allianz.

if (isset ($_REQUEST['f']))
{
	$f = $_REQUEST['f'];
}
else
	$f = 1;

if (($f == 6) || ($f == 2))
	$no_reload = 1;

require_once("php/base/user.inc.php");
require_once("php/base_functions.php");
require_once("php/base.php");
require_once("php/event.php");
require_once("headers.php");
$me->activevillage->update_stamp ();
// We include basic design parts here
require_once ("styles/php/base_design-".$_SESSION['theme'].".php");
require_once("php/allianz/allianz_backend.php");
require_once("allianz_frontend.inc.php");
$target = 0;
require_once("php/allianz/allianz_join.php");

if (isset ($_REQUEST['a']))
	$target = (int)$_REQUEST['a'];
else
{
	if ($me->aid == 0)
	{
	//Der Spieler ist in keiner Allianz
		require_once("php/allianz/allianz_noally.php");
	}
	else
		$target = $me->aid;
}
if (isset($output))
	echo '<br><span class="error"><b>Fehler:</b><br>'.$output.'</span></div>';
if (isset($output_pos))
	echo '<br><span class="success"><b>Gl&uuml;ckwunsch!</b><br>'.$output_pos.'</span></div>';

//Der Spieler ist bereits in einer Allianz, oder er will eine andere Allianz ansehen
if ($target != 0)
{
	$allyurl = "allianz.php?a=".$target;

	// Don't let outsiders see the attacks, forum and options fields
	if ($target != $me->aid)
	{
		if (($f != 5) && ($f != 7))
			$f = min ($f, 3);
	}
	else
		$f = min ($f, 7);
	$f = max (1, $f);
?>
<div id="contentbox">
<!--
<div id="reiter">
	<table width="100%" class="inhalt">
		<tr>
		<?php doallylink (1, "&Uuml;bersicht");
			doallylink (2, "Mitglieder");
			doallylink (3, "Neues");
			if ((($user_row[7]+ $user_row[8]) > 0) && ($target == $me->aid))
			{
				//echo "<td>".generateNews()."</td>";
				echo "<td><img src=\"styles/".$_SESSION['theme']."/new.gif\" width=\"25px\"></td>";
			}
			if ($target == $me->aid)
			{
				doallylink (4, "Angriffe");
				doallylink (6, "Optionen");
			}
			doallylink (5, "Diplomatie");
			//doallylink (7, "Blog");
			?>
		</tr>
	</table>
</div>-->
<?php
	switch ($f)
	{
		case 1:
			require_once("php/allianz/allianz_overview.php");
		break;
		case 2:
			require_once("php/allianz/allianz_member.php");
		break;
		case 3:
			require_once("php/allianz/allianz_news.php");
		break;
		case 4:
			require_once("php/allianz/allianz_attacks.php");
		break;
		case 5:
			require_once("php/allianz/allianz_diplomacy.php");
		break;
		case 6:
			require_once("php/allianz/allianz_options.php");
		break;
		case 7:
			require_once("php/allianz/allianz_blog.php");
		break;
	}


}
	echo "</div>";
		echo "<div id=\"leiste-unten\">\n
			<table><tr><td>andere Allianzen: </td>\n
			<td><img src=\"gfx/axe2.gif\" height=\"20px\"></td>\n
			<td><a href=\"war.php?f=3\"><b>aktuelle Kriege</b></a></td>\n
			</tr></table></div></div>";

require_once("footer.php");

?>