@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include_once('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | -if(sn_module_get_active_count('payment') && !defined('SN_GOOGLE')) { |
|
5 | +if (sn_module_get_active_count('payment') && !defined('SN_GOOGLE')) { |
|
6 | 6 | sys_redirect('metamatter.php'); |
7 | 7 | } |
8 | 8 |
@@ -7,10 +7,10 @@ |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | 12 | |
13 | -require('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
13 | +require('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
14 | 14 | |
15 | 15 | lng_include('quest'); |
16 | 16 | $template = gettemplate('quest', true); |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | define('SN_IN_FLEET', true); |
4 | 4 | define('SN_RENDER_NAVBAR_PLANET', true); |
5 | 5 | |
6 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
6 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
7 | 7 | |
8 | 8 | // TODO - Переместить это куда-нибудь |
9 | 9 | $fleet_page = sys_get_param_int('fleet_page', sys_get_param_int('mode')); |
10 | -if($fleet_ship_sort = sys_get_param_id('sort_elements') && $fleet_page == 0) { |
|
10 | +if ($fleet_ship_sort = sys_get_param_id('sort_elements') && $fleet_page == 0) { |
|
11 | 11 | define('IN_AJAX', true); |
12 | - if(!empty(classLocale::$lang['player_option_fleet_ship_sort'][$fleet_ship_sort])) { |
|
12 | + if (!empty(classLocale::$lang['player_option_fleet_ship_sort'][$fleet_ship_sort])) { |
|
13 | 13 | classSupernova::$user_options[PLAYER_OPTION_FLEET_SHIP_SORT] = $fleet_ship_sort; |
14 | 14 | classSupernova::$user_options[PLAYER_OPTION_FLEET_SHIP_SORT_INVERSE] = sys_get_param_id('sort_elements_inverse', 0); |
15 | 15 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $objFleet5->initDefaults($user, $planetrow, $targetVector, $target_mission, $ships, $fleet_group_mr, $speed_percent, 0, $captainId, $resources); |
46 | 46 | |
47 | 47 | |
48 | -switch($fleet_page) { |
|
48 | +switch ($fleet_page) { |
|
49 | 49 | case 1: |
50 | 50 | $objFleet5->fleetPage1(); |
51 | 51 | break; |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | -if(classSupernova::$config->game_mode == GAME_BLITZ) { |
|
5 | +if (classSupernova::$config->game_mode == GAME_BLITZ) { |
|
6 | 6 | message(classLocale::$lang['sys_blitz_page_disabled'], classLocale::$lang['sys_error'], 'overview.php', 10); |
7 | 7 | die(); |
8 | 8 | } |
@@ -14,16 +14,16 @@ discard block |
||
14 | 14 | |
15 | 15 | $mode = sys_get_param_str('mode'); |
16 | 16 | |
17 | -if($mode == 'ainfo') { |
|
17 | +if ($mode == 'ainfo') { |
|
18 | 18 | include('includes/alliance/ali_info.inc'); |
19 | 19 | } |
20 | 20 | |
21 | -if(!$user['ally_id']) { |
|
21 | +if (!$user['ally_id']) { |
|
22 | 22 | $user_request = db_ally_request_get_by_user_id($user['id']); |
23 | - if($user_request['id_user']) { |
|
23 | + if ($user_request['id_user']) { |
|
24 | 24 | require('includes/alliance/ali_external_request.inc'); |
25 | 25 | } else { |
26 | - switch($mode) { |
|
26 | + switch ($mode) { |
|
27 | 27 | case 'search': |
28 | 28 | require('includes/alliance/ali_external_search.inc'); |
29 | 29 | break; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | sn_ali_fill_user_ally($user); |
47 | -if(!isset($user['ally'])) { |
|
47 | +if (!isset($user['ally'])) { |
|
48 | 48 | db_user_set_by_id($user['id'], "`ally_id` = null, `ally_name` = null, `ally_register_time` = 0, `ally_rank_id` = 0"); |
49 | 49 | message(classLocale::$lang['ali_sys_notFound'], classLocale::$lang['your_alliance'], 'alliance.php'); |
50 | 50 | } |
@@ -72,18 +72,18 @@ discard block |
||
72 | 72 | |
73 | 73 | // This piece converting old ally data to new one |
74 | 74 | // unset($ally['ranklist']); |
75 | -if(!$ally['ranklist'] && $ally['ally_ranks']) { |
|
75 | +if (!$ally['ranklist'] && $ally['ally_ranks']) { |
|
76 | 76 | $ally_ranks = unserialize($ally['ally_ranks']); |
77 | 77 | $i = 0; |
78 | - foreach($ally_ranks as $rank_id => $rank) { |
|
79 | - foreach($ally_rights as $key => $value) { |
|
78 | + foreach ($ally_ranks as $rank_id => $rank) { |
|
79 | + foreach ($ally_rights as $key => $value) { |
|
80 | 80 | $ranks[$i][$value] = $rank[$rights_old[$key]]; |
81 | 81 | } |
82 | 82 | db_user_list_set_ally_deprecated_convert_ranks($user['ally_id'], $i, $rank_id); |
83 | 83 | $i++; |
84 | 84 | } |
85 | 85 | |
86 | - if(!empty($ranks)) { |
|
86 | + if (!empty($ranks)) { |
|
87 | 87 | ali_rank_list_save($ranks); |
88 | 88 | } |
89 | 89 | } |
@@ -101,15 +101,15 @@ discard block |
||
101 | 101 | |
102 | 102 | $edit = sys_get_param_str('edit'); |
103 | 103 | ally_pre_call(); |
104 | -switch($mode) { |
|
104 | +switch ($mode) { |
|
105 | 105 | case 'admin': |
106 | - if(!array_key_exists($edit, $sn_ali_admin_internal)) { |
|
106 | + if (!array_key_exists($edit, $sn_ali_admin_internal)) { |
|
107 | 107 | $edit = 'default'; |
108 | 108 | } |
109 | - if($sn_ali_admin_internal[$edit]['include']) { |
|
109 | + if ($sn_ali_admin_internal[$edit]['include']) { |
|
110 | 110 | require("includes/{$sn_ali_admin_internal[$edit]['include']}"); |
111 | 111 | } |
112 | - if(isset($sn_ali_admin_internal[$edit]['function']) && is_callable($sn_ali_admin_internal[$edit]['function'])) { |
|
112 | + if (isset($sn_ali_admin_internal[$edit]['function']) && is_callable($sn_ali_admin_internal[$edit]['function'])) { |
|
113 | 113 | call_user_func($sn_ali_admin_internal[$edit]['function']); |
114 | 114 | } |
115 | 115 | break; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * |
10 | 10 | * Idea from buddy.php Created by Perberos. All rights reversed (C) 2006 |
11 | 11 | * */ |
12 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
12 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
13 | 13 | |
14 | 14 | lng_include('buddy'); |
15 | 15 | |
@@ -17,32 +17,32 @@ discard block |
||
17 | 17 | try { |
18 | 18 | sn_db_transaction_start(); |
19 | 19 | |
20 | - if($buddy_id = sys_get_param_id('buddy_id')) { |
|
20 | + if ($buddy_id = sys_get_param_id('buddy_id')) { |
|
21 | 21 | $buddy_row = db_buddy_get_row($buddy_id); |
22 | - if(!is_array($buddy_row)) { |
|
22 | + if (!is_array($buddy_row)) { |
|
23 | 23 | throw new exception('buddy_err_not_exist', ERR_ERROR); |
24 | 24 | } |
25 | 25 | |
26 | - switch($mode = sys_get_param_str('mode')) { |
|
26 | + switch ($mode = sys_get_param_str('mode')) { |
|
27 | 27 | case 'accept': |
28 | - if($buddy_row['BUDDY_SENDER_ID'] == $user['id']) { |
|
28 | + if ($buddy_row['BUDDY_SENDER_ID'] == $user['id']) { |
|
29 | 29 | throw new exception('buddy_err_accept_own', ERR_ERROR); |
30 | 30 | } |
31 | 31 | |
32 | - if($buddy_row['BUDDY_OWNER_ID'] != $user['id']) { |
|
32 | + if ($buddy_row['BUDDY_OWNER_ID'] != $user['id']) { |
|
33 | 33 | throw new exception('buddy_err_accept_alien', ERR_ERROR); |
34 | 34 | } |
35 | 35 | |
36 | - if($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE) { |
|
36 | + if ($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE) { |
|
37 | 37 | throw new exception('buddy_err_accept_already', ERR_WARNING); |
38 | 38 | } |
39 | 39 | |
40 | - if($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_DENIED) { |
|
40 | + if ($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_DENIED) { |
|
41 | 41 | throw new exception('buddy_err_accept_denied', ERR_ERROR); |
42 | 42 | } |
43 | 43 | |
44 | 44 | db_buddy_update_status($buddy_id, BUDDY_REQUEST_ACTIVE); |
45 | - if(classSupernova::$db->db_affected_rows()) { |
|
45 | + if (classSupernova::$db->db_affected_rows()) { |
|
46 | 46 | msg_send_simple_message($buddy_row['BUDDY_SENDER_ID'], $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, $user['username'], classLocale::$lang['buddy_msg_accept_title'], |
47 | 47 | sprintf(classLocale::$lang['buddy_msg_accept_text'], $user['username'])); |
48 | 48 | sn_db_transaction_commit(); |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | break; |
54 | 54 | |
55 | 55 | case 'delete': |
56 | - if($buddy_row['BUDDY_SENDER_ID'] != $user['id'] && $buddy_row['BUDDY_OWNER_ID'] != $user['id']) { |
|
56 | + if ($buddy_row['BUDDY_SENDER_ID'] != $user['id'] && $buddy_row['BUDDY_OWNER_ID'] != $user['id']) { |
|
57 | 57 | throw new exception('buddy_err_delete_alien', ERR_ERROR); |
58 | 58 | } |
59 | 59 | |
60 | - if($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE) // Existing friendship |
|
60 | + if ($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE) // Existing friendship |
|
61 | 61 | { |
62 | 62 | $ex_friend_id = $buddy_row['BUDDY_SENDER_ID'] == $user['id'] ? $buddy_row['BUDDY_OWNER_ID'] : $buddy_row['BUDDY_SENDER_ID']; |
63 | 63 | |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | db_buddy_delete($buddy_id); |
68 | 68 | sn_db_transaction_commit(); |
69 | 69 | throw new exception('buddy_err_unfriend_none', ERR_NONE); |
70 | - } elseif($buddy_row['BUDDY_SENDER_ID'] == $user['id']) // Player's outcoming request - either denied or waiting |
|
70 | + } elseif ($buddy_row['BUDDY_SENDER_ID'] == $user['id']) // Player's outcoming request - either denied or waiting |
|
71 | 71 | { |
72 | 72 | db_buddy_delete($buddy_id); |
73 | 73 | sn_db_transaction_commit(); |
74 | 74 | throw new exception('buddy_err_delete_own', ERR_NONE); |
75 | - } elseif($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_WAITING) // Deny incoming request |
|
75 | + } elseif ($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_WAITING) // Deny incoming request |
|
76 | 76 | { |
77 | 77 | msg_send_simple_message($buddy_row['BUDDY_SENDER_ID'], $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, $user['username'], classLocale::$lang['buddy_msg_deny_title'], |
78 | 78 | sprintf(classLocale::$lang['buddy_msg_deny_text'], $user['username'])); |
@@ -87,22 +87,22 @@ discard block |
||
87 | 87 | |
88 | 88 | // New request? |
89 | 89 | // Checking for user ID - in case if it was request from outside buddy system |
90 | - if($new_friend_id = sys_get_param_id('request_user_id')) { |
|
90 | + if ($new_friend_id = sys_get_param_id('request_user_id')) { |
|
91 | 91 | $new_friend_row = db_user_by_id($new_friend_id, true, '`id`, `username`'); |
92 | - } elseif($new_friend_name = sys_get_param_str_unsafe('request_user_name')) { |
|
92 | + } elseif ($new_friend_name = sys_get_param_str_unsafe('request_user_name')) { |
|
93 | 93 | $new_friend_row = db_user_by_username($new_friend_name, true, '`id`, `username`'); |
94 | 94 | $new_friend_name = db_escape($new_friend_name); |
95 | 95 | } |
96 | 96 | |
97 | - if($new_friend_row['id'] == $user['id']) { |
|
97 | + if ($new_friend_row['id'] == $user['id']) { |
|
98 | 98 | unset($new_friend_row); |
99 | 99 | throw new exception('buddy_err_adding_self', ERR_ERROR); |
100 | 100 | } |
101 | 101 | |
102 | 102 | // Checking for user name & request text - in case if it was request to adding new request |
103 | - if(isset($new_friend_row['id']) && ($new_request_text = sys_get_param_str('request_text'))) { |
|
103 | + if (isset($new_friend_row['id']) && ($new_request_text = sys_get_param_str('request_text'))) { |
|
104 | 104 | $check_relation = db_buddy_check_relation($user, $new_friend_row); |
105 | - if(isset($check_relation['BUDDY_ID'])) { |
|
105 | + if (isset($check_relation['BUDDY_ID'])) { |
|
106 | 106 | throw new exception('buddy_err_adding_exists', ERR_WARNING); |
107 | 107 | } |
108 | 108 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | sn_db_transaction_commit(); |
114 | 114 | throw new exception('buddy_err_adding_none', ERR_NONE); |
115 | 115 | } |
116 | -} catch(Exception $e) { |
|
116 | +} catch (Exception $e) { |
|
117 | 117 | $result[] = array( |
118 | 118 | 'STATUS' => in_array($e->getCode(), array(ERR_NONE, ERR_WARNING, ERR_ERROR)) ? $e->getCode() : ERR_ERROR, |
119 | 119 | 'MESSAGE' => classLocale::$lang[$e->getMessage()], |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | sn_db_transaction_rollback(); |
124 | 124 | |
125 | 125 | $query = db_buddy_list_by_user($user['id']); |
126 | -while($row = db_fetch($query)) { |
|
126 | +while ($row = db_fetch($query)) { |
|
127 | 127 | $row['BUDDY_REQUEST'] = sys_bbcodeParse($row['BUDDY_REQUEST']); |
128 | 128 | |
129 | 129 | $row['BUDDY_ACTIVE'] = $row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * |
23 | 23 | **/ |
24 | 24 | |
25 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
25 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * @param $resource_id |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $storage_fill = $caps_real['total_storage'][$resource_id] ? floor(mrc_get_level($user, $planetrow, $resource_id) / $caps_real['total_storage'][$resource_id] * 100) : 0; |
37 | 37 | |
38 | 38 | $template->assign_block_vars('resources', array( |
39 | - 'NAME' => classLocale::$lang["sys_" . pname_resource_name($resource_id)], |
|
39 | + 'NAME' => classLocale::$lang["sys_".pname_resource_name($resource_id)], |
|
40 | 40 | |
41 | 41 | 'HOURLY' => pretty_number($totalProduction, true, true), |
42 | 42 | 'WEEKLY' => pretty_number($totalProduction * 24 * 7, true, true), |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | //$SubQry .= "`{$field_name}` = '{$percent}',"; |
78 | 78 | $SubQry[] = "`{$field_name}` = '{$percent}'"; |
79 | 79 | } else { |
80 | - classSupernova::$debug->warning('Supplying wrong ID in production array - attempt to change some field - ID' . $prod_id, 'Resource Page', 301); |
|
80 | + classSupernova::$debug->warning('Supplying wrong ID in production array - attempt to change some field - ID'.$prod_id, 'Resource Page', 301); |
|
81 | 81 | continue; |
82 | 82 | } |
83 | 83 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | $template = gettemplate('viewreport', true); |
6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $id_ref = $_GET['id_ref'] ? intval($_GET['id_ref']) : 0; |
4 | -$id_ref = $id_ref ? '?id_ref=' . $id_ref : ''; |
|
4 | +$id_ref = $id_ref ? '?id_ref='.$id_ref : ''; |
|
5 | 5 | |
6 | 6 | header('HTTP/1.1 301 Moved Permanently'); |
7 | 7 | header("Location: login.php{$id_ref}#tab_password_reset"); |
@@ -13,10 +13,10 @@ |
||
13 | 13 | |
14 | 14 | $allow_anonymous = true; |
15 | 15 | |
16 | -include('includes/init.' . substr(strrchr(__FILE__, '.'), 1)); |
|
16 | +include('includes/init.'.substr(strrchr(__FILE__, '.'), 1)); |
|
17 | 17 | // die(); |
18 | -if($template_result[F_USER_IS_AUTHORIZED]) { |
|
19 | - sys_redirect('index' . DOT_PHP_EX); |
|
18 | +if ($template_result[F_USER_IS_AUTHORIZED]) { |
|
19 | + sys_redirect('index'.DOT_PHP_EX); |
|
20 | 20 | } |
21 | 21 | lng_include('login'); |
22 | 22 | lng_include('admin'); |