@@ -6,8 +6,7 @@ discard block |
||
6 | 6 | $sql = "DELETE FROM `servers` WHERE `dbid`='" . $id . "';"; |
7 | 7 | $result_of_query = $db_connection->query($sql); |
8 | 8 | |
9 | -} |
|
10 | -elseif (isset($_POST['edit'])) { |
|
9 | +} elseif (isset($_POST['edit'])) { |
|
11 | 10 | if (isset($_POST['sql_host'])) { |
12 | 11 | if ($_SESSION['permissions']['super_admin']) { |
13 | 12 | if (formtoken::validateToken($_POST)) { |
@@ -32,8 +31,12 @@ discard block |
||
32 | 31 | $sql = "UPDATE `servers` SET `name`= '" . $name . "',`type`= '" . $type . "',`use_sq`= '" . $usegsq . "' WHERE `dbid`='" . $id . "';"; |
33 | 32 | } |
34 | 33 | $result_of_query = $db_connection->query($sql); |
35 | - } else message($lang['expired']); |
|
36 | - } else logAction($_SESSION['user_name'], $lang['failedUpdate'] . ' ' . $lang['gsq'], 3); |
|
34 | + } else { |
|
35 | + message($lang['expired']); |
|
36 | + } |
|
37 | + } else { |
|
38 | + logAction($_SESSION['user_name'], $lang['failedUpdate'] . ' ' . $lang['gsq'], 3); |
|
39 | + } |
|
37 | 40 | } |
38 | 41 | } |
39 | 42 | $sql = "SELECT * FROM `servers` WHERE `dbid`='" . $id . "';"; |
@@ -116,7 +119,12 @@ discard block |
||
116 | 119 | |
117 | 120 | <script> |
118 | 121 | $(document).ready(function() { |
119 | -if (<?php if ($server->usegsq == 1) echo 'false'; else echo 'true'; ?>) { |
|
122 | +if (<?php if ($server->usegsq == 1) { |
|
123 | + echo 'false'; |
|
124 | +} else { |
|
125 | + echo 'true'; |
|
126 | +} |
|
127 | +?>) { |
|
120 | 128 | $("#sq_details").hide(); |
121 | 129 | }; |
122 | 130 | $("#usegsq").change(function () { |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $id = clean($id, "int"); |
3 | 3 | if (isset($_POST['del']) && $id != 1) { |
4 | - $sql = "DELETE FROM `db` WHERE `dbid`='" . $id . "';"; |
|
4 | + $sql = "DELETE FROM `db` WHERE `dbid`='".$id."';"; |
|
5 | 5 | $result_of_query = $db_connection->query($sql); |
6 | - $sql = "DELETE FROM `servers` WHERE `dbid`='" . $id . "';"; |
|
6 | + $sql = "DELETE FROM `servers` WHERE `dbid`='".$id."';"; |
|
7 | 7 | $result_of_query = $db_connection->query($sql); |
8 | 8 | |
9 | 9 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $pass = encrypt(clean($_POST['sql_pass'], "string")); |
17 | 17 | $name = encrypt(clean($_POST['sql_name'], "string")); |
18 | 18 | |
19 | - $sql = "UPDATE `db` SET `sql_host` = '" . $host . "',`sql_name` = '" . $name . "',`sql_pass` = '" . $pass . "',`sql_user` = '" . $user . "' WHERE `dbid`='" . $id . "';"; |
|
19 | + $sql = "UPDATE `db` SET `sql_host` = '".$host."',`sql_name` = '".$name."',`sql_pass` = '".$pass."',`sql_user` = '".$user."' WHERE `dbid`='".$id."';"; |
|
20 | 20 | $result_of_query = $db_connection->query($sql); |
21 | 21 | |
22 | 22 | $type = clean($_POST['type'], "string"); |
@@ -27,21 +27,21 @@ discard block |
||
27 | 27 | $sq_ip = encrypt(clean($_POST['sq_ip'], "string")); |
28 | 28 | $sq_port = encrypt(clean($_POST['sq_port'], "string")); |
29 | 29 | $rcon_pass = encrypt(clean($_POST['rcon_pass'], "string")); |
30 | - $sql = "UPDATE `servers` SET `name`= '" . $name . "',`type`= '" . $type . "',`use_sq`= '" . $usegsq . "',`sq_port`= '" . $sq_port . "',`sq_ip`= '" . $sq_ip . "',`rcon_pass`= '" . $rcon_pass . "' WHERE `dbid`='" . $id . "';"; |
|
30 | + $sql = "UPDATE `servers` SET `name`= '".$name."',`type`= '".$type."',`use_sq`= '".$usegsq."',`sq_port`= '".$sq_port."',`sq_ip`= '".$sq_ip."',`rcon_pass`= '".$rcon_pass."' WHERE `dbid`='".$id."';"; |
|
31 | 31 | } else { |
32 | - $sql = "UPDATE `servers` SET `name`= '" . $name . "',`type`= '" . $type . "',`use_sq`= '" . $usegsq . "' WHERE `dbid`='" . $id . "';"; |
|
32 | + $sql = "UPDATE `servers` SET `name`= '".$name."',`type`= '".$type."',`use_sq`= '".$usegsq."' WHERE `dbid`='".$id."';"; |
|
33 | 33 | } |
34 | 34 | $result_of_query = $db_connection->query($sql); |
35 | 35 | } else message($lang['expired']); |
36 | - } else logAction($_SESSION['user_name'], $lang['failedUpdate'] . ' ' . $lang['gsq'], 3); |
|
36 | + } else logAction($_SESSION['user_name'], $lang['failedUpdate'].' '.$lang['gsq'], 3); |
|
37 | 37 | } |
38 | 38 | } |
39 | - $sql = "SELECT * FROM `servers` WHERE `dbid`='" . $id . "';"; |
|
39 | + $sql = "SELECT * FROM `servers` WHERE `dbid`='".$id."';"; |
|
40 | 40 | $result_of_query = $db_connection->query($sql); |
41 | 41 | |
42 | 42 | if ($result_of_query->num_rows == 1) { |
43 | 43 | $server = $result_of_query->fetch_object(); |
44 | - $sql = "SELECT `sql_host`,`dbid`,`sql_name`,`sql_pass`,`sql_user` FROM `db` WHERE `dbid`='" . $id . "';"; |
|
44 | + $sql = "SELECT `sql_host`,`dbid`,`sql_name`,`sql_pass`,`sql_user` FROM `db` WHERE `dbid`='".$id."';"; |
|
45 | 45 | $result = $db_connection->query($sql); |
46 | 46 | if ($result->num_rows == 1) { |
47 | 47 | $db = $result->fetch_object(); |
@@ -59,45 +59,45 @@ discard block |
||
59 | 59 | <form method='post' action='<?php echo $settings['url'] ?>editServer/<?php echo $id ?>' id='updateServer' name='updateServer'> |
60 | 60 | <div class="col-md-6"> |
61 | 61 | <?php |
62 | - echo "<h3>" . $lang['database'] . "</h3>"; |
|
63 | - echo "<div class='form-group'><label for='sql_host'>" . $lang['database'] . " " . $lang['host'] . ": </label><input class='form-control' id='sql_host' type='text' name='sql_host' value='" . decrypt($db->sql_host) . "'></div>"; |
|
64 | - echo "<div class='form-group'><label for='sql_user'>" . $lang['database'] . " " . $lang['user'] . ": </label><input class='form-control' id='sql_user' type='text' name='sql_user' value='" . decrypt($db->sql_user) . "'></div>"; |
|
65 | - echo "<div class='form-group'><div class='input-group'><label for='sql_pass'>" . $lang['database'] . " " . $lang['password'] . ": </label><input class='form-control pwd' id='sql_pass' type='password' name='sql_pass' value='" . decrypt($db->sql_pass) . "'>"; |
|
62 | + echo "<h3>".$lang['database']."</h3>"; |
|
63 | + echo "<div class='form-group'><label for='sql_host'>".$lang['database']." ".$lang['host'].": </label><input class='form-control' id='sql_host' type='text' name='sql_host' value='".decrypt($db->sql_host)."'></div>"; |
|
64 | + echo "<div class='form-group'><label for='sql_user'>".$lang['database']." ".$lang['user'].": </label><input class='form-control' id='sql_user' type='text' name='sql_user' value='".decrypt($db->sql_user)."'></div>"; |
|
65 | + echo "<div class='form-group'><div class='input-group'><label for='sql_pass'>".$lang['database']." ".$lang['password'].": </label><input class='form-control pwd' id='sql_pass' type='password' name='sql_pass' value='".decrypt($db->sql_pass)."'>"; |
|
66 | 66 | echo "<span class='input-group-btn'><button style='margin-top: 23px; background-color: #eee;' "; |
67 | 67 | echo "class='btn btn-default reveal' type='button'><i class='fa fa-eye-slash'></i></button></span></div></div>"; |
68 | - echo "<div class='form-group'><label for='sql_name'>" . $lang['database'] . " " . $lang['name'] . ": </label><input class='form-control' id='sql_name' type='text' name='sql_name' value='" . decrypt($db->sql_name) . "'></div>"; |
|
69 | - echo "<div class='form-group'><label for='name'>" . $lang['name'] . ": </label><input class='form-control' id='name' type='text' name='name' value='" . $server->name . "'></div>"; |
|
68 | + echo "<div class='form-group'><label for='sql_name'>".$lang['database']." ".$lang['name'].": </label><input class='form-control' id='sql_name' type='text' name='sql_name' value='".decrypt($db->sql_name)."'></div>"; |
|
69 | + echo "<div class='form-group'><label for='name'>".$lang['name'].": </label><input class='form-control' id='name' type='text' name='name' value='".$server->name."'></div>"; |
|
70 | 70 | ?> |
71 | - <div class='form-group'><label for="type"><?php echo $lang['database'] . " " . $lang['type'] ?>: </label> |
|
71 | + <div class='form-group'><label for="type"><?php echo $lang['database']." ".$lang['type'] ?>: </label> |
|
72 | 72 | <select name="type" id="type" class="form-control"> |
73 | 73 | <option value="life" |
74 | - <?php echo select('life', $server->type) . '>' . $lang['life'] ?></option> |
|
74 | + <?php echo select('life', $server->type).'>'.$lang['life'] ?></option> |
|
75 | 75 | <option value="waste" |
76 | - <?php echo select('waste', $server->type) . '>' . $lang['waste'] ?></option> |
|
76 | + <?php echo select('waste', $server->type).'>'.$lang['waste'] ?></option> |
|
77 | 77 | </select> |
78 | 78 | </div> |
79 | 79 | </div> |
80 | 80 | <div class="col-md-6" style="float:right;"> |
81 | 81 | <h3><?php echo $lang['gsq'] ?></h3> |
82 | - <div class='form-group'><label for="usegsq"><?php echo $lang['use'] . " " . $lang['gsq'] ?>: </label> |
|
82 | + <div class='form-group'><label for="usegsq"><?php echo $lang['use']." ".$lang['gsq'] ?>: </label> |
|
83 | 83 | <select name="usegsq" id="usegsq" class="form-control"> |
84 | 84 | <option value="1" |
85 | - <?php echo select('1', $server->use_sq) . '>' . $lang['yes'] ?></option> |
|
85 | + <?php echo select('1', $server->use_sq).'>'.$lang['yes'] ?></option> |
|
86 | 86 | <option value="0" |
87 | - <?php echo select('0', $server->use_sq) . '>' . $lang['no'] ?></option> |
|
87 | + <?php echo select('0', $server->use_sq).'>'.$lang['no'] ?></option> |
|
88 | 88 | </select> |
89 | 89 | </div> <?php |
90 | - echo "<div id='sq_details'><div class='form-group'><label for='sq_ip'>" . $lang['gsq'] . " " . $lang['gsqa'] . ": </label><input class='form-control' id='sq_ip' type='text' name='sq_ip' value='"; |
|
90 | + echo "<div id='sq_details'><div class='form-group'><label for='sq_ip'>".$lang['gsq']." ".$lang['gsqa'].": </label><input class='form-control' id='sq_ip' type='text' name='sq_ip' value='"; |
|
91 | 91 | if (isset($server->sq_ip)) { |
92 | 92 | echo decrypt($server->sq_ip); |
93 | 93 | } |
94 | 94 | echo "'></div>"; |
95 | - echo "<div class='form-group'><label for='sq_port'>" . $lang['gsq'] . " " . $lang['gsqp'] . ": </label><input class='form-control' id='sq_port' type='text' name='sq_port' value='"; |
|
95 | + echo "<div class='form-group'><label for='sq_port'>".$lang['gsq']." ".$lang['gsqp'].": </label><input class='form-control' id='sq_port' type='text' name='sq_port' value='"; |
|
96 | 96 | if (isset($server->sq_port)) { |
97 | 97 | echo decrypt($server->sq_port); |
98 | 98 | } |
99 | 99 | echo "'></div>"; |
100 | - echo "<div class='form-group'><div class='input-group'><label for='rcon_pass'>" . $lang['gsq'] . " " . $lang['gsrc'] . ": </label><input class='form-control pwd' id='rcon_pass' type='password' name='rcon_pass' value='"; |
|
100 | + echo "<div class='form-group'><div class='input-group'><label for='rcon_pass'>".$lang['gsq']." ".$lang['gsrc'].": </label><input class='form-control pwd' id='rcon_pass' type='password' name='rcon_pass' value='"; |
|
101 | 101 | if (isset($server->rcon_pass)) { |
102 | 102 | echo decrypt($server->rcon_pass); |
103 | 103 | } |
@@ -117,24 +117,32 @@ |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | $dropIn = array_diff($files, array_column($plugins, 'dirname')); |
120 | - if ($dropIn > 0) echo "<h2 style='margin-top: 0;'>" . $lang['dropIn'] . "</h2>"; |
|
120 | + if ($dropIn > 0) { |
|
121 | + echo "<h2 style='margin-top: 0;'>" . $lang['dropIn'] . "</h2>"; |
|
122 | + } |
|
121 | 123 | |
122 | 124 | foreach ($dropIn as &$plugin) { |
123 | 125 | $key = array_search($plugin, array_column($installed, 'dirname')); |
124 | 126 | echo '<div class="col-sm-6 col-md-4"><div class="thumbnail"><div class="caption">'; |
125 | 127 | echo '<h3>' . $installed[$key]['name'] . ' - ' . $installed[$key]['version']; |
126 | 128 | |
127 | - if (in_array($plugin, $settings['plugins'])) |
|
128 | - echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span></small>'; |
|
129 | - else echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>'; |
|
129 | + if (in_array($plugin, $settings['plugins'])) { |
|
130 | + echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span></small>'; |
|
131 | + } else { |
|
132 | + echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>'; |
|
133 | + } |
|
130 | 134 | |
131 | 135 | echo '</h3><p><strong>' . $installed[$key]['author'] . '</strong> - ' . $installed[$key]['description'] . '</p>'; |
132 | 136 | |
133 | - if (in_array($plugin, $settings['plugins'])) |
|
134 | - echo '<p><a href="?deactivate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>'; |
|
135 | - else echo '<p><a href="?activate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>'; |
|
137 | + if (in_array($plugin, $settings['plugins'])) { |
|
138 | + echo '<p><a href="?deactivate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>'; |
|
139 | + } else { |
|
140 | + echo '<p><a href="?activate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>'; |
|
141 | + } |
|
136 | 142 | |
137 | - if (isset($installed[$key]['authurl'])) echo '<a style="margin-left: 5px;" href="' . $installed[$key]['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>'; |
|
143 | + if (isset($installed[$key]['authurl'])) { |
|
144 | + echo '<a style="margin-left: 5px;" href="' . $installed[$key]['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>'; |
|
145 | + } |
|
138 | 146 | echo '<a style="float: right;" href="?delete=' . $plugin . '" class="btn btn-danger" role="button">' . $lang['delete'] . '</a>'; |
139 | 147 | echo '</p></div></div></div>'; |
140 | 148 | } |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if (file_exists("plugins")) { |
3 | - $plugins = json_decode(file_get_contents('http://cyberbyte.org.uk/hooks/cyberworks/plugins.php?id=' . $settings['id']), true); |
|
3 | + $plugins = json_decode(file_get_contents('http://cyberbyte.org.uk/hooks/cyberworks/plugins.php?id='.$settings['id']), true); |
|
4 | 4 | |
5 | 5 | function downloadFile($url) { |
6 | - $newfname = realpath('downloading') . '/plugin.zip'; |
|
6 | + $newfname = realpath('downloading').'/plugin.zip'; |
|
7 | 7 | $folder = realpath('plugins'); |
8 | 8 | $file = fopen($url, "rb"); |
9 | 9 | if ($file) { |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | $objects = scandir($dir); |
38 | 38 | foreach ($objects as $object) { |
39 | 39 | if ($object != "." && $object != "..") { |
40 | - if (filetype($dir . "/" . $object) == "dir") { |
|
41 | - rrmdir($dir . "/" . $object); |
|
40 | + if (filetype($dir."/".$object) == "dir") { |
|
41 | + rrmdir($dir."/".$object); |
|
42 | 42 | } else { |
43 | - unlink($dir . "/" . $object); |
|
43 | + unlink($dir."/".$object); |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | if (isset($_GET['activate'])) { |
59 | 59 | if (!in_array($_GET['activate'], $settings['plugins'])) { |
60 | 60 | array_push($settings['plugins'], $_GET['activate']); |
61 | - $json = json_decode(file_get_contents('plugins/' . $_GET['activate'] . '/plugin.json'), true); |
|
61 | + $json = json_decode(file_get_contents('plugins/'.$_GET['activate'].'/plugin.json'), true); |
|
62 | 62 | if (isset($json['language']) && isset($json['short'])) { |
63 | 63 | $lang = array($json['language'], $json['short']); |
64 | 64 | array_push($settings['installedLanguage'], $lang); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | } |
71 | 71 | } |
72 | - file_put_contents('config/settings.php', '<?php return ' . var_export($settings, true) . ';'); |
|
72 | + file_put_contents('config/settings.php', '<?php return '.var_export($settings, true).';'); |
|
73 | 73 | message($lang['pluginActivated']); |
74 | 74 | } message($lang['activeAlready']); |
75 | 75 | } |
@@ -82,17 +82,17 @@ discard block |
||
82 | 82 | $settings['plugins'] = array_diff($settings['plugins'], array($_GET['deactivate'])); |
83 | 83 | } |
84 | 84 | |
85 | - $json = json_decode(file_get_contents('plugins/' . $_GET['deactivate'] . '/plugin.json'), true); |
|
85 | + $json = json_decode(file_get_contents('plugins/'.$_GET['deactivate'].'/plugin.json'), true); |
|
86 | 86 | if (isset($json['language']) && isset($json['short'])) { |
87 | 87 | $key = array_search($_GET['deactivate'], array_column($settings['installedLanguage'], 0)); |
88 | 88 | unset($settings['installedLanguage'][$key]); |
89 | 89 | } |
90 | - file_put_contents('config/settings.php', '<?php return ' . var_export($settings, true) . ';'); |
|
90 | + file_put_contents('config/settings.php', '<?php return '.var_export($settings, true).';'); |
|
91 | 91 | } message($lang['notActive']); |
92 | 92 | } |
93 | 93 | |
94 | 94 | if (isset($_GET['delete'])) { |
95 | - rrmdir(realpath('plugins') . '/' . $_GET['delete']); |
|
95 | + rrmdir(realpath('plugins').'/'.$_GET['delete']); |
|
96 | 96 | } |
97 | 97 | ?> |
98 | 98 | |
@@ -112,91 +112,91 @@ discard block |
||
112 | 112 | unset($files[1]); |
113 | 113 | |
114 | 114 | foreach ($files as &$file) { |
115 | - $path = 'plugins/' . $file . '/plugin.json'; |
|
115 | + $path = 'plugins/'.$file.'/plugin.json'; |
|
116 | 116 | $installed[] = json_decode(file_get_contents($path), true); |
117 | 117 | } |
118 | 118 | |
119 | 119 | $dropIn = array_diff($files, array_column($plugins, 'dirname')); |
120 | - if ($dropIn > 0) echo "<h2 style='margin-top: 0;'>" . $lang['dropIn'] . "</h2>"; |
|
120 | + if ($dropIn > 0) echo "<h2 style='margin-top: 0;'>".$lang['dropIn']."</h2>"; |
|
121 | 121 | |
122 | 122 | foreach ($dropIn as &$plugin) { |
123 | 123 | $key = array_search($plugin, array_column($installed, 'dirname')); |
124 | 124 | echo '<div class="col-sm-6 col-md-4"><div class="thumbnail"><div class="caption">'; |
125 | - echo '<h3>' . $installed[$key]['name'] . ' - ' . $installed[$key]['version']; |
|
125 | + echo '<h3>'.$installed[$key]['name'].' - '.$installed[$key]['version']; |
|
126 | 126 | |
127 | 127 | if (in_array($plugin, $settings['plugins'])) |
128 | - echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span></small>'; |
|
129 | - else echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>'; |
|
128 | + echo '<small style="padding-left: 6px;"><span class="label label-success">'.$lang['active'].'</span></small>'; |
|
129 | + else echo '<small style="padding-left: 6px;"><span class="label label-default">'.$lang['installed'].'</span></small>'; |
|
130 | 130 | |
131 | - echo '</h3><p><strong>' . $installed[$key]['author'] . '</strong> - ' . $installed[$key]['description'] . '</p>'; |
|
131 | + echo '</h3><p><strong>'.$installed[$key]['author'].'</strong> - '.$installed[$key]['description'].'</p>'; |
|
132 | 132 | |
133 | 133 | if (in_array($plugin, $settings['plugins'])) |
134 | - echo '<p><a href="?deactivate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>'; |
|
135 | - else echo '<p><a href="?activate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>'; |
|
134 | + echo '<p><a href="?deactivate='.$plugin.'" class="btn btn-primary" role="button">'.$lang['deactivate'].'</a>'; |
|
135 | + else echo '<p><a href="?activate='.$plugin.'" class="btn btn-primary" role="button">'.$lang['activate'].'</a>'; |
|
136 | 136 | |
137 | - if (isset($installed[$key]['authurl'])) echo '<a style="margin-left: 5px;" href="' . $installed[$key]['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>'; |
|
138 | - echo '<a style="float: right;" href="?delete=' . $plugin . '" class="btn btn-danger" role="button">' . $lang['delete'] . '</a>'; |
|
137 | + if (isset($installed[$key]['authurl'])) echo '<a style="margin-left: 5px;" href="'.$installed[$key]['authurl'].'" class="btn btn-default" role="button">'.$lang['visitSite'].'</a>'; |
|
138 | + echo '<a style="float: right;" href="?delete='.$plugin.'" class="btn btn-danger" role="button">'.$lang['delete'].'</a>'; |
|
139 | 139 | echo '</p></div></div></div>'; |
140 | 140 | } |
141 | - echo "<div class='row'></div><h2>" . $lang['pluginstore'] . "</h2>"; |
|
141 | + echo "<div class='row'></div><h2>".$lang['pluginstore']."</h2>"; |
|
142 | 142 | |
143 | 143 | foreach ($plugins as &$plugin) { |
144 | 144 | echo '<div class="col-sm-6 col-md-4"><div class="thumbnail">'; |
145 | - echo '<img src="' . $plugin['image'] . '" alt="' . $plugin['name'] . '">'; |
|
145 | + echo '<img src="'.$plugin['image'].'" alt="'.$plugin['name'].'">'; |
|
146 | 146 | echo '<div class="caption">'; |
147 | - echo '<h3>' . $plugin['name'] . ' - ' . $plugin['version']; |
|
147 | + echo '<h3>'.$plugin['name'].' - '.$plugin['version']; |
|
148 | 148 | |
149 | 149 | $key = array_search($plugin['dirname'], array_column($installed, 'dirname')); |
150 | 150 | |
151 | 151 | if ($key !== false) { |
152 | 152 | if (in_array($plugin['dirname'], $settings['plugins'])) { |
153 | 153 | if ($plugin['version'] > $installed[$key]['version']) { |
154 | - echo '<small style="padding-left: 6px;"><span class="label label-info">' . $lang['updateAvalible'] . '</span></small>'; |
|
154 | + echo '<small style="padding-left: 6px;"><span class="label label-info">'.$lang['updateAvalible'].'</span></small>'; |
|
155 | 155 | } |
156 | 156 | // Update avalible |
157 | 157 | else { |
158 | - echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span>'; |
|
158 | + echo '<small style="padding-left: 6px;"><span class="label label-success">'.$lang['active'].'</span>'; |
|
159 | 159 | } |
160 | 160 | // Active plugin |
161 | 161 | } elseif (in_array($plugin['dirname'], $files)) { |
162 | - echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>'; |
|
162 | + echo '<small style="padding-left: 6px;"><span class="label label-default">'.$lang['installed'].'</span></small>'; |
|
163 | 163 | } |
164 | 164 | // Installed not active |
165 | 165 | } |
166 | - echo '</h3><p><strong>' . $plugin['author'] . '</strong> - ' . $plugin['description'] . '</p>'; |
|
166 | + echo '</h3><p><strong>'.$plugin['author'].'</strong> - '.$plugin['description'].'</p>'; |
|
167 | 167 | |
168 | 168 | if ($key !== false) { |
169 | 169 | if (in_array($plugin['dirname'], $settings['plugins'])) { |
170 | 170 | if ($plugin['version'] > $installed[$key]['version']) { |
171 | - echo '<div><a href="?install=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['update'] . '</a>'; |
|
171 | + echo '<div><a href="?install='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['update'].'</a>'; |
|
172 | 172 | } |
173 | 173 | // Update avalible |
174 | 174 | else { |
175 | - echo '<p><a href="?deactivate=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>'; |
|
175 | + echo '<p><a href="?deactivate='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['deactivate'].'</a>'; |
|
176 | 176 | } |
177 | 177 | // Active plugin |
178 | 178 | } elseif (in_array($plugin['dirname'], $files)) { |
179 | - echo '<p><a href="?activate=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>'; |
|
179 | + echo '<p><a href="?activate='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['activate'].'</a>'; |
|
180 | 180 | } |
181 | 181 | // Installed not active |
182 | 182 | } else { |
183 | - echo '<p><a href="?install=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['install'] . '</a>'; |
|
183 | + echo '<p><a href="?install='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['install'].'</a>'; |
|
184 | 184 | } |
185 | 185 | // Not installed |
186 | 186 | |
187 | 187 | if (isset($plugin['authurl'])) { |
188 | - echo '<a style="margin-left: 5px;" href="' . $plugin['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>'; |
|
188 | + echo '<a style="margin-left: 5px;" href="'.$plugin['authurl'].'" class="btn btn-default" role="button">'.$lang['visitSite'].'</a>'; |
|
189 | 189 | } |
190 | 190 | if (in_array($plugin['dirname'], $files)) { |
191 | - echo '<a style="float: right;" href="?delete=' . $plugin['dirname'] . '" class="btn btn-danger" role="button">' . $lang['delete'] . '</a></div>'; |
|
191 | + echo '<a style="float: right;" href="?delete='.$plugin['dirname'].'" class="btn btn-danger" role="button">'.$lang['delete'].'</a></div>'; |
|
192 | 192 | } |
193 | 193 | echo '</div></div></div>'; |
194 | 194 | } |
195 | 195 | |
196 | 196 | echo '</div></div></form>'; |
197 | 197 | } else { |
198 | - echo '<h2>' . $lang['notverified'] . '</h2>'; |
|
198 | + echo '<h2>'.$lang['notverified'].'</h2>'; |
|
199 | 199 | } |
200 | 200 | } else { |
201 | - echo '<h2>' . $lang['noPlugin'] . '</h2>'; |
|
201 | + echo '<h2>'.$lang['noPlugin'].'</h2>'; |
|
202 | 202 | } |
@@ -75,7 +75,8 @@ discard block |
||
75 | 75 | <input placeholder="SQ IP" id="server_SQ_host" |
76 | 76 | class=" form-control login_input" type="text" |
77 | 77 | name="server_SQ_host" |
78 | - <?php if (isset($_POST['server_SQ_host'])) echo 'value="' . $_POST['server_SQ_host'] . '"' ?> autocorrect="off" autocapitalize="off"> |
|
78 | + <?php if (isset($_POST['server_SQ_host'])) { |
|
79 | + echo 'value="' . $_POST['server_SQ_host'] . '"' ?> autocorrect="off" autocapitalize="off"> |
|
79 | 80 | </div> |
80 | 81 | <div class="form-group"> |
81 | 82 | <label for="server_SQ_port">SQ port: </label> |
@@ -93,6 +94,7 @@ discard block |
||
93 | 94 | <?php |
94 | 95 | $sql = "SELECT `dbid`,`sql_name` FROM `db`;"; |
95 | 96 | } |
97 | +} |
|
96 | 98 | $result_of_query = $db_connection->query($sql); |
97 | 99 | if ($result_of_query->num_rows >= 1) { |
98 | 100 | echo '<div class="form-group"><label for="server_dbid">Database: </label>'; |
@@ -5,10 +5,10 @@ discard block |
||
5 | 5 | if ($dbid == 'none') { |
6 | 6 | $server_type = 'life'; |
7 | 7 | |
8 | - $sql = "INSERT INTO `db` (`type`, `sql_host`, `sql_user`, `sql_pass`, `sql_name`) VALUES ('" . $server_type . "', '" . $settings['db']['host'] . "', '" . $settings['db']['user'] . "', '" . $settings['db']['pass'] . "', '" . $settings['db']['name'] . "');"; |
|
8 | + $sql = "INSERT INTO `db` (`type`, `sql_host`, `sql_user`, `sql_pass`, `sql_name`) VALUES ('".$server_type."', '".$settings['db']['host']."', '".$settings['db']['user']."', '".$settings['db']['pass']."', '".$settings['db']['name']."');"; |
|
9 | 9 | $result_of_query = $db_connection->query($sql); |
10 | 10 | |
11 | - $sql = "SELECT `dbid` FROM `db` WHERE `sql_name` = '" . $SQL_name . "';"; |
|
11 | + $sql = "SELECT `dbid` FROM `db` WHERE `sql_name` = '".$SQL_name."';"; |
|
12 | 12 | $result_of_query = $db_connection->query($sql); |
13 | 13 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
14 | 14 | $dbid = $row['dbid']; |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | $server_RCON_pass = encrypt($_POST['server_RCON_pass']); |
28 | 28 | |
29 | 29 | $sql = "INSERT INTO `servers` (`name`, `dbid`, `type`, `use_sq`, `sq_port`,`sq_ip`, `rcon_pass`) VALUES |
30 | - ('" . $server_name . "', '" . $dbid . "', '" . $server_type . "', '" . $server_SQ . "', '" . $server_SQ_port . "', '" . $server_SQ_host . "', '" . $server_RCON_pass . "');"; |
|
30 | + ('" . $server_name."', '".$dbid."', '".$server_type."', '".$server_SQ."', '".$server_SQ_port."', '".$server_SQ_host."', '".$server_RCON_pass."');"; |
|
31 | 31 | } |
32 | 32 | } else { |
33 | 33 | $sql = "INSERT INTO `servers` (`name`, `dbid`, `type`, `use_sq`) VALUES |
34 | - ('" . $server_name . "', '" . $dbid . "', '" . $server_type . "', '" . $server_SQ . "');"; |
|
34 | + ('" . $server_name."', '".$dbid."', '".$server_type."', '".$server_SQ."');"; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $result_of_query = $db_connection->query($sql); |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | <form method="post" action="newServer" name="newServer" id="newServer"> |
47 | 47 | <?php echo formtoken::getField() ?> |
48 | 48 | <h2 class="form-login-heading"> |
49 | - <?php echo $lang['new'] . ' ' . $lang['gameServers'] ?> |
|
49 | + <?php echo $lang['new'].' '.$lang['gameServers'] ?> |
|
50 | 50 | </h2> |
51 | 51 | <div class="form-group"> |
52 | 52 | <label for="server_name">Server Name: </label> |
53 | 53 | <input placeholder="Server Name" id="server_name" class=" form-control login_input" type="text" name="server_name" |
54 | 54 | <?php if (isset($_POST['server_name'])) { |
55 | - echo 'value="' . $_POST['server_name'] . '"' ?> |
|
55 | + echo 'value="'.$_POST['server_name'].'"' ?> |
|
56 | 56 | autocorrect="off" required> |
57 | 57 | </div> |
58 | 58 | <div class="form-group"> |
@@ -75,19 +75,19 @@ discard block |
||
75 | 75 | <input placeholder="SQ IP" id="server_SQ_host" |
76 | 76 | class=" form-control login_input" type="text" |
77 | 77 | name="server_SQ_host" |
78 | - <?php if (isset($_POST['server_SQ_host'])) echo 'value="' . $_POST['server_SQ_host'] . '"' ?> autocorrect="off" autocapitalize="off"> |
|
78 | + <?php if (isset($_POST['server_SQ_host'])) echo 'value="'.$_POST['server_SQ_host'].'"' ?> autocorrect="off" autocapitalize="off"> |
|
79 | 79 | </div> |
80 | 80 | <div class="form-group"> |
81 | 81 | <label for="server_SQ_port">SQ port: </label> |
82 | 82 | <input placeholder="SQ Port" id="server_SQ_port" |
83 | 83 | class=" form-control login_input" type="text" |
84 | 84 | name="server_SQ_port" |
85 | - <?php if (isset($_POST['server_SQ_port'])) echo 'value="' . $_POST['server_SQ_port'] . '"' ?> autocorrect="off" autocapitalize="off" autocomplete="off"> |
|
85 | + <?php if (isset($_POST['server_SQ_port'])) echo 'value="'.$_POST['server_SQ_port'].'"' ?> autocorrect="off" autocapitalize="off" autocomplete="off"> |
|
86 | 86 | </div> |
87 | 87 | <div class="form-group"> |
88 | 88 | <label for="server_RCON_pass">RCON Password: </label> |
89 | 89 | <input placeholder="RCON Password" id="server_RCON_pass" class=" form-control login_input" type="password" name="server_RCON_pass" |
90 | - <?php if (isset($_POST['server_RCON_pass'])) echo 'value="' . $_POST['server_RCON_pass'] . '"' ?> autocorrect="off" autocapitalize="off" autocomplete="off"> |
|
90 | + <?php if (isset($_POST['server_RCON_pass'])) echo 'value="'.$_POST['server_RCON_pass'].'"' ?> autocorrect="off" autocapitalize="off" autocomplete="off"> |
|
91 | 91 | </div> |
92 | 92 | </div> |
93 | 93 | <?php |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | echo '<div class="form-group"><label for="server_dbid">Database: </label>'; |
99 | 99 | echo '<select id="server_dbid" name="server_dbid" class="form-control login_input">'; |
100 | 100 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
101 | - echo '<option value="' . $row['dbid'] . '">' . decrypt($row['sql_name'], $settings['key']) . '</option>'; |
|
101 | + echo '<option value="'.$row['dbid'].'">'.decrypt($row['sql_name'], $settings['key']).'</option>'; |
|
102 | 102 | } |
103 | 103 | echo '</select></div>'; |
104 | 104 | } else { |
@@ -103,7 +103,10 @@ discard block |
||
103 | 103 | invalid: 'fa fa-times', |
104 | 104 | validating: 'fa fa-refresh' |
105 | 105 | }, |
106 | - locale: '<?php if (isset($_SESSION['forum_lang'])) echo $_SESSION['forum_lang']; else echo 'en_US' ?>', |
|
106 | + locale: '<?php if (isset($_SESSION['forum_lang'])) { |
|
107 | + echo $_SESSION['forum_lang']; |
|
108 | +} else { |
|
109 | + echo 'en_US' ?>', |
|
107 | 110 | fields: { |
108 | 111 | email: { |
109 | 112 | validators: { |
@@ -131,7 +134,9 @@ discard block |
||
131 | 134 | regexp: /^\d{15,25}$/ |
132 | 135 | }, |
133 | 136 | remote: { |
134 | - url: '<?php echo $settings['url']; ?>validators/pid.php', |
|
137 | + url: '<?php echo $settings['url']; |
|
138 | +} |
|
139 | +?>validators/pid.php', |
|
135 | 140 | type: 'POST', |
136 | 141 | message: '<?php echo $lang['failPID'] ?>' |
137 | 142 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | $user_pic = $_POST['user_pic']; |
6 | 6 | $pId = $_POST['player_id']; |
7 | 7 | $_SESSION['user_profile'] = $user_pic; |
8 | - $sql = "UPDATE `users` SET `user_email`= '" . $email . "',`playerid`= '" . $pId . "', `user_profile`= '" . $user_pic . "'WHERE `user_id` = '" . $_SESSION['user_id'] . "' "; |
|
8 | + $sql = "UPDATE `users` SET `user_email`= '".$email."',`playerid`= '".$pId."', `user_profile`= '".$user_pic."'WHERE `user_id` = '".$_SESSION['user_id']."' "; |
|
9 | 9 | $result_of_query = $db_connection->query($sql); |
10 | 10 | } else { |
11 | 11 | message($lang['expired']); |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | } |
14 | 14 | if (isset($_POST['user_password'])) { |
15 | 15 | if (formtoken::validateToken($_POST)) { |
16 | - $sql = "SELECT `user_password_hash` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';"; |
|
16 | + $sql = "SELECT `user_password_hash` FROM `users` WHERE `user_id` = '".$_SESSION['user_id']."';"; |
|
17 | 17 | $result = $db_connection->query($sql)->fetch_object(); |
18 | - if ($_POST['user_password'] == $_POST['user_password_again'] && password_verify($_POST['current_password'],$result->user_password_hash)) { |
|
19 | - $sql = "UPDATE `users` SET `user_password_hash`= '" . password_hash($_POST['user_password'], PASSWORD_DEFAULT) . "' WHERE `user_id` = '" . $_SESSION['user_id'] . "';"; |
|
18 | + if ($_POST['user_password'] == $_POST['user_password_again'] && password_verify($_POST['current_password'], $result->user_password_hash)) { |
|
19 | + $sql = "UPDATE `users` SET `user_password_hash`= '".password_hash($_POST['user_password'], PASSWORD_DEFAULT)."' WHERE `user_id` = '".$_SESSION['user_id']."';"; |
|
20 | 20 | $result_of_query = $db_connection->query($sql); |
21 | 21 | message($lang['passChanged']); |
22 | 22 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
28 | -$sql = "SELECT * FROM `users` WHERE `user_name` ='" . $_SESSION['user_name'] . "';"; |
|
28 | +$sql = "SELECT * FROM `users` WHERE `user_name` ='".$_SESSION['user_name']."';"; |
|
29 | 29 | $profile = $db_connection->query($sql)->fetch_object(); |
30 | 30 | ?> |
31 | 31 | <div class="row"> |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | <div class="panel-body"> |
45 | 45 | <div class="row"> |
46 | 46 | <div style="padding-top:4%;" class="col-md-3 col-lg-3 " align="center"> |
47 | - <?php if(!isset($_SESSION['profile_link'])) { |
|
48 | - if(isset($_SESSION['user_email']) && $settings['gravatar']) { ?> |
|
49 | - <a href="<?php echo $settings['url'] . 'profile' ?>"> <img alt="User Pic" src="<?php getGravatar($_SESSION['user_email'],64,'retro') ?>" class="img-circle img-responsive"></a> |
|
47 | + <?php if (!isset($_SESSION['profile_link'])) { |
|
48 | + if (isset($_SESSION['user_email']) && $settings['gravatar']) { ?> |
|
49 | + <a href="<?php echo $settings['url'].'profile' ?>"> <img alt="User Pic" src="<?php getGravatar($_SESSION['user_email'], 64, 'retro') ?>" class="img-circle img-responsive"></a> |
|
50 | 50 | <?php } else {?> |
51 | - <a href="<?php echo $settings['url'] . 'profile' ?>"> <img alt="User Pic" src="<?php echo $settings['url'] . 'assets/img/profile/' . $_SESSION['user_profile'] . '.jpg' ?>" class="img-circle img-responsive"></a> |
|
51 | + <a href="<?php echo $settings['url'].'profile' ?>"> <img alt="User Pic" src="<?php echo $settings['url'].'assets/img/profile/'.$_SESSION['user_profile'].'.jpg' ?>" class="img-circle img-responsive"></a> |
|
52 | 52 | <?php } ?> |
53 | 53 | <?php } else { ?> |
54 | - <img alt="User Pic" src="<?php echo $settings['url'] . 'assets/img/profile/' . $_SESSION['user_profile'] . '.jpg' ?>" class="img-circle img-responsive"> |
|
54 | + <img alt="User Pic" src="<?php echo $settings['url'].'assets/img/profile/'.$_SESSION['user_profile'].'.jpg' ?>" class="img-circle img-responsive"> |
|
55 | 55 | <?php } ?> |
56 | 56 | </div> |
57 | 57 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | <tbody> |
61 | 61 | <tr> |
62 | 62 | <td><?php echo $lang['rank'] ?>:</td> |
63 | - <td><?php echo $settings['ranks'][$profile->user_level] . " (" . $profile->user_level . ")" ?></td> |
|
63 | + <td><?php echo $settings['ranks'][$profile->user_level]." (".$profile->user_level.")" ?></td> |
|
64 | 64 | </tr> |
65 | 65 | <form method="post" action="profile" name="profileEdit" id="profileEdit"> |
66 | 66 | <?php echo formtoken::getField(); ?> |
@@ -78,26 +78,26 @@ discard block |
||
78 | 78 | <select id='user_pic' name='user_pic' class='form-control'>"; |
79 | 79 | <?php |
80 | 80 | for ($icon = 1; $icon < 6; $icon++) { |
81 | - echo '<option value="' . $icon . '" ' . select($icon, $profile->user_profile) . '>' . $settings['names'][$icon] . '</option>'; |
|
81 | + echo '<option value="'.$icon.'" '.select($icon, $profile->user_profile).'>'.$settings['names'][$icon].'</option>'; |
|
82 | 82 | } |
83 | 83 | ?> |
84 | 84 | </select> |
85 | 85 | </td> |
86 | 86 | </tr> |
87 | 87 | <tr> |
88 | - <td><?php echo $lang['current'] . " " . $lang['password'] ?></td> |
|
88 | + <td><?php echo $lang['current']." ".$lang['password'] ?></td> |
|
89 | 89 | <td> |
90 | 90 | <input type="password" id="current_password" name="current_password" class="form-control" autocorrect="off" autocapitalize="off" autocomplete="off"> |
91 | 91 | </td> |
92 | 92 | </tr> |
93 | 93 | <tr> |
94 | - <td><?php echo "New " . $lang['password'] ?></td> |
|
94 | + <td><?php echo "New ".$lang['password'] ?></td> |
|
95 | 95 | <td> |
96 | 96 | <input type="password" id="user_password" name="user_password" class="form-control" autocorrect="off" autocapitalize="off" autocomplete="off"> |
97 | 97 | </td> |
98 | 98 | </tr> |
99 | 99 | <tr> |
100 | - <td><?php echo $lang['repeat'] . " New " . $lang['password'] ?></td> |
|
100 | + <td><?php echo $lang['repeat']." New ".$lang['password'] ?></td> |
|
101 | 101 | <td> |
102 | 102 | <input type="password" id="user_password_again" name="user_password_again" autocorrect="off" class="form-control" autocapitalize="off" autocomplete="off"> |
103 | 103 | </td> |
@@ -22,13 +22,19 @@ discard block |
||
22 | 22 | <p>Username:</p> |
23 | 23 | <input id="user_name" type="text" class="form-control" |
24 | 24 | placeholder="Username (only letters and numbers, 2 to 30 characters)" autofocus |
25 | - name="user_name" <?php if (isset($_POST['user_name'])) echo 'value="' . $_POST['user_name'] . '"'; ?> required> |
|
25 | + name="user_name" <?php if (isset($_POST['user_name'])) { |
|
26 | + echo 'value="' . $_POST['user_name'] . '"'; |
|
27 | +} |
|
28 | +?> required> |
|
26 | 29 | </div> |
27 | 30 | |
28 | 31 | <div class="form-group"> |
29 | 32 | <p>Email Address:</p> |
30 | 33 | <input id="user_email" placeholder="User's email" class=" form-control" type="email" |
31 | - name="user_email" <?php if (isset($_POST['user_name'])) echo 'value="' . $_POST['user_name'] . '"'; ?> required/> |
|
34 | + name="user_email" <?php if (isset($_POST['user_name'])) { |
|
35 | + echo 'value="' . $_POST['user_name'] . '"'; |
|
36 | +} |
|
37 | +?> required/> |
|
32 | 38 | </div> |
33 | 39 | <div class="form-group"> |
34 | 40 | <p>Password:</p> |
@@ -47,7 +53,9 @@ discard block |
||
47 | 53 | <select class=" form-control" name="profile_pic"> |
48 | 54 | <?php for ($icon = 1; $icon <= 6; $icon++) { |
49 | 55 | echo '<option value="' . $icon . '" '; |
50 | - if (isset($_POST['user_name'])) if ($icon == $_POST['user_name']) echo 'selected'; |
|
56 | + if (isset($_POST['user_name'])) { |
|
57 | + if ($icon == $_POST['user_name']) echo 'selected'; |
|
58 | + } |
|
51 | 59 | echo '>' . $settings['names'][$icon] . '</option>'; |
52 | 60 | } ?> |
53 | 61 | </select> |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | <p>Username:</p> |
23 | 23 | <input id="user_name" type="text" class="form-control" |
24 | 24 | placeholder="Username (only letters and numbers, 2 to 30 characters)" autofocus |
25 | - name="user_name" <?php if (isset($_POST['user_name'])) echo 'value="' . $_POST['user_name'] . '"'; ?> required> |
|
25 | + name="user_name" <?php if (isset($_POST['user_name'])) echo 'value="'.$_POST['user_name'].'"'; ?> required> |
|
26 | 26 | </div> |
27 | 27 | |
28 | 28 | <div class="form-group"> |
29 | 29 | <p>Email Address:</p> |
30 | 30 | <input id="user_email" placeholder="User's email" class=" form-control" type="email" |
31 | - name="user_email" <?php if (isset($_POST['user_name'])) echo 'value="' . $_POST['user_name'] . '"'; ?> required/> |
|
31 | + name="user_email" <?php if (isset($_POST['user_name'])) echo 'value="'.$_POST['user_name'].'"'; ?> required/> |
|
32 | 32 | </div> |
33 | 33 | <div class="form-group"> |
34 | 34 | <p>Password:</p> |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | <p>Profile Picture:</p> |
47 | 47 | <select class=" form-control" name="profile_pic"> |
48 | 48 | <?php for ($icon = 1; $icon <= 6; $icon++) { |
49 | - echo '<option value="' . $icon . '" '; |
|
49 | + echo '<option value="'.$icon.'" '; |
|
50 | 50 | if (isset($_POST['user_name'])) if ($icon == $_POST['user_name']) echo 'selected'; |
51 | - echo '>' . $settings['names'][$icon] . '</option>'; |
|
51 | + echo '>'.$settings['names'][$icon].'</option>'; |
|
52 | 52 | } ?> |
53 | 53 | </select> |
54 | 54 | </div> |
@@ -13,9 +13,15 @@ discard block |
||
13 | 13 | if ($total_pages > 5) { |
14 | 14 | $start = $pageNum - 2; |
15 | 15 | $end = $pageNum + 2; |
16 | - if ($pageNum < 4) $start = 1; |
|
17 | - if ($pageNum < 2) $end += 1; |
|
18 | - if ($pageNum < 3) $end += 1; |
|
16 | + if ($pageNum < 4) { |
|
17 | + $start = 1; |
|
18 | + } |
|
19 | + if ($pageNum < 2) { |
|
20 | + $end += 1; |
|
21 | + } |
|
22 | + if ($pageNum < 3) { |
|
23 | + $end += 1; |
|
24 | + } |
|
19 | 25 | |
20 | 26 | if ($pageNum > $total_pages - 2) {$start -= 1; $end -= 1; } |
21 | 27 | if ($pageNum > $total_pages - 1) {$start -= 1; $end -= 1; } |
@@ -26,7 +32,9 @@ discard block |
||
26 | 32 | |
27 | 33 | for ($i = $start; $i <= $end; $i++) { |
28 | 34 | echo '<li'; |
29 | - if ($i == $pageNum) echo ' class="active"'; |
|
35 | + if ($i == $pageNum) { |
|
36 | + echo ' class="active"'; |
|
37 | + } |
|
30 | 38 | echo '><a href="?page=' . $i . '">' . $i . '</a></li>'; |
31 | 39 | }; ?> |
32 | 40 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | for ($i = $start; $i <= $end; $i++) { |
28 | 28 | echo '<li'; |
29 | 29 | if ($i == $pageNum) echo ' class="active"'; |
30 | - echo '><a href="?page=' . $i . '">' . $i . '</a></li>'; |
|
30 | + echo '><a href="?page='.$i.'">'.$i.'</a></li>'; |
|
31 | 31 | }; ?> |
32 | 32 | |
33 | 33 | <li> |
@@ -40,7 +40,9 @@ |
||
40 | 40 | ?> |
41 | 41 | <h5 class="centered"> |
42 | 42 | <?php |
43 | - if ($_SESSION['steamsignon']) echo '<i class="fa fa-steam-square"></i>'; |
|
43 | + if ($_SESSION['steamsignon']) { |
|
44 | + echo '<i class="fa fa-steam-square"></i>'; |
|
45 | + } |
|
44 | 46 | echo $_SESSION['user_name']; ?> |
45 | 47 | </h5> |
46 | 48 |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | <p class="centered"> |
22 | 22 | <?php if (!isset($_SESSION['profile_link'])) { |
23 | 23 | if (isset($_SESSION['user_email']) && $settings['gravatar']) { |
24 | - echo '<a href="' . $settings['url'] . 'profile">'; |
|
25 | - echo '<img src="' . getGravatar($_SESSION['user_email'],64,'retro') . '" class="img-circle" width="60" height="60"></a></p>'; |
|
24 | + echo '<a href="'.$settings['url'].'profile">'; |
|
25 | + echo '<img src="'.getGravatar($_SESSION['user_email'], 64, 'retro').'" class="img-circle" width="60" height="60"></a></p>'; |
|
26 | 26 | } else { |
27 | - echo '<a href="' . $settings['url'] . 'profile">'; |
|
28 | - echo '<img src="' . $settings['url'] . 'assets/img/profile/' . $_SESSION['user_profile'] . '.jpg"'; |
|
27 | + echo '<a href="'.$settings['url'].'profile">'; |
|
28 | + echo '<img src="'.$settings['url'].'assets/img/profile/'.$_SESSION['user_profile'].'.jpg"'; |
|
29 | 29 | echo 'class="img-circle" width="60" height="60"></a></p>'; |
30 | 30 | } |
31 | 31 | } else { |
32 | - echo '<a href="' . $_SESSION['profile_link'] . '" target="_blank">'; |
|
33 | - echo '<img src="' . $_SESSION['user_profile'] . '"'; |
|
32 | + echo '<a href="'.$_SESSION['profile_link'].'" target="_blank">'; |
|
33 | + echo '<img src="'.$_SESSION['user_profile'].'"'; |
|
34 | 34 | echo 'class="img-circle" width="64" height="64"></a></p>'; |
35 | 35 | } |
36 | 36 | ?> |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | </li> |
49 | 49 | |
50 | 50 | <?php |
51 | - if(isset($_SESSION['server_type'])) |
|
51 | + if (isset($_SESSION['server_type'])) |
|
52 | 52 | { |
53 | - switch($_SESSION['server_type']) |
|
53 | + switch ($_SESSION['server_type']) |
|
54 | 54 | { |
55 | 55 | case 'life': |
56 | 56 | include("views/life/nav.php"); |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | foreach ($settings['plugins'] as &$plugin) { |
61 | - if (file_exists("plugins/". $plugin. "/nav.php")) { |
|
62 | - include("plugins/". $plugin."/nav.php"); |
|
61 | + if (file_exists("plugins/".$plugin."/nav.php")) { |
|
62 | + include("plugins/".$plugin."/nav.php"); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -135,19 +135,19 @@ discard block |
||
135 | 135 | <li> |
136 | 136 | <a href="<?php echo $settings['url'] ?>newDB"> |
137 | 137 | <i class="fa fa-fw fa-plus"></i> |
138 | - <span><?php echo $lang['new'] . ' ' . $lang['database'] ?></span> |
|
138 | + <span><?php echo $lang['new'].' '.$lang['database'] ?></span> |
|
139 | 139 | </a> |
140 | 140 | </li> |
141 | 141 | <li> |
142 | 142 | <a href="<?php echo $settings['url'] ?>newServer"> |
143 | 143 | <i class="fa fa-fw fa-plus"></i> |
144 | - <span><?php echo $lang['new'] . ' ' . $lang['server'] ?></span> |
|
144 | + <span><?php echo $lang['new'].' '.$lang['server'] ?></span> |
|
145 | 145 | </a> |
146 | 146 | </li> |
147 | 147 | <li> |
148 | 148 | <a href="<?php echo $settings['url'] ?>servers"> |
149 | 149 | <i class="fa fa-fw fa-cogs"></i> |
150 | - <span><?php echo $lang['edit'] . ' ' . $lang['databases'] ?></span> |
|
150 | + <span><?php echo $lang['edit'].' '.$lang['databases'] ?></span> |
|
151 | 151 | </a> |
152 | 152 | </li> |
153 | 153 | <li> |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | <li> |
171 | 171 | <a data-toggle="modal" href="#changeDB"> |
172 | 172 | <i class="fa fa-fw fa-cogs"></i> |
173 | - <span><?php echo $lang['database'] . 's' ?></span> |
|
173 | + <span><?php echo $lang['database'].'s' ?></span> |
|
174 | 174 | </a> |
175 | 175 | </li> |
176 | 176 | <?php } ?> |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | <section class="wrapper"> |
190 | 190 | <?php |
191 | 191 | if (isset($error)) { |
192 | - echo '<div style="margin-top: 120px;" class="alert alert-danger animated infinite bounce" role="alert">' . $error . '</div>'; |
|
192 | + echo '<div style="margin-top: 120px;" class="alert alert-danger animated infinite bounce" role="alert">'.$error.'</div>'; |
|
193 | 193 | } |
194 | 194 | if (isset($message)) { |
195 | - echo '<div style="margin-top: 120px;" class="alert alert-info animated infinite bounce" role="alert">' . $message . '</div>'; |
|
195 | + echo '<div style="margin-top: 120px;" class="alert alert-info animated infinite bounce" role="alert">'.$message.'</div>'; |
|
196 | 196 | } |
197 | 197 | if (isset($page)) { |
198 | 198 | include($page); |
@@ -9,14 +9,18 @@ |
||
9 | 9 | <div class="form-inline pull-right-md"> |
10 | 10 | <form name='rows' method="post" action="<?php echo $settings['url'] . $currentPage ?>"> |
11 | 11 | |
12 | - <input id='searchText' class="form-control" type='text' name='searchText' placeholder="<?php if (isset($search)) echo $search ?>"> |
|
12 | + <input id='searchText' class="form-control" type='text' name='searchText' placeholder="<?php if (isset($search)) { |
|
13 | + echo $search ?>"> |
|
13 | 14 | <input style='margin-right: 10px;' class='btn btn-primary' type='button' name='search' onclick='searchpage();' value='<?php echo $lang['search'] ?>'> |
14 | 15 | </form> |
15 | 16 | <select style="margin-right:15px;" onchange="if (this.value) window.location.href='?items='+this.value" id='items' class="form-control" name='items'> |
16 | 17 | <?php |
17 | 18 | foreach ($settings['item'] as $item) { |
18 | 19 | echo '<option value="'.$item.'"'; |
19 | - if ($item == $_SESSION['items']) echo ' selected'; |
|
20 | +} |
|
21 | + if ($item == $_SESSION['items']) { |
|
22 | + echo ' selected'; |
|
23 | + } |
|
20 | 24 | echo '>'.$item.'</option>'; |
21 | 25 | } |
22 | 26 | ?> |
@@ -7,7 +7,7 @@ |
||
7 | 7 | </style> |
8 | 8 | |
9 | 9 | <div class="form-inline pull-right-md"> |
10 | - <form id="search" name='rows' method="post" action="<?php echo $settings['url'] . $currentPage ?>"> |
|
10 | + <form id="search" name='rows' method="post" action="<?php echo $settings['url'].$currentPage ?>"> |
|
11 | 11 | |
12 | 12 | <input id='searchText' class="form-control" type='text' name='searchText' placeholder="<?php if (isset($search)) echo $search ?>"> |
13 | 13 | <input id="searchButton" style='margin-right: 10px;' class='btn btn-primary' type='button' name='search' onclick='searchpage();' value='<?php echo $lang['search'] ?>'> |
@@ -16,20 +16,26 @@ discard block |
||
16 | 16 | $sql = "SELECT `id`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` WHERE `owner` IN ( " . $samepID . " ) OR `name` LIKE '%" . $search . "%' OR `id` = '" . $search . "' OR `owner` LIKE '" . $search . "' OR `members` LIKE '%" . $search . "%' ;"; |
17 | 17 | $result_of_query = $db_link->query($sql); |
18 | 18 | $total_records = mysqli_num_rows($result_of_query); |
19 | - if ($pageNum > $total_records) $pageNum = $total_records; |
|
19 | + if ($pageNum > $total_records) { |
|
20 | + $pageNum = $total_records; |
|
21 | + } |
|
20 | 22 | $sql = "SELECT `id`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` WHERE `owner` IN ( " . $samepID . " ) OR `name` LIKE '%" . $search . "%' OR `id` = '" . $search . "' OR `owner` LIKE '" . $search . "' OR `members` LIKE '%" . $search . "%' " . $max . " ;"; |
21 | 23 | } else { |
22 | 24 | $sql = "SELECT `id` FROM `gangs` WHERE `name` LIKE '%" . $search . "%' OR `id` = '" . $search . "' OR `owner` LIKE '" . $search . "' OR `members` LIKE '%" . $search . "%' ;"; |
23 | 25 | $result_of_query = $db_link->query($sql); |
24 | 26 | $total_records = mysqli_num_rows($result_of_query); |
25 | - if ($pageNum > $total_records) $pageNum = $total_records; |
|
27 | + if ($pageNum > $total_records) { |
|
28 | + $pageNum = $total_records; |
|
29 | + } |
|
26 | 30 | $sql = "SELECT `id`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` WHERE `name` LIKE '%" . $search . "%' OR `id` = '" . $search . "' OR `owner` LIKE '" . $search . "' OR `members` LIKE '%" . $search . "%' " . $max . " ;"; |
27 | 31 | } |
28 | 32 | } else { |
29 | 33 | $sql = "SELECT `id` FROM `gangs`;"; |
30 | 34 | $result_of_query = $db_link->query($sql); |
31 | 35 | $total_records = mysqli_num_rows($result_of_query); |
32 | - if ($pageNum > $total_records) $pageNum = $total_records; |
|
36 | + if ($pageNum > $total_records) { |
|
37 | + $pageNum = $total_records; |
|
38 | + } |
|
33 | 39 | $sql = "SELECT `id`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` " . $max . " ;"; |
34 | 40 | } |
35 | 41 | $result_of_query = $db_link->query($sql); |
@@ -100,4 +106,6 @@ discard block |
||
100 | 106 | </div> |
101 | 107 | |
102 | 108 | <?php |
103 | -} else echo errorMessage(3, $lang); |
|
104 | 109 | \ No newline at end of file |
110 | +} else { |
|
111 | + echo errorMessage(3, $lang); |
|
112 | +} |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $db_link = serverConnect(); |
3 | 3 | |
4 | -$max = ' LIMIT ' . ($pageNum - 1) * $_SESSION['items'] . ',' . $_SESSION['items']; |
|
4 | +$max = ' LIMIT '.($pageNum - 1) * $_SESSION['items'].','.$_SESSION['items']; |
|
5 | 5 | |
6 | 6 | if (isset($search)) { |
7 | - logAction($_SESSION['user_name'], $lang['searched'] . ' (' . $search . ') ' . $lang['in'] . ' ' . $lang['gangs'], 1); |
|
8 | - $sql = "SELECT $playerIdColumn as playerid FROM `players` WHERE `name` LIKE '%" . $search . "%' "; |
|
7 | + logAction($_SESSION['user_name'], $lang['searched'].' ('.$search.') '.$lang['in'].' '.$lang['gangs'], 1); |
|
8 | + $sql = "SELECT $playerIdColumn as playerid FROM `players` WHERE `name` LIKE '%".$search."%' "; |
|
9 | 9 | $result_of_query = $db_link->query($sql); |
10 | 10 | if ($result_of_query->num_rows > 0) { |
11 | 11 | while ($row = mysqli_fetch_row($result_of_query)) { |
@@ -13,24 +13,24 @@ discard block |
||
13 | 13 | } |
14 | 14 | $samepID = array_reduce($samepID, 'array_merge', array()); |
15 | 15 | $samepID = implode(',', $samepID); |
16 | - $sql = "SELECT `id`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` WHERE `owner` IN ( " . $samepID . " ) OR `name` LIKE '%" . $search . "%' OR `id` = '" . $search . "' OR `owner` LIKE '" . $search . "' OR `members` LIKE '%" . $search . "%' ;"; |
|
16 | + $sql = "SELECT `id`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` WHERE `owner` IN ( ".$samepID." ) OR `name` LIKE '%".$search."%' OR `id` = '".$search."' OR `owner` LIKE '".$search."' OR `members` LIKE '%".$search."%' ;"; |
|
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`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` WHERE `owner` IN ( " . $samepID . " ) OR `name` LIKE '%" . $search . "%' OR `id` = '" . $search . "' OR `owner` LIKE '" . $search . "' OR `members` LIKE '%" . $search . "%' " . $max . " ;"; |
|
20 | + $sql = "SELECT `id`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` WHERE `owner` IN ( ".$samepID." ) OR `name` LIKE '%".$search."%' OR `id` = '".$search."' OR `owner` LIKE '".$search."' OR `members` LIKE '%".$search."%' ".$max." ;"; |
|
21 | 21 | } else { |
22 | - $sql = "SELECT `id` FROM `gangs` WHERE `name` LIKE '%" . $search . "%' OR `id` = '" . $search . "' OR `owner` LIKE '" . $search . "' OR `members` LIKE '%" . $search . "%' ;"; |
|
22 | + $sql = "SELECT `id` FROM `gangs` WHERE `name` LIKE '%".$search."%' OR `id` = '".$search."' OR `owner` LIKE '".$search."' OR `members` LIKE '%".$search."%' ;"; |
|
23 | 23 | $result_of_query = $db_link->query($sql); |
24 | 24 | $total_records = mysqli_num_rows($result_of_query); |
25 | 25 | if ($pageNum > $total_records) $pageNum = $total_records; |
26 | - $sql = "SELECT `id`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` WHERE `name` LIKE '%" . $search . "%' OR `id` = '" . $search . "' OR `owner` LIKE '" . $search . "' OR `members` LIKE '%" . $search . "%' " . $max . " ;"; |
|
26 | + $sql = "SELECT `id`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` WHERE `name` LIKE '%".$search."%' OR `id` = '".$search."' OR `owner` LIKE '".$search."' OR `members` LIKE '%".$search."%' ".$max." ;"; |
|
27 | 27 | } |
28 | 28 | } else { |
29 | 29 | $sql = "SELECT `id` FROM `gangs`;"; |
30 | 30 | $result_of_query = $db_link->query($sql); |
31 | 31 | $total_records = mysqli_num_rows($result_of_query); |
32 | 32 | if ($pageNum > $total_records) $pageNum = $total_records; |
33 | - $sql = "SELECT `id`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` " . $max . " ;"; |
|
33 | + $sql = "SELECT `id`,`name`,`owner`,`bank`,`members`,`maxmembers`,`active` FROM `gangs` ".$max." ;"; |
|
34 | 34 | } |
35 | 35 | $result_of_query = $db_link->query($sql); |
36 | 36 | if ($result_of_query->num_rows > 0) { |
@@ -52,18 +52,18 @@ discard block |
||
52 | 52 | <thead> |
53 | 53 | <tr> |
54 | 54 | <th class="hidden-xs"><i class="fa fa-eye"></i> <?php echo $lang['id']; ?></th> |
55 | - <th><i class="fa fa-user"></i> <?php echo $lang['gang'] . " " . $lang['name']; ?></th> |
|
55 | + <th><i class="fa fa-user"></i> <?php echo $lang['gang']." ".$lang['name']; ?></th> |
|
56 | 56 | <th class="hidden-xs"><i class="fa fa-user"></i> <?php echo $lang['owner']; ?></th> |
57 | 57 | <th class="hidden-xs"><i class="fa fa-bank"></i> <?php echo $lang['bank']; ?></th> |
58 | 58 | <?php if ($_SESSION['permissions']['edit']['gangs']) { |
59 | - echo '<th class="hidden-xs"><i class="fa fa-user"></i> ' . $lang['members'] . '</th>'; |
|
59 | + echo '<th class="hidden-xs"><i class="fa fa-user"></i> '.$lang['members'].'</th>'; |
|
60 | 60 | } else { |
61 | - echo '<th><i class="fa fa-user"></i> ' . $lang['members'] . '</th>'; |
|
61 | + echo '<th><i class="fa fa-user"></i> '.$lang['members'].'</th>'; |
|
62 | 62 | }?> |
63 | 63 | <th class="hidden-xs"><i class="fa fa-user"></i> <?php echo $lang['maxMembers']; ?></th> |
64 | 64 | <th class="hidden-xs"><i class="fa fa-user"></i> <?php echo $lang['active']; ?></th> |
65 | 65 | <?php if ($_SESSION['permissions']['edit']['gangs']) { |
66 | - echo '<th><i class="fa fa-pencil"></i>' . $lang['edit'] . '</th>'; |
|
66 | + echo '<th><i class="fa fa-pencil"></i>'.$lang['edit'].'</th>'; |
|
67 | 67 | } |
68 | 68 | ?> |
69 | 69 | </tr> |
@@ -72,21 +72,21 @@ discard block |
||
72 | 72 | <?php |
73 | 73 | while ($row = mysqli_fetch_assoc($result_of_query)) { |
74 | 74 | echo "<tr>"; |
75 | - echo "<td class='hidden-xs'>" . $row["id"] . "</td>"; |
|
76 | - echo "<td>" . $row["name"] . "</td>"; |
|
77 | - echo "<td class='hidden-xs'>" . nameID($row["owner"], $db_link) . "</td>"; |
|
78 | - echo "<td class='hidden-xs'>" . $row["bank"] . "</td>"; |
|
75 | + echo "<td class='hidden-xs'>".$row["id"]."</td>"; |
|
76 | + echo "<td>".$row["name"]."</td>"; |
|
77 | + echo "<td class='hidden-xs'>".nameID($row["owner"], $db_link)."</td>"; |
|
78 | + echo "<td class='hidden-xs'>".$row["bank"]."</td>"; |
|
79 | 79 | $members = substr_count($row['members'], ","); |
80 | 80 | $members++; |
81 | 81 | if ($_SESSION['permissions']['edit']['gangs']) { |
82 | - echo "<td class='hidden-xs'>" . $members . "</td>"; |
|
82 | + echo "<td class='hidden-xs'>".$members."</td>"; |
|
83 | 83 | } else { |
84 | - echo "<td>" . $members . "</td>"; |
|
84 | + echo "<td>".$members."</td>"; |
|
85 | 85 | } |
86 | - echo "<td class='hidden-xs'>" . $row["maxmembers"] . "</td>"; |
|
87 | - echo "<td class='hidden-xs'>" . yesNo($row["active"], $lang) . "</td>"; |
|
86 | + echo "<td class='hidden-xs'>".$row["maxmembers"]."</td>"; |
|
87 | + echo "<td class='hidden-xs'>".yesNo($row["active"], $lang)."</td>"; |
|
88 | 88 | if ($_SESSION['permissions']['edit']['gangs']) { |
89 | - echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editGang/" . $row["id"] . "'>"; |
|
89 | + echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url']."editGang/".$row["id"]."'>"; |
|
90 | 90 | echo "<i class='fa fa-pencil'></i></a></td>"; |
91 | 91 | } |
92 | 92 | echo "</tr>"; |