@@ -1,7 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function sys_maintenance() |
|
4 | -{ |
|
3 | +function sys_maintenance() { |
|
5 | 4 | global $config; |
6 | 5 | |
7 | 6 | $bashing_time_limit = SN_TIME_NOW - $config->fleet_bashing_scope; |
@@ -42,8 +41,7 @@ discard block |
||
42 | 41 | * TODO: 2. [<m|w|d|h|m|s>@]<time> |
43 | 42 | */ |
44 | 43 | |
45 | -function sys_schedule_get_prev_run($scheduleList, $recorded_run = SN_TIME_NOW, $return_next_run = false) |
|
46 | -{ |
|
44 | +function sys_schedule_get_prev_run($scheduleList, $recorded_run = SN_TIME_NOW, $return_next_run = false) { |
|
47 | 45 | static $date_part_names_reverse = array('seconds', 'minutes', 'hours', 'days', 'months', 'years',); |
48 | 46 | |
49 | 47 | $possible_schedules = array(); |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | array('query' => "DELETE FROM `{{planets}}` WHERE `id_owner` = 0 AND `destruyed` < UNIX_TIMESTAMP();", 'result' => false, 'error' => '', 'affected_rows' => 0), |
18 | 18 | ); |
19 | 19 | |
20 | - foreach($queries as &$query) |
|
20 | + foreach ($queries as &$query) |
|
21 | 21 | { |
22 | 22 | $query['result'] = doquery($query['query']); |
23 | 23 | $query['error'] = SN::$db->db_error(); |
24 | - $query['affected_rows'] = SN::$db->db_affected_rows(); |
|
24 | + $query['affected_rows'] = SN::$db->db_affected_rows(); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | return $queries; |
@@ -53,30 +53,30 @@ discard block |
||
53 | 53 | $recorded_run = strtotime($recorded_run); |
54 | 54 | |
55 | 55 | $prev_run_array = getdate($recorded_run); |
56 | - $prev_run_array = array($prev_run_array['seconds'],$prev_run_array['minutes'],$prev_run_array['hours'],$prev_run_array['mday'],$prev_run_array['mon'],$prev_run_array['year']); |
|
56 | + $prev_run_array = array($prev_run_array['seconds'], $prev_run_array['minutes'], $prev_run_array['hours'], $prev_run_array['mday'], $prev_run_array['mon'], $prev_run_array['year']); |
|
57 | 57 | $today_array = getdate(SN_TIME_NOW); |
58 | - $today_array = array($today_array['seconds'],$today_array['minutes'],$today_array['hours'],$today_array['mday'],$today_array['mon'],$today_array['year']); |
|
58 | + $today_array = array($today_array['seconds'], $today_array['minutes'], $today_array['hours'], $today_array['mday'], $today_array['mon'], $today_array['year']); |
|
59 | 59 | $scheduleList = explode(',', $scheduleList); |
60 | 60 | array_walk($scheduleList, function(&$schedule) use ($prev_run_array, $today_array, $date_part_names_reverse, &$possible_schedules) { |
61 | 61 | $schedule = array('schedule_array' => array_reverse(explode(':', trim($schedule)))); |
62 | 62 | |
63 | 63 | $interval = $date_part_names_reverse[count($schedule['schedule_array'])]; |
64 | 64 | |
65 | - foreach($prev_run_array as $index => $date_part) { |
|
65 | + foreach ($prev_run_array as $index => $date_part) { |
|
66 | 66 | $schedule['array']['recorded'][$index] = isset($schedule['schedule_array'][$index]) ? intval($schedule['schedule_array'][$index]) : $date_part; |
67 | 67 | $schedule['array']['now'][$index] = isset($schedule['schedule_array'][$index]) ? intval($schedule['schedule_array'][$index]) : $today_array[$index]; |
68 | 68 | } |
69 | - if($schedule['array']['recorded'] == $schedule['array']['now']) { |
|
69 | + if ($schedule['array']['recorded'] == $schedule['array']['now']) { |
|
70 | 70 | unset($schedule['array']['now']); |
71 | 71 | } |
72 | 72 | |
73 | - foreach($schedule['array'] as $name => $array) { |
|
73 | + foreach ($schedule['array'] as $name => $array) { |
|
74 | 74 | $schedule['string'][$name] = "{$array[5]}-{$array[4]}-{$array[3]} {$array[2]}:{$array[1]}:{$array[0]}"; |
75 | 75 | $schedule['string'][$name . '_next'] = $schedule['string'][$name] . ' +1 ' . $interval; |
76 | 76 | $schedule['string'][$name . '_prev'] = $schedule['string'][$name] . ' -1 ' . $interval; |
77 | 77 | } |
78 | 78 | |
79 | - foreach($schedule['string'] as $string) { |
|
79 | + foreach ($schedule['string'] as $string) { |
|
80 | 80 | $timestamp = strtotime($string); |
81 | 81 | $schedule['timestamp'][$timestamp] = $possible_schedules[$timestamp] = date(FMT_DATE_TIME_SQL, strtotime($string)); |
82 | 82 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | $prev_run = 0; |
88 | 88 | $next_run = 0; |
89 | - foreach($possible_schedules as $timestamp => $string_date) { |
|
89 | + foreach ($possible_schedules as $timestamp => $string_date) { |
|
90 | 90 | $prev_run = SN_TIME_NOW >= $timestamp ? $timestamp : $prev_run; |
91 | 91 | $next_run = SN_TIME_NOW < $timestamp && !$next_run ? $timestamp : $next_run; |
92 | 92 | } |
@@ -1,14 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // ---------------------------------------------------------------------------------------------------------------- |
4 | -function lng_try_filepath($path, $file_path_relative) |
|
5 | -{ |
|
4 | +function lng_try_filepath($path, $file_path_relative) { |
|
6 | 5 | $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative; |
7 | 6 | return file_exists($file_path) ? $file_path : false; |
8 | 7 | } |
9 | 8 | |
10 | -function lng_die_not_an_object() |
|
11 | -{ |
|
9 | +function lng_die_not_an_object() { |
|
12 | 10 | print('Ошибка - $lang не объект! Сообщите Администратору сервера и приложите содержимое страницы'); |
13 | 11 | $trace = debug_backtrace(); |
14 | 12 | unset($trace[0]); |
@@ -17,32 +15,27 @@ discard block |
||
17 | 15 | } |
18 | 16 | |
19 | 17 | // ---------------------------------------------------------------------------------------------------------------- |
20 | -function lng_include($filename, $path = '', $ext = '.mo.php') |
|
21 | -{ |
|
18 | +function lng_include($filename, $path = '', $ext = '.mo.php') { |
|
22 | 19 | global $lang; |
23 | 20 | return is_object($lang) ? $lang->lng_include($filename, $path, $ext) : lng_die_not_an_object(); |
24 | 21 | } |
25 | 22 | |
26 | -function lng_get_list() |
|
27 | -{ |
|
23 | +function lng_get_list() { |
|
28 | 24 | global $lang; |
29 | 25 | return is_object($lang) ? $lang->lng_get_list() : lng_die_not_an_object(); |
30 | 26 | } |
31 | 27 | |
32 | -function lng_get_info($entry) |
|
33 | -{ |
|
28 | +function lng_get_info($entry) { |
|
34 | 29 | global $lang; |
35 | 30 | return is_object($lang) ? $lang->lng_get_info($entry) : lng_die_not_an_object(); |
36 | 31 | } |
37 | 32 | |
38 | -function lng_switch($language_new) |
|
39 | -{ |
|
33 | +function lng_switch($language_new) { |
|
40 | 34 | global $lang; |
41 | 35 | return is_object($lang) ? $lang->lng_switch($language_new) : lng_die_not_an_object(); |
42 | 36 | } |
43 | 37 | |
44 | -function lng_load_i18n($i18n) |
|
45 | -{ |
|
38 | +function lng_load_i18n($i18n) { |
|
46 | 39 | global $lang; |
47 | 40 | return is_object($lang) ? $lang->lng_load_i18n($i18n) : lng_die_not_an_object(); |
48 | 41 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | function flt_mission_hold(&$mission_data) |
4 | 4 | { |
5 | - if($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW) |
|
5 | + if ($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW) |
|
6 | 6 | { |
7 | 7 | fleet_send_back($mission_data['fleet']); |
8 | 8 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;"); |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function flt_mission_hold(&$mission_data) |
|
4 | -{ |
|
3 | +function flt_mission_hold(&$mission_data) { |
|
5 | 4 | if($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW) |
6 | 5 | { |
7 | 6 | fleet_send_back($mission_data['fleet']); |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | * @copyright 2008 By Chlorel for XNova |
8 | 8 | */ |
9 | 9 | |
10 | -function flt_mission_recycle(&$mission_data) |
|
11 | -{ |
|
10 | +function flt_mission_recycle(&$mission_data) { |
|
12 | 11 | $fleet_row = &$mission_data['fleet']; |
13 | 12 | $destination_planet = &$mission_data['dst_planet']; |
14 | 13 | |
@@ -37,8 +36,7 @@ discard block |
||
37 | 36 | if(in_array($unit_id, sn_get_groups('flt_recyclers'))) |
38 | 37 | { |
39 | 38 | $RecyclerCapacity += $capacity; |
40 | - } |
|
41 | - else |
|
39 | + } else |
|
42 | 40 | { |
43 | 41 | $OtherFleetCapacity += $capacity; |
44 | 42 | } |
@@ -55,16 +53,14 @@ discard block |
||
55 | 53 | { |
56 | 54 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
57 | 55 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
58 | - } |
|
59 | - else |
|
56 | + } else |
|
60 | 57 | { |
61 | 58 | if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
62 | 59 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
63 | 60 | { |
64 | 61 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
65 | 62 | $RecycledGoods["crystal"] = $RecyclerCapacity / 2; |
66 | - } |
|
67 | - else |
|
63 | + } else |
|
68 | 64 | { |
69 | 65 | if ($destination_planet["debris_metal"] > $destination_planet["debris_crystal"]) |
70 | 66 | { |
@@ -72,20 +68,17 @@ discard block |
||
72 | 68 | if ($destination_planet["debris_metal"] > ($RecyclerCapacity - $RecycledGoods["crystal"])) |
73 | 69 | { |
74 | 70 | $RecycledGoods["metal"] = $RecyclerCapacity - $RecycledGoods["crystal"]; |
75 | - } |
|
76 | - else |
|
71 | + } else |
|
77 | 72 | { |
78 | 73 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
79 | 74 | } |
80 | - } |
|
81 | - else |
|
75 | + } else |
|
82 | 76 | { |
83 | 77 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
84 | 78 | if ($destination_planet["debris_crystal"] > ($RecyclerCapacity - $RecycledGoods["metal"])) |
85 | 79 | { |
86 | 80 | $RecycledGoods["crystal"] = $RecyclerCapacity - $RecycledGoods["metal"]; |
87 | - } |
|
88 | - else |
|
81 | + } else |
|
89 | 82 | { |
90 | 83 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
91 | 84 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | } |
59 | 59 | else |
60 | 60 | { |
61 | - if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
61 | + if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) and |
|
62 | 62 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
63 | 63 | { |
64 | 64 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
@@ -12,12 +12,12 @@ discard block |
||
12 | 12 | $fleet_row = &$mission_data['fleet']; |
13 | 13 | $destination_planet = &$mission_data['dst_planet']; |
14 | 14 | |
15 | - if(!$fleet_row) |
|
15 | + if (!$fleet_row) |
|
16 | 16 | { |
17 | 17 | return CACHE_NOTHING; |
18 | 18 | } |
19 | 19 | |
20 | - if(!isset($destination_planet['id'])) |
|
20 | + if (!isset($destination_planet['id'])) |
|
21 | 21 | { |
22 | 22 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
23 | 23 | fleet_send_back($mission_data['fleet']); |
@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | $RecyclerCapacity = 0; |
30 | 30 | $OtherFleetCapacity = 0; |
31 | 31 | $fleet_array = sys_unit_str2arr($fleet_row['fleet_array']); |
32 | - foreach($fleet_array as $unit_id => $unit_count) |
|
32 | + foreach ($fleet_array as $unit_id => $unit_count) |
|
33 | 33 | { |
34 | - if(in_array($unit_id, sn_get_groups('fleet'))) |
|
34 | + if (in_array($unit_id, sn_get_groups('fleet'))) |
|
35 | 35 | { |
36 | 36 | $capacity = get_unit_param($unit_id, P_CAPACITY) * $unit_count; |
37 | - if(in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
37 | + if (in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
38 | 38 | { |
39 | 39 | $RecyclerCapacity += $capacity; |
40 | 40 | } |
@@ -46,19 +46,19 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | $IncomingFleetGoods = $fleet_row["fleet_resource_metal"] + $fleet_row["fleet_resource_crystal"] + $fleet_row["fleet_resource_deuterium"]; |
49 | - if($IncomingFleetGoods > $OtherFleetCapacity) |
|
49 | + if ($IncomingFleetGoods > $OtherFleetCapacity) |
|
50 | 50 | { |
51 | 51 | $RecyclerCapacity -= ($IncomingFleetGoods - $OtherFleetCapacity); |
52 | 52 | } |
53 | 53 | |
54 | - if(($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
54 | + if (($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
55 | 55 | { |
56 | 56 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
57 | 57 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
58 | 58 | } |
59 | 59 | else |
60 | 60 | { |
61 | - if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
61 | + if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
62 | 62 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
63 | 63 | { |
64 | 64 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |
95 | - $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
95 | + $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
96 | 96 | $NewCargo['Crystal'] = $fleet_row["fleet_resource_crystal"] + $RecycledGoods["crystal"]; |
97 | 97 | $NewCargo['Deuterium'] = $fleet_row["fleet_resource_deuterium"]; |
98 | 98 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | HelperString::numberFloorAndFormat($RecycledGoods["metal"]), $lang['Metal'], |
106 | 106 | HelperString::numberFloorAndFormat($RecycledGoods["crystal"]), $lang['Crystal'] |
107 | 107 | ); |
108 | - msg_send_simple_message ( $fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message); |
|
108 | + msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message); |
|
109 | 109 | |
110 | 110 | // $QryUpdateFleet = "UPDATE {{fleets}} SET `fleet_mess` = 1,`fleet_resource_metal` = '{$NewCargo['Metal']}',`fleet_resource_crystal` = '{$NewCargo['Crystal']}',`fleet_resource_deuterium` = '{$NewCargo['Deuterium']}' "; |
111 | 111 | // $QryUpdateFleet .= "WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;"; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $fleet_row = &$mission_data['fleet']; |
14 | 14 | $destination_planet = &$mission_data['dst_planet']; |
15 | 15 | |
16 | - if(!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
16 | + if (!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
17 | 17 | { |
18 | 18 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
19 | 19 | fleet_send_back($mission_data['fleet']); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $mission_data['src_planet']['name'], uni_render_coordinates_href($fleet_row, 'fleet_start_', 3, ''), $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), |
27 | 27 | $fleet_row['fleet_resource_metal'], $lang['Metal'], $fleet_row['fleet_resource_crystal'], $lang['Crystal'], $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']) . |
28 | 28 | '<br />' . $lang['sys_relocate_mess_user']; |
29 | - foreach(sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
29 | + foreach (sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
30 | 30 | { |
31 | 31 | $Message .= $lang['tech'][$ship_id] . ' - ' . $ship_count . '<br />'; |
32 | 32 | } |
@@ -8,8 +8,7 @@ |
||
8 | 8 | * @version 1.1 |
9 | 9 | * @copyright 2008 by Chlorel for XNova |
10 | 10 | */ |
11 | -function flt_mission_relocate($mission_data) |
|
12 | -{ |
|
11 | +function flt_mission_relocate($mission_data) { |
|
13 | 12 | $fleet_row = &$mission_data['fleet']; |
14 | 13 | $destination_planet = &$mission_data['dst_planet']; |
15 | 14 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | function flt_mission_destroy($mission_data) { |
9 | 9 | $fleet_row = $mission_data['fleet']; |
10 | 10 | $destination_planet = $mission_data['dst_planet']; |
11 | - if(!$destination_planet || !is_array($destination_planet) || $destination_planet['planet_type'] != PT_MOON) { |
|
11 | + if (!$destination_planet || !is_array($destination_planet) || $destination_planet['planet_type'] != PT_MOON) { |
|
12 | 12 | fleet_send_back($fleet_row); |
13 | 13 | |
14 | 14 | return CACHE_FLEET; |
@@ -170,7 +170,7 @@ |
||
170 | 170 | |
171 | 171 | function upd_db_unit_by_location($user_id = 0, $location_type, $location_id, $unit_snid = 0, $for_update = false, $fields = '*') { |
172 | 172 | return db_fetch(upd_do_query( |
173 | - "SELECT {$fields} |
|
173 | + "select {$fields} |
|
174 | 174 | FROM {{unit}} |
175 | 175 | WHERE |
176 | 176 | `unit_location_type` = {$location_type} AND `unit_location_id` = {$location_id} AND " . DBStaticUnit::db_unit_time_restrictions() . |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $source_planet = &$mission_data['src_planet']; |
15 | 15 | $destination_planet = &$mission_data['dst_planet']; |
16 | 16 | |
17 | - if(!isset($destination_planet['id']) || !$destination_planet['id_owner']) |
|
17 | + if (!isset($destination_planet['id']) || !$destination_planet['id_owner']) |
|
18 | 18 | { |
19 | 19 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
20 | 20 | fleet_send_back($fleet_row); |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), |
28 | 28 | $fleet_row['fleet_resource_metal'], $lang['Metal'], |
29 | 29 | $fleet_row['fleet_resource_crystal'], $lang['Crystal'], |
30 | - $fleet_row['fleet_resource_deuterium'], $lang['Deuterium'] ); |
|
30 | + $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']); |
|
31 | 31 | msg_send_simple_message($fleet_row['fleet_target_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message); |
32 | 32 | |
33 | - if($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner']) |
|
33 | + if ($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner']) |
|
34 | 34 | { |
35 | 35 | msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message); |
36 | 36 | } |
@@ -8,8 +8,7 @@ |
||
8 | 8 | * @copyright 2008 By Chlorel for XNova |
9 | 9 | */ |
10 | 10 | |
11 | -function flt_mission_transport(&$mission_data) |
|
12 | -{ |
|
11 | +function flt_mission_transport(&$mission_data) { |
|
13 | 12 | $fleet_row = &$mission_data['fleet']; |
14 | 13 | $source_planet = &$mission_data['src_planet']; |
15 | 14 | $destination_planet = &$mission_data['dst_planet']; |
@@ -5,14 +5,14 @@ |
||
5 | 5 | */ |
6 | 6 | global $template; |
7 | 7 | |
8 | -if(isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
8 | +if (isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
9 | 9 | require_once('common.' . substr(strrchr(__FILE__, '.'), 1)); |
10 | - if($sn_page_name) { |
|
10 | + if ($sn_page_name) { |
|
11 | 11 | // Loading page-specific language files |
12 | 12 | |
13 | 13 | !empty($sn_mvc['model'][$sn_page_name]) and execute_hooks($sn_mvc['model'][$sn_page_name], $template, 'model', $sn_page_name); |
14 | 14 | !empty($sn_mvc['view'][$sn_page_name]) and execute_hooks($sn_mvc['view'][$sn_page_name], $template, 'view', $sn_page_name); |
15 | - if(!empty($template_result) && is_object($template)) { |
|
15 | + if (!empty($template_result) && is_object($template)) { |
|
16 | 16 | $template->assign_recursive($template_result); |
17 | 17 | } |
18 | 18 |