Test Failed
Push — trunk ( 132e87...b3f953 )
by SuperNova.WS
11:54
created

admin/adm_planet_list.php (1 issue)

Severity
1
<?php
2
3
define('INSIDE'  , true);
4
define('INSTALL' , false);
5
define('IN_ADMIN', true);
6
7
require('../common.' . substr(strrchr(__FILE__, '.'), 1));
8
9
global $config, $lang, $user;
10
11
SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR);
12
13
$planet_active = sys_get_param_int('planet_active');
14
if(!$planet_active) {
15
  $planet_type = sys_get_param_int('planet_type', 1);
16
  $planet_type = $planet_type == 3 ? 3 : 1;
17
} else {
18
  $active_time = SN_TIME_NOW - SN::$config->game_users_online_timeout;
19
}
20
$table_parent_columns = $planet_type == 3 || $planet_active;
21
22
$template = SnTemplate::gettemplate('admin/adm_planet_list', true);
23
24
$query = db_planet_list_admin_list($table_parent_columns, $planet_active, $active_time, $planet_type);
25
while ($planet_row = db_fetch($query)) {
0 ignored issues
show
Deprecated Code introduced by
The function db_fetch() has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

25
while ($planet_row = /** @scrutinizer ignore-deprecated */ db_fetch($query)) {
Loading history...
26
  $template->assign_block_vars('planet', array(
27
    'ID'          => $planet_row['id'],
28
    'NAME'        => js_safe_string($planet_row['name']),
29
    'GALAXY'      => $planet_row['galaxy'],
30
    'SYSTEM'      => $planet_row['system'],
31
    'PLANET'      => $planet_row['planet'],
32
    'PLANET_TYPE' => $planet_row['planet_type'],
33
    'PLANET_TYPE_PRINT' => $lang['sys_planet_type_sh'][$planet_row['planet_type']],
34
    'PARENT_ID'   => js_safe_string($planet_row['parent_planet']),
35
    'PARENT_NAME' => js_safe_string($planet_row['parent_name']),
36
    'OWNER'       => js_safe_string($planet_row['username']),
37
    'OWNER_ID'    => $planet_row['id_owner'],
38
  ));
39
}
40
41
$page_title =
42
  $lang['adm_planet_list_title'] . ': ' .
43
  ($planet_active ? $lang['adm_planet_active'] :
44
    ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '')
45
  );
46
$template->assign_vars(array(
47
  'PAGE_TITLE' => $page_title,
48
49
  'PLANET_COUNT'  => SN::$db->db_num_rows($query),
50
  'PARENT_COLUMN' => $table_parent_columns,
51
));
52
53
SnTemplate::display($template, $page_title);
54