-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhof.php
More file actions
executable file
·151 lines (113 loc) · 5.29 KB
/
hof.php
File metadata and controls
executable file
·151 lines (113 loc) · 5.29 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
if (!defined('IN_SPYOGAME'))
{
exit('Hacking attempt');
}
/* On verifie que le mod est actif */
$select_active = $db->sql_query('SELECT active FROM '. TABLE_MOD .' WHERE action=\'hof\'');
$active = $db->sql_fetch_assoc($select_active);
if (!$active['active'])
{
exit('Hacking attempt');
}
// Prefix des tables choisi lors de l'installation d'OGSpy
global $table_prefix;
// Variable qui defini sur quel page on est
$page = isset($_GET['page']) ? htmlentities($_GET['page'], ENT_QUOTES) : 'batiments';
/* Definition des noms des tables utilisees en fonctions du prefix */
define('TABLE_HOF_CONFIG', $table_prefix .'hof_config');
define('TABLE_HOF_RECORDS', $table_prefix .'hof_records');
define('TABLE_HOF_PROD', $table_prefix .'hof_prod');
define('TABLE_FLOTTES', $table_prefix .'mod_flottes');
// $rightToAdmin vaut true si l'utilisateur a le droit d'administre OGSpy
$rightToAdmin = $user_data['user_admin'] || $user_data['user_coadmin'];
// Determine la taille, en %, des colones du menu
$rowWidth = $rightToAdmin ? 12 : 14;
require_once 'views/page_header.php';
require_once 'mod/hof/pages/functions.php';
require_once 'mod/hof/pages/arrays.php';
?>
<style type='text/css'>
@import url("mod/hof/pages/skin.css");
</style>
<table class='table_menu'>
<tr>
<td style='width: <?php echo $rowWidth; ?>%;'><a style='color: <?php if ($page == 'batiments') { echo 'lime;'; } else { echo '#00F0F0;'; } ?>' href='index.php?action=hof&page=batiments'>Bâtiments</a></td>
<td style='width: <?php echo $rowWidth; ?>%;'><a style='color: <?php if ($page == 'labo') { echo 'lime;'; } else { echo '#00F0F0;'; } ?>' href='index.php?action=hof&page=labo'>Laboratoire</a></th>
<td style='width: <?php echo $rowWidth; ?>%;'><a style='color: <?php if ($page == 'flottes') { echo 'lime;'; } else { echo '#00F0F0;'; } ?>' href='index.php?action=hof&page=flottes'>Flottes</a></td>
<td style='width: <?php echo $rowWidth; ?>%;'><a style='color: <?php if ($page == 'defense') { echo 'lime;'; } else { echo '#00F0F0;'; } ?>' href='index.php?action=hof&page=defense'>Défense</a></th>
<td style='width: <?php echo $rowWidth; ?>%;'><a style='color: <?php if ($page == 'prod') { echo 'lime;'; } else { echo '#00F0F0;'; } ?>' href='index.php?action=hof&page=prod'>Production</a></td>
<td style='width: <?php echo $rowWidth; ?>%;'><a style='color: <?php if ($page == 'bbcode') { echo 'lime;'; } else { echo '#00F0F0;'; } ?>' href='index.php?action=hof&page=bbcode'>Export BBCode</a></td>
<?php
if ($rightToAdmin)
{
echo '<td style=\'width: '. $rowWidth .'%;\'><a style=\'color: '. ($page == 'admin' ? 'lime;' : '#00F0F0;') .'\' href=\'index.php?action=hof&page=admin\'>Administration</a></td>'."\n";
}
?>
<td style='width: <?php echo $rowWidth; ?>%;'><a style='color: <?php if ($page == 'changelog') { echo 'lime;'; } else { echo '#00F0F0;'; } ?>' href='index.php?action=hof&page=changelog'>Change Log</a></td>
</tr>
</table>
<?php
$userId = $user_data['user_id'];
switch ($page)
{
/* Batiments */
case 'batiments':
$cat = isset($_GET['cat']) && $_GET['cat'] == 'cumul' ? 5 : 1;
createHoF($cat, $labelBatiment, $nameBatiment, $iconBatiment, $userId);
if ($cat == 1)
{
echo '<p style=\'font-weight: bold;\'><a href=\'index.php?action=hof&page=batiments&cat=cumul\'>Voir les records des niveaux cumulés</a></p>';
}
else
{
echo '<p style=\'font-weight: bold;\'><a href=\'index.php?action=hof&page=batiments&cat=nonCumul\'>Voir les records des niveaux non-cumulés</a></p>';
}
break;
/* Laboratoires */
case 'labo':
createHoF(2, $labelLabo, $nameLabo, $iconLabo, $userId);
break;
/* Flottes */
case 'flottes':
$select_mod = $db->sql_query('SELECT title FROM '. TABLE_MOD .' WHERE title = \'Flottes\'');
$mod = $db->sql_fetch_assoc($select_mod);
if (!empty($mod))
{
createHoF(3, $labelFlotte, $nameFlotte, $iconFlotte, $userId);
}
else
{
echo '<p style=\'color: red; font-weight: bold;\'>Vous devez installer le mod <a href=\'https://forum.ogsteam.fr\'>Flottes</a> !</p>';
}
break;
/* Defense */
case 'defense':
$cat = isset($_GET['cat']) && $_GET['cat'] == 'cumul' ? 6 : 4;
createHoF($cat, $labelDefense, $nameDefense, $iconDefense, $userId);
if ($cat == 4)
echo '<p style=\'font-weight: bold;\'><a href=\'index.php?action=hof&page=defense&cat=cumul\'>Voir les défenses cumulées</a></p>';
else
echo '<p style=\'font-weight: bold;\'><a href=\'index.php?action=hof&page=defense&cat=nonCumul\'>Voir les défenses non-cumulées</a></p>';
break;
/* Le reste =) */
case 'prod':
require_once 'mod/hof/pages/prod.php';
break;
case 'bbcode':
require_once 'mod/hof/pages/bbcode.php';
break;
case 'admin':
require_once 'mod/hof/pages/admin.php';
break;
case 'changelog':
require_once 'mod/hof/pages/changelog.php';
break;
}
?>
<div align="right">Hof v1.3.3 - <a href="index.php?action=hof&page=changelog">ChangeLog</a><br />
Mod d'affichage des records<br />
Version originale par <a href='https://forum.ogsteam.fr/index.php?action=profile;u=98'>Ninety</a> mis à jour par <a href="mailto:contact@alexandre-perrigault.fr">Aerue</a> et Pumpk1in</div>
<?php
require_once 'views/page_tail.php';
?>