@@ -2,7 +2,9 @@ discard block |
||
2 | 2 | |
3 | 3 | function dump($value,$varname = "",$level=0,$dumper = "") |
4 | 4 | { |
5 | - if ($varname) $varname .= " = "; |
|
5 | + if ($varname) { |
|
6 | + $varname .= " = "; |
|
7 | + } |
|
6 | 8 | |
7 | 9 | if ($level==-1) |
8 | 10 | { |
@@ -13,7 +15,9 @@ discard block |
||
13 | 15 | $trans["\0"]='⊕'; |
14 | 16 | return strtr(htmlspecialchars($value),$trans); |
15 | 17 | } |
16 | - if ($level==0) $dumper = '<pre>' . $varname; |
|
18 | + if ($level==0) { |
|
19 | + $dumper = '<pre>' . $varname; |
|
20 | + } |
|
17 | 21 | |
18 | 22 | $type = gettype($value); |
19 | 23 | $dumper .= $type; |
@@ -22,9 +26,9 @@ discard block |
||
22 | 26 | { |
23 | 27 | $dumper .= '('.strlen($value).')'; |
24 | 28 | $value = dump($value,"",-1); |
25 | - } |
|
26 | - elseif ($type=='boolean') $value= ($value?'true':'false'); |
|
27 | - elseif ($type=='object') |
|
29 | + } elseif ($type=='boolean') { |
|
30 | + $value= ($value?'true':'false'); |
|
31 | + } elseif ($type=='object') |
|
28 | 32 | { |
29 | 33 | $props= get_class_vars(get_class($value)); |
30 | 34 | $dumper .= '('.count($props).') <u>'.get_class($value).'</u>'; |
@@ -34,8 +38,7 @@ discard block |
||
34 | 38 | $dumper .= dump($value->$key,"",$level+1); |
35 | 39 | } |
36 | 40 | $value= ''; |
37 | - } |
|
38 | - elseif ($type=='array') |
|
41 | + } elseif ($type=='array') |
|
39 | 42 | { |
40 | 43 | $dumper .= '('.count($value).')'; |
41 | 44 | foreach($value as $key=>$val) |
@@ -46,7 +49,9 @@ discard block |
||
46 | 49 | $value= ''; |
47 | 50 | } |
48 | 51 | $dumper .= " <b>$value</b>"; |
49 | - if ($level==0) $dumper .= '</pre>'; |
|
52 | + if ($level==0) { |
|
53 | + $dumper .= '</pre>'; |
|
54 | + } |
|
50 | 55 | return $dumper; |
51 | 56 | } |
52 | 57 | |
@@ -70,8 +75,7 @@ discard block |
||
70 | 75 | if(substr(getcwd(), -4) != 'docs') |
71 | 76 | { |
72 | 77 | $path_prefix = 'docs/'; |
73 | -} |
|
74 | -else |
|
78 | +} else |
|
75 | 79 | { |
76 | 80 | $path_prefix = ''; |
77 | 81 | } |
@@ -119,8 +123,7 @@ discard block |
||
119 | 123 | $buffer['name'] = $chapter[0]; |
120 | 124 | } |
121 | 125 | $prev_chapter_is_header = true; |
122 | - } |
|
123 | - else |
|
126 | + } else |
|
124 | 127 | { |
125 | 128 | $prev_chapter_is_header = false; |
126 | 129 | foreach($chapter as &$note) |
@@ -150,8 +153,7 @@ discard block |
||
150 | 153 | if(!isset($note_out['name'])) |
151 | 154 | { |
152 | 155 | $note_out['name'] = $buf_str; |
153 | - } |
|
154 | - else |
|
156 | + } else |
|
155 | 157 | { |
156 | 158 | $note_out['lines'][] = $buf_str; |
157 | 159 | } |
@@ -228,36 +230,31 @@ discard block |
||
228 | 230 | if($matches[2]) |
229 | 231 | { |
230 | 232 | buf_print("<ol>\r\n"); |
231 | - } |
|
232 | - else |
|
233 | + } else |
|
233 | 234 | { |
234 | 235 | buf_print("<ul>\r\n"); |
235 | 236 | } |
236 | 237 | buf_print('<li>'); |
237 | 238 | $last_spaces = $matches[1]; |
238 | 239 | $depth[] = $matches[2]; |
239 | - } |
|
240 | - elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
240 | + } elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
241 | 241 | { |
242 | 242 | if(array_pop($depth)) |
243 | 243 | { |
244 | 244 | buf_print("</ol>\r\n"); |
245 | - } |
|
246 | - else |
|
245 | + } else |
|
247 | 246 | { |
248 | 247 | buf_print("</ul>\r\n"); |
249 | 248 | } |
250 | 249 | $last_spaces = $matches[1]; |
251 | 250 | buf_print('<li>'); |
252 | - } |
|
253 | - elseif(strlen($last_spaces) == strlen($matches[1])) |
|
251 | + } elseif(strlen($last_spaces) == strlen($matches[1])) |
|
254 | 252 | { |
255 | 253 | if($matches[2] == '' && $depth[count($depth) - 1] != '') |
256 | 254 | { |
257 | 255 | buf_print("</ol>\r\n"); |
258 | 256 | buf_print("<ul>\r\n"); |
259 | - } |
|
260 | - elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
257 | + } elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
261 | 258 | { |
262 | 259 | buf_print("</ul>\r\n"); |
263 | 260 | buf_print("<ol>\r\n"); |
@@ -274,8 +271,7 @@ discard block |
||
274 | 271 | if(array_pop($depth)) |
275 | 272 | { |
276 | 273 | buf_print("</ol>\r\n"); |
277 | - } |
|
278 | - else |
|
274 | + } else |
|
279 | 275 | { |
280 | 276 | buf_print("</ul>\r\n"); |
281 | 277 | } |
@@ -1,58 +1,58 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function dump($value,$varname = "",$level=0,$dumper = "") |
|
3 | +function dump($value, $varname = "", $level = 0, $dumper = "") |
|
4 | 4 | { |
5 | 5 | if ($varname) $varname .= " = "; |
6 | 6 | |
7 | - if ($level==-1) |
|
7 | + if ($level == -1) |
|
8 | 8 | { |
9 | - $trans[' ']='∴'; |
|
10 | - $trans["\t"]='⇒'; |
|
11 | - $trans["\n"]='¶;'; |
|
12 | - $trans["\r"]='⇐'; |
|
13 | - $trans["\0"]='⊕'; |
|
14 | - return strtr(htmlspecialchars($value),$trans); |
|
9 | + $trans[' '] = '∴'; |
|
10 | + $trans["\t"] = '⇒'; |
|
11 | + $trans["\n"] = '¶;'; |
|
12 | + $trans["\r"] = '⇐'; |
|
13 | + $trans["\0"] = '⊕'; |
|
14 | + return strtr(htmlspecialchars($value), $trans); |
|
15 | 15 | } |
16 | - if ($level==0) $dumper = '<pre>' . $varname; |
|
16 | + if ($level == 0) $dumper = '<pre>'.$varname; |
|
17 | 17 | |
18 | 18 | $type = gettype($value); |
19 | 19 | $dumper .= $type; |
20 | 20 | |
21 | - if ($type=='string') |
|
21 | + if ($type == 'string') |
|
22 | 22 | { |
23 | 23 | $dumper .= '('.strlen($value).')'; |
24 | - $value = dump($value,"",-1); |
|
24 | + $value = dump($value, "", -1); |
|
25 | 25 | } |
26 | - elseif ($type=='boolean') $value= ($value?'true':'false'); |
|
27 | - elseif ($type=='object') |
|
26 | + elseif ($type == 'boolean') $value = ($value ? 'true' : 'false'); |
|
27 | + elseif ($type == 'object') |
|
28 | 28 | { |
29 | - $props= get_class_vars(get_class($value)); |
|
29 | + $props = get_class_vars(get_class($value)); |
|
30 | 30 | $dumper .= '('.count($props).') <u>'.get_class($value).'</u>'; |
31 | - foreach($props as $key=>$val) |
|
31 | + foreach ($props as $key=>$val) |
|
32 | 32 | { |
33 | - $dumper .= "\n".str_repeat("\t",$level+1).$key.' => '; |
|
34 | - $dumper .= dump($value->$key,"",$level+1); |
|
33 | + $dumper .= "\n".str_repeat("\t", $level + 1).$key.' => '; |
|
34 | + $dumper .= dump($value->$key, "", $level + 1); |
|
35 | 35 | } |
36 | - $value= ''; |
|
36 | + $value = ''; |
|
37 | 37 | } |
38 | - elseif ($type=='array') |
|
38 | + elseif ($type == 'array') |
|
39 | 39 | { |
40 | 40 | $dumper .= '('.count($value).')'; |
41 | - foreach($value as $key=>$val) |
|
41 | + foreach ($value as $key=>$val) |
|
42 | 42 | { |
43 | - $dumper .= "\n".str_repeat("\t",$level+1).dump($key,"",-1).' => '; |
|
44 | - $dumper .= dump($val,"",$level+1); |
|
43 | + $dumper .= "\n".str_repeat("\t", $level + 1).dump($key, "", -1).' => '; |
|
44 | + $dumper .= dump($val, "", $level + 1); |
|
45 | 45 | } |
46 | - $value= ''; |
|
46 | + $value = ''; |
|
47 | 47 | } |
48 | 48 | $dumper .= " <b>$value</b>"; |
49 | - if ($level==0) $dumper .= '</pre>'; |
|
49 | + if ($level == 0) $dumper .= '</pre>'; |
|
50 | 50 | return $dumper; |
51 | 51 | } |
52 | 52 | |
53 | 53 | function pdump($value, $varname = '') |
54 | 54 | { |
55 | - print('<span style="text-align: left">' . dump($value, $varname) . '</span>'); |
|
55 | + print('<span style="text-align: left">'.dump($value, $varname).'</span>'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | function debug($value, $varname = '') |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $output_buffer .= $string; |
68 | 68 | } |
69 | 69 | |
70 | -if(substr(getcwd(), -4) != 'docs') |
|
70 | +if (substr(getcwd(), -4) != 'docs') |
|
71 | 71 | { |
72 | 72 | $path_prefix = 'docs/'; |
73 | 73 | } |
@@ -80,22 +80,22 @@ discard block |
||
80 | 80 | |
81 | 81 | $filename = 'changelog'; |
82 | 82 | |
83 | -$input = file_get_contents($path_prefix . $filename . '.txt'); |
|
83 | +$input = file_get_contents($path_prefix.$filename.'.txt'); |
|
84 | 84 | //$input = iconv('CP1251', 'UTF-8', $input); |
85 | 85 | |
86 | 86 | $input = preg_replace("/\r\n\d\d\d\d\-\d\d\-\d\d\ \d\d\:\d\d/", "[D] $0", $input); |
87 | 87 | |
88 | -while(strpos($input, "\r\n\r\n") !== false) |
|
88 | +while (strpos($input, "\r\n\r\n") !== false) |
|
89 | 89 | { |
90 | 90 | $input = str_replace("\r\n\r\n", "\r\n", $input); |
91 | 91 | } |
92 | -while(strpos($input, "~~~") !== false) |
|
92 | +while (strpos($input, "~~~") !== false) |
|
93 | 93 | { |
94 | 94 | $input = str_replace("~~~", "~~", $input); |
95 | 95 | } |
96 | 96 | $input = str_replace("\r\n~~", "~~", $input); |
97 | 97 | |
98 | -while(strpos($input, "===") !== false) |
|
98 | +while (strpos($input, "===") !== false) |
|
99 | 99 | { |
100 | 100 | $input = str_replace("===", "==", $input); |
101 | 101 | } |
@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | $prev_chapter_is_header = false; |
107 | 107 | $output = array(); |
108 | 108 | $buffer = array(); |
109 | -foreach($input as &$chapter) |
|
109 | +foreach ($input as &$chapter) |
|
110 | 110 | { |
111 | 111 | $chapter = preg_split("/(\r\n[\[])/", $chapter, -1, PREG_SPLIT_NO_EMPTY); // , PREG_SPLIT_DELIM_CAPTURE |
112 | 112 | |
113 | - if(count($chapter) == 1 && !$prev_chapter_is_header) |
|
113 | + if (count($chapter) == 1 && !$prev_chapter_is_header) |
|
114 | 114 | { |
115 | - if(!empty($chapter)) |
|
115 | + if (!empty($chapter)) |
|
116 | 116 | { |
117 | 117 | $output[] = $buffer; |
118 | 118 | $buffer = array(); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | else |
124 | 124 | { |
125 | 125 | $prev_chapter_is_header = false; |
126 | - foreach($chapter as &$note) |
|
126 | + foreach ($chapter as &$note) |
|
127 | 127 | { |
128 | 128 | $note = explode("\r\n", $note); |
129 | 129 | $new_note = true; |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | |
132 | 132 | $note_out = array(); |
133 | 133 | |
134 | - foreach($note as &$line) |
|
134 | + foreach ($note as &$line) |
|
135 | 135 | { |
136 | - if(!$line) |
|
136 | + if (!$line) |
|
137 | 137 | { |
138 | 138 | continue; |
139 | 139 | } |
140 | - if($new_note) |
|
140 | + if ($new_note) |
|
141 | 141 | { |
142 | 142 | // 78 - 3 = 75 |
143 | 143 | $note_out['style'] = $line[0]; |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | $buf_str .= $line; |
148 | - if(mb_strlen($line, 'utf-8') < ($new_note ? 75 : 79)) |
|
148 | + if (mb_strlen($line, 'utf-8') < ($new_note ? 75 : 79)) |
|
149 | 149 | { |
150 | - if(!isset($note_out['name'])) |
|
150 | + if (!isset($note_out['name'])) |
|
151 | 151 | { |
152 | 152 | $note_out['name'] = $buf_str; |
153 | 153 | } |
@@ -201,31 +201,31 @@ discard block |
||
201 | 201 | 'D' => 'date', |
202 | 202 | ); |
203 | 203 | |
204 | -foreach($output as $chapter) |
|
204 | +foreach ($output as $chapter) |
|
205 | 205 | { |
206 | - if(!$chapter) |
|
206 | + if (!$chapter) |
|
207 | 207 | { |
208 | 208 | continue; |
209 | 209 | } |
210 | 210 | |
211 | 211 | buf_print("<h1>{$chapter['name']}</h1>\r\n"); |
212 | - foreach($chapter['content'] as $block) |
|
212 | + foreach ($chapter['content'] as $block) |
|
213 | 213 | { |
214 | - buf_print("<div class=\"{$styles[$block['style']]}\">" . ($block['style'] != 'D' ? "[{$block['style']}] " : '')); |
|
215 | - buf_print(preg_replace("/\s{2,10}/", " ", $block['name']) . '<br />'); |
|
216 | - if(isset($block['lines'])) |
|
214 | + buf_print("<div class=\"{$styles[$block['style']]}\">".($block['style'] != 'D' ? "[{$block['style']}] " : '')); |
|
215 | + buf_print(preg_replace("/\s{2,10}/", " ", $block['name']).'<br />'); |
|
216 | + if (isset($block['lines'])) |
|
217 | 217 | { |
218 | 218 | $last_spaces = ''; |
219 | 219 | $depth = array(); |
220 | - foreach($block['lines'] as $line) |
|
220 | + foreach ($block['lines'] as $line) |
|
221 | 221 | { |
222 | - if(preg_match("/^(\s+)(\d*|\s)\.*\s*(.*)/", $line, $matches)) |
|
222 | + if (preg_match("/^(\s+)(\d*|\s)\.*\s*(.*)/", $line, $matches)) |
|
223 | 223 | { |
224 | 224 | //$line = strlen($matches[1]) . '/' . $matches[2] . '/' . $matches[3]; |
225 | 225 | $line = $matches[3]; |
226 | - if(strlen($matches[1]) > strlen($last_spaces)) |
|
226 | + if (strlen($matches[1]) > strlen($last_spaces)) |
|
227 | 227 | { |
228 | - if($matches[2]) |
|
228 | + if ($matches[2]) |
|
229 | 229 | { |
230 | 230 | buf_print("<ol>\r\n"); |
231 | 231 | } |
@@ -237,9 +237,9 @@ discard block |
||
237 | 237 | $last_spaces = $matches[1]; |
238 | 238 | $depth[] = $matches[2]; |
239 | 239 | } |
240 | - elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
240 | + elseif (strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
241 | 241 | { |
242 | - if(array_pop($depth)) |
|
242 | + if (array_pop($depth)) |
|
243 | 243 | { |
244 | 244 | buf_print("</ol>\r\n"); |
245 | 245 | } |
@@ -250,14 +250,14 @@ discard block |
||
250 | 250 | $last_spaces = $matches[1]; |
251 | 251 | buf_print('<li>'); |
252 | 252 | } |
253 | - elseif(strlen($last_spaces) == strlen($matches[1])) |
|
253 | + elseif (strlen($last_spaces) == strlen($matches[1])) |
|
254 | 254 | { |
255 | - if($matches[2] == '' && $depth[count($depth) - 1] != '') |
|
255 | + if ($matches[2] == '' && $depth[count($depth) - 1] != '') |
|
256 | 256 | { |
257 | 257 | buf_print("</ol>\r\n"); |
258 | 258 | buf_print("<ul>\r\n"); |
259 | 259 | } |
260 | - elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
260 | + elseif ($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
261 | 261 | { |
262 | 262 | buf_print("</ul>\r\n"); |
263 | 263 | buf_print("<ol>\r\n"); |
@@ -267,11 +267,11 @@ discard block |
||
267 | 267 | } |
268 | 268 | } |
269 | 269 | $line = preg_replace("/\s{2,10}/", " ", $line); |
270 | - buf_print($line . "<br />\r\n"); |
|
270 | + buf_print($line."<br />\r\n"); |
|
271 | 271 | } |
272 | - while(count($depth)) |
|
272 | + while (count($depth)) |
|
273 | 273 | { |
274 | - if(array_pop($depth)) |
|
274 | + if (array_pop($depth)) |
|
275 | 275 | { |
276 | 276 | buf_print("</ol>\r\n"); |
277 | 277 | } |
@@ -286,11 +286,11 @@ discard block |
||
286 | 286 | } |
287 | 287 | buf_print("</body>\r\n</html>\r\n"); |
288 | 288 | |
289 | -$html = file_get_contents($path_prefix . 'html/' . $filename . '.html'); |
|
290 | -if($html != $output_buffer) |
|
289 | +$html = file_get_contents($path_prefix.'html/'.$filename.'.html'); |
|
290 | +if ($html != $output_buffer) |
|
291 | 291 | { |
292 | - file_put_contents($path_prefix . 'html/' . $filename . '.html', $output_buffer); |
|
293 | - if(!$path_prefix) |
|
292 | + file_put_contents($path_prefix.'html/'.$filename.'.html', $output_buffer); |
|
293 | + if (!$path_prefix) |
|
294 | 294 | { |
295 | 295 | print($output_buffer); |
296 | 296 | } |
@@ -50,52 +50,52 @@ |
||
50 | 50 | stat_tpl_assign($template, $who, 'subject', $subject_list, $sn_group_stat_common); |
51 | 51 | |
52 | 52 | $stat_types = array( |
53 | - STAT_TOTAL => array( |
|
54 | - 'type' => 'total', |
|
55 | - ), |
|
53 | + STAT_TOTAL => array( |
|
54 | + 'type' => 'total', |
|
55 | + ), |
|
56 | 56 | |
57 | - STAT_FLEET => array( |
|
58 | - 'type' => 'fleet', |
|
59 | - ), |
|
57 | + STAT_FLEET => array( |
|
58 | + 'type' => 'fleet', |
|
59 | + ), |
|
60 | 60 | |
61 | - STAT_TECH => array( |
|
62 | - 'type' => 'tech', |
|
63 | - ), |
|
61 | + STAT_TECH => array( |
|
62 | + 'type' => 'tech', |
|
63 | + ), |
|
64 | 64 | |
65 | - STAT_BUILDING => array( |
|
66 | - 'type' => 'build', |
|
67 | - ), |
|
65 | + STAT_BUILDING => array( |
|
66 | + 'type' => 'build', |
|
67 | + ), |
|
68 | 68 | |
69 | - STAT_DEFENSE => array( |
|
70 | - 'type' => 'defs', |
|
71 | - ), |
|
69 | + STAT_DEFENSE => array( |
|
70 | + 'type' => 'defs', |
|
71 | + ), |
|
72 | 72 | |
73 | - STAT_RESOURCE => array( |
|
74 | - 'type' => 'res', |
|
75 | - ), |
|
73 | + STAT_RESOURCE => array( |
|
74 | + 'type' => 'res', |
|
75 | + ), |
|
76 | 76 | |
77 | - STAT_RAID_TOTAL => array( |
|
78 | - 'type' => 'raids', |
|
79 | - ), |
|
77 | + STAT_RAID_TOTAL => array( |
|
78 | + 'type' => 'raids', |
|
79 | + ), |
|
80 | 80 | |
81 | - STAT_RAID_WON => array( |
|
82 | - 'type' => 'raidswin', |
|
83 | - ), |
|
81 | + STAT_RAID_WON => array( |
|
82 | + 'type' => 'raidswin', |
|
83 | + ), |
|
84 | 84 | |
85 | - STAT_RAID_LOST => array( |
|
86 | - 'type' => 'raidsloose', |
|
87 | - ), |
|
85 | + STAT_RAID_LOST => array( |
|
86 | + 'type' => 'raidsloose', |
|
87 | + ), |
|
88 | 88 | |
89 | 89 | STAT_LVL_BUILDING => array( |
90 | - 'type' => 'lvl_minier', |
|
90 | + 'type' => 'lvl_minier', |
|
91 | 91 | ), |
92 | 92 | |
93 | 93 | STAT_LVL_TECH => array( |
94 | - 'type' => 'player_rpg_tech_level', |
|
94 | + 'type' => 'player_rpg_tech_level', |
|
95 | 95 | ), |
96 | 96 | |
97 | 97 | STAT_LVL_RAID => array( |
98 | - 'type' => 'lvl_raid', |
|
98 | + 'type' => 'lvl_raid', |
|
99 | 99 | ), |
100 | 100 | ); |
101 | 101 | stat_tpl_assign($template, $type, 'type', $stat_types, $sn_group_stat_common); |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | global $who; |
12 | 12 | |
13 | 13 | // $sn_group_stat_common = sn_get_groups('STAT_COMMON'); |
14 | - foreach($array as $key => $value) { |
|
15 | - if($array_name == 'type' && $who == 2 && !in_array($key, $sn_group_stat_common)) { |
|
14 | + foreach ($array as $key => $value) { |
|
15 | + if ($array_name == 'type' && $who == 2 && !in_array($key, $sn_group_stat_common)) { |
|
16 | 16 | continue; |
17 | 17 | } |
18 | 18 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $allow_anonymous = true; |
30 | 30 | |
31 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
31 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
32 | 32 | |
33 | 33 | lng_include('stat'); |
34 | 34 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $subject_list = array( |
45 | 45 | 1 => array('header' => classLocale::$lang['stat_player']), |
46 | 46 | ); |
47 | -if(!$source) { |
|
47 | +if (!$source) { |
|
48 | 48 | $subject_list[2] = array('header' => classLocale::$lang['stat_allys']); |
49 | 49 | } |
50 | 50 | stat_tpl_assign($template, $who, 'subject', $subject_list, $sn_group_stat_common); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $page_count = floor($record_count / 100); |
115 | 115 | $pages = array(); |
116 | -for($i = 0; $i <= $page_count; $i++) { |
|
116 | +for ($i = 0; $i <= $page_count; $i++) { |
|
117 | 117 | $first_element = $i * 100 + 1; |
118 | 118 | $last_element = $first_element + 99; |
119 | 119 | $pages[$first_element] = array( |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | ); |
134 | 134 | //pdump($row); |
135 | 135 | |
136 | - if($who == 1) { |
|
136 | + if ($who == 1) { |
|
137 | 137 | $row_stat['ALLY_NAME'] = $row['ally_name']; |
138 | 138 | $row_stat['ALLY_ID'] = $row['ally_id']; |
139 | 139 | empty($row['username']) ? $row['username'] = $row['name'] : false; |
@@ -24,11 +24,11 @@ |
||
24 | 24 | |
25 | 25 | // require_once('includes/includes/scheduler_process.php'); |
26 | 26 | |
27 | -if(($result = scheduler_process()) && !defined('IN_ADMIN')) { |
|
27 | +if (($result = scheduler_process()) && !defined('IN_ADMIN')) { |
|
28 | 28 | $result = htmlspecialchars($result, ENT_QUOTES, 'UTF-8'); |
29 | 29 | print(json_encode($result)); |
30 | 30 | } |
31 | 31 | |
32 | -if(!defined('IN_ADMIN')) { |
|
32 | +if (!defined('IN_ADMIN')) { |
|
33 | 33 | die(); |
34 | 34 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
3 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
4 | 4 | { |
5 | 5 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
6 | 6 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | header('Location: alliance.php'); |
21 | 21 | } |
22 | 22 | |
23 | - if($user_request['request_denied']) |
|
23 | + if ($user_request['request_denied']) |
|
24 | 24 | { |
25 | 25 | $lang['request_text'] = sprintf($lang['ali_req_deny_msg'], $ally['ally_tag'], $user_request['request_text']); |
26 | 26 | } |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | |
43 | 43 | $ally = doquery("SELECT * FROM {{alliance}} WHERE `id` ='{$id_ally}'", true); |
44 | 44 | |
45 | -if(!$ally) |
|
45 | +if (!$ally) |
|
46 | 46 | { |
47 | 47 | message($lang['ali_sys_notFound'], $lang['ali_req_title']); |
48 | 48 | } |
49 | 49 | |
50 | -if($ally['ally_request_notallow']) |
|
50 | +if ($ally['ally_request_notallow']) |
|
51 | 51 | { |
52 | 52 | message($lang['ali_req_not_allowed'], $lang['ali_req_title']); |
53 | 53 | } |
@@ -115,8 +115,7 @@ |
||
115 | 115 | )); |
116 | 116 | |
117 | 117 | display($template, $lang['tech'][STRUC_MOON_GATE]); |
118 | - } |
|
119 | - else |
|
118 | + } else |
|
120 | 119 | { |
121 | 120 | message($lang['gate_no_src_ga'], $lang['tech'][STRUC_MOON_GATE], "overview.php", 10); |
122 | 121 | } |
@@ -46,8 +46,7 @@ |
||
46 | 46 | sn_db_transaction_commit(); |
47 | 47 | sys_redirect("galaxy.php?mode=name&galaxy={$uni_galaxy}&system={$uni_system}"); |
48 | 48 | } |
49 | - } |
|
50 | - catch (exception $e) |
|
49 | + } catch (exception $e) |
|
51 | 50 | { |
52 | 51 | sn_db_transaction_rollback(); |
53 | 52 | $template->assign_block_vars('result', array( |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | $uni_galaxy = sys_get_param_int('galaxy', $planetrow['galaxy']); |
12 | 12 | $uni_system = sys_get_param_int('system'); |
13 | 13 | |
14 | - if($uni_galaxy < 1 || $uni_galaxy > Vector::$knownGalaxies) |
|
14 | + if ($uni_galaxy < 1 || $uni_galaxy > Vector::$knownGalaxies) |
|
15 | 15 | { |
16 | 16 | throw new exception(classLocale::$lang['uni_msg_error_wrong_galaxy'], ERR_ERROR); |
17 | 17 | } |
18 | 18 | |
19 | - if($uni_system < 0 || $uni_system > Vector::$knownSystems) |
|
19 | + if ($uni_system < 0 || $uni_system > Vector::$knownSystems) |
|
20 | 20 | { |
21 | 21 | throw new exception(classLocale::$lang['uni_msg_error_wrong_system'], ERR_ERROR); |
22 | 22 | } |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | $uni_row['universe_price'] += $uni_system ? classSupernova::$config->uni_price_system : classSupernova::$config->uni_price_galaxy; |
26 | 26 | $uni_row['universe_name'] = strip_tags($uni_row['universe_name'] ? $uni_row['universe_name'] : ($uni_system ? "{$classLocale['sys_system']} [{$uni_galaxy}:{$uni_system}]" : "{$classLocale['sys_galaxy']} {$uni_galaxy}")); |
27 | 27 | |
28 | - if(sys_get_param_str('uni_name_submit')) |
|
28 | + if (sys_get_param_str('uni_name_submit')) |
|
29 | 29 | { |
30 | 30 | $uni_row['universe_name'] = strip_tags(sys_get_param_str('uni_name')); |
31 | 31 | |
32 | 32 | $uni_price = sys_get_param_float('uni_price'); |
33 | - if($uni_price < $uni_row['universe_price']) |
|
33 | + if ($uni_price < $uni_row['universe_price']) |
|
34 | 34 | { |
35 | 35 | throw new exception(classLocale::$lang['uni_msg_error_low_price'], ERR_ERROR); |
36 | 36 | } |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | sn_db_transaction_start(); |
40 | 40 | $user = db_user_by_id($user['id'], true); |
41 | 41 | // if($user[get_unit_param(RES_DARK_MATTER, P_NAME)] < $uni_price) |
42 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
42 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
43 | 43 | { |
44 | 44 | throw new exception(classLocale::$lang['uni_msg_error_no_dm'], ERR_ERROR); |
45 | 45 | } |
46 | 46 | |
47 | - if(!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
47 | + if (!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to ".sys_get_param_str_unsafe('uni_name'))) |
|
48 | 48 | { |
49 | 49 | throw new exception(classLocale::$lang['sys_msg_err_update_dm'], ERR_ERROR); |
50 | 50 | } |
@@ -74,4 +74,4 @@ discard block |
||
74 | 74 | 'PAGE_HINT' => classLocale::$lang['uni_name_page_hint'], |
75 | 75 | )); |
76 | 76 | |
77 | - display($template, classLocale::$lang['sys_universe'] . ' - ' . classLocale::$lang['uni_naming'], true, '', false); |
|
77 | + display($template, classLocale::$lang['sys_universe'].' - '.classLocale::$lang['uni_naming'], true, '', false); |
@@ -79,8 +79,7 @@ |
||
79 | 79 | |
80 | 80 | sn_db_transaction_commit(); |
81 | 81 | throw new Exception($info_action, ERR_NONE); |
82 | - } |
|
83 | - catch (Exception $e) |
|
82 | + } catch (Exception $e) |
|
84 | 83 | { |
85 | 84 | sn_db_transaction_rollback(); |
86 | 85 |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | $classLocale = classLocale::$lang; |
4 | 4 | |
5 | -if(!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) |
|
5 | +if (!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) |
|
6 | 6 | { |
7 | 7 | classSupernova::$debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403); |
8 | 8 | } |
@@ -17,54 +17,54 @@ discard block |
||
17 | 17 | )); |
18 | 18 | |
19 | 19 | $info_action = sys_get_param_int('action'); |
20 | -if($info_action) |
|
20 | +if ($info_action) |
|
21 | 21 | { |
22 | 22 | try |
23 | 23 | { |
24 | 24 | sn_db_transaction_start(); |
25 | 25 | |
26 | 26 | $user = db_user_by_id($user['id'], true); |
27 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < classSupernova::$config->rpg_cost_info) |
|
27 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < classSupernova::$config->rpg_cost_info) |
|
28 | 28 | { |
29 | 29 | throw new Exception(MARKET_NO_DM, ERR_ERROR); |
30 | 30 | } |
31 | 31 | |
32 | - switch($info_action) |
|
32 | + switch ($info_action) |
|
33 | 33 | { |
34 | 34 | case MARKET_INFO_PLAYER: |
35 | 35 | $user_info_name_unsafe = sys_get_param_str_unsafe('user_info_name'); |
36 | - if(!$user_info_name_unsafe) |
|
36 | + if (!$user_info_name_unsafe) |
|
37 | 37 | { |
38 | 38 | throw new Exception(MARKET_INFO_PLAYER_WRONG, ERR_ERROR); |
39 | 39 | } |
40 | 40 | |
41 | - if(is_id($user_info_name_unsafe)) |
|
41 | + if (is_id($user_info_name_unsafe)) |
|
42 | 42 | { |
43 | 43 | $user_info = db_user_by_id($user_info_name_unsafe, true, '`id`, `username`', true); |
44 | 44 | } |
45 | - if(!is_array($user_info)) |
|
45 | + if (!is_array($user_info)) |
|
46 | 46 | { |
47 | 47 | $user_info = db_user_by_username($user_info_name_unsafe, true, '`id`, `username`', true, true); |
48 | 48 | } |
49 | - if(!is_array($user_info)) |
|
49 | + if (!is_array($user_info)) |
|
50 | 50 | { |
51 | 51 | throw new Exception(MARKET_INFO_PLAYER_NOT_FOUND, ERR_ERROR); |
52 | 52 | } |
53 | - if($user_info['id'] == $user['id']) |
|
53 | + if ($user_info['id'] == $user['id']) |
|
54 | 54 | { |
55 | 55 | throw new Exception(MARKET_INFO_PLAYER_SAME, ERR_ERROR); |
56 | 56 | } |
57 | 57 | |
58 | 58 | $msg_text = array(); |
59 | - foreach(sn_get_groups('mercenaries') as $mercenary_id) |
|
59 | + foreach (sn_get_groups('mercenaries') as $mercenary_id) |
|
60 | 60 | { |
61 | - $msg_text[] = "{$classLocale['tech'][$mercenary_id]} - " . (($mercenary_level = mrc_get_level($user_info, null, $mercenary_id)) ? "{$classLocale['sys_level']} {$mercenary_level}" : classLocale::$lang['eco_mrk_info_not_hired']); |
|
61 | + $msg_text[] = "{$classLocale['tech'][$mercenary_id]} - ".(($mercenary_level = mrc_get_level($user_info, null, $mercenary_id)) ? "{$classLocale['sys_level']} {$mercenary_level}" : classLocale::$lang['eco_mrk_info_not_hired']); |
|
62 | 62 | } |
63 | - if($mercenary_level = mrc_get_level($user_info, null, UNIT_PREMIUM)) |
|
63 | + if ($mercenary_level = mrc_get_level($user_info, null, UNIT_PREMIUM)) |
|
64 | 64 | { |
65 | 65 | $msg_text[] = "{$classLocale['tech'][UNIT_PREMIUM]} - {$mercenary_level} {$classLocale['sys_level']}"; |
66 | 66 | } |
67 | - $msg_text = sprintf(classLocale::$lang['eco_mrk_info_player_message'], $user_info['id'], $user_info['username']) . "\r\n" . implode("\r\n", $msg_text); |
|
67 | + $msg_text = sprintf(classLocale::$lang['eco_mrk_info_player_message'], $user_info['id'], $user_info['username'])."\r\n".implode("\r\n", $msg_text); |
|
68 | 68 | |
69 | 69 | msg_send_simple_message($user['id'], 0, SN_TIME_NOW, MSG_TYPE_SPY, classLocale::$lang['eco_mrk_info_msg_from'], "{$classLocale['eco_mrk_info_player']} ID {$user_info['id']} [{$user_info['username']}]", $msg_text, false, true); |
70 | 70 | break; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | break; |
75 | 75 | } |
76 | 76 | |
77 | - if(!rpg_points_change($user['id'], RPG_MARKET_INFO_MERCENARY, -classSupernova::$config->rpg_cost_info, "Using Black Market page {$classLocale['eco_mrk_info']} - getting info about user ID {$user_info['id']}")) |
|
77 | + if (!rpg_points_change($user['id'], RPG_MARKET_INFO_MERCENARY, -classSupernova::$config->rpg_cost_info, "Using Black Market page {$classLocale['eco_mrk_info']} - getting info about user ID {$user_info['id']}")) |
|
78 | 78 | { |
79 | 79 | // TODO: throw new Exception(MARKET_INFO_PLAYER_SAME, ERR_ERROR); |
80 | 80 | } |
@@ -35,8 +35,7 @@ |
||
35 | 35 | if($planetrow['id_owner']) { |
36 | 36 | $global_data = sys_o_get_updated($user, $planetrow, SN_TIME_NOW); |
37 | 37 | $planetrow = $global_data['planet']; |
38 | - } |
|
39 | - else { |
|
38 | + } else { |
|
40 | 39 | // Locking user record |
41 | 40 | $user = db_user_by_id($user['id'], true); |
42 | 41 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if((!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) && (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)) { |
|
3 | +if ((!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) && (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)) { |
|
4 | 4 | classSupernova::$debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403); |
5 | 5 | } |
6 | 6 | |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | |
27 | 27 | // $dm_db_name = pname_resource_name(RES_DARK_MATTER); |
28 | 28 | $exchangeTo = in_array($exchangeTo = sys_get_param_int('exchangeTo'), sn_get_groups('resources_trader')) ? $exchangeTo : 0; |
29 | - if($exchangeTo && is_array($tradeList = $_POST['spend'])) { |
|
29 | + if ($exchangeTo && is_array($tradeList = $_POST['spend'])) { |
|
30 | 30 | $value = 0; |
31 | 31 | |
32 | 32 | sn_db_transaction_start(); |
33 | - if($planetrow['id_owner']) { |
|
33 | + if ($planetrow['id_owner']) { |
|
34 | 34 | $global_data = sys_o_get_updated($user, $planetrow, SN_TIME_NOW); |
35 | 35 | $planetrow = $global_data['planet']; |
36 | 36 | } |
@@ -40,26 +40,26 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | $fields = array(); |
43 | - foreach(sn_get_groups('resources_trader') as $resource_id) { |
|
43 | + foreach (sn_get_groups('resources_trader') as $resource_id) { |
|
44 | 44 | $amount = floatval($tradeList[$resource_id]); |
45 | - if($amount < 0) { |
|
45 | + if ($amount < 0) { |
|
46 | 46 | classSupernova::$debug->error('Trying to supply negative resource amount on Black Market Page', 'Hack Attempt', 305); |
47 | 47 | } |
48 | 48 | |
49 | - if($resource_id == RES_DARK_MATTER && $exchangeTo == RES_DARK_MATTER) { |
|
49 | + if ($resource_id == RES_DARK_MATTER && $exchangeTo == RES_DARK_MATTER) { |
|
50 | 50 | continue; |
51 | 51 | } |
52 | 52 | |
53 | 53 | $sign = '+'; |
54 | - if($exchangeTo == RES_DARK_MATTER) { |
|
54 | + if ($exchangeTo == RES_DARK_MATTER) { |
|
55 | 55 | $amount = floor($tradeList[RES_DARK_MATTER] / 3 * $rates[RES_DARK_MATTER] / $rates[$resource_id]); |
56 | 56 | $value += $amount; |
57 | 57 | } else { |
58 | 58 | $value += floor($amount * $rates[$resource_id] / $rates[$exchangeTo]); |
59 | - if($resource_id == RES_DARK_MATTER) { |
|
59 | + if ($resource_id == RES_DARK_MATTER) { |
|
60 | 60 | $amount = 0; |
61 | 61 | } else { |
62 | - if(mrc_get_level($user, $planetrow, $resource_id, true) < $amount) { |
|
62 | + if (mrc_get_level($user, $planetrow, $resource_id, true) < $amount) { |
|
63 | 63 | $intError = MARKET_NO_RESOURCES; |
64 | 64 | break; |
65 | 65 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | - if($amount) { |
|
71 | + if ($amount) { |
|
72 | 72 | $fields[pname_resource_name($resource_id)] = "{$sign} {$amount}"; |
73 | 73 | } |
74 | 74 | } |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | $intError = $value <= 0 ? MARKET_ZERO_DEAL : $intError; |
79 | 79 | $intError = mrc_get_level($user, null, RES_DARK_MATTER) < $operation_cost ? MARKET_NO_DM : $intError; |
80 | 80 | |
81 | - if($intError == MARKET_DEAL) { |
|
82 | - if($exchangeTo != RES_DARK_MATTER) { |
|
81 | + if ($intError == MARKET_DEAL) { |
|
82 | + if ($exchangeTo != RES_DARK_MATTER) { |
|
83 | 83 | $amountExchangeTo = floor($value); |
84 | 84 | $fields[pname_resource_name($exchangeTo)] = $amountExchangeTo; |
85 | 85 | } |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | 'EXCHANGE_TO_RESOURCE_ID' => $exchangeTo, |
116 | 116 | )); |
117 | 117 | |
118 | - foreach(sn_get_groups('resources_trader') as $resource_id) { |
|
119 | - if($resource_id == RES_DARK_MATTER) { |
|
118 | + foreach (sn_get_groups('resources_trader') as $resource_id) { |
|
119 | + if ($resource_id == RES_DARK_MATTER) { |
|
120 | 120 | $amount = floor(mrc_get_level($user, null, RES_DARK_MATTER) - classSupernova::$config->rpg_cost_trader); |
121 | 121 | } else { |
122 | 122 | $amount = floor(mrc_get_level($user, $planetrow, $resource_id)); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | // OK 4.9 |
37 | 37 | public function __construct($filename = __FILE__) { |
38 | - if($this->provider_id == ACCOUNT_PROVIDER_NONE) { |
|
38 | + if ($this->provider_id == ACCOUNT_PROVIDER_NONE) { |
|
39 | 39 | die('У всех провайдеров должен быть $provider_id!'); |
40 | 40 | } |
41 | 41 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | // OK 4.6 |
134 | 134 | public function player_name_suggest() { |
135 | 135 | $name = ''; |
136 | - if(is_object($this->account) && !empty($this->account->account_email)) { |
|
136 | + if (is_object($this->account) && !empty($this->account->account_email)) { |
|
137 | 137 | list($name) = explode('@', $this->account->account_email); |
138 | 138 | } |
139 | 139 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // $same_user = false; |
54 | 54 | // } |
55 | 55 | |
56 | - if(!$user_data) { |
|
56 | + if (!$user_data) { |
|
57 | 57 | message($lang['imp_imperator_none'], $lang['sys_error'], 'index.php', 10); |
58 | 58 | die(); |
59 | 59 | } |
@@ -64,15 +64,15 @@ discard block |
||
64 | 64 | $stat_array = array(); |
65 | 65 | $query = doquery("SELECT * FROM {{statpoints}} WHERE `stat_type` = 1 AND `id_owner` = {$user_id} ORDER BY `stat_code` DESC;"); |
66 | 66 | $stat_count = classSupernova::$db->db_affected_rows(); |
67 | - while($row = db_fetch($query)) { |
|
68 | - foreach($stat_fields as $field_db_name => $field_template_name) { |
|
67 | + while ($row = db_fetch($query)) { |
|
68 | + foreach ($stat_fields as $field_db_name => $field_template_name) { |
|
69 | 69 | // $stat_count - $row['stat_code'] - для реверсирования ID статы в JS |
70 | 70 | $stat_array[$field_template_name]['DATA'][$stat_count - $row['stat_code']] = $row[$field_db_name]; |
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
74 | 74 | $stat_array_date = $stat_array['STAT_DATE']; |
75 | - foreach($stat_array_date['DATA'] as $key => $value) { |
|
75 | + foreach ($stat_array_date['DATA'] as $key => $value) { |
|
76 | 76 | $template->assign_block_vars('stat_date', array( |
77 | 77 | 'ID' => $key, |
78 | 78 | 'VALUE' => $value, |
@@ -85,17 +85,17 @@ discard block |
||
85 | 85 | |
86 | 86 | unset($stat_array['STAT_DATE']); |
87 | 87 | $template_data = array(); |
88 | - foreach($stat_array as $stat_type => &$stat_type_data) { |
|
88 | + foreach ($stat_array as $stat_type => &$stat_type_data) { |
|
89 | 89 | $reverse_min_max = strpos($stat_type, '_RANK') !== false; |
90 | 90 | $stat_type_data['MIN'] = $reverse_min_max ? max($stat_type_data['DATA']) : min($stat_type_data['DATA']); |
91 | 91 | $stat_type_data['MAX'] = $reverse_min_max ? min($stat_type_data['DATA']) : max($stat_type_data['DATA']); |
92 | 92 | $stat_type_data['AVG'] = average($stat_type_data['DATA']); |
93 | - foreach($stat_type_data['DATA'] as $key => $value) { |
|
93 | + foreach ($stat_type_data['DATA'] as $key => $value) { |
|
94 | 94 | // $stat_type_data['PERCENT'][$key] = $stat_type_data['MAX'] - $value ? ($stat_type_data['MAX'] - $stat_type_data['MIN']) / ($stat_type_data['MAX'] - $value) : 100; |
95 | 95 | $stat_type_data['PERCENT'][$key] = ($stat_type_data['MAX'] - $value ? ($value - $stat_type_data['MIN']) / ($stat_type_data['MAX'] - $stat_type_data['MIN']) : 1) * 100; |
96 | 96 | $template_data[$stat_type][$key]['ID'] = $key; |
97 | 97 | $template_data[$stat_type][$key]['VALUE'] = $value; |
98 | - $template_data[$stat_type][$key]['DELTA'] = ($reverse_min_max ? $stat_type_data['MIN'] - $value : $value - $stat_type_data['MAX']); |
|
98 | + $template_data[$stat_type][$key]['DELTA'] = ($reverse_min_max ? $stat_type_data['MIN'] - $value : $value - $stat_type_data['MAX']); |
|
99 | 99 | $template_data[$stat_type][$key]['PERCENT'] = $stat_type_data['PERCENT'][$key]; |
100 | 100 | |
101 | 101 | //$template_data[$stat_type][$key]['PERCENT'] = $key ? $stat_type_data['PERCENT'][$key] : 50; // TODO DEBUG |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | } |
104 | 104 | // pdump($stat_array['RES_POINTS']); |
105 | 105 | |
106 | - foreach($template_data as $stat_type => $stat_type_data) { |
|
106 | + foreach ($template_data as $stat_type => $stat_type_data) { |
|
107 | 107 | $template->assign_block_vars('stat', array( |
108 | 108 | 'TYPE' => $stat_type, |
109 | 109 | 'TEXT' => $lang['imp_stat_types'][$stat_type], |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | 'MAX' => $stat_array[$stat_type]['MAX'], |
112 | 112 | 'AVG' => $stat_array[$stat_type]['AVG'], |
113 | 113 | )); |
114 | - foreach($stat_type_data as $stat_entry) { |
|
114 | + foreach ($stat_type_data as $stat_entry) { |
|
115 | 115 | $template->assign_block_vars('stat.entry', $stat_entry); |
116 | 116 | } |
117 | 117 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | // pdump($template_data); |
121 | 121 | |
122 | - if($same_user) { |
|
122 | + if ($same_user) { |
|
123 | 123 | rpg_level_up($user, RPG_STRUCTURE); |
124 | 124 | rpg_level_up($user, RPG_RAID); |
125 | 125 | rpg_level_up($user, RPG_TECH); |
@@ -153,29 +153,29 @@ discard block |
||
153 | 153 | 'builder_xp' => pretty_number($user_data['xpminier']), |
154 | 154 | 'builder_lvl' => pretty_number($user_data['lvl_minier']), |
155 | 155 | 'builder_lvl_st' => pretty_number(rpg_get_miner_xp($user_data['lvl_minier'])), |
156 | - 'builder_lvl_up' => pretty_number(rpg_get_miner_xp($user_data['lvl_minier']+1)), |
|
156 | + 'builder_lvl_up' => pretty_number(rpg_get_miner_xp($user_data['lvl_minier'] + 1)), |
|
157 | 157 | 'raid_xp' => pretty_number($user_data['xpraid']), |
158 | 158 | 'raid_lvl' => pretty_number($user_data['lvl_raid']), |
159 | - 'raid_lvl_up' => pretty_number(rpg_get_raider_xp($user_data['lvl_raid']+1)), |
|
159 | + 'raid_lvl_up' => pretty_number(rpg_get_raider_xp($user_data['lvl_raid'] + 1)), |
|
160 | 160 | 'raids' => pretty_number($user_data['raids']), |
161 | 161 | 'raidswin' => pretty_number($user_data['raidswin']), |
162 | 162 | 'raidsloose' => pretty_number($user_data['raidsloose']), |
163 | 163 | 'tech_xp' => pretty_number($user_data['player_rpg_tech_xp']), |
164 | 164 | 'tech_lvl' => pretty_number($user_data['player_rpg_tech_level']), |
165 | 165 | 'tech_lvl_st' => pretty_number(rpg_get_tech_xp($user_data['player_rpg_tech_level'])), |
166 | - 'tech_lvl_up' => pretty_number(rpg_get_tech_xp($user_data['player_rpg_tech_level']+1)), |
|
166 | + 'tech_lvl_up' => pretty_number(rpg_get_tech_xp($user_data['player_rpg_tech_level'] + 1)), |
|
167 | 167 | |
168 | 168 | 'explore_xp' => pretty_number($user_data['player_rpg_explore_xp']), |
169 | 169 | 'explore_lvl' => pretty_number($user_data['player_rpg_explore_level']), |
170 | 170 | 'explore_lvl_st' => pretty_number(rpg_get_explore_xp($user_data['player_rpg_explore_level'])), |
171 | - 'explore_lvl_up' => pretty_number(rpg_get_explore_xp($user_data['player_rpg_explore_level']+1)), |
|
172 | - |
|
173 | - 'build_points' => pretty_number( $StatRecord['build_points'] ), |
|
174 | - 'tech_points' => pretty_number( $StatRecord['tech_points'] ), |
|
175 | - 'fleet_points' => pretty_number( $StatRecord['fleet_points'] ), |
|
176 | - 'defs_points' => pretty_number( $StatRecord['defs_points'] ), |
|
177 | - 'res_points' => pretty_number( $StatRecord['res_points'] ), |
|
178 | - 'total_points' => pretty_number( $StatRecord['total_points'] ), |
|
171 | + 'explore_lvl_up' => pretty_number(rpg_get_explore_xp($user_data['player_rpg_explore_level'] + 1)), |
|
172 | + |
|
173 | + 'build_points' => pretty_number($StatRecord['build_points']), |
|
174 | + 'tech_points' => pretty_number($StatRecord['tech_points']), |
|
175 | + 'fleet_points' => pretty_number($StatRecord['fleet_points']), |
|
176 | + 'defs_points' => pretty_number($StatRecord['defs_points']), |
|
177 | + 'res_points' => pretty_number($StatRecord['res_points']), |
|
178 | + 'total_points' => pretty_number($StatRecord['total_points']), |
|
179 | 179 | 'user_rank' => $StatRecord['total_rank'], |
180 | 180 | 'RANK_DIFF' => $StatRecord['total_old_rank'] - $StatRecord['total_rank'], |
181 | 181 |