forked from wap-game/ogame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgalaxy.php
More file actions
124 lines (104 loc) · 3.78 KB
/
galaxy.php
File metadata and controls
124 lines (104 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
/**
* galaxy.php
*
* @version 1.3
* @copyright 2008 by Chlorel for XNova
*/
define('INSIDE' , true);
define('INSTALL' , false);
$xnova_root_path = './';
include($xnova_root_path . 'extension.inc');
include($xnova_root_path . 'common.' . $phpEx);
includeLang('galaxy');
$CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_planet'] ."';", 'planets', true);
$lunarow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user['current_luna'] ."';", 'lunas', true);
$galaxyrow = doquery("SELECT * FROM {{table}} WHERE `id_planet` = '". $CurrentPlanet['id'] ."';", 'galaxy', true);
$dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"];
$fleetmax = $user['computer_tech'] + 1;
$CurrentPlID = $CurrentPlanet['id'];
$CurrentMIP = $CurrentPlanet['interplanetary_misil'];
$CurrentRC = $CurrentPlanet['recycler'];
$CurrentSP = $CurrentPlanet['spy_sonde'];
$HavePhalanx = $CurrentPlanet['phalanx'];
$CurrentSystem = $CurrentPlanet['system'];
$CurrentGalaxy = $CurrentPlanet['galaxy'];
$CanDestroy = $CurrentPlanet[$resource[213]] + $CurrentPlanet[$resource[214]];
$maxfleet = doquery("SELECT * FROM {{table}} WHERE `fleet_owner` = '". $user['id'] ."';", 'fleets');
$maxfleet_count = mysql_num_rows($maxfleet);
CheckPlanetUsedFields($CurrentPlanet);
CheckPlanetUsedFields($lunarow);
if (!isset($mode)) {
if (isset($_GET['mode'])) {
$mode = intval($_GET['mode']);
} else {
$mode = 0;
}
}
if ($mode == 0) {
$galaxy = $CurrentPlanet['galaxy'];
$system = $CurrentPlanet['system'];
$planet = $CurrentPlanet['planet'];
} elseif ($mode == 1) {
if ($_POST["galaxyLeft"]) {
if ($_POST["galaxy"] <= 1) {
$galaxy = 1;
} else {
$galaxy = $_POST["galaxy"] - 1;
}
} elseif ($_POST["galaxyRight"]) {
if ($_POST["galaxy"] >= MAX_GALAXY_IN_WORLD) {
$galaxy = MAX_GALAXY_IN_WORLD;
} else {
$galaxy = $_POST["galaxy"] + 1;
}
} else {
$galaxy = $_POST["galaxy"];
}
if ($_POST["systemLeft"]) {
if ($_POST["system"] <= 1) {
$system = 1;
} else {
$system = $_POST["system"] - 1;
}
} elseif ($_POST["systemRight"]) {
if ($_POST["system"] >= MAX_SYSTEM_IN_GALAXY) {
$system = MAX_SYSTEM_IN_GALAXY;
} else {
$system = $_POST["system"] + 1;
}
} else {
$system = $_POST["system"];
}
} elseif ($mode == 2) {
$galaxy = $_GET['galaxy'];
$system = $_GET['system'];
$planet = $_GET['planet'];
} elseif ($mode == 3) {
$galaxy = $_GET['galaxy'];
$system = $_GET['system'];
} else {
$galaxy = 1;
$system = 1;
}
$planetcount = 0;
$lunacount = 0;
$page = InsertGalaxyScripts ( $CurrentPlanet );
$page .= ShowGalaxySelector ( $galaxy, $system );
if ($mode == 2) {
$CurrentPlanetID = $_GET['current'];
$page .= ShowGalaxyMISelector ( $galaxy, $system, $planet, $CurrentPlanetID, $CurrentMIP );
}
$page .= "<table width='650px'><tbody>";
$page .= ShowGalaxyTitles ( $galaxy, $system );
$page .= ShowGalaxyRows ( $galaxy, $system );
$page .= ShowGalaxyFooter ( $galaxy, $system, $CurrentMIP, $CurrentRC, $CurrentSP);
$page .= "</tbody></table></div>";
display ($page, $lang[''], false, '', false);
// -----------------------------------------------------------------------------------------------------------
// History version
// 1.0 - Created by Perberos
// 1.1 - Modified by -MoF- (UGamela germany)
// 1.2 - 1er Nettoyage Chlorel ...
// 1.3 - 2eme Nettoyage Chlorel ... Mise en fonction et debuging complet
?><?php /* Powered by OGameCN www.ogamecn.com */ ?>