Completed
Push — master ( dfdb4c...98f390 )
by Sam
23:19
created
views/firstTime.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 RewriteRule . /'.$base . 'index.php [L]
34 34
 
35 35
 php_value file_get_contents 1';
36
-    file_put_contents('.htaccess',$hta);
36
+    file_put_contents('.htaccess', $hta);
37 37
     //if (isset($_POST['user_pid'])) $verify = str_replace(" ", "%20", 'http://cyberbyte.org.uk/hooks/cyberworks/getid.php?url=' . $settings['url'] . '&name=' . $_POST['community_name'] . '&pid=' . $_POST['user_pid']);
38 38
     //else $verify = str_replace(" ", "%20", 'http://cyberbyte.org.uk/hooks/cyberworks/getid.php?url=' . $settings['url'] . '&name=' . $_POST['community_name']);
39 39
     //$verify = json_decode(file_get_contents($verify));
@@ -113,19 +113,19 @@  discard block
 block discarded – undo
113 113
         $settings['communityBansTest'] = false;
114 114
         $settings['communityBansAPI'] = '';
115 115
 
116
-        $settings['item'] = array(5,10,15,25,50);
116
+        $settings['item'] = array(5, 10, 15, 25, 50);
117 117
 
118
-        $settings['installedLanguage']=array();
119
-        $lang = array('English','en');
118
+        $settings['installedLanguage'] = array();
119
+        $lang = array('English', 'en');
120 120
         array_push($settings['installedLanguage'], $lang);
121 121
 
122 122
         $settings['names'] = array('', 'Dave', 'Sam', 'Joe', 'Kerry', 'Connie', 'Jess');
123
-        $settings['ranks'] = array('Banned','Player','Member','Moderator','Server Admin','Super Admin');
123
+        $settings['ranks'] = array('Banned', 'Player', 'Member', 'Moderator', 'Server Admin', 'Super Admin');
124 124
 
125 125
         $permissions = include 'config/permissions.php';
126 126
         $userPerms = json_encode($permissions['5']);
127 127
 
128
-        $link = mysqli_connect($server_SQL_host,$server_SQL_user,$server_SQL_pass,$server_SQL_name);
128
+        $link = mysqli_connect($server_SQL_host, $server_SQL_user, $server_SQL_pass, $server_SQL_name);
129 129
         if (mysqli_connect_errno()) {
130 130
             printf("Connect failed: %s\n", mysqli_connect_error());
131 131
             exit();
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -295,7 +295,8 @@  discard block
 block discarded – undo
295 295
                             <br>
296 296
                             <label for="community_name">Community Name: </label>
297 297
                             <input placeholder="Community Name" id="community_name"
298
-                                   class="form-control login_input" type="text" name="community_name" <?php if (isset($_POST['community_name'])) echo 'value="' . $_POST['community_name'] . '"'?>>
298
+                                   class="form-control login_input" type="text" name="community_name" <?php if (isset($_POST['community_name'])) {
299
+    echo 'value="' . $_POST['community_name'] . '"'?>>
299 300
                             <br><h4>User Setup</h4>
300 301
                             <label for="user_name">Username: </label>
301 302
                             <input placeholder="Username" id="user_name"
@@ -317,10 +318,14 @@  discard block
 block discarded – undo
317 318
 
318 319
                             <select id='user_pic' name='user_pic' class=" form-control login_input">
319 320
                             <?php
320
-                            for ($icon = 1; $icon < 7; $icon++) {
321
+                            for ($icon = 1;
322
+}
323
+$icon < 7; $icon++) {
321 324
                                 echo '<option value="' . $icon . '"';
322 325
                                 if (isset($_POST['user_pic'])) {
323
-                                    if ($icon == $_POST['user_pic']) echo ' selected';
326
+                                    if ($icon == $_POST['user_pic']) {
327
+                                        echo ' selected';
328
+                                    }
324 329
                                 }
325 330
                                 echo '>' . $icon . '</option>';
326 331
                             } ?>
Please login to merge, or discard this patch.
views/templates/page.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,9 +13,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
views/templates/template.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
                 <?php if (!isset($_SESSION['profile_link'])) {
27 27
                     if (isset($_SESSION['user_email']) && $settings['gravatar']) {
28 28
                         echo '<a href="' . $settings['url'] . 'profile">';
29
-                        echo '<img src="' . get_gravatar($_SESSION['user_email'],64,'retro') . '" class="img-circle" width="60" height="60"></a></p>';
29
+                        echo '<img src="' . get_gravatar($_SESSION['user_email'], 64, 'retro') . '" class="img-circle" width="60" height="60"></a></p>';
30 30
                     } else {
31 31
                         echo '<a href="' . $settings['url'] . 'profile">';
32 32
                         echo '<img src="' . $settings['url'] . 'assets/img/profile/' . $_SESSION['user_profile'] . '.jpg"';
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
             </li>
53 53
 
54 54
 			<?php
55
-                if(isset($_SESSION['server_type']))
55
+                if (isset($_SESSION['server_type']))
56 56
                 {
57
-                    switch($_SESSION['server_type'])
57
+                    switch ($_SESSION['server_type'])
58 58
                     {
59 59
                         case 'life':
60 60
                             include("views/life/nav.php");
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
                 }
63 63
 
64 64
                 foreach ($settings['plugins'] as &$plugin) {
65
-                    if (file_exists("plugins/". $plugin. "/nav.php")) {
66
-                        include("plugins/". $plugin."/nav.php");
65
+                    if (file_exists("plugins/" . $plugin . "/nav.php")) {
66
+                        include("plugins/" . $plugin . "/nav.php");
67 67
                     }
68 68
                 }
69 69
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,9 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
views/templates/scripts.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,10 @@
 block discarded – undo
77 77
     </div>
78 78
 </div>
79 79
 <script async src="<?php echo $settings['url'] ?>assets/js/main.min.js"></script>
80
-<?php if (isset($_SESSION['forum_lang'])) echo '<script async type="text/javascript" src="' . $settings["url"] . 'assets/js/language/' . $_SESSION['forum_lang'] . '.js"></script>'; ?>
80
+<?php if (isset($_SESSION['forum_lang'])) {
81
+    echo '<script async type="text/javascript" src="' . $settings["url"] . 'assets/js/language/' . $_SESSION['forum_lang'] . '.js"></script>';
82
+}
83
+?>
81 84
 <script>
82 85
     function searchpage() {
83 86
         sn = document.getElementById('searchText').value;
Please login to merge, or discard this patch.
views/templates/search.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@
 block discarded – undo
15 15
     <select style="margin-right:15px;" onchange="if (this.value) window.location.href='?items='+this.value" id='items' class="form-control" name='items'>
16 16
         <?php
17 17
         foreach ($settings['item'] as $item) {
18
-            echo '<option value="'.$item.'"';
18
+            echo '<option value="' . $item . '"';
19 19
             if ($item == $_SESSION['items']) echo ' selected';
20
-            echo '>'.$item.'</option>';
20
+            echo '>' . $item . '</option>';
21 21
         }
22 22
         ?>
23 23
     </select>
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,14 +9,18 @@
 block discarded – undo
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
         ?>
Please login to merge, or discard this patch.
views/life/vehicles.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,13 +10,17 @@  discard block
 block discarded – undo
10 10
     $sql = "SELECT `id` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid WHERE `pid` LIKE '" . $search . "' OR `classname` LIKE '%" . $search . "%' OR `name` LIKE '%" . $search . "%' OR `plate` LIKE '" . $search . "' OR `inventory` LIKE '%" . $search . "%' OR `name` 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 '" . $search . "' OR `classname` LIKE '%" . $search . "%' OR `name` LIKE '%" . $search . "%' OR `plate` LIKE '" . $search . "' OR `inventory` LIKE '%" . $search . "%' OR `name` LIKE '%" . $search . "%' " . $max . " ;";
15 17
 } else {
16 18
     $sql = "SELECT `id` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.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`,`name` FROM `vehicles` INNER JOIN `players` ON vehicles.pid=players.playerid " . $max . " ;";
21 25
 }
22 26
 $result_of_query = $db_link->query($sql);
@@ -77,4 +81,6 @@  discard block
 block discarded – undo
77 81
     </table>
78 82
 </div>
79 83
 <?php
80
-} else echo errorMessage(37, $lang);
81 84
\ No newline at end of file
85
+} else {
86
+    echo errorMessage(37, $lang);
87
+}
Please login to merge, or discard this patch.
views/life/dashboard.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 $db_link = serverConnect();
3 3
 
4 4
 if ($db_link->connect_error) {
5
-    echo '<h1>'.$lang['dbError'].'</h1>';
5
+    echo '<h1>' . $lang['dbError'] . '</h1>';
6 6
     unset($_SESSION['server_type']);
7 7
     unset($_SESSION['dbid']);
8 8
 } else {
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,10 @@
 block discarded – undo
16 16
             </h1>
17 17
         </div>
18 18
     </div>
19
-    <?php if (isset($_SESSION['update'])) echo '<div class="alert alert-info" role="alert">' . $land['updateMessage'] . ' (' . $_SESSION['message']->version . ') <a href="https://github.com/Cyberbyte-Studios/CyberWorks/releases">Download Section</a</div>'; ?>
19
+    <?php if (isset($_SESSION['update'])) {
20
+    echo '<div class="alert alert-info" role="alert">' . $land['updateMessage'] . ' (' . $_SESSION['message']->version . ') <a href="https://github.com/Cyberbyte-Studios/CyberWorks/releases">Download Section</a</div>';
21
+}
22
+?>
20 23
     <div class="row">
21 24
         <div class="col-lg-4">
22 25
             <div class="content-panel">
Please login to merge, or discard this patch.
views/life/players.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,14 +7,18 @@  discard block
 block discarded – undo
7 7
     $sql = "SELECT `uid` FROM `players` WHERE `uid` LIKE '" . $search . "' OR `name` LIKE '" . $search . "' OR `playerid` LIKE '" . $search . "';";
8 8
     $result_of_query = $db_link->query($sql);
9 9
     $total_records = mysqli_num_rows($result_of_query);
10
-    if ($pageNum > $total_records) $pageNum = $total_records;
10
+    if ($pageNum > $total_records) {
11
+        $pageNum = $total_records;
12
+    }
11 13
     $sql = "SELECT `playerid`,`name`,`bankacc`,`cash`,`coplevel`,`mediclevel`,`adminlevel`,`uid` FROM `players` WHERE `uid` LIKE '" . $search . "' OR `name` LIKE '" . $search . "' OR `playerid` LIKE '" . $search . "'" . $max . " ;";
12 14
     logAction($_SESSION['user_name'], $lang['searched'] . ' (' . $search . ') ' . $lang['in'] . ' ' . $lang['players'], 1);
13 15
 } else {
14 16
     $sql = "SELECT `uid` FROM `players`;";
15 17
     $result_of_query = $db_link->query($sql);
16 18
     $total_records = mysqli_num_rows($result_of_query);
17
-    if ($pageNum > $total_records) $pageNum = $total_records;
19
+    if ($pageNum > $total_records) {
20
+        $pageNum = $total_records;
21
+    }
18 22
     $sql = "SELECT `playerid`,`name`,`bankacc`,`cash`,`coplevel`,`mediclevel`,`adminlevel`,`uid` FROM `players` " . $max . " ;";
19 23
 }
20 24
 
@@ -107,4 +111,6 @@  discard block
 block discarded – undo
107 111
                 ?>
108 112
         </div>
109 113
 <?php
110
-} else echo '<h3>' . errorMessage(36, $lang) . '</h3>';
111 114
\ No newline at end of file
115
+} else {
116
+    echo '<h3>' . errorMessage(36, $lang) . '</h3>';
117
+}
Please login to merge, or discard this patch.
views/life/editHouse.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -233,4 +233,7 @@
 block discarded – undo
233 233
         </div>
234 234
     </div>
235 235
 </div>
236
-<?php } else errorMessage(3, $lang); ?>
237 236
\ No newline at end of file
237
+<?php } else {
238
+    errorMessage(3, $lang);
239
+}
240
+?>
238 241
\ No newline at end of file
Please login to merge, or discard this patch.