Passed
Push — master ( 14e287...f4a883 )
by Nicolas
03:36
created
public/php/common/DAO/ControlDAO.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
         $stmt->close();
105 105
     }
106 106
     
107
-     /**
108
-     * add a control to the database
109
-     *
110
-     * @param varchar control
111
-     */
107
+        /**
108
+         * add a control to the database
109
+         *
110
+         * @param varchar control
111
+         */
112 112
     public function addControl($control) {
113 113
         $stmt = \AL\Db\execute_query(
114 114
             "ControlDAO: addControl",
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
         $stmt->close();
137 137
     }
138 138
     
139
-     /**
140
-     * update a control
141
-     *
142
-     * @param int control_id
143
-     * @param varchar control_name
144
-     */
139
+        /**
140
+         * update a control
141
+         *
142
+         * @param int control_id
143
+         * @param varchar control_name
144
+         */
145 145
     public function updateControl($control_id, $control_name) {
146 146
         $stmt = \AL\Db\execute_query(
147 147
             "ControlDAO: updateControl",
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace AL\Common\DAO;
3 3
 
4
-require_once __DIR__."/../../lib/Db.php" ;
5
-require_once __DIR__."/../Model/Game/Control.php" ;
4
+require_once __DIR__."/../../lib/Db.php";
5
+require_once __DIR__."/../Model/Game/Control.php";
6 6
 
7 7
 /**
8 8
  * DAO for game controls
Please login to merge, or discard this patch.
public/php/common/login/user_process_logout.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 //$params = session_get_cookie_params();
28 28
 
29 29
 // Delete the actual cookie.
30
-setcookie("cooksession", session_id(), time()-60*60*24*100, "/");
30
+setcookie("cooksession", session_id(), time() - 60 * 60 * 24 * 100, "/");
31 31
 
32 32
 // Destroy session
33 33
 session_destroy();
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     header('Location: ../../main/front/front.php');
38 38
 } else {
39 39
     $_SESSION['edit_message'] = "Log out succesfull";
40
-    header('Location: ' . $_SERVER['HTTP_REFERER']);
40
+    header('Location: '.$_SERVER['HTTP_REFERER']);
41 41
 }
42 42
 
43 43
 mysql_close();
Please login to merge, or discard this patch.
public/php/common/login/db_reset.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 
19 19
 include("../../config/common.php");
20 20
 
21
-require_once __DIR__."/../../common/Model/Database/ChangeLog.php" ;
22
-require_once __DIR__."/../../common/DAO/ChangeLogDAO.php" ;
21
+require_once __DIR__."/../../common/Model/Database/ChangeLog.php";
22
+require_once __DIR__."/../../common/DAO/ChangeLogDAO.php";
23 23
 
24 24
 use PHPMailer\PHPMailer\PHPMailer;
25 25
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     } else {
36 36
         //check if the email addres is valid
37 37
         if (!filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) {
38
-            $_SESSION['edit_message'] =  "Invalid email format";
38
+            $_SESSION['edit_message'] = "Invalid email format";
39 39
             header("Location: ../../main/front/front.php?action=reset");
40 40
         } else {
41 41
             //check if email address exists in DB
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             $number = $query_rows->num_rows;
44 44
 
45 45
             if ($number == 0) {
46
-                $_SESSION['edit_message'] =  "There is no user with this email address in our DB - "
46
+                $_SESSION['edit_message'] = "There is no user with this email address in our DB - "
47 47
                     ."Please contact the admins";
48 48
                 header("Location: ../../main/front/front.php?action=reset");
49 49
             } else { //lets create an email
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
                 $mailbody = "Dear user,\n\nIf this e-mail does not apply to you please ignore it. It appears that "
101 101
                     ."you have requested a password reset at our website www.atarilegend.com\n\nTo reset your password,"
102 102
                     ." please click the link below. If you cannot click it, please paste it into your web browser's "
103
-                    ."address bar.\n\n" . $pwrurl . "\n\nThanks,\nTEAM AL";
103
+                    ."address bar.\n\n".$pwrurl."\n\nThanks,\nTEAM AL";
104 104
 
105
-                $mail->Body    = $mailbody;
105
+                $mail->Body = $mailbody;
106 106
 
107 107
                 try {
108 108
                     $mail->send();
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
     //check if the email addres is valid
132 132
     if (!filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) {
133
-        $_SESSION['edit_message'] =  "Invalid email format";
133
+        $_SESSION['edit_message'] = "Invalid email format";
134 134
         header("Location: ../../main/front/front.php?action=new_pwd&q=$hash");
135 135
     } else {
136 136
         //check if email address exists in DB
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
         $number = $query_rows->num_rows;
139 139
 
140 140
         if ($number == 0) {
141
-            $_SESSION['edit_message'] =  "There is no user with this email address in our DB - "
141
+            $_SESSION['edit_message'] = "There is no user with this email address in our DB - "
142 142
                 ."Please contact the admins";
143 143
             header("Location: ../../main/front/front.php?action=new_pwd&q=$hash");
144 144
         } else {
145 145
             if ($password != $confirmpassword) {
146
-                $_SESSION['edit_message'] =  "The passwords you entered are not the same - please try again";
146
+                $_SESSION['edit_message'] = "The passwords you entered are not the same - please try again";
147 147
                 header("Location: ../../main/front/front.php?action=new_pwd&q=$hash");
148 148
             } else {
149 149
                 //get the userid
@@ -157,13 +157,13 @@  discard block
 block discarded – undo
157 157
                 // Does the new reset key match the old one?
158 158
                 if ($resetkey == $hash) {
159 159
                     //now check if this hash exists
160
-                    $twentyfour_hours = time()-(60*1440);
160
+                    $twentyfour_hours = time() - (60 * 1440);
161 161
                     $query_time = $mysqli->query("select * from users_reset where password = '$resetkey'")
162 162
                         or die("problem getting time from the users_reset table");
163 163
                     $number_hash = $query_time->num_rows;
164 164
 
165 165
                     if ($number_hash == 0) {
166
-                        $_SESSION['edit_message'] =  "Something went wrong - validation not possible, contact the "
166
+                        $_SESSION['edit_message'] = "Something went wrong - validation not possible, contact the "
167 167
                             ."admins or try a new password request";
168 168
                         header("Location: ../../main/front/front.php");
169 169
                     } else {
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
                             $random_salt = hash(
177 177
                                 'sha512',
178 178
                                 uniqid(mt_rand(1, mt_getrandmax()), true)
179
-                            );//create random salt
180
-                            $update_password = hash('sha512', $sha512 . $random_salt); // Create salted password
179
+                            ); //create random salt
180
+                            $update_password = hash('sha512', $sha512.$random_salt); // Create salted password
181 181
                             $timestamp = time();
182 182
 
183 183
                             $sdbquery = $mysqli->query("UPDATE users SET password = '$md5pass',
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                                 header("Location: ../../main/front/front.php");
214 214
                             }
215 215
                         } else {
216
-                            $_SESSION['edit_message'] =  "Something went wrong - hash password request expired, try a "
216
+                            $_SESSION['edit_message'] = "Something went wrong - hash password request expired, try a "
217 217
                                 ."new password request";
218 218
 
219 219
                             //delete the hash from the user_reset table so a new reset can be done
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                         }
225 225
                     }
226 226
                 } else {
227
-                    $_SESSION['edit_message'] =  "Something went wrong - Did you enter the correct email addres?";
227
+                    $_SESSION['edit_message'] = "Something went wrong - Did you enter the correct email addres?";
228 228
                     header("Location: ../../main/front/front.php?action=new_pwd&q=$hash");
229 229
                 }
230 230
             }
Please login to merge, or discard this patch.
public/php/common/login/user_process_login.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             //$params = session_get_cookie_params();
47 47
 
48 48
             // Delete the actual cookie.
49
-            setcookie("cooksession", session_id(), time()+60*60*24*100, "/");
49
+            setcookie("cooksession", session_id(), time() + 60 * 60 * 24 * 100, "/");
50 50
             $session_id = session_id();
51 51
 
52 52
             //update the table with the session id
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         }
57 57
         //header('Location: ../../main/front/front.php');
58 58
         $_SESSION['edit_message'] = "Login successful";
59
-        header('Location: ' . $_SERVER['HTTP_REFERER']);
59
+        header('Location: '.$_SERVER['HTTP_REFERER']);
60 60
     } else {
61 61
         // Login failed
62 62
         // check the cause - is the user inactive?
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
         if ($query_inactive['inactive'] == 1) {
66 66
             //header('Location: ../../main/front/front.php?error=2');
67 67
             $_SESSION['edit_message'] = 'User is set inactive - contact admin';
68
-            header('Location: ' . $_SERVER['HTTP_REFERER']);
68
+            header('Location: '.$_SERVER['HTTP_REFERER']);
69 69
         } else {
70 70
             $_SESSION['edit_message'] = 'Usn or pwd incorrect - Please try again';
71
-            header('Location: ' . $_SERVER['HTTP_REFERER']);
71
+            header('Location: '.$_SERVER['HTTP_REFERER']);
72 72
             //header('Location: ../../main/front/front.php?error=1');
73 73
         }
74 74
     }
@@ -76,5 +76,5 @@  discard block
 block discarded – undo
76 76
     // The correct POST variables were not sent to this page.
77 77
     //header('Location: ../../main/front/front.php?error=1');
78 78
     $_SESSION['edit_message'] = 'Usn or pwd incorrect - Please try again';
79
-    header('Location: ' . $_SERVER['HTTP_REFERER']);
79
+    header('Location: '.$_SERVER['HTTP_REFERER']);
80 80
 }
Please login to merge, or discard this patch.
public/php/common/login/db_register.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 //load all common functions
19 19
 include("../../config/common.php");
20 20
 
21
-require_once __DIR__."/../../common/Model/Database/ChangeLog.php" ;
22
-require_once __DIR__."/../../common/DAO/ChangeLogDAO.php" ;
21
+require_once __DIR__."/../../common/Model/Database/ChangeLog.php";
22
+require_once __DIR__."/../../common/DAO/ChangeLogDAO.php";
23 23
 
24 24
 use PHPMailer\PHPMailer\PHPMailer;
25 25
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $query_user = $mysqli->query("SELECT * FROM users WHERE userid='$_GET[usn]'
37 37
             AND password='$_GET[pwd]'
38 38
             AND inactive='1'") or die(mysql_error());
39
-        $match  = $query_user->num_rows;
39
+        $match = $query_user->num_rows;
40 40
 
41 41
         if ($match > 0) {
42 42
             $query_update_user = $mysqli->query("UPDATE users SET inactive = '0' WHERE userid = '$_GET[usn]'")
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
                     } else {
85 85
                         //check if the email addres is valid
86 86
                         if (!filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) {
87
-                            $_SESSION['edit_message'] =  "Invalid email format";
87
+                            $_SESSION['edit_message'] = "Invalid email format";
88 88
                             header("Location: ../../main/front/front.php?action=register");
89 89
                         } else {
90 90
                             //check if the email already exists
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                             $number = $query_rows->num_rows;
93 93
 
94 94
                             if ($number > 0) {
95
-                                $_SESSION['edit_message'] =  "Email address already exists in database!";
95
+                                $_SESSION['edit_message'] = "Email address already exists in database!";
96 96
                                 header("Location: ../../main/front/front.php?action=register");
97 97
                             } else {
98 98
                                 //Add the new account to the database but make it inactive for now
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
                                     'sha512',
104 104
                                     uniqid(mt_rand(1, mt_getrandmax()), true)
105 105
                                 ); //create random salt
106
-                                $update_password = hash('sha512', $sha512 . $random_salt); // Create salted password
106
+                                $update_password = hash('sha512', $sha512.$random_salt); // Create salted password
107 107
                                 $timestamp = time();
108 108
 
109 109
                                 $sdbquery = $mysqli->query("INSERT INTO users (
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
                                 "Dear user,\n\nIf this e-mail does not apply to you please ignore it. "
157 157
                                 ."Please activate your account at www.atarilegend.com\n\nby clicking the link below. "
158 158
                                 ."If you cannot click it, please paste it into your web browser's address bar.\n\n"
159
-                                . $pwrurl . "\n\nThanks,\nTEAM AL";
159
+                                . $pwrurl."\n\nThanks,\nTEAM AL";
160 160
 
161
-                                $mail->Body    = $mailbody;
161
+                                $mail->Body = $mailbody;
162 162
 
163 163
                                 try {
164 164
                                     $mail->send();
Please login to merge, or discard this patch.
public/php/main/games/db_games_comment_main.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 require "../../config/admin.php";
19 19
 
20 20
 if (isset($action)) {
21
-    if ($action=='delete_comment') {
21
+    if ($action == 'delete_comment') {
22 22
         create_log_entry('Games', $comment_id, 'Comment', $comment_id, 'Delete', $_SESSION['user_id']);
23 23
 
24 24
         $sql = $mysqli->query("DELETE FROM game_user_comments WHERE comment_id = '$comment_id'")
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
                     LEFT JOIN comments ON ( game_user_comments.comment_id = comments.comments_id )
66 66
                     LEFT JOIN users ON ( comments.user_id = users.user_id )
67 67
                     LEFT JOIN game ON ( game_user_comments.game_id = game.game_id )
68
-                     " . $where_clause . "
69
-                    ORDER BY comments.timestamp DESC LIMIT  " . $v_counter . ", 5";
68
+                     " . $where_clause."
69
+                    ORDER BY comments.timestamp DESC LIMIT  " . $v_counter.", 5";
70 70
 
71 71
     $sql_comment = $mysqli->query($sql_build);
72 72
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         //(instead of a post with pure HTML) The translation of the 'enter' breaks is different in JS, so in JS I do
145 145
         // a conversion to a <br>. However, when we edit a comment, this <br> should not be
146 146
         //visible to the user, hence again, now this conversion in php
147
-        $breaks = array("<br />","<br>","<br/>");
147
+        $breaks = array("<br />", "<br>", "<br/>");
148 148
         $comment = str_ireplace($breaks, "\r\n", $comment);
149 149
 
150 150
         if ($query_comment['join_date'] == "") {
@@ -193,13 +193,13 @@  discard block
 block discarded – undo
193 193
     //Check if back arrow is needed
194 194
     if ($v_counter > 0) {
195 195
         // Build the link
196
-        $v_linkback = ('?v_counter=' . ($v_counter - 5 . $users_comments));
196
+        $v_linkback = ('?v_counter='.($v_counter - 5.$users_comments));
197 197
     }
198 198
 
199 199
     //Check if we need to place a next arrow
200 200
     if ($v_rows > ($v_counter + 15)) {
201 201
         //Build the link
202
-        $v_linknext = ('?v_counter=' . ($v_counter + 5 . $users_comments));
202
+        $v_linknext = ('?v_counter='.($v_counter + 5.$users_comments));
203 203
     }
204 204
 
205 205
     if (empty($c_counter)) {
@@ -224,5 +224,5 @@  discard block
 block discarded – undo
224 224
     );
225 225
 
226 226
     $smarty->assign('smarty_action', 'delete_comment');
227
-    $smarty->display("file:" . $mainsite_template_folder. "games/ajax_games_comment_main.html");
227
+    $smarty->display("file:".$mainsite_template_folder."games/ajax_games_comment_main.html");
228 228
 }
Please login to merge, or discard this patch.
public/php/main/games/games_reviews_main.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                                 LEFT JOIN users on (review_main.user_id = users.user_id)
51 51
                                 LEFT JOIN game on (review_game.game_id = game.game_id)
52 52
                                 WHERE review_main.review_edit = '0'
53
-                                ORDER BY review_main.review_date DESC LIMIT  " . $v_counter . ", 5"
53
+                                ORDER BY review_main.review_date DESC LIMIT  " . $v_counter.", 5"
54 54
         ) or die("couldn't get the reviews - search all");
55 55
 
56 56
         // count number of interviews
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                                 LEFT JOIN users on (review_main.user_id = users.user_id)
75 75
                                 LEFT JOIN game on (review_game.game_id = game.game_id)
76 76
                                 WHERE review_main.review_edit = '0' AND review_main.user_id = '$author_id'
77
-                                ORDER BY review_main.review_date DESC LIMIT  " . $v_counter . ", 5"
77
+                                ORDER BY review_main.review_date DESC LIMIT  ".$v_counter.", 5"
78 78
         ) or die("couldn't get the reviews  - search");
79 79
 
80 80
         // count number of interviews
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                         LEFT JOIN users on (review_main.user_id = users.user_id)
105 105
 						LEFT JOIN game on (review_game.game_id = game.game_id)
106 106
 						WHERE review_main.review_edit = '0'
107
-						ORDER BY review_main.review_date DESC LIMIT  " . $v_counter . ", 5"
107
+						ORDER BY review_main.review_date DESC LIMIT  " . $v_counter.", 5"
108 108
     ) or die("couldn't get the reviews");
109 109
 
110 110
     // count number of interviews
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     $pos_end = strpos($review_text, '[/frontpage]');
122 122
     $nr_char = $pos_end - $pos_start;
123 123
 
124
-    $review_text  = substr($review_text, $pos_start, $nr_char);
124
+    $review_text = substr($review_text, $pos_start, $nr_char);
125 125
 
126 126
     //$review_text = str_replace("[i][b]Comments[/b][/i]", "",$review_text);
127 127
     //$review_text = str_replace("[i][b]Intro[/b][/i]", "",$review_text);
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
 //Check if back arrow is needed
190 190
 if ($v_counter > 0) {
191 191
     // Build the link
192
-    $v_linkback = ('?v_counter=' . ($v_counter - 5));
192
+    $v_linkback = ('?v_counter='.($v_counter - 5));
193 193
     if (isset($action) and $action == 'search') {
194 194
         if ($author_id != '-') {
195
-            $v_linkback .= '&author_id=' . $author_id . '&action=search';
195
+            $v_linkback .= '&author_id='.$author_id.'&action=search';
196 196
         }
197 197
     }
198 198
 }
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
 //Check if we need to place a next arrow
201 201
 if ($v_rows > ($v_counter + 5)) {
202 202
     //Build the link
203
-    $v_linknext = ('?v_counter=' . ($v_counter + 5));
203
+    $v_linknext = ('?v_counter='.($v_counter + 5));
204 204
     if (isset($action) and $action == 'search') {
205 205
         if ($author_id != '-') {
206
-            $v_linknext .= '&author_id=' . $author_id . '&action=search';
206
+            $v_linknext .= '&author_id='.$author_id.'&action=search';
207 207
         }
208 208
     }
209 209
 }
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 );
229 229
 
230 230
 //Send all smarty variables to the templates
231
-$smarty->display("file:" . $mainsite_template_folder . "games/games_reviews_main.html");
231
+$smarty->display("file:".$mainsite_template_folder."games/games_reviews_main.html");
232 232
 
233 233
 //close the connection
234 234
 mysqli_close($mysqli);
Please login to merge, or discard this patch.
public/php/main/games/db_games_reviews_detail.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
 require "../../config/admin.php";
18 18
 
19 19
 if (isset($action)) {
20
-    if ($action=='delete_comment') {
20
+    if ($action == 'delete_comment') {
21 21
         create_log_entry('Reviews', $comment_id, 'Comment', $comment_id, 'Delete', $_SESSION['user_id']);
22 22
 
23 23
         $sql = $mysqli->query("DELETE FROM review_user_comments WHERE comment_id = '$comment_id'")
24 24
             or die("couldn't delete game_comment quote");
25 25
         $sql = $mysqli->query("DELETE FROM comments WHERE comments_id = '$comment_id'")
26 26
             or die("couldn't delete comment quote");
27
-    } elseif ($action=="save_comment") {
27
+    } elseif ($action == "save_comment") {
28 28
         //$data = $_POST['data'];
29 29
         $data = $mysqli->real_escape_string($data);
30 30
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         //(instead of a post with pure HTML) The translation of the 'enter' breaks is different in JS, so in JS I do
76 76
         //a conversion to a <br>. However, when we edit a comment, this <br> should not be
77 77
         //visible to the user, hence again, now this conversion in php
78
-        $breaks = array("<br />","<br>","<br/>");
78
+        $breaks = array("<br />", "<br>", "<br/>");
79 79
         $comment = str_ireplace($breaks, "\r\n", $comment);
80 80
 
81 81
         $date = date("d/m/y", $query_comment['timestamp']);
@@ -102,5 +102,5 @@  discard block
 block discarded – undo
102 102
     $smarty->assign('review_id', $review_id);
103 103
 
104 104
     //Send all smarty variables to the templates
105
-    $smarty->display("file:" . $mainsite_template_folder . "games/ajax_games_reviews_detail_comments.html");
105
+    $smarty->display("file:".$mainsite_template_folder."games/ajax_games_reviews_detail_comments.html");
106 106
 }
Please login to merge, or discard this patch.
public/php/main/games/db_games_main_detail.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 require "../../config/admin.php";
19 19
 
20 20
 if (isset($action)) {
21
-    if ($action=='delete_comment') {
21
+    if ($action == 'delete_comment') {
22 22
         create_log_entry('Games', $comment_id, 'Comment', $comment_id, 'Delete', $_SESSION['user_id']);
23 23
 
24 24
         $sql = $mysqli->query("DELETE FROM game_user_comments WHERE comment_id = '$comment_id'")
25 25
             or die("couldn't delete game_comment quote");
26 26
         $sql = $mysqli->query("DELETE FROM comments WHERE comments_id = '$comment_id'")
27 27
             or die("couldn't delete comment quote");
28
-    } elseif ($action=="save_comment") {
28
+    } elseif ($action == "save_comment") {
29 29
         //$data = $_POST['data'];
30 30
         $data = $mysqli->real_escape_string($data);
31 31
 
@@ -33,15 +33,15 @@  discard block
 block discarded – undo
33 33
             or die("couldn't update comments table");
34 34
 
35 35
         create_log_entry('Games', $comment_id, 'Comment', $comment_id, 'Update', $_SESSION['user_id']);
36
-    } elseif ($action=="submit_info") {
36
+    } elseif ($action == "submit_info") {
37 37
         if (isset($subtype) and $subtype == 'medium') {
38
-            if ($textfield_medium == '' or  $textfield_medium == 'Game info') {
38
+            if ($textfield_medium == '' or $textfield_medium == 'Game info') {
39 39
                 $_SESSION['edit_message'] = "Please add some info in the game info field";
40 40
                 header("Location: ../games/games_detail.php?game_id=$game_id");
41 41
                 die();
42 42
             } else {
43 43
                 $timestamp = time();
44
-                $maxsize    = 10000000; //10mb
44
+                $maxsize = 10000000; //10mb
45 45
                 $mysqli->query(
46 46
                     "INSERT INTO game_submitinfo (game_id, user_id, timestamp, submit_text, game_done ) "
47 47
                     ."VALUES ('$game_id', '$_SESSION[user_id]', '$timestamp', '$textfield_medium', '2')"
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
                 die();
123 123
             }
124 124
         } else {
125
-            if ($textfield == '' or  $textfield == 'Game info') {
125
+            if ($textfield == '' or $textfield == 'Game info') {
126 126
                 $_SESSION['edit_message'] = "Please add some info in the game info field";
127 127
                 header("Location: ../games/games_detail.php?game_id=$game_id");
128 128
                 die();
129 129
             } else {
130 130
                 $timestamp = time();
131
-                $maxsize    = 10000000; //10mb
131
+                $maxsize = 10000000; //10mb
132 132
                 $mysqli->query(
133 133
                     "INSERT INTO game_submitinfo (game_id, user_id, timestamp, submit_text, game_done ) "
134 134
                     ."VALUES ('$game_id', '$_SESSION[user_id]', '$timestamp', '$textfield', '2')"
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
                         $ext        = "";
149 149
                         $type_image = $image['type'][$key];
150
-                        $size_image  = $image['size'][$key];
150
+                        $size_image = $image['size'][$key];
151 151
 
152 152
                         // set extension
153 153
                         if ($type_image == 'image/png') {
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         //(instead of a post with pure HTML) The translation of the 'enter' breaks is different in JS, so in JS I do
258 258
         //a conversion to a <br>. However, when we edit a comment, this <br> should not be
259 259
         //visible to the user, hence again, now this conversion in php
260
-        $breaks = array("<br />","<br>","<br/>");
260
+        $breaks = array("<br />", "<br>", "<br/>");
261 261
         $comment = str_ireplace($breaks, "\r\n", $comment);
262 262
 
263 263
         $date = date("F j, Y", $query_comment['timestamp']);
@@ -289,5 +289,5 @@  discard block
 block discarded – undo
289 289
     $smarty->assign('user_avatar_path', $user_avatar_path);
290 290
 
291 291
     //Send all smarty variables to the templates
292
-    $smarty->display("file:" . $mainsite_template_folder . "games/ajax_games_main_detail_comments.html");
292
+    $smarty->display("file:".$mainsite_template_folder."games/ajax_games_main_detail_comments.html");
293 293
 }
Please login to merge, or discard this patch.