@@ -2,14 +2,14 @@ discard block |
||
2 | 2 | |
3 | 3 | use Alliance\DBStaticAlly; |
4 | 4 | |
5 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
5 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
6 | 6 | { |
7 | 7 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
8 | 8 | } |
9 | 9 | |
10 | 10 | $template = gettemplate('ali_info', true); |
11 | 11 | |
12 | -if($mode == 'exit') |
|
12 | +if ($mode == 'exit') |
|
13 | 13 | { |
14 | 14 | if ($ally['ally_owner'] == $user['id']) |
15 | 15 | { |
@@ -26,25 +26,25 @@ discard block |
||
26 | 26 | messageBox(sprintf($lang['ali_info_leave_success'], $ally['ally_name']), $lang['sys_alliance']); |
27 | 27 | } |
28 | 28 | } |
29 | -elseif($mode == 'ainfo') |
|
29 | +elseif ($mode == 'ainfo') |
|
30 | 30 | { |
31 | 31 | $tag = sys_get_param_str('tag'); |
32 | 32 | $id_ally = sys_get_param_id('a'); |
33 | - if($tag) |
|
33 | + if ($tag) |
|
34 | 34 | { |
35 | 35 | $ally = doquery("SELECT * FROM {{alliance}} WHERE ally_tag='{$tag}' LIMIT 1;", '', true); |
36 | 36 | } |
37 | - elseif($id_ally) |
|
37 | + elseif ($id_ally) |
|
38 | 38 | { |
39 | 39 | $ally = doquery("SELECT * FROM {{alliance}} WHERE id='{$id_ally}' LIMIT 1;", '', true); |
40 | 40 | } |
41 | 41 | |
42 | - if(!$ally) |
|
42 | + if (!$ally) |
|
43 | 43 | { |
44 | 44 | messageBox($lang['ali_sys_notFound'], $lang['Ally_info_1']); |
45 | 45 | } |
46 | 46 | |
47 | - if(!$ally['ally_description']) |
|
47 | + if (!$ally['ally_description']) |
|
48 | 48 | { |
49 | 49 | $ally['ally_description'] = $lang['Ally_nodescription']; |
50 | 50 | } |
@@ -53,17 +53,17 @@ discard block |
||
53 | 53 | 'EXTERNAL' => true, |
54 | 54 | 'USER_ALLY_ID' => $user['ally_id'], |
55 | 55 | )); |
56 | - $page_header = $lang['sys_alliance']; |
|
56 | + $page_header = $lang['sys_alliance']; |
|
57 | 57 | } |
58 | 58 | else |
59 | 59 | { |
60 | 60 | $page_header = $lang['your_alliance']; |
61 | 61 | |
62 | - if($ally['ally_owner'] == $user['id']) |
|
62 | + if ($ally['ally_owner'] == $user['id']) |
|
63 | 63 | { |
64 | 64 | $range = $ally['ally_owner_range'] ? $ally['ally_owner_range'] : $lang['Founder']; |
65 | 65 | } |
66 | - elseif($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name'])) |
|
66 | + elseif ($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name'])) |
|
67 | 67 | { |
68 | 68 | $range = $ranks[$user['ally_rank_id']]['name']; |
69 | 69 | } |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | )); |
108 | 108 | |
109 | 109 | $relations = ali_relations($ally['id']); |
110 | -foreach($relations as $relation) |
|
110 | +foreach ($relations as $relation) |
|
111 | 111 | { |
112 | - if($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id']) |
|
112 | + if ($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id']) |
|
113 | 113 | { |
114 | 114 | $template->assign_block_vars('relation', array( |
115 | 115 | 'NAME' => $relation['alliance_diplomacy_contr_ally_name'], |
@@ -6,18 +6,18 @@ discard block |
||
6 | 6 | |
7 | 7 | use Planet\DBStaticPlanet; |
8 | 8 | |
9 | -if(SN_IN_FLEET !== true) { |
|
9 | +if (SN_IN_FLEET !== true) { |
|
10 | 10 | $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403); |
11 | 11 | } |
12 | 12 | |
13 | 13 | $template = gettemplate('fleet1', true); |
14 | 14 | |
15 | 15 | $ships = sys_get_param('ships', array()); |
16 | -if(!is_array($ships)) { |
|
16 | +if (!is_array($ships)) { |
|
17 | 17 | $ships = array(); |
18 | 18 | } |
19 | 19 | |
20 | -foreach(array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) { |
|
20 | +foreach (array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) { |
|
21 | 21 | $template->assign_block_vars('possible_planet_type_id', array( |
22 | 22 | 'ID' => $possible_planet_type_id, |
23 | 23 | 'NAME' => $lang['sys_planet_type_sh'][$possible_planet_type_id], |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | 'START_NAME' => $planetrow['name'], |
31 | 31 | ); |
32 | 32 | |
33 | -if(!empty($TargetPlanet)) { |
|
33 | +if (!empty($TargetPlanet)) { |
|
34 | 34 | $template_route += array( |
35 | 35 | 'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']], |
36 | 36 | 'END_COORDS' => uni_render_coordinates($TargetPlanet), |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | $template->assign_block_vars('fleets', $template_route); |
42 | 42 | |
43 | 43 | $sn_groups_fleet = sn_get_groups('fleet'); |
44 | -foreach($ships as $ship_id => $ship_count) { |
|
45 | - if(in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
44 | +foreach ($ships as $ship_id => $ship_count) { |
|
45 | + if (in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
46 | 46 | $ship_info = get_unit_param($ship_id); |
47 | - if($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) { |
|
47 | + if ($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) { |
|
48 | 48 | $page .= $lang['fl_noenought']; |
49 | 49 | } else { |
50 | 50 | $fleet['fleetarray'][$ship_id] = $ship_count; |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | -if(empty($fleet['fleetarray'])) { |
|
66 | +if (empty($fleet['fleetarray'])) { |
|
67 | 67 | messageBox($lang['fl_err_no_ships'], $lang['fl_error'], 'fleet' . DOT_PHP_EX, 5); |
68 | 68 | } |
69 | 69 | |
70 | 70 | // Building list of shortcuts |
71 | 71 | $query = doquery("SELECT * FROM {{notes}} WHERE `owner` = {$user['id']} AND `galaxy` <> 0 AND `system` <> 0 AND `planet` <> 0 ORDER BY `priority` DESC, `galaxy`, `system`, `planet`, `planet_type`;"); |
72 | -while($shortcut = db_fetch($query)) { |
|
72 | +while ($shortcut = db_fetch($query)) { |
|
73 | 73 | $template->assign_block_vars('shortcut', array( |
74 | 74 | 'NAME' => $shortcut['title'], |
75 | 75 | 'GALAXY' => $shortcut['galaxy'], |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | // Building list of own planets & moons |
86 | -$colonies = DBStaticPlanet::db_planet_list_sorted ( $user ); |
|
87 | -if(count($colonies) > 1) { |
|
86 | +$colonies = DBStaticPlanet::db_planet_list_sorted($user); |
|
87 | +if (count($colonies) > 1) { |
|
88 | 88 | // while($row = db_fetch($colonies)) |
89 | - foreach($colonies as $row) { |
|
89 | + foreach ($colonies as $row) { |
|
90 | 90 | $template->assign_block_vars('colonies', array( |
91 | 91 | 'NAME' => $row['name'], |
92 | 92 | 'GALAXY' => $row['galaxy'], |
@@ -101,9 +101,9 @@ discard block |
||
101 | 101 | //ACS Start |
102 | 102 | //Need to look for acs attacks. |
103 | 103 | $aks_madnessred = doquery('SELECT * FROM {{aks}};'); |
104 | -while($row = db_fetch($aks_madnessred)) { |
|
104 | +while ($row = db_fetch($aks_madnessred)) { |
|
105 | 105 | $members = explode(',', $row['eingeladen']); |
106 | - foreach($members as $a => $b) { |
|
106 | + foreach ($members as $a => $b) { |
|
107 | 107 | if ($b == $user['id']) { |
108 | 108 | $template->assign_block_vars('acss', array( |
109 | 109 | 'ID' => $row['id'], |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use DBAL\OldDbChangeSet; |
4 | 4 | use Planet\DBStaticPlanet; |
5 | 5 | |
6 | -if(!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) { |
|
6 | +if (!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) { |
|
7 | 7 | $debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403); |
8 | 8 | } |
9 | 9 | |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | 'rpg_cost' => $rpg_cost, |
16 | 16 | )); |
17 | 17 | |
18 | -if(is_array($shipList)) { |
|
19 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $rpg_cost) { |
|
18 | +if (is_array($shipList)) { |
|
19 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $rpg_cost) { |
|
20 | 20 | $intError = MARKET_NO_DM; |
21 | 21 | } |
22 | 22 | |
@@ -33,30 +33,30 @@ discard block |
||
33 | 33 | $qry = array(); |
34 | 34 | $total = array(); |
35 | 35 | $db_changeset = array(); |
36 | - foreach($shipList as $shipID => &$shipCount) { |
|
36 | + foreach ($shipList as $shipID => &$shipCount) { |
|
37 | 37 | $shipCount = ceil(floatval($shipCount)); |
38 | - if(!$shipCount) { |
|
38 | + if (!$shipCount) { |
|
39 | 39 | continue; |
40 | 40 | } |
41 | 41 | |
42 | - if($shipCount < 0) { |
|
42 | + if ($shipCount < 0) { |
|
43 | 43 | $debug->warning('User supplied negative ship count on Black Market page', 'Hack Attempt', 307); |
44 | 44 | $intError = MARKET_NEGATIVE_SHIPS; |
45 | 45 | break; |
46 | 46 | } |
47 | 47 | |
48 | - if($mode == MARKET_SCRAPPER) { |
|
48 | + if ($mode == MARKET_SCRAPPER) { |
|
49 | 49 | $amount = mrc_get_level($user, $planetrow, $shipID, true, true); // $planetrow[get_unit_param($shipID, P_NAME)]; |
50 | - } elseif($mode == MARKET_STOCKMAN) { |
|
50 | + } elseif ($mode == MARKET_STOCKMAN) { |
|
51 | 51 | $amount = $stock[$shipID]; |
52 | 52 | } |
53 | 53 | |
54 | - if($amount < $shipCount) { |
|
54 | + if ($amount < $shipCount) { |
|
55 | 55 | $intError = $error_no_stock; |
56 | 56 | break; |
57 | 57 | } |
58 | 58 | |
59 | - if(!in_array($shipID, sn_get_groups('fleet'))) { |
|
59 | + if (!in_array($shipID, sn_get_groups('fleet'))) { |
|
60 | 60 | $debug->warning('Hack Attempt', 'User supplied non-ship unit ID on Black Market page', 306); |
61 | 61 | $intError = MARKET_NOT_A_SHIP; |
62 | 62 | break; |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | $resTemp[RES_CRYSTAL] = floor($build_data[BUILD_CREATE][RES_CRYSTAL] * $shipCount * $config_rpg_scrape_crystal * (-$multiplier)); |
73 | 73 | $resTemp[RES_DEUTERIUM] = floor($build_data[BUILD_CREATE][RES_DEUTERIUM] * $shipCount * $config_rpg_scrape_deuterium * (-$multiplier)); |
74 | 74 | |
75 | - foreach($resTemp as $resID => $resCount) { |
|
75 | + foreach ($resTemp as $resID => $resCount) { |
|
76 | 76 | $total[$resID] += $resCount; |
77 | 77 | } |
78 | 78 | |
79 | 79 | $message .= "<li>{$lang['tech'][$shipID]}: " . HelperString::numberFloorAndFormat($shipCount); |
80 | 80 | } |
81 | 81 | |
82 | - if($mode == MARKET_STOCKMAN && $intError == MARKET_DEAL) { |
|
83 | - foreach($total as $resID => $resCount) { |
|
84 | - if(mrc_get_level($user, $planetrow, $resID, true, true) < -$resCount) { |
|
82 | + if ($mode == MARKET_STOCKMAN && $intError == MARKET_DEAL) { |
|
83 | + foreach ($total as $resID => $resCount) { |
|
84 | + if (mrc_get_level($user, $planetrow, $resID, true, true) < -$resCount) { |
|
85 | 85 | $intError = MARKET_NO_RESOURCES; |
86 | 86 | $debug->warning('Trying to use bug in s/h market', 'S/H Ship Market', 301); |
87 | 87 | break; |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | |
92 | 92 | $intError = ($intError == MARKET_DEAL) && (array_sum($total) == 0) ? $error_zero_res : $intError; |
93 | 93 | |
94 | - if($intError == MARKET_DEAL) { |
|
94 | + if ($intError == MARKET_DEAL) { |
|
95 | 95 | $message .= '</ul>' . $lang["eco_mrk_{$submode}_res"] . '<ul>'; |
96 | - foreach($total as $resID => $resCount) { |
|
97 | - if(!$resCount) { |
|
96 | + foreach ($total as $resID => $resCount) { |
|
97 | + if (!$resCount) { |
|
98 | 98 | continue; |
99 | 99 | } |
100 | 100 | |
@@ -128,38 +128,38 @@ discard block |
||
128 | 128 | 'MESSAGE' => $lang['eco_mrk_errors'][$intError], |
129 | 129 | )); |
130 | 130 | |
131 | - foreach($shipList as $shipID => $shipCount) { |
|
131 | + foreach ($shipList as $shipID => $shipCount) { |
|
132 | 132 | $data['ships'][$shipID] = max(0, intval($shipCount)); |
133 | 133 | } |
134 | 134 | } |
135 | 135 | } |
136 | 136 | $message = ''; |
137 | 137 | |
138 | -if(!$config->eco_stockman_fleet && $config->eco_stockman_fleet_populate) { |
|
139 | - $config->db_saveItem('eco_stockman_fleet', sys_unit_arr2str(array_map(function($item){return mt_rand(1, 1000);}, sn_get_groups('fleet')))); |
|
138 | +if (!$config->eco_stockman_fleet && $config->eco_stockman_fleet_populate) { |
|
139 | + $config->db_saveItem('eco_stockman_fleet', sys_unit_arr2str(array_map(function($item) {return mt_rand(1, 1000); }, sn_get_groups('fleet')))); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | tpl_set_resource_info($template, $planetrow, array()); |
143 | 143 | |
144 | -if(!$array) { |
|
144 | +if (!$array) { |
|
145 | 145 | $array = array(); |
146 | 146 | } |
147 | 147 | |
148 | 148 | $group_fleet = sn_get_groups('fleet'); |
149 | -foreach($array as $key => $value) { |
|
150 | - if($mode == MARKET_SCRAPPER) { |
|
149 | +foreach ($array as $key => $value) { |
|
150 | + if ($mode == MARKET_SCRAPPER) { |
|
151 | 151 | $shipID = $value; |
152 | 152 | $amount = mrc_get_level($user, $planetrow, $shipID, false, true); // $planetrow[get_unit_param($shipID, P_NAME)]; |
153 | - } elseif($mode == MARKET_STOCKMAN) { |
|
153 | + } elseif ($mode == MARKET_STOCKMAN) { |
|
154 | 154 | $shipID = $key; |
155 | 155 | $amount = $value; |
156 | 156 | } |
157 | 157 | |
158 | - if(!in_array($shipID, $group_fleet)) { |
|
158 | + if (!in_array($shipID, $group_fleet)) { |
|
159 | 159 | continue; |
160 | 160 | } |
161 | 161 | |
162 | - if($amount > 0) { |
|
162 | + if ($amount > 0) { |
|
163 | 163 | $build_data = eco_get_build_data($user, $planetrow, $shipID); |
164 | 164 | $template->assign_block_vars('ships', array( |
165 | 165 | 'ID' => $shipID, |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | |
11 | 11 | use Unit\DBStaticUnit; |
12 | 12 | |
13 | -define('INSIDE' , true); |
|
14 | -define('INSTALL' , false); |
|
13 | +define('INSIDE', true); |
|
14 | +define('INSTALL', false); |
|
15 | 15 | define('IN_ADMIN', true); |
16 | 16 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
17 | 17 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | $template = gettemplate('admin/settings', true); |
23 | 23 | |
24 | -if(sys_get_param('save')) { |
|
24 | +if (sys_get_param('save')) { |
|
25 | 25 | SN::$config->game_name = sys_get_param_str_unsafe('game_name'); |
26 | 26 | SN::$config->game_mode = sys_get_param_int('game_mode'); |
27 | 27 | SN::$config->game_speed = sys_get_param_float('game_speed', 1); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | SN::$config->url_faq = sys_get_param_str_unsafe('url_faq'); |
32 | 32 | SN::$config->url_forum = sys_get_param_str_unsafe('url_forum'); |
33 | 33 | SN::$config->url_rules = sys_get_param_str_unsafe('url_rules'); |
34 | - SN::$config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter'); |
|
34 | + SN::$config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter'); |
|
35 | 35 | SN::$config->game_disable = sys_get_param_int('game_disable'); |
36 | 36 | SN::$config->game_disable_reason = sys_get_param_str_unsafe('game_disable_reason'); |
37 | 37 | SN::$config->server_updater_check_auto = sys_get_param_int('server_updater_check_auto'); |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | SN::$config->stats_schedule = sys_get_param_str('stats_schedule'); |
102 | 102 | |
103 | 103 | SN::$config->empire_mercenary_base_period = sys_get_param_int('empire_mercenary_base_period'); |
104 | - if(SN::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) { |
|
105 | - if(SN::$config->empire_mercenary_temporary) { |
|
104 | + if (SN::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) { |
|
105 | + if (SN::$config->empire_mercenary_temporary) { |
|
106 | 106 | DBStaticUnit::db_unit_list_admin_delete_mercenaries_finished(); |
107 | 107 | } else { |
108 | 108 | DBStaticUnit::db_unit_list_admin_set_mercenaries_expire_time(SN::$config->empire_mercenary_base_period); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | tpl_assign_select($template, 'ver_response', SN::$lang['adm_opt_ver_response'], 'ID', 'NAME'); |
153 | 153 | |
154 | 154 | $lang_list = lng_get_list(); |
155 | -foreach($lang_list as $lang_id => $lang_data) { |
|
155 | +foreach ($lang_list as $lang_id => $lang_data) { |
|
156 | 156 | $template->assign_block_vars('game_languages', array( |
157 | 157 | 'ID' => $lang_id, |
158 | 158 | 'NAME' => "{$lang_data['LANG_NAME_NATIVE']} ({$lang_data['LANG_NAME_ENGLISH']})", |
@@ -114,7 +114,7 @@ |
||
114 | 114 | $this->addFirstLast(); |
115 | 115 | } |
116 | 116 | |
117 | - if(!empty($this->result)) { |
|
117 | + if (!empty($this->result)) { |
|
118 | 118 | $template = gettemplate('_paging'); |
119 | 119 | $template->assign_recursive([ |
120 | 120 | 'PAGING_ROOT' => $this->rootUrl, |
@@ -19,7 +19,7 @@ |
||
19 | 19 | } |
20 | 20 | } |
21 | 21 | |
22 | - if(!empty($paramList)) { |
|
22 | + if (!empty($paramList)) { |
|
23 | 23 | $strParams = implode('&', $paramList); |
24 | 24 | } |
25 | 25 |
@@ -239,7 +239,7 @@ |
||
239 | 239 | |
240 | 240 | $factory = $this->values[$id]; |
241 | 241 | |
242 | - $extended = function ($c) use ($callable, $factory) { |
|
242 | + $extended = function($c) use ($callable, $factory) { |
|
243 | 243 | return $callable($factory($c), $c); |
244 | 244 | }; |
245 | 245 |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | |
142 | 142 | preg_match_all('#<!-- INCLUDE (\{\$?[A-Z0-9\-_]+\}|[a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches); |
143 | 143 | $include_blocks = $matches[1]; |
144 | - if($include_blocks) |
|
144 | + if ($include_blocks) |
|
145 | 145 | { |
146 | - foreach($include_blocks as &$included_file) |
|
146 | + foreach ($include_blocks as &$included_file) |
|
147 | 147 | { |
148 | 148 | $included_file .= '.tpl.html'; |
149 | 149 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | $varname = $var_val[3]; |
309 | 309 | $new = $this->generate_block_varref($namespace, $varname, $var_val[2]); |
310 | 310 | |
311 | - if(!empty($var_val[4])) { |
|
311 | + if (!empty($var_val[4])) { |
|
312 | 312 | $new = \Ptl\PtlVariableDecorator::decorate($var_val[0], $new, $this->template); |
313 | 313 | } |
314 | 314 | |
@@ -462,8 +462,8 @@ discard block |
||
462 | 462 | |
463 | 463 | $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){'; |
464 | 464 | // $tag_template_php .= '$this->_block_counter["'. $tag_args . '"] = $_' . $tag_args . '_i;'; |
465 | - $tag_template_php .= '$_'. $tag_args . '_val = &' . $varref . '[$_'. $tag_args. '_i];'; |
|
466 | - $tag_template_php .= '$this->_block_value["'. $tag_args . '"] = &' . $varref . '[$_'. $tag_args. '_i];'; |
|
465 | + $tag_template_php .= '$_' . $tag_args . '_val = &' . $varref . '[$_' . $tag_args . '_i];'; |
|
466 | + $tag_template_php .= '$this->_block_value["' . $tag_args . '"] = &' . $varref . '[$_' . $tag_args . '_i];'; |
|
467 | 467 | |
468 | 468 | return $tag_template_php; |
469 | 469 | } |
@@ -567,10 +567,10 @@ discard block |
||
567 | 567 | break; |
568 | 568 | |
569 | 569 | case 'is': |
570 | - $is_arg_start = ($tokens[$i-1] == ')') ? array_pop($is_arg_stack) : $i-1; |
|
570 | + $is_arg_start = ($tokens[$i - 1] == ')') ? array_pop($is_arg_stack) : $i - 1; |
|
571 | 571 | $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start)); |
572 | 572 | |
573 | - $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1)); |
|
573 | + $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i + 1)); |
|
574 | 574 | |
575 | 575 | array_splice($tokens, $is_arg_start, sizeof($tokens), $new_tokens); |
576 | 576 | |
@@ -834,11 +834,11 @@ discard block |
||
834 | 834 | } |
835 | 835 | else if ($include_last_iterator) |
836 | 836 | { |
837 | - return '$_'. $blocks[$blockcount] . '_val'; |
|
837 | + return '$_' . $blocks[$blockcount] . '_val'; |
|
838 | 838 | } |
839 | 839 | else |
840 | 840 | { |
841 | - return '$_'. $blocks[$blockcount - 1] . '_val[\''. $blocks[$blockcount]. '\']'; |
|
841 | + return '$_' . $blocks[$blockcount - 1] . '_val[\'' . $blocks[$blockcount] . '\']'; |
|
842 | 842 | } |
843 | 843 | } |
844 | 844 | |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | if ($fp = @fopen($filename, 'wb')) |
856 | 856 | { |
857 | 857 | @flock($fp, LOCK_EX); |
858 | - @fwrite ($fp, $data); |
|
858 | + @fwrite($fp, $data); |
|
859 | 859 | @flock($fp, LOCK_UN); |
860 | 860 | @fclose($fp); |
861 | 861 | |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | */ |
874 | 874 | function minify($html) |
875 | 875 | { |
876 | - if(!SN::$config->tpl_minifier) |
|
876 | + if (!SN::$config->tpl_minifier) |
|
877 | 877 | { |
878 | 878 | return $html; |
879 | 879 | } |
@@ -885,14 +885,14 @@ discard block |
||
885 | 885 | //$html = preg_replace('/[\r\n\t]+/', ' ', $html); |
886 | 886 | $html = preg_replace('/>[\s]*</', '><', $html); // Strip spacechars between tags |
887 | 887 | $html = preg_replace('/[\s]+/', ' ', $html); // Replace several spacechars with one space |
888 | - if(!empty($pre[0])) |
|
888 | + if (!empty($pre[0])) |
|
889 | 889 | { |
890 | - foreach($pre[0] as $tag) |
|
890 | + foreach ($pre[0] as $tag) |
|
891 | 891 | { |
892 | 892 | $tag = preg_replace('/^\ *\/\/[^\<]*?$/m', ' ', $tag); // Strips comments - except those that contains HTML comment inside |
893 | 893 | $tag = preg_replace('/[\ \t]{2,}/', ' ', $tag); // Replace several spaces by one |
894 | 894 | $tag = preg_replace('/\s{2,}/', "\r\n", $tag); // Replace several linefeeds by one |
895 | - $html = preg_replace('/#pre#/', $tag, $html,1); |
|
895 | + $html = preg_replace('/#pre#/', $tag, $html, 1); |
|
896 | 896 | } |
897 | 897 | } |
898 | 898 |
@@ -29,19 +29,19 @@ |
||
29 | 29 | 'ID' => self::PAGE_SORT_BY_RANK, |
30 | 30 | 'HTML_ID' => 'byTotalRank', |
31 | 31 | 'HTML_NAME' => '{ byTotalRank }', |
32 | - 'SQL_SORT' => ['u.total_rank',], |
|
32 | + 'SQL_SORT' => ['u.total_rank', ], |
|
33 | 33 | ], |
34 | 34 | self::PAGE_SORT_BY_ID => [ |
35 | 35 | 'ID' => self::PAGE_SORT_BY_ID, |
36 | 36 | 'HTML_ID' => 'byId', |
37 | 37 | 'HTML_NAME' => '{ byId }', |
38 | - 'SQL_SORT' => ['u.id',], |
|
38 | + 'SQL_SORT' => ['u.id', ], |
|
39 | 39 | ], |
40 | 40 | self::PAGE_SORT_BY_NAME => [ |
41 | 41 | 'ID' => self::PAGE_SORT_BY_NAME, |
42 | 42 | 'HTML_ID' => 'byName', |
43 | 43 | 'HTML_NAME' => '{ byName }', |
44 | - 'SQL_SORT' => ['u.username',], |
|
44 | + 'SQL_SORT' => ['u.username', ], |
|
45 | 45 | ], |
46 | 46 | |
47 | 47 | self::PAGE_SORT_BY_POINTS => [ |