@@ -154,6 +154,9 @@ discard block |
||
154 | 154 | return !!gethostbynamel($server); |
155 | 155 | } |
156 | 156 | |
157 | + /** |
|
158 | + * @param boolean $update_claimed_id |
|
159 | + */ |
|
157 | 160 | protected function request_curl($url, $method = 'GET', $params = array(), $update_claimed_id) |
158 | 161 | { |
159 | 162 | $params = http_build_query($params, '', '&'); |
@@ -262,6 +265,9 @@ discard block |
||
262 | 265 | return $headers; |
263 | 266 | } |
264 | 267 | |
268 | + /** |
|
269 | + * @param boolean $update_claimed_id |
|
270 | + */ |
|
265 | 271 | protected function request_streams($url, $method = 'GET', $params = array(), $update_claimed_id) |
266 | 272 | { |
267 | 273 | if (!$this->hostExists($url)) { |
@@ -384,6 +390,11 @@ discard block |
||
384 | 390 | /** |
385 | 391 | * Helper function used to scan for <meta>/<link> tags and extract information |
386 | 392 | * from them |
393 | + * @param string $tag |
|
394 | + * @param string $attrName |
|
395 | + * @param string $attrValue |
|
396 | + * @param string $valueName |
|
397 | + * @return string |
|
387 | 398 | */ |
388 | 399 | protected function htmlTag($content, $tag, $attrName, $attrValue, $valueName) |
389 | 400 | { |
@@ -628,6 +639,9 @@ discard block |
||
628 | 639 | return $params; |
629 | 640 | } |
630 | 641 | |
642 | + /** |
|
643 | + * @param boolean $immediate |
|
644 | + */ |
|
631 | 645 | protected function authUrl_v1($immediate) |
632 | 646 | { |
633 | 647 | $returnUrl = $this->returnUrl; |
@@ -649,6 +663,9 @@ discard block |
||
649 | 663 | , array('query' => http_build_query($params, '', '&'))); |
650 | 664 | } |
651 | 665 | |
666 | + /** |
|
667 | + * @param boolean $immediate |
|
668 | + */ |
|
652 | 669 | protected function authUrl_v2($immediate) |
653 | 670 | { |
654 | 671 | $params = array( |
@@ -684,7 +701,6 @@ discard block |
||
684 | 701 | /** |
685 | 702 | * Returns authentication url. Usually, you want to redirect your user to it. |
686 | 703 | * @return String The authentication url. |
687 | - * @param String $select_identifier Whether to request OP to select identity for an user in OpenID 2. Does not affect OpenID 1. |
|
688 | 704 | * @throws ErrorException |
689 | 705 | */ |
690 | 706 | function authUrl($immediate = false) |
@@ -1,52 +1,52 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This class provides a simple interface for OpenID (1.1 and 2.0) authentication. |
|
4 | - * Supports Yadis discovery. |
|
5 | - * The authentication process is stateless/dumb. |
|
6 | - * |
|
7 | - * Usage: |
|
8 | - * Sign-on with OpenID is a two step process: |
|
9 | - * Step one is authentication with the provider: |
|
10 | - * <code> |
|
11 | - * $openid = new LightOpenID('my-host.example.org'); |
|
12 | - * $openid->identity = 'ID supplied by user'; |
|
13 | - * header('Location: ' . $openid->authUrl()); |
|
14 | - * </code> |
|
15 | - * The provider then sends various parameters via GET, one of them is openid_mode. |
|
16 | - * Step two is verification: |
|
17 | - * <code> |
|
18 | - * $openid = new LightOpenID('my-host.example.org'); |
|
19 | - * if ($openid->mode) { |
|
20 | - * echo $openid->validate() ? 'Logged in.' : 'Failed'; |
|
21 | - * } |
|
22 | - * </code> |
|
23 | - * |
|
24 | - * Change the 'my-host.example.org' to your domain name. Do NOT use $_SERVER['HTTP_HOST'] |
|
25 | - * for that, unless you know what you are doing. |
|
26 | - * |
|
27 | - * Optionally, you can set $returnUrl and $realm (or $trustRoot, which is an alias). |
|
28 | - * The default values for those are: |
|
29 | - * $openid->realm = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; |
|
30 | - * $openid->returnUrl = $openid->realm . $_SERVER['REQUEST_URI']; |
|
31 | - * If you don't know their meaning, refer to any openid tutorial, or specification. Or just guess. |
|
32 | - * |
|
33 | - * AX and SREG extensions are supported. |
|
34 | - * To use them, specify $openid->required and/or $openid->optional before calling $openid->authUrl(). |
|
35 | - * These are arrays, with values being AX schema paths (the 'path' part of the URL). |
|
36 | - * For example: |
|
37 | - * $openid->required = array('namePerson/friendly', 'contact/email'); |
|
38 | - * $openid->optional = array('namePerson/first'); |
|
39 | - * If the server supports only SREG or OpenID 1.1, these are automaticaly |
|
40 | - * mapped to SREG names, so that user doesn't have to know anything about the server. |
|
41 | - * |
|
42 | - * To get the values, use $openid->getAttributes(). |
|
43 | - * |
|
44 | - * |
|
45 | - * The library requires PHP >= 5.1.2 with curl or http/https stream wrappers enabled. |
|
46 | - * @author Mewp |
|
47 | - * @copyright Copyright (c) 2010, Mewp |
|
48 | - * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
49 | - */ |
|
3 | + * This class provides a simple interface for OpenID (1.1 and 2.0) authentication. |
|
4 | + * Supports Yadis discovery. |
|
5 | + * The authentication process is stateless/dumb. |
|
6 | + * |
|
7 | + * Usage: |
|
8 | + * Sign-on with OpenID is a two step process: |
|
9 | + * Step one is authentication with the provider: |
|
10 | + * <code> |
|
11 | + * $openid = new LightOpenID('my-host.example.org'); |
|
12 | + * $openid->identity = 'ID supplied by user'; |
|
13 | + * header('Location: ' . $openid->authUrl()); |
|
14 | + * </code> |
|
15 | + * The provider then sends various parameters via GET, one of them is openid_mode. |
|
16 | + * Step two is verification: |
|
17 | + * <code> |
|
18 | + * $openid = new LightOpenID('my-host.example.org'); |
|
19 | + * if ($openid->mode) { |
|
20 | + * echo $openid->validate() ? 'Logged in.' : 'Failed'; |
|
21 | + * } |
|
22 | + * </code> |
|
23 | + * |
|
24 | + * Change the 'my-host.example.org' to your domain name. Do NOT use $_SERVER['HTTP_HOST'] |
|
25 | + * for that, unless you know what you are doing. |
|
26 | + * |
|
27 | + * Optionally, you can set $returnUrl and $realm (or $trustRoot, which is an alias). |
|
28 | + * The default values for those are: |
|
29 | + * $openid->realm = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; |
|
30 | + * $openid->returnUrl = $openid->realm . $_SERVER['REQUEST_URI']; |
|
31 | + * If you don't know their meaning, refer to any openid tutorial, or specification. Or just guess. |
|
32 | + * |
|
33 | + * AX and SREG extensions are supported. |
|
34 | + * To use them, specify $openid->required and/or $openid->optional before calling $openid->authUrl(). |
|
35 | + * These are arrays, with values being AX schema paths (the 'path' part of the URL). |
|
36 | + * For example: |
|
37 | + * $openid->required = array('namePerson/friendly', 'contact/email'); |
|
38 | + * $openid->optional = array('namePerson/first'); |
|
39 | + * If the server supports only SREG or OpenID 1.1, these are automaticaly |
|
40 | + * mapped to SREG names, so that user doesn't have to know anything about the server. |
|
41 | + * |
|
42 | + * To get the values, use $openid->getAttributes(). |
|
43 | + * |
|
44 | + * |
|
45 | + * The library requires PHP >= 5.1.2 with curl or http/https stream wrappers enabled. |
|
46 | + * @author Mewp |
|
47 | + * @copyright Copyright (c) 2010, Mewp |
|
48 | + * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
49 | + */ |
|
50 | 50 | class LightOpenID |
51 | 51 | { |
52 | 52 | public $returnUrl |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | |
74 | 74 | function __construct($host) |
75 | 75 | { |
76 | - $this->trustRoot = (strpos($host, '://') ? $host : 'http://' . $host); |
|
76 | + $this->trustRoot = (strpos($host, '://') ? $host : 'http://'.$host); |
|
77 | 77 | if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') |
78 | 78 | || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) |
79 | 79 | && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') |
80 | 80 | ) { |
81 | - $this->trustRoot = (strpos($host, '://') ? $host : 'https://' . $host); |
|
81 | + $this->trustRoot = (strpos($host, '://') ? $host : 'https://'.$host); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | if (($host_end = strpos($this->trustRoot, '/', 8)) !== false) { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | $uri = rtrim(preg_replace('#((?<=\?)|&)openid\.[^&]+#', '', $_SERVER['REQUEST_URI']), '?'); |
89 | - $this->returnUrl = $this->trustRoot . $uri; |
|
89 | + $this->returnUrl = $this->trustRoot.$uri; |
|
90 | 90 | |
91 | 91 | $this->data = ($_SERVER['REQUEST_METHOD'] === 'POST') ? $_POST : $_GET; |
92 | 92 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | protected function request_curl($url, $method = 'GET', $params = array(), $update_claimed_id) |
158 | 158 | { |
159 | 159 | $params = http_build_query($params, '', '&'); |
160 | - $curl = curl_init($url . ($method == 'GET' && $params ? '?' . $params : '')); |
|
160 | + $curl = curl_init($url.($method == 'GET' && $params ? '?'.$params : '')); |
|
161 | 161 | curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); |
162 | 162 | curl_setopt($curl, CURLOPT_HEADER, false); |
163 | 163 | curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | } elseif ($headers[$name][0] == '/') { |
253 | 253 | $parsed_url = parse_url($this->claimed_id); |
254 | 254 | $this->identity = |
255 | - $this->claimed_id = $parsed_url['scheme'] . '://' |
|
255 | + $this->claimed_id = $parsed_url['scheme'].'://' |
|
256 | 256 | . $parsed_url['host'] |
257 | 257 | . $headers[$name]; |
258 | 258 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | 'CN_match' => parse_url($url, PHP_URL_HOST), |
281 | 281 | ), |
282 | 282 | ); |
283 | - $url = $url . ($params ? '?' . $params : ''); |
|
283 | + $url = $url.($params ? '?'.$params : ''); |
|
284 | 284 | break; |
285 | 285 | case 'POST': |
286 | 286 | $opts = array( |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | ) |
312 | 312 | ); |
313 | 313 | |
314 | - $url = $url . ($params ? '?' . $params : ''); |
|
314 | + $url = $url.($params ? '?'.$params : ''); |
|
315 | 315 | $headers = get_headers($url); |
316 | 316 | if (!$headers) { |
317 | 317 | return array(); |
@@ -365,11 +365,11 @@ discard block |
||
365 | 365 | protected function build_url($url, $parts) |
366 | 366 | { |
367 | 367 | if (isset($url['query'], $parts['query'])) { |
368 | - $parts['query'] = $url['query'] . '&' . $parts['query']; |
|
368 | + $parts['query'] = $url['query'].'&'.$parts['query']; |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | $url = $parts + $url; |
372 | - $url = $url['scheme'] . '://' |
|
372 | + $url = $url['scheme'].'://' |
|
373 | 373 | . (empty($url['username']) ? '' |
374 | 374 | :(empty($url['password']) ? "{$url['username']}@" |
375 | 375 | :"{$url['username']}:{$url['password']}@")) |
@@ -442,11 +442,11 @@ discard block |
||
442 | 442 | |
443 | 443 | preg_match_all('#<Service.*?>(.*?)</Service>#s', $content, $m); |
444 | 444 | foreach ($m[1] as $content) { |
445 | - $content = ' ' . $content; # The space is added, so that strpos doesn't return 0. |
|
445 | + $content = ' '.$content; # The space is added, so that strpos doesn't return 0. |
|
446 | 446 | |
447 | 447 | # OpenID 2 |
448 | 448 | $ns = preg_quote('http://specs.openid.net/auth/2.0/', '#'); |
449 | - if (preg_match('#<Type>\s*' . $ns . '(server|signon)\s*</Type>#s', $content, $type)) { |
|
449 | + if (preg_match('#<Type>\s*'.$ns.'(server|signon)\s*</Type>#s', $content, $type)) { |
|
450 | 450 | if ($type[1] == 'server') { |
451 | 451 | $this->identifier_select = true; |
452 | 452 | } |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | |
474 | 474 | # OpenID 1.1 |
475 | 475 | $ns = preg_quote('http://openid.net/signon/1.1', '#'); |
476 | - if (preg_match('#<Type>\s*' . $ns . '\s*</Type>#s', $content)) { |
|
476 | + if (preg_match('#<Type>\s*'.$ns.'\s*</Type>#s', $content)) { |
|
477 | 477 | |
478 | 478 | preg_match('#<URI.*?>(.*)</URI>#', $content, $server); |
479 | 479 | preg_match('#<.*?Delegate>(.*)</.*?Delegate>#', $content, $delegate); |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | if (is_int($alias)) { |
599 | 599 | $alias = strtr($field, '/', '_'); |
600 | 600 | } |
601 | - $this->aliases[$alias] = 'http://axschema.org/' . $field; |
|
601 | + $this->aliases[$alias] = 'http://axschema.org/'.$field; |
|
602 | 602 | if (empty($counts[$alias])) { |
603 | 603 | $counts[$alias] = 0; |
604 | 604 | } |
@@ -607,13 +607,13 @@ discard block |
||
607 | 607 | } |
608 | 608 | } |
609 | 609 | foreach ($this->aliases as $alias => $ns) { |
610 | - $params['openid.ax.type.' . $alias] = $ns; |
|
610 | + $params['openid.ax.type.'.$alias] = $ns; |
|
611 | 611 | } |
612 | 612 | foreach ($counts as $alias => $count) { |
613 | 613 | if ($count == 1) { |
614 | 614 | continue; |
615 | 615 | } |
616 | - $params['openid.ax.count.' . $alias] = $count; |
|
616 | + $params['openid.ax.count.'.$alias] = $count; |
|
617 | 617 | } |
618 | 618 | |
619 | 619 | # Don't send empty ax.requied and ax.if_available. |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | # we need to somehow preserve the claimed id between requests. |
636 | 636 | # The simplest way is to just send it along with the return_to url. |
637 | 637 | if ($this->identity != $this->claimed_id) { |
638 | - $returnUrl .= (strpos($returnUrl, '?') ? '&' : '?') . 'openid.claimed_id=' . $this->claimed_id; |
|
638 | + $returnUrl .= (strpos($returnUrl, '?') ? '&' : '?').'openid.claimed_id='.$this->claimed_id; |
|
639 | 639 | } |
640 | 640 | |
641 | 641 | $params = array( |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | # If it's an OpenID 1 provider, and we've got claimed_id, |
740 | 740 | # we have to append it to the returnUrl, like authUrl_v1 does. |
741 | 741 | $this->returnUrl .= (strpos($this->returnUrl, '?') ? '&' : '?') |
742 | - . 'openid.claimed_id=' . $this->claimed_id; |
|
742 | + . 'openid.claimed_id='.$this->claimed_id; |
|
743 | 743 | } |
744 | 744 | |
745 | 745 | if ($this->data['openid_return_to'] != $this->returnUrl) { |
@@ -757,8 +757,8 @@ discard block |
||
757 | 757 | # In such case, validation would fail, since we'd send different data than OP |
758 | 758 | # wants to verify. stripslashes() should solve that problem, but we can't |
759 | 759 | # use it when magic_quotes is off. |
760 | - $value = $this->data['openid_' . str_replace('.', '_', $item)]; |
|
761 | - $params['openid.' . $item] = function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ? stripslashes($value) : $value; |
|
760 | + $value = $this->data['openid_'.str_replace('.', '_', $item)]; |
|
761 | + $params['openid.'.$item] = function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ? stripslashes($value) : $value; |
|
762 | 762 | |
763 | 763 | } |
764 | 764 | |
@@ -796,19 +796,19 @@ discard block |
||
796 | 796 | |
797 | 797 | $attributes = array(); |
798 | 798 | foreach (explode(',', $this->data['openid_signed']) as $key) { |
799 | - $keyMatch = $alias . '.value.'; |
|
799 | + $keyMatch = $alias.'.value.'; |
|
800 | 800 | if (substr($key, 0, strlen($keyMatch)) != $keyMatch) { |
801 | 801 | continue; |
802 | 802 | } |
803 | 803 | $key = substr($key, strlen($keyMatch)); |
804 | - if (!isset($this->data['openid_' . $alias . '_type_' . $key])) { |
|
804 | + if (!isset($this->data['openid_'.$alias.'_type_'.$key])) { |
|
805 | 805 | # OP is breaking the spec by returning a field without |
806 | 806 | # associated ns. This shouldn't happen, but it's better |
807 | 807 | # to check, than cause an E_NOTICE. |
808 | 808 | continue; |
809 | 809 | } |
810 | - $value = $this->data['openid_' . $alias . '_value_' . $key]; |
|
811 | - $key = substr($this->data['openid_' . $alias . '_type_' . $key], |
|
810 | + $value = $this->data['openid_'.$alias.'_value_'.$key]; |
|
811 | + $key = substr($this->data['openid_'.$alias.'_type_'.$key], |
|
812 | 812 | strlen('http://axschema.org/')); |
813 | 813 | |
814 | 814 | $attributes[$key] = $value; |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | # The field name isn't part of the SREG spec, so we ignore it. |
831 | 831 | continue; |
832 | 832 | } |
833 | - $attributes[$sreg_to_ax[$key]] = $this->data['openid_sreg_' . $key]; |
|
833 | + $attributes[$sreg_to_ax[$key]] = $this->data['openid_sreg_'.$key]; |
|
834 | 834 | } |
835 | 835 | return $attributes; |
836 | 836 | } |
@@ -1,4 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | +/** |
|
3 | + * @param string $string |
|
4 | + */ |
|
2 | 5 | function strToHex($string) |
3 | 6 | { |
4 | 7 | $hex = ''; |
@@ -46,6 +49,9 @@ discard block |
||
46 | 49 | return $sign . $h; |
47 | 50 | } |
48 | 51 | |
52 | +/** |
|
53 | + * @param string $cs |
|
54 | + */ |
|
49 | 55 | function get_checksum($cs) |
50 | 56 | { |
51 | 57 | $var = computeUnsignedCRC32($cs); |
@@ -61,6 +67,9 @@ discard block |
||
61 | 67 | return chr($d) . chr($c) . chr($b) . chr($a); |
62 | 68 | } |
63 | 69 | |
70 | +/** |
|
71 | + * @param string $answer |
|
72 | + */ |
|
64 | 73 | function fixAnswer($answer) |
65 | 74 | { |
66 | 75 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $string = ''; |
15 | 15 | for ($i = 0; $i < strlen($hex) - 1; $i += 2) |
16 | 16 | { |
17 | - $string .= chr(hexdec($hex[$i] . $hex[$i + 1])); |
|
17 | + $string .= chr(hexdec($hex[$i].$hex[$i + 1])); |
|
18 | 18 | } |
19 | 19 | return $string; |
20 | 20 | } |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | |
39 | 39 | do |
40 | 40 | { |
41 | - $h = $hex[($dec % 16)] . $h; |
|
41 | + $h = $hex[($dec % 16)].$h; |
|
42 | 42 | $dec /= 16; |
43 | 43 | } |
44 | 44 | while ($dec >= 1); |
45 | 45 | |
46 | - return $sign . $h; |
|
46 | + return $sign.$h; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | function get_checksum($cs) |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | $var = computeUnsignedCRC32($cs); |
52 | 52 | $x = ('0x'); |
53 | 53 | $a = substr($var, 0, 2); |
54 | - $a = $x . $a; |
|
54 | + $a = $x.$a; |
|
55 | 55 | $b = substr($var, 2, 2); |
56 | - $b = $x . $b; |
|
56 | + $b = $x.$b; |
|
57 | 57 | $c = substr($var, 4, 2); |
58 | - $c = $x . $c; |
|
58 | + $c = $x.$c; |
|
59 | 59 | $d = substr($var, 6, 2); |
60 | - $d = $x . $d; |
|
61 | - return chr($d) . chr($c) . chr($b) . chr($a); |
|
60 | + $d = $x.$d; |
|
61 | + return chr($d).chr($c).chr($b).chr($a); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | function fixAnswer($answer) |
@@ -95,15 +95,15 @@ discard block |
||
95 | 95 | |
96 | 96 | function rcon($serverip, $serverport, $rconpassword, $cmd) |
97 | 97 | { |
98 | - $passhead = chr(0xFF) . chr(0x00); |
|
99 | - $head = chr(0x42) . chr(0x45); |
|
100 | - $pass = $passhead . $rconpassword; |
|
98 | + $passhead = chr(0xFF).chr(0x00); |
|
99 | + $head = chr(0x42).chr(0x45); |
|
100 | + $pass = $passhead.$rconpassword; |
|
101 | 101 | $answer = ""; |
102 | 102 | $checksum = get_checksum($pass); |
103 | 103 | |
104 | - $loginmsg = $head . $checksum . $pass; |
|
104 | + $loginmsg = $head.$checksum.$pass; |
|
105 | 105 | |
106 | - $rcon = fsockopen("udp://" . $serverip, $serverport, $errno, $errstr, 1); |
|
106 | + $rcon = fsockopen("udp://".$serverip, $serverport, $errno, $errstr, 1); |
|
107 | 107 | stream_set_timeout($rcon, 1); |
108 | 108 | |
109 | 109 | if (!$rcon) { |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | fwrite($rcon, $loginmsg); |
113 | 113 | $res = fread($rcon, 16); |
114 | 114 | |
115 | - $cmdhead = chr(0xFF) . chr(0x01) . chr(0x00); |
|
115 | + $cmdhead = chr(0xFF).chr(0x01).chr(0x00); |
|
116 | 116 | //$cmd = "Players"; |
117 | - $cmd = $cmdhead . $cmd; |
|
117 | + $cmd = $cmdhead.$cmd; |
|
118 | 118 | $checksum = get_checksum($cmd); |
119 | - $cmdmsg = $head . $checksum . $cmd; |
|
120 | - $hlen = strlen($head . $checksum . chr(0xFF) . chr(0x01)); |
|
119 | + $cmdmsg = $head.$checksum.$cmd; |
|
120 | + $hlen = strlen($head.$checksum.chr(0xFF).chr(0x01)); |
|
121 | 121 | |
122 | 122 | fwrite($rcon, $cmdmsg); |
123 | 123 | $answer = fread($rcon, 102400); |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | } |
130 | 130 | } |
131 | 131 | $cmd = "Exit"; |
132 | - $cmd = $cmdhead . $cmd; |
|
132 | + $cmd = $cmdhead.$cmd; |
|
133 | 133 | $checksum = get_checksum($cmd); |
134 | - $cmdmsg = $head . $checksum . $cmd; |
|
134 | + $cmdmsg = $head.$checksum.$cmd; |
|
135 | 135 | fwrite($rcon, $cmdmsg); |
136 | 136 | } |
137 | 137 |
@@ -3,6 +3,9 @@ |
||
3 | 3 | |
4 | 4 | class user |
5 | 5 | { |
6 | + /** |
|
7 | + * @param string $steamid |
|
8 | + */ |
|
6 | 9 | public function GetPlayerSummaries($steamid) |
7 | 10 | { |
8 | 11 | $settings = require('config/settings.php'); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | public function GetPlayerSummaries($steamid) |
7 | 7 | { |
8 | 8 | $settings = require('config/settings.php'); |
9 | - $response = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=' . $settings['steamAPI'] . '&steamids=' . $steamid); |
|
9 | + $response = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.$settings['steamAPI'].'&steamids='.$steamid); |
|
10 | 10 | $json = json_decode($response); |
11 | 11 | return $json->response->players[0]; |
12 | 12 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $openid = new LightOpenID($settings['url']); |
20 | 20 | if (!$openid->mode) { |
21 | 21 | $openid->identity = 'http://steamcommunity.com/openid'; |
22 | - header('Location: ' . $openid->authUrl()); |
|
22 | + header('Location: '.$openid->authUrl()); |
|
23 | 23 | } elseif ($openid->mode == 'cancel') { |
24 | 24 | print ('User has canceled authentication!'); |
25 | 25 | } else { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $db_connection = masterConnect(); |
31 | 31 | |
32 | 32 | $sql = "SELECT user_name, user_email, user_level, user_profile, permissions, user_password_hash, user_id |
33 | - FROM users WHERE playerid = '" . $_SESSION['playerid'] . "';"; |
|
33 | + FROM users WHERE playerid = '" . $_SESSION['playerid']."';"; |
|
34 | 34 | $result_of_login_check = $db_connection->query($sql); |
35 | 35 | |
36 | 36 | if ($result_of_login_check->num_rows == 1) { |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | $_SESSION['steamsignon'] = false; //used to determine if its a single sign on with no account |
55 | 55 | multiDB(); |
56 | 56 | |
57 | - logAction($_SESSION['user_name'], 'Successful Steam Login (' . $_SERVER['REMOTE_ADDR'] . ')', 2); |
|
57 | + logAction($_SESSION['user_name'], 'Successful Steam Login ('.$_SERVER['REMOTE_ADDR'].')', 2); |
|
58 | 58 | } else { |
59 | 59 | $this->errors[] = "User is banned."; |
60 | - logAction($_POST['user_name'], 'Steam Login Failed - Banned User (' . $_SERVER['REMOTE_ADDR'] . ')', 3); |
|
60 | + logAction($_POST['user_name'], 'Steam Login Failed - Banned User ('.$_SERVER['REMOTE_ADDR'].')', 3); |
|
61 | 61 | } |
62 | 62 | } else { |
63 | 63 | if ($settings['annonlogin']) { |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | $_SESSION['steamsignon'] = true; //used to determine if its a single sign on with no account |
74 | 74 | multiDB(); |
75 | 75 | |
76 | - logAction($_SESSION['user_name'], 'Successful Steam Login (' . $_SERVER['REMOTE_ADDR'] . ')', 2); |
|
76 | + logAction($_SESSION['user_name'], 'Successful Steam Login ('.$_SERVER['REMOTE_ADDR'].')', 2); |
|
77 | 77 | } else { |
78 | 78 | errorMessage(7); |
79 | 79 | } |
80 | 80 | } |
81 | - header('Location: ' . $settings['url']); |
|
81 | + header('Location: '.$settings['url']); |
|
82 | 82 | exit; |
83 | 83 | } else { |
84 | 84 | print ('Error'); |
@@ -374,7 +374,7 @@ |
||
374 | 374 | * Get either a Gravatar URL or complete image tag for a specified email address. |
375 | 375 | * |
376 | 376 | * @param string $email The email address |
377 | - * @param string $s Size in pixels, defaults to 80px [ 1 - 2048 ] |
|
377 | + * @param integer $s Size in pixels, defaults to 80px [ 1 - 2048 ] |
|
378 | 378 | * @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ] |
379 | 379 | * @param string $r Maximum rating (inclusive) [ g | pg | r | x ] |
380 | 380 | * @param boole $img True to return a complete IMG tag False for just the URL |
@@ -332,7 +332,9 @@ discard block |
||
332 | 332 | } elseif ($type == 'boolean') { |
333 | 333 | return ($input === 'true'); |
334 | 334 | } elseif ($type == 'intbool') { |
335 | - if ($input == 1 || $input == 0) return $input; |
|
335 | + if ($input == 1 || $input == 0) { |
|
336 | + return $input; |
|
337 | + } |
|
336 | 338 | } else { |
337 | 339 | return 0; |
338 | 340 | } |
@@ -388,8 +390,9 @@ discard block |
||
388 | 390 | $url .= "?s=$s&d=$d&r=$r"; |
389 | 391 | if ( $img ) { |
390 | 392 | $url = '<img src="' . $url . '"'; |
391 | - foreach ( $atts as $key => $val ) |
|
392 | - $url .= ' ' . $key . '="' . $val . '"'; |
|
393 | + foreach ( $atts as $key => $val ) { |
|
394 | + $url .= ' ' . $key . '="' . $val . '"'; |
|
395 | + } |
|
393 | 396 | $url .= ' />'; |
394 | 397 | } |
395 | 398 | return $url; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $settings = require('config/settings.php'); |
36 | 36 | $db_connection = masterConnect(); |
37 | 37 | |
38 | - $sql = "SELECT `sql_host`,`sql_name`,`sql_pass`,`sql_user` FROM `db` WHERE `dbid` = '" . $dbid . "';"; |
|
38 | + $sql = "SELECT `sql_host`,`sql_name`,`sql_pass`,`sql_user` FROM `db` WHERE `dbid` = '".$dbid."';"; |
|
39 | 39 | $server = $db_connection->query($sql); |
40 | 40 | |
41 | 41 | if ($server->num_rows === 1) { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | function nameID($pId, $db_link) |
102 | 102 | { |
103 | - $sql = "SELECT `name` FROM `players` WHERE `playerid` LIKE '" . $pId . "' "; |
|
103 | + $sql = "SELECT `name` FROM `players` WHERE `playerid` LIKE '".$pId."' "; |
|
104 | 104 | $result_of_query = $db_link->query($sql); |
105 | 105 | |
106 | 106 | if ($result_of_query->num_rows > 0) { |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | function uID($pId, $db_link) |
116 | 116 | { |
117 | - $sql = "SELECT `uid` FROM `players` WHERE `playerid` = '" . $pId . "' "; |
|
117 | + $sql = "SELECT `uid` FROM `players` WHERE `playerid` = '".$pId."' "; |
|
118 | 118 | $result_of_query = $db_link->query($sql); |
119 | 119 | if ($result_of_query->num_rows > 0) { |
120 | 120 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | function uIDname($uID, $db_link) |
129 | 129 | { |
130 | - $sql = "SELECT `name` FROM `players` WHERE `uid` = '" . $uID . "' "; |
|
130 | + $sql = "SELECT `name` FROM `players` WHERE `uid` = '".$uID."' "; |
|
131 | 131 | $result_of_query = $db_link->query($sql); |
132 | 132 | if ($result_of_query->num_rows > 0) { |
133 | 133 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | function IDname($name, $db_link) |
142 | 142 | { |
143 | - $sql = "SELECT `name`,`playerid` FROM `players` WHERE `name` LIKE '%" . $name . "%' "; |
|
143 | + $sql = "SELECT `name`,`playerid` FROM `players` WHERE `name` LIKE '%".$name."%' "; |
|
144 | 144 | $result_of_query = $db_link->query($sql); |
145 | 145 | |
146 | 146 | if ($result_of_query->num_rows > 0) { |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | if ($settings['logging']) { |
163 | 163 | $db_connection = masterConnect(); |
164 | - $sql = "INSERT INTO `logs` (`user`, `action`, `level`) VALUES ('" . $user . "', '" . $action . "', '" . $level . "');"; |
|
164 | + $sql = "INSERT INTO `logs` (`user`, `action`, `level`) VALUES ('".$user."', '".$action."', '".$level."');"; |
|
165 | 165 | $db_connection->query($sql); |
166 | 166 | } |
167 | 167 | } |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | echo "<br><div class='row'><div class='col-lg-12'>"; |
172 | 172 | echo "<div class='alert alert-danger alert-dismissable'>"; |
173 | 173 | echo "<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>"; |
174 | - echo "<i class='fa fa-info-circle'></i> " . $text . "</div></div></div>"; |
|
174 | + echo "<i class='fa fa-info-circle'></i> ".$text."</div></div></div>"; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | function error($errno, $errstr, $errfile, $errline) |
178 | 178 | { |
179 | - echo '<h4><b>PHP ERROR ' . $errno . '</b> ' . $errstr . ' - ' . $errfile . ':' . $errline . '</h4>'; |
|
179 | + echo '<h4><b>PHP ERROR '.$errno.'</b> '.$errstr.' - '.$errfile.':'.$errline.'</h4>'; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -223,19 +223,19 @@ discard block |
||
223 | 223 | case 37: |
224 | 224 | return $lang['noLic']; //No License |
225 | 225 | case 371: |
226 | - return $lang['no'] . ' ' . $lang['civil'] . ' ' . $lang['licenses']; //No Civillian Licenses |
|
226 | + return $lang['no'].' '.$lang['civil'].' '.$lang['licenses']; //No Civillian Licenses |
|
227 | 227 | case 372: |
228 | - return $lang['no'] . ' ' . $lang['medic'] . ' ' . $lang['licenses']; //No Medic Licenses |
|
228 | + return $lang['no'].' '.$lang['medic'].' '.$lang['licenses']; //No Medic Licenses |
|
229 | 229 | case 373: |
230 | - return $lang['no'] . ' ' . $lang['police'] . ' ' . $lang['licenses']; //No Police Licenses |
|
230 | + return $lang['no'].' '.$lang['police'].' '.$lang['licenses']; //No Police Licenses |
|
231 | 231 | case 38: |
232 | - return $lang['no'] . ' ' . $lang['gear']; //No License |
|
232 | + return $lang['no'].' '.$lang['gear']; //No License |
|
233 | 233 | case 381: |
234 | - return $lang['no'] . ' ' . $lang['civil'] . ' ' . $lang['gear']; //No Civillian Licenses |
|
234 | + return $lang['no'].' '.$lang['civil'].' '.$lang['gear']; //No Civillian Licenses |
|
235 | 235 | case 382: |
236 | - return $lang['no'] . ' ' . $lang['medic'] . ' ' . $lang['gear']; //No Medic Licenses |
|
236 | + return $lang['no'].' '.$lang['medic'].' '.$lang['gear']; //No Medic Licenses |
|
237 | 237 | case 383: |
238 | - return $lang['no'] . ' ' . $lang['police'] . ' ' . $lang['gear']; //No Police Licenses |
|
238 | + return $lang['no'].' '.$lang['police'].' '.$lang['gear']; //No Police Licenses |
|
239 | 239 | } |
240 | 240 | } |
241 | 241 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $max = ceil($length / 40); |
245 | 245 | $random = ''; |
246 | 246 | for ($i = 0; $i < $max; $i++) { |
247 | - $random .= sha1(microtime(true) . mt_rand(10000, 90000)); |
|
247 | + $random .= sha1(microtime(true).mt_rand(10000, 90000)); |
|
248 | 248 | } |
249 | 249 | return substr($random, 0, $length); |
250 | 250 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | { |
254 | 254 | $settings = require('config/settings.php'); |
255 | 255 | if (!empty($settings['steamAPI'])) { |
256 | - $api = "http://api.steampowered.com/ISteamUser/GetPlayerBans/v1/?key=" . $settings['steamAPI'] . "&steamids=" . $PID; |
|
256 | + $api = "http://api.steampowered.com/ISteamUser/GetPlayerBans/v1/?key=".$settings['steamAPI']."&steamids=".$PID; |
|
257 | 257 | $bans = json_decode(file_get_contents($api), true); |
258 | 258 | if ($bans['players']['0']['VACBanned']) { |
259 | 259 | return '<h4><span class="label label-danger" style="margin-left:3px; line-height:2;">VAC BANNED</span></h4>'; |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | function communityBanned($GUID) |
364 | 364 | { |
365 | 365 | $settings = require('config/settings.php'); |
366 | - $data = json_decode(file_get_contents("http://bans.itsyuka.tk/api/bans/player/id/" . $GUID . "/format/json/key/" . $settings['communityBansAPI']), true); |
|
366 | + $data = json_decode(file_get_contents("http://bans.itsyuka.tk/api/bans/player/id/".$GUID."/format/json/key/".$settings['communityBansAPI']), true); |
|
367 | 367 | |
368 | 368 | if ($data['level'] >= 1) { |
369 | 369 | return true; |
@@ -384,14 +384,14 @@ discard block |
||
384 | 384 | * @return String containing either just a URL or a complete image tag |
385 | 385 | * @source http://gravatar.com/site/implement/images/php/ |
386 | 386 | */ |
387 | -function get_gravatar( $email, $s = 80, $d = 'mm', $r = 'x', $img = false, $atts = array() ) { |
|
387 | +function get_gravatar($email, $s = 80, $d = 'mm', $r = 'x', $img = false, $atts = array()) { |
|
388 | 388 | $url = 'https://www.gravatar.com/avatar/'; |
389 | - $url .= md5( strtolower( trim( $email ) ) ); |
|
389 | + $url .= md5(strtolower(trim($email))); |
|
390 | 390 | $url .= "?s=$s&d=$d&r=$r"; |
391 | - if ( $img ) { |
|
392 | - $url = '<img src="' . $url . '"'; |
|
393 | - foreach ( $atts as $key => $val ) |
|
394 | - $url .= ' ' . $key . '="' . $val . '"'; |
|
391 | + if ($img) { |
|
392 | + $url = '<img src="'.$url.'"'; |
|
393 | + foreach ($atts as $key => $val) |
|
394 | + $url .= ' '.$key.'="'.$val.'"'; |
|
395 | 395 | $url .= ' />'; |
396 | 396 | } |
397 | 397 | return $url; |
@@ -41,7 +41,7 @@ |
||
41 | 41 | </div> |
42 | 42 | </div> |
43 | 43 | </li> |
44 | - <?php }elseif ($row['type'] == 'waste') { ?> |
|
44 | + <?php } elseif ($row['type'] == 'waste') { ?> |
|
45 | 45 | <li class="list-danger"> |
46 | 46 | <i class=" fa fa-ellipsis-v"></i> |
47 | 47 | <div class="task-title"> |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | </div> |
7 | 7 | </div> |
8 | 8 | <?php if (isset($message)) { |
9 | - echo '<div class="alert alert-info" role="alert">' . $message . '</div>'; |
|
9 | + echo '<div class="alert alert-info" role="alert">'.$message.'</div>'; |
|
10 | 10 | } |
11 | 11 | ?> |
12 | 12 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | if ($result_of_query->num_rows >= 1) { |
28 | 28 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
29 | - if ($row['type'] == 'life'){ ?> |
|
29 | + if ($row['type'] == 'life') { ?> |
|
30 | 30 | <li class="list-primary"> |
31 | 31 | <i class=" fa fa-ellipsis-v"></i> |
32 | 32 | <div class="task-title"> |
@@ -272,7 +272,8 @@ discard block |
||
272 | 272 | </tbody> |
273 | 273 | </table> |
274 | 274 | <?php echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="' . $settings['url'] . 'houses/' . $player->playerid . '"> More</a>'; |
275 | - } else echo $lang['noHouse'] ?> |
|
275 | + } else { |
|
276 | + echo $lang['noHouse'] ?> |
|
276 | 277 | </div> |
277 | 278 | </div> |
278 | 279 | <?php } if ($player->playerid == $_SESSION['playerid']) { ?> |
@@ -281,6 +282,7 @@ discard block |
||
281 | 282 | <?php |
282 | 283 | $sql = "SELECT `classname`,`type`,`id`,`plate` FROM `vehicles` WHERE `pid` = '" . $player->playerid . "' ORDER BY `id` DESC LIMIT 8"; |
283 | 284 | } |
285 | + } |
|
284 | 286 | $result_of_query = $db_link->query($sql); |
285 | 287 | if ($result_of_query->num_rows > 0) { |
286 | 288 | $veh = $result_of_query->fetch_object(); |
@@ -5,9 +5,9 @@ discard block |
||
5 | 5 | require_once("config/images.php"); |
6 | 6 | require_once("config/license.php"); |
7 | 7 | } else { |
8 | - require_once(realpath($settings['url']) . "config/carNames.php"); |
|
9 | - require_once(realpath($settings['url']) . "config/images.php"); |
|
10 | - require_once(realpath($settings['url']) . "config/license.php"); |
|
8 | + require_once(realpath($settings['url'])."config/carNames.php"); |
|
9 | + require_once(realpath($settings['url'])."config/images.php"); |
|
10 | + require_once(realpath($settings['url'])."config/license.php"); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | $db_link = serverConnect(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | -$sql = "SELECT * FROM `players` WHERE `playerid` = '" . $_SESSION['playerid'] . "'"; |
|
31 | +$sql = "SELECT * FROM `players` WHERE `playerid` = '".$_SESSION['playerid']."'"; |
|
32 | 32 | $result = $db_link->query($sql); |
33 | 33 | if ($result->num_rows > 0) { |
34 | 34 | $player = $result->fetch_object(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $temp .= chr($pGID & 0xFF); |
40 | 40 | $pGID >>= 8; |
41 | 41 | } |
42 | - $pGID = md5('BE' . $temp); |
|
42 | + $pGID = md5('BE'.$temp); |
|
43 | 43 | ?> |
44 | 44 | <div class="col-md-3" style="float:left; padding-top:20px;"> |
45 | 45 | <div class="panel panel-default"> |
@@ -53,26 +53,26 @@ discard block |
||
53 | 53 | $alias = str_replace('"[`', "", $player->aliases); |
54 | 54 | $alias = str_replace('`]"', "", $alias); |
55 | 55 | |
56 | - echo '<center><img alt="' . $alias . '" src="' . $settings['url'] . 'assets/img/uniform/' . getPlayerSkin($player->civ_gear, $playerSkins) . '.jpg">'; |
|
57 | - echo "<h4>" . $lang['aliases'] . ": " . $alias . "</h4>"; |
|
58 | - echo "<h4>" . $lang['playerID'] . ": " . $player->playerid . "</h4>"; |
|
59 | - echo "<h4 style='word-wrap: break-word;'>" . $lang['GUID'] . ": " . $pGID . "</h4>"; |
|
56 | + echo '<center><img alt="'.$alias.'" src="'.$settings['url'].'assets/img/uniform/'.getPlayerSkin($player->civ_gear, $playerSkins).'.jpg">'; |
|
57 | + echo "<h4>".$lang['aliases'].": ".$alias."</h4>"; |
|
58 | + echo "<h4>".$lang['playerID'].": ".$player->playerid."</h4>"; |
|
59 | + echo "<h4 style='word-wrap: break-word;'>".$lang['GUID'].": ".$pGID."</h4>"; |
|
60 | 60 | ?> |
61 | 61 | <i class="fa fa-2x fa-money"></i> |
62 | - <h4> <?php echo $lang['cash'] . ": " . $player->cash; ?> </h4> |
|
62 | + <h4> <?php echo $lang['cash'].": ".$player->cash; ?> </h4> |
|
63 | 63 | <i style="padding-left:15px;" class="fa fa-2x fa-bank"></i> |
64 | - <h4> <?php echo $lang['bank'] . ": " . $player->bankacc; ?> </h4> |
|
64 | + <h4> <?php echo $lang['bank'].": ".$player->bankacc; ?> </h4> |
|
65 | 65 | <?php |
66 | 66 | if ($player->arrested == 0) { |
67 | - echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-success'>" . $lang["not"] . " " . $lang["arrested"] . "</button></h4>"; |
|
67 | + echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-success'>".$lang["not"]." ".$lang["arrested"]."</button></h4>"; |
|
68 | 68 | } else { |
69 | - echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-theme01'>" . $lang["arrested"] . "</button></h4>"; |
|
69 | + echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-theme01'>".$lang["arrested"]."</button></h4>"; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | if ($player->blacklist == 0) { |
73 | - echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-success'>" . $lang["not"] . " " . $lang["blacklisted"] . "</button></h4>"; |
|
73 | + echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-success'>".$lang["not"]." ".$lang["blacklisted"]."</button></h4>"; |
|
74 | 74 | } else { |
75 | - echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-theme01'>" . $lang["blacklisted"] . "</button></h4>"; |
|
75 | + echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-theme01'>".$lang["blacklisted"]."</button></h4>"; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | echo "</center>"; |
@@ -89,34 +89,34 @@ discard block |
||
89 | 89 | <div class="box1"> |
90 | 90 | <span class="fa fa-3x fa-taxi"></span> |
91 | 91 | |
92 | - <h3> <?php echo $lang['police'] . ": " . $player->coplevel; ?> </h3> |
|
92 | + <h3> <?php echo $lang['police'].": ".$player->coplevel; ?> </h3> |
|
93 | 93 | </div> |
94 | 94 | </div> |
95 | 95 | <div class="col-md-2 col-sm-2 box0"> |
96 | 96 | <div class="box1"> |
97 | 97 | <span class="fa fa-3x fa-ambulance"></span> |
98 | 98 | |
99 | - <h3> <?php echo $lang['medic'] . ": " . $player->mediclevel; ?> </h3> |
|
99 | + <h3> <?php echo $lang['medic'].": ".$player->mediclevel; ?> </h3> |
|
100 | 100 | </div> |
101 | 101 | </div> |
102 | 102 | <div class="col-md-2 col-sm-2 box0"> |
103 | 103 | <div class="box1"> |
104 | 104 | <span class="fa fa-3x fa-usd"></span> |
105 | 105 | |
106 | - <h3> <?php echo $lang['donator'] . ": " . $player->$settings['donorFormat']; ?> </h3> |
|
106 | + <h3> <?php echo $lang['donator'].": ".$player->$settings['donorFormat']; ?> </h3> |
|
107 | 107 | </div> |
108 | 108 | </div> |
109 | 109 | <div class="col-md-2 col-sm-2 box0"> |
110 | 110 | <div class="box1"> |
111 | 111 | <span class="fa fa-3x fa-group"></span> |
112 | 112 | |
113 | - <h3> <?php echo $lang['admin'] . ": " . $player->adminlevel; ?> </h3> |
|
113 | + <h3> <?php echo $lang['admin'].": ".$player->adminlevel; ?> </h3> |
|
114 | 114 | </div> |
115 | 115 | </div> |
116 | 116 | <?php |
117 | 117 | if ($player->playerid == $_SESSION['playerid']) { |
118 | 118 | echo '<div class="col-md-2 col-sm-2 box0">'; |
119 | - echo '<a href="http://steamcommunity.com/profiles/' . $player->playerid . '"'; |
|
119 | + echo '<a href="http://steamcommunity.com/profiles/'.$player->playerid.'"'; |
|
120 | 120 | echo 'target="_blank">'; |
121 | 121 | echo '<div class="box1">'; |
122 | 122 | echo '<span class="fa fa-3x fa-steam"></span>'; |
@@ -151,25 +151,25 @@ discard block |
||
151 | 151 | <div id="myTabContent" class="tab-content"> |
152 | 152 | <?php if ($player->playerid == $_SESSION['playerid']) { ?> |
153 | 153 | <div class="tab-pane fade in active well" id="civ_lic"> |
154 | - <h4 style="centred"><?php echo $lang['civ'] . " " . $lang['licenses']; ?> </h4> |
|
154 | + <h4 style="centred"><?php echo $lang['civ']." ".$lang['licenses']; ?> </h4> |
|
155 | 155 | <?php |
156 | 156 | if ($player->civ_licenses !== '"[]"') { |
157 | 157 | $return = stripArray($player->civ_licenses, 0); |
158 | 158 | foreach ($return as $value) { |
159 | 159 | if (strpos($value, "1") == TRUE) { |
160 | 160 | $name = before(',', $value); |
161 | - echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
161 | + echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
162 | 162 | } else { |
163 | 163 | $name = before(',', $value); |
164 | - echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
164 | + echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | } else { |
168 | - echo $lang['no'] . " " . $lang['licenses']; |
|
168 | + echo $lang['no']." ".$lang['licenses']; |
|
169 | 169 | }?> |
170 | 170 | </div> |
171 | 171 | <div class="tab-pane well fade" id="medic_lic"> |
172 | - <h4 style="centred"><?php echo $lang['medic'] . " " . $lang['licenses']; ?> </h4> |
|
172 | + <h4 style="centred"><?php echo $lang['medic']." ".$lang['licenses']; ?> </h4> |
|
173 | 173 | <?php |
174 | 174 | if ($player->med_licenses !== '"[]"') { |
175 | 175 | $return = stripArray($player->med_licenses, 0); |
@@ -177,18 +177,18 @@ discard block |
||
177 | 177 | foreach ($return as $value) { |
178 | 178 | if (strpos($value, "1") == TRUE) { |
179 | 179 | $name = before(',', $value); |
180 | - echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
180 | + echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
181 | 181 | } else { |
182 | 182 | $name = before(',', $value); |
183 | - echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
183 | + echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | } else { |
187 | - echo $lang['no'] . " " . $lang['licenses']; |
|
187 | + echo $lang['no']." ".$lang['licenses']; |
|
188 | 188 | } ?> |
189 | 189 | </div> |
190 | 190 | <div class="tab-pane well fade" id="police_lic"> |
191 | - <h4 style="centred"><?php echo $lang['cop'] . " " . $lang['licenses']; ?> </h4> |
|
191 | + <h4 style="centred"><?php echo $lang['cop']." ".$lang['licenses']; ?> </h4> |
|
192 | 192 | <?php |
193 | 193 | if ($player->cop_licenses !== '"[]"') { |
194 | 194 | $return = stripArray($player->cop_licenses, 0); |
@@ -196,22 +196,22 @@ discard block |
||
196 | 196 | foreach ($return as $value) { |
197 | 197 | if (strpos($value, "1") == TRUE) { |
198 | 198 | $name = before(',', $value); |
199 | - echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
199 | + echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
200 | 200 | } else { |
201 | 201 | $name = before(',', $value); |
202 | - echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
202 | + echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | } else { |
206 | - echo $lang['no'] . " " . $lang['licenses']; |
|
206 | + echo $lang['no']." ".$lang['licenses']; |
|
207 | 207 | } |
208 | 208 | ?> |
209 | 209 | </div> |
210 | 210 | <?php } if ($player->playerid == $_SESSION['playerid']) { ?> |
211 | 211 | <div class="tab-pane fade well" id="civ_inv"> |
212 | - <h4 style="centred"><?php echo $lang['civ'] . " " . $lang['gear']; ?> </h4> |
|
212 | + <h4 style="centred"><?php echo $lang['civ']." ".$lang['gear']; ?> </h4> |
|
213 | 213 | <?php |
214 | - echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='civ_gear'>" . $player->civ_gear . "</textarea>"; |
|
214 | + echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='civ_gear'>".$player->civ_gear."</textarea>"; |
|
215 | 215 | echo '<br>'; |
216 | 216 | |
217 | 217 | if ($_SESSION['permissions']['edit']['inventory']) { |
@@ -222,9 +222,9 @@ discard block |
||
222 | 222 | <br> |
223 | 223 | </div> |
224 | 224 | <div class="tab-pane fade well" id="police_inv"> |
225 | - <h4 style="centred"><?php echo $lang['police'] . " " . $lang['gear']; ?> </h4> |
|
225 | + <h4 style="centred"><?php echo $lang['police']." ".$lang['gear']; ?> </h4> |
|
226 | 226 | <?php |
227 | - echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='cop_gear'>" . $player->cop_gear . "</textarea>"; |
|
227 | + echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='cop_gear'>".$player->cop_gear."</textarea>"; |
|
228 | 228 | echo '<br>'; |
229 | 229 | if ($_SESSION['permissions']['edit']['inventory']) { |
230 | 230 | echo '<a data-toggle="modal" href="#edit_cop_inv" class="btn btn-primary btn-xs" style="float: right;">'; |
@@ -234,9 +234,9 @@ discard block |
||
234 | 234 | <br> |
235 | 235 | </div> |
236 | 236 | <div class="tab-pane fade well" id="medic_inv"> |
237 | - <h4 style="centred"><?php echo $lang['medic'] . " " . $lang['gear']; ?> </h4> |
|
237 | + <h4 style="centred"><?php echo $lang['medic']." ".$lang['gear']; ?> </h4> |
|
238 | 238 | <?php |
239 | - echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='med_gear'>" . $player->med_gear . "</textarea>"; |
|
239 | + echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='med_gear'>".$player->med_gear."</textarea>"; |
|
240 | 240 | echo '<br>'; |
241 | 241 | if ($_SESSION['permissions']['edit']['inventory']) { |
242 | 242 | echo '<a data-toggle="modal" href="#edit_med_inv" class="btn btn-primary btn-xs" style="float: right;">'; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | <div class="tab-pane fade" id="house"> |
249 | 249 | <div class="table-responsive"> |
250 | 250 | <?php |
251 | - $sql = "SELECT `pos`,`id` FROM `houses` WHERE `pid` = '" . $player->playerid . "' ORDER BY `id` DESC LIMIT 8"; |
|
251 | + $sql = "SELECT `pos`,`id` FROM `houses` WHERE `pid` = '".$player->playerid."' ORDER BY `id` DESC LIMIT 8"; |
|
252 | 252 | $result_of_query = $db_link->query($sql); |
253 | 253 | if ($result_of_query->num_rows > 0) { |
254 | 254 | ?> |
@@ -263,15 +263,15 @@ discard block |
||
263 | 263 | <?php |
264 | 264 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
265 | 265 | echo "<tr>"; |
266 | - echo "<td>" . $row["pos"] . "</td>"; |
|
267 | - echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editHouse/" . $row["id"] . "'>"; |
|
266 | + echo "<td>".$row["pos"]."</td>"; |
|
267 | + echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url']."editHouse/".$row["id"]."'>"; |
|
268 | 268 | echo "<i class='fa fa-pencil'></i></a></td>"; |
269 | 269 | echo "</tr>"; |
270 | 270 | }; |
271 | 271 | ?> |
272 | 272 | </tbody> |
273 | 273 | </table> |
274 | - <?php echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="' . $settings['url'] . 'houses/' . $player->playerid . '"> More</a>'; |
|
274 | + <?php echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="'.$settings['url'].'houses/'.$player->playerid.'"> More</a>'; |
|
275 | 275 | } else echo $lang['noHouse'] ?> |
276 | 276 | </div> |
277 | 277 | </div> |
@@ -279,33 +279,33 @@ discard block |
||
279 | 279 | <div class="tab-pane fade" id="veh"> |
280 | 280 | <div class="table-responsive"> |
281 | 281 | <?php |
282 | - $sql = "SELECT `classname`,`type`,`id`,`plate` FROM `vehicles` WHERE `pid` = '" . $player->playerid . "' ORDER BY `id` DESC LIMIT 8"; |
|
282 | + $sql = "SELECT `classname`,`type`,`id`,`plate` FROM `vehicles` WHERE `pid` = '".$player->playerid."' ORDER BY `id` DESC LIMIT 8"; |
|
283 | 283 | } |
284 | 284 | $result_of_query = $db_link->query($sql); |
285 | 285 | if ($result_of_query->num_rows > 0) { |
286 | 286 | $veh = $result_of_query->fetch_object(); |
287 | 287 | echo '<table class="table table-bordered table-hover table-striped">'; |
288 | 288 | echo '<thead><tr>'; |
289 | - echo '<th>' . $lang['class'] . '</th>'; |
|
290 | - echo '<th>' . $lang['type'] . '</th>'; |
|
291 | - echo '<th>' . $lang['plate'] . '</th>'; |
|
289 | + echo '<th>'.$lang['class'].'</th>'; |
|
290 | + echo '<th>'.$lang['type'].'</th>'; |
|
291 | + echo '<th>'.$lang['plate'].'</th>'; |
|
292 | 292 | if ($_SESSION['permissions']['edit']['vehicles']) { |
293 | - echo "<th>" . $lang['edit'] . "</th>"; |
|
293 | + echo "<th>".$lang['edit']."</th>"; |
|
294 | 294 | } |
295 | 295 | echo '</tr></thead><tbody'; |
296 | 296 | echo '<tr>'; |
297 | - echo '<td>' . carName($veh->classname) . '</td>'; |
|
298 | - echo '<td>' . carType($veh->type, $lang) . '</td>'; |
|
299 | - echo '<td>' . $veh->plate . '</td>'; |
|
297 | + echo '<td>'.carName($veh->classname).'</td>'; |
|
298 | + echo '<td>'.carType($veh->type, $lang).'</td>'; |
|
299 | + echo '<td>'.$veh->plate.'</td>'; |
|
300 | 300 | |
301 | 301 | if ($_SESSION['permissions']['edit']['vehicles']) { |
302 | - echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editVeh.php?ID=" . $veh->id . "'>"; |
|
302 | + echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url']."editVeh.php?ID=".$veh->id."'>"; |
|
303 | 303 | echo "<i class='fa fa-pencil'></i></a></td>"; |
304 | 304 | } |
305 | 305 | |
306 | 306 | echo '</tr>'; |
307 | 307 | echo '</tbody></table>'; |
308 | - echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="' . $settings['url'] . 'vehicles/' . $player->playerid . '"> More</a>'; |
|
308 | + echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="'.$settings['url'].'vehicles/'.$player->playerid.'"> More</a>'; |
|
309 | 309 | |
310 | 310 | } else { |
311 | 311 | echo $lang['noVeh']; |
@@ -323,6 +323,6 @@ discard block |
||
323 | 323 | if ($settings['url'] == "/") { |
324 | 324 | include("views/steam/errors/noData.php"); |
325 | 325 | } else { |
326 | - include(realpath($settings['url']) . "views/steam/errors/noData.php"); |
|
326 | + include(realpath($settings['url'])."views/steam/errors/noData.php"); |
|
327 | 327 | } |
328 | 328 | } ?> |
329 | 329 | \ No newline at end of file |
@@ -10,13 +10,17 @@ discard block |
||
10 | 10 | $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' OR `classname` LIKE '%" . $search . "%' OR `name` LIKE '%" . $search . "%' OR `plate` LIKE '" . $search . "' OR `inventory` LIKE '%" . $search . "%';"; |
11 | 11 | $result_of_query = $db_link->query($sql); |
12 | 12 | $total_records = mysqli_num_rows($result_of_query); |
13 | - if ($pageNum > $total_records) $pageNum = $total_records; |
|
13 | + if ($pageNum > $total_records) { |
|
14 | + $pageNum = $total_records; |
|
15 | + } |
|
14 | 16 | $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' OR `classname` LIKE '%" . $search . "%' OR `name` LIKE '%" . $search . "%' OR `plate` LIKE '" . $search . "' OR `inventory` LIKE '%" . $search . "%'" . $max . " ;"; |
15 | 17 | } else { |
16 | 18 | $sql = "SELECT `id` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "';"; |
17 | 19 | $result_of_query = $db_link->query($sql); |
18 | 20 | $total_records = mysqli_num_rows($result_of_query); |
19 | - if ($pageNum > $total_records) $pageNum = $total_records; |
|
21 | + if ($pageNum > $total_records) { |
|
22 | + $pageNum = $total_records; |
|
23 | + } |
|
20 | 24 | $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' " . $max . " ;"; |
21 | 25 | } |
22 | 26 | $result_of_query = $db_link->query($sql); |
@@ -74,4 +78,6 @@ discard block |
||
74 | 78 | </table> |
75 | 79 | </div> |
76 | 80 | <?php |
77 | -} else echo errorMessage(3, $lang); |
|
78 | 81 | \ No newline at end of file |
82 | +} else { |
|
83 | + echo errorMessage(3, $lang); |
|
84 | +} |
@@ -2,22 +2,22 @@ discard block |
||
2 | 2 | $db_link = serverConnect(); |
3 | 3 | require_once("config/carNames.php"); |
4 | 4 | |
5 | -$max = 'LIMIT ' . ($pageNum - 1) * $_SESSION['items'] . ',' . $_SESSION['items']; |
|
5 | +$max = 'LIMIT '.($pageNum - 1) * $_SESSION['items'].','.$_SESSION['items']; |
|
6 | 6 | |
7 | 7 | if (isset($search)) { |
8 | - logAction($_SESSION['user_name'], $lang['searched'] . ' (' . $search . ') ' . $lang['in'] . ' ' . $lang['vehicles'], 1); |
|
8 | + logAction($_SESSION['user_name'], $lang['searched'].' ('.$search.') '.$lang['in'].' '.$lang['vehicles'], 1); |
|
9 | 9 | |
10 | - $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' OR `classname` LIKE '%" . $search . "%' OR `name` LIKE '%" . $search . "%' OR `plate` LIKE '" . $search . "' OR `inventory` LIKE '%" . $search . "%';"; |
|
10 | + $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '".$_SESSION['playerid']."' OR `classname` LIKE '%".$search."%' OR `name` LIKE '%".$search."%' OR `plate` LIKE '".$search."' OR `inventory` LIKE '%".$search."%';"; |
|
11 | 11 | $result_of_query = $db_link->query($sql); |
12 | 12 | $total_records = mysqli_num_rows($result_of_query); |
13 | 13 | if ($pageNum > $total_records) $pageNum = $total_records; |
14 | - $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' OR `classname` LIKE '%" . $search . "%' OR `name` LIKE '%" . $search . "%' OR `plate` LIKE '" . $search . "' OR `inventory` LIKE '%" . $search . "%'" . $max . " ;"; |
|
14 | + $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '".$_SESSION['playerid']."' OR `classname` LIKE '%".$search."%' OR `name` LIKE '%".$search."%' OR `plate` LIKE '".$search."' OR `inventory` LIKE '%".$search."%'".$max." ;"; |
|
15 | 15 | } else { |
16 | - $sql = "SELECT `id` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "';"; |
|
16 | + $sql = "SELECT `id` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '".$_SESSION['playerid']."';"; |
|
17 | 17 | $result_of_query = $db_link->query($sql); |
18 | 18 | $total_records = mysqli_num_rows($result_of_query); |
19 | 19 | if ($pageNum > $total_records) $pageNum = $total_records; |
20 | - $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $_SESSION['playerid'] . "' " . $max . " ;"; |
|
20 | + $sql = "SELECT `id`,`pid`,`classname`,`active`,`type`,`plate`,`alive`,`active` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '".$_SESSION['playerid']."' ".$max." ;"; |
|
21 | 21 | } |
22 | 22 | $result_of_query = $db_link->query($sql); |
23 | 23 | if ($result_of_query->num_rows > 0) { ?> |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | <?php |
55 | 55 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
56 | 56 | echo "<tr>"; |
57 | - echo "<td>" . nameID($row["pid"], $db_link) . "</td>"; |
|
58 | - echo "<td>" . carName($row["classname"]) . "</td>"; |
|
59 | - echo "<td class='hidden-xs'> " . carType($row["type"], $lang) . "</td>"; |
|
60 | - echo "<td class='hidden-xs'> " . $row["plate"] . "</td>"; |
|
61 | - echo "<td class='hidden-xs'> " . yesNo($row["alive"], $lang) . "</td>"; |
|
62 | - echo "<td class='hidden-xs'> " . yesNo($row["active"], $lang) . "</td>"; |
|
57 | + echo "<td>".nameID($row["pid"], $db_link)."</td>"; |
|
58 | + echo "<td>".carName($row["classname"])."</td>"; |
|
59 | + echo "<td class='hidden-xs'> ".carType($row["type"], $lang)."</td>"; |
|
60 | + echo "<td class='hidden-xs'> ".$row["plate"]."</td>"; |
|
61 | + echo "<td class='hidden-xs'> ".yesNo($row["alive"], $lang)."</td>"; |
|
62 | + echo "<td class='hidden-xs'> ".yesNo($row["active"], $lang)."</td>"; |
|
63 | 63 | if ($row["pid"] == $_SESSION['playerid']) { |
64 | - echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editVeh/" . $row["id"] . "'>"; |
|
64 | + echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url']."editVeh/".$row["id"]."'>"; |
|
65 | 65 | echo "<i class='fa fa-pencil'></i></a></td>"; |
66 | 66 | } |
67 | 67 | echo "</tr>"; |
@@ -277,7 +277,9 @@ discard block |
||
277 | 277 | </tbody> |
278 | 278 | </table> |
279 | 279 | <?php echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="' . $settings['url'] . 'houses/' . $player->playerid . '"> More</a>'; |
280 | - } else echo errorMessage(31, $lang); |
|
280 | + } else { |
|
281 | + echo errorMessage(31, $lang); |
|
282 | + } |
|
281 | 283 | < / div > |
282 | 284 | < / div > |
283 | 285 | < ? php } ?> |
@@ -313,7 +315,9 @@ discard block |
||
313 | 315 | echo '</tbody></table>'; |
314 | 316 | echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="' . $settings['url'] . 'vehicles/' . $player->playerid . '"> More</a>'; |
315 | 317 | |
316 | - } else echo errorMessage(31, $lang); |
|
318 | + } else { |
|
319 | + echo errorMessage(31, $lang); |
|
320 | + } |
|
317 | 321 | ?> |
318 | 322 | </div> |
319 | 323 | </div> |
@@ -5,9 +5,9 @@ discard block |
||
5 | 5 | require_once("config/images.php"); |
6 | 6 | require_once("config/license.php"); |
7 | 7 | } else { |
8 | - require_once(realpath($settings['url']) . "config/carNames.php"); |
|
9 | - require_once(realpath($settings['url']) . "config/images.php"); |
|
10 | - require_once(realpath($settings['url']) . "config/license.php"); |
|
8 | + require_once(realpath($settings['url'])."config/carNames.php"); |
|
9 | + require_once(realpath($settings['url'])."config/images.php"); |
|
10 | + require_once(realpath($settings['url'])."config/license.php"); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | $db_link = serverConnect(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | -$sql = "SELECT * FROM `players` WHERE `playerid` = '" . $_SESSION['playerid'] . "'"; |
|
31 | +$sql = "SELECT * FROM `players` WHERE `playerid` = '".$_SESSION['playerid']."'"; |
|
32 | 32 | $result = $db_link->query($sql); |
33 | 33 | if ($result->num_rows > 0) { |
34 | 34 | $player = $result->fetch_object(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $temp .= chr($pGID & 0xFF); |
40 | 40 | $pGID >>= 8; |
41 | 41 | } |
42 | - $pGID = md5('BE' . $temp); |
|
42 | + $pGID = md5('BE'.$temp); |
|
43 | 43 | ?> |
44 | 44 | <div class="col-md-3" style="float:left; padding-top:20px;"> |
45 | 45 | <div class="panel panel-default"> |
@@ -53,27 +53,27 @@ discard block |
||
53 | 53 | $alias = str_replace('"[`', "", $player->aliases); |
54 | 54 | $alias = str_replace('`]"', "", $alias); |
55 | 55 | |
56 | - echo '<center><img alt="' . $alias . '" src="' . $settings['url'] . 'assets/img/uniform/' . getPlayerSkin($player->civ_gear, $playerSkins) . '.jpg">'; |
|
57 | - echo "<h4>" . $lang['aliases'] . ": " . $alias . "</h4>"; |
|
58 | - echo "<h4>" . $lang['uid'] . ": " . $player->uid . "</h4>"; |
|
59 | - echo "<h4>" . $lang['playerID'] . ": " . $player->playerid . "</h4>"; |
|
60 | - echo "<h4 style='word-wrap: break-word;'>" . $lang['GUID'] . ": " . $pGID . "</h4>"; |
|
56 | + echo '<center><img alt="'.$alias.'" src="'.$settings['url'].'assets/img/uniform/'.getPlayerSkin($player->civ_gear, $playerSkins).'.jpg">'; |
|
57 | + echo "<h4>".$lang['aliases'].": ".$alias."</h4>"; |
|
58 | + echo "<h4>".$lang['uid'].": ".$player->uid."</h4>"; |
|
59 | + echo "<h4>".$lang['playerID'].": ".$player->playerid."</h4>"; |
|
60 | + echo "<h4 style='word-wrap: break-word;'>".$lang['GUID'].": ".$pGID."</h4>"; |
|
61 | 61 | ?> |
62 | 62 | <i class="fa fa-2x fa-money"></i> |
63 | - <h4> <?php echo $lang['cash'] . ": " . $player->cash; ?> </h4> |
|
63 | + <h4> <?php echo $lang['cash'].": ".$player->cash; ?> </h4> |
|
64 | 64 | <i style="padding-left:15px;" class="fa fa-2x fa-bank"></i> |
65 | - <h4> <?php echo $lang['bank'] . ": " . $player->bankacc; ?> </h4> |
|
65 | + <h4> <?php echo $lang['bank'].": ".$player->bankacc; ?> </h4> |
|
66 | 66 | <?php |
67 | 67 | if ($player->arrested == 0) { |
68 | - echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-success'>" . $lang["not"] . " " . $lang["arrested"] . "</button></h4>"; |
|
68 | + echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-success'>".$lang["not"]." ".$lang["arrested"]."</button></h4>"; |
|
69 | 69 | } else { |
70 | - echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-theme01'>" . $lang["arrested"] . "</button></h4>"; |
|
70 | + echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-theme01'>".$lang["arrested"]."</button></h4>"; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | if ($player->blacklist == 0) { |
74 | - echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-success'>" . $lang["not"] . " " . $lang["blacklisted"] . "</button></h4>"; |
|
74 | + echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-success'>".$lang["not"]." ".$lang["blacklisted"]."</button></h4>"; |
|
75 | 75 | } else { |
76 | - echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-theme01'>" . $lang["blacklisted"] . "</button></h4>"; |
|
76 | + echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-theme01'>".$lang["blacklisted"]."</button></h4>"; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | echo "</center>"; |
@@ -90,34 +90,34 @@ discard block |
||
90 | 90 | <div class="box1"> |
91 | 91 | <span class="fa fa-3x fa-taxi"></span> |
92 | 92 | |
93 | - <h3> <?php echo $lang['police'] . ": " . $player->coplevel; ?> </h3> |
|
93 | + <h3> <?php echo $lang['police'].": ".$player->coplevel; ?> </h3> |
|
94 | 94 | </div> |
95 | 95 | </div> |
96 | 96 | <div class="col-md-2 col-sm-2 box0"> |
97 | 97 | <div class="box1"> |
98 | 98 | <span class="fa fa-3x fa-ambulance"></span> |
99 | 99 | |
100 | - <h3> <?php echo $lang['medic'] . ": " . $player->mediclevel; ?> </h3> |
|
100 | + <h3> <?php echo $lang['medic'].": ".$player->mediclevel; ?> </h3> |
|
101 | 101 | </div> |
102 | 102 | </div> |
103 | 103 | <div class="col-md-2 col-sm-2 box0"> |
104 | 104 | <div class="box1"> |
105 | 105 | <span class="fa fa-3x fa-usd"></span> |
106 | 106 | |
107 | - <h3> <?php echo $lang['donator'] . ": " . $player->$settings['donorFormat']; ?> </h3> |
|
107 | + <h3> <?php echo $lang['donator'].": ".$player->$settings['donorFormat']; ?> </h3> |
|
108 | 108 | </div> |
109 | 109 | </div> |
110 | 110 | <div class="col-md-2 col-sm-2 box0"> |
111 | 111 | <div class="box1"> |
112 | 112 | <span class="fa fa-3x fa-group"></span> |
113 | 113 | |
114 | - <h3> <?php echo $lang['admin'] . ": " . $player->adminlevel; ?> </h3> |
|
114 | + <h3> <?php echo $lang['admin'].": ".$player->adminlevel; ?> </h3> |
|
115 | 115 | </div> |
116 | 116 | </div> |
117 | 117 | <?php |
118 | 118 | if ($_SESSION['permissions']['view']['steam'] || $uID == $_SESSION['playerid']) { |
119 | 119 | echo '<div class="col-md-2 col-sm-2 box0">'; |
120 | - echo '<a href="http://steamcommunity.com/profiles/' . $row["playerid"] . '"'; |
|
120 | + echo '<a href="http://steamcommunity.com/profiles/'.$row["playerid"].'"'; |
|
121 | 121 | echo 'target="_blank">'; |
122 | 122 | echo '<div class="box1">'; |
123 | 123 | echo '<span class="fa fa-3x fa-steam"></span>'; |
@@ -152,59 +152,59 @@ discard block |
||
152 | 152 | <div id="myTabContent" class="tab-content"> |
153 | 153 | <?php if ($player->playerid == $_SESSION['playerid']) { ?> |
154 | 154 | <div class="tab-pane fade in active well" id="civ_lic"> |
155 | - <h4 style="centred"><?php echo $lang['civ'] . " " . $lang['licenses']; ?> </h4> |
|
155 | + <h4 style="centred"><?php echo $lang['civ']." ".$lang['licenses']; ?> </h4> |
|
156 | 156 | <?php |
157 | 157 | if ($player->civ_licenses !== '"[]"') { |
158 | 158 | $return = stripArray($player->civ_licenses, 0); |
159 | 159 | foreach ($return as $value) { |
160 | 160 | if (strpos($value, "1") == TRUE) { |
161 | 161 | $name = before(',', $value); |
162 | - echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
162 | + echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
163 | 163 | } else { |
164 | 164 | $name = before(',', $value); |
165 | - echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
165 | + echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 | } else { |
169 | - echo errorMessage(37,$lang); |
|
169 | + echo errorMessage(37, $lang); |
|
170 | 170 | }?> |
171 | 171 | </div> |
172 | 172 | <div class="tab-pane well fade" id="medic_lic"> |
173 | - <h4 style="centred"><?php echo $lang['medic'] . " " . $lang['licenses']; ?> </h4> |
|
173 | + <h4 style="centred"><?php echo $lang['medic']." ".$lang['licenses']; ?> </h4> |
|
174 | 174 | <?php |
175 | 175 | if ($player->med_licenses !== '"[]"') { |
176 | - $return = stripArray($player->med_licenses,0); |
|
176 | + $return = stripArray($player->med_licenses, 0); |
|
177 | 177 | |
178 | 178 | foreach ($return as $value) { |
179 | 179 | if (strpos($value, "1") == TRUE) { |
180 | 180 | $name = before(',', $value); |
181 | - echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
181 | + echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
182 | 182 | } else { |
183 | 183 | $name = before(',', $value); |
184 | - echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
184 | + echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | } else { |
188 | - echo errorMessage(37,$lang); |
|
188 | + echo errorMessage(37, $lang); |
|
189 | 189 | } ?> |
190 | 190 | </div> |
191 | 191 | <div class="tab-pane well fade" id="police_lic"> |
192 | - <h4 style="centred"><?php echo $lang['cop'] . " " . $lang['licenses']; ?> </h4> |
|
192 | + <h4 style="centred"><?php echo $lang['cop']." ".$lang['licenses']; ?> </h4> |
|
193 | 193 | <?php |
194 | 194 | if ($player->cop_licenses !== '"[]"') { |
195 | - $return = stripArray($player->cop_licenses,0); |
|
195 | + $return = stripArray($player->cop_licenses, 0); |
|
196 | 196 | |
197 | 197 | foreach ($return as $value) { |
198 | 198 | if (strpos($value, "1") == TRUE) { |
199 | 199 | $name = before(',', $value); |
200 | - echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
200 | + echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
201 | 201 | } else { |
202 | 202 | $name = before(',', $value); |
203 | - echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> "; |
|
203 | + echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license)."</button> "; |
|
204 | 204 | } |
205 | 205 | } |
206 | 206 | } else { |
207 | - echo errorMessage(37,$lang); |
|
207 | + echo errorMessage(37, $lang); |
|
208 | 208 | } |
209 | 209 | ?> |
210 | 210 | </div> |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | |
213 | 213 | <?php if ($player->playerid == $_SESSION['playerid']) { ?> |
214 | 214 | <div class="tab-pane fade well" id="civ_inv"> |
215 | - <h4 style="centred"><?php echo $lang['civ'] . " " . $lang['gear']; ?> </h4> |
|
215 | + <h4 style="centred"><?php echo $lang['civ']." ".$lang['gear']; ?> </h4> |
|
216 | 216 | <?php |
217 | - echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='civ_gear'>" . $player->civ_gear . "</textarea>"; |
|
217 | + echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='civ_gear'>".$player->civ_gear."</textarea>"; |
|
218 | 218 | echo '<br>'; |
219 | 219 | |
220 | 220 | if ($_SESSION['permissions']['edit']['inventory']) { |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | <br> |
226 | 226 | </div> |
227 | 227 | <div class="tab-pane fade well" id="police_inv"> |
228 | - <h4 style="centred"><?php echo $lang['police'] . " " . $lang['gear']; ?> </h4> |
|
228 | + <h4 style="centred"><?php echo $lang['police']." ".$lang['gear']; ?> </h4> |
|
229 | 229 | <?php |
230 | - echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='cop_gear'>" . $player->cop_gear . "</textarea>"; |
|
230 | + echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='cop_gear'>".$player->cop_gear."</textarea>"; |
|
231 | 231 | echo '<br>'; |
232 | 232 | if ($_SESSION['permissions']['edit']['inventory']) { |
233 | 233 | echo '<a data-toggle="modal" href="#edit_cop_inv" class="btn btn-primary btn-xs" style="float: right;">'; |
@@ -237,9 +237,9 @@ discard block |
||
237 | 237 | <br> |
238 | 238 | </div> |
239 | 239 | <div class="tab-pane fade well" id="medic_inv"> |
240 | - <h4 style="centred"><?php echo $lang['medic'] . " " . $lang['gear']; ?> </h4> |
|
240 | + <h4 style="centred"><?php echo $lang['medic']." ".$lang['gear']; ?> </h4> |
|
241 | 241 | <?php |
242 | - echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='med_gear'>" . $player->med_gear . "</textarea>"; |
|
242 | + echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='med_gear'>".$player->med_gear."</textarea>"; |
|
243 | 243 | echo '<br>'; |
244 | 244 | if ($_SESSION['permissions']['edit']['inventory']) { |
245 | 245 | echo '<a data-toggle="modal" href="#edit_med_inv" class="btn btn-primary btn-xs" style="float: right;">'; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | <div class="tab-pane fade" id="house"> |
254 | 254 | <div class="table-responsive"> |
255 | 255 | <?php |
256 | - $sql = "SELECT `pos`,`id` FROM `houses` WHERE `pid` = '" . $player->playerid . "' ORDER BY `id` DESC LIMIT 8"; |
|
256 | + $sql = "SELECT `pos`,`id` FROM `houses` WHERE `pid` = '".$player->playerid."' ORDER BY `id` DESC LIMIT 8"; |
|
257 | 257 | $result_of_query = $db_link->query($sql); |
258 | 258 | if ($result_of_query->num_rows > 0) { |
259 | 259 | ?> |
@@ -268,15 +268,15 @@ discard block |
||
268 | 268 | <?php |
269 | 269 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
270 | 270 | echo "<tr>"; |
271 | - echo "<td>" . $row["pos"] . "</td>"; |
|
272 | - echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editHouse/" . $row["id"] . "'>"; |
|
271 | + echo "<td>".$row["pos"]."</td>"; |
|
272 | + echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url']."editHouse/".$row["id"]."'>"; |
|
273 | 273 | echo "<i class='fa fa-pencil'></i></a></td>"; |
274 | 274 | echo "</tr>"; |
275 | 275 | }; |
276 | 276 | ?> |
277 | 277 | </tbody> |
278 | 278 | </table> |
279 | - <?php echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="' . $settings['url'] . 'houses/' . $player->playerid . '"> More</a>'; |
|
279 | + <?php echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="'.$settings['url'].'houses/'.$player->playerid.'"> More</a>'; |
|
280 | 280 | } else echo errorMessage(31, $lang); |
281 | 281 | < / div > |
282 | 282 | < / div > |
@@ -286,32 +286,32 @@ discard block |
||
286 | 286 | <div class="tab-pane fade" id="veh"> |
287 | 287 | <div class="table-responsive"> |
288 | 288 | <?php |
289 | - $sql = "SELECT `classname`,`type`,`id`,`plate` FROM `vehicles` WHERE `pid` = '" . $player->playerid . "' ORDER BY `id` DESC LIMIT 8"; |
|
289 | + $sql = "SELECT `classname`,`type`,`id`,`plate` FROM `vehicles` WHERE `pid` = '".$player->playerid."' ORDER BY `id` DESC LIMIT 8"; |
|
290 | 290 | $result_of_query = $db_link->query($sql); |
291 | 291 | if ($result_of_query->num_rows > 0) { |
292 | 292 | $veh = $result_of_query->fetch_object(); |
293 | 293 | echo '<table class="table table-bordered table-hover table-striped">'; |
294 | 294 | echo '<thead><tr>'; |
295 | - echo '<th>' . $lang['class'] . '</th>'; |
|
296 | - echo '<th>' . $lang['type'] . '</th>'; |
|
297 | - echo '<th>' . $lang['plate'] . '</th>'; |
|
295 | + echo '<th>'.$lang['class'].'</th>'; |
|
296 | + echo '<th>'.$lang['type'].'</th>'; |
|
297 | + echo '<th>'.$lang['plate'].'</th>'; |
|
298 | 298 | if ($_SESSION['permissions']['edit']['vehicles']) { |
299 | - echo "<th>" . $lang['edit'] . "</th>"; |
|
299 | + echo "<th>".$lang['edit']."</th>"; |
|
300 | 300 | } |
301 | 301 | echo '</tr></thead><tbody'; |
302 | 302 | echo '<tr>'; |
303 | - echo '<td>' . carName($veh->classname) . '</td>'; |
|
304 | - echo '<td>' . carType($veh->type, $lang) . '</td>'; |
|
305 | - echo '<td>' . $veh->plate . '</td>'; |
|
303 | + echo '<td>'.carName($veh->classname).'</td>'; |
|
304 | + echo '<td>'.carType($veh->type, $lang).'</td>'; |
|
305 | + echo '<td>'.$veh->plate.'</td>'; |
|
306 | 306 | |
307 | 307 | if ($_SESSION['permissions']['edit']['vehicles']) { |
308 | - echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editVeh.php?ID=" . $veh->id . "'>"; |
|
308 | + echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url']."editVeh.php?ID=".$veh->id."'>"; |
|
309 | 309 | echo "<i class='fa fa-pencil'></i></a></td>"; |
310 | 310 | } |
311 | 311 | |
312 | 312 | echo '</tr>'; |
313 | 313 | echo '</tbody></table>'; |
314 | - echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="' . $settings['url'] . 'vehicles/' . $player->playerid . '"> More</a>'; |
|
314 | + echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="'.$settings['url'].'vehicles/'.$player->playerid.'"> More</a>'; |
|
315 | 315 | |
316 | 316 | } else echo errorMessage(31, $lang); |
317 | 317 | ?> |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | if ($result_of_query->num_rows >= 1) { |
20 | 20 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
21 | - if ($row['type'] == 'life'){ |
|
21 | + if ($row['type'] == 'life') { |
|
22 | 22 | ?> |
23 | 23 | <li class="list-primary"> |
24 | 24 | <i class=" fa fa-ellipsis-v"></i> |
@@ -30,7 +30,7 @@ |
||
30 | 30 | </div> |
31 | 31 | </div> |
32 | 32 | </li> |
33 | - <?php }elseif ($row['type'] == 'waste') { ?> |
|
33 | + <?php } elseif ($row['type'] == 'waste') { ?> |
|
34 | 34 | <li class="list-danger"> |
35 | 35 | <i class=" fa fa-ellipsis-v"></i> |
36 | 36 | <div class="task-title"> |