Completed
Push — master ( 929644...1ba5c4 )
by mains
02:48
created
index.php 1 patch
Braces   +38 added lines, -9 removed lines patch added patch discarded remove patch
@@ -75,7 +75,11 @@  discard block
 block discarded – undo
75 75
 
76 76
 					<div id="location_mobile" class="hidden-sm-up">
77 77
 						<form method="get">
78
-							<input type="text" id="city_mobile" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required>
78
+							<input type="text" id="city_mobile" name="city" placeholder="<?php if(isset($newPositionStatus))
79
+{
80
+	echo $newPositionStatus;
81
+}
82
+?>" required>
79 83
 
80 84
 							<input type="submit" id="submit_mobile" class="fa" value="&#xf0ac;" />
81 85
 						</form>
@@ -102,7 +106,9 @@  discard block
 block discarded – undo
102 106
 
103 107
 					</content>
104 108
 					
105
-					<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?>
109
+					<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails']))
110
+{
111
+?>
106 112
 						<p id="loading">
107 113
 							Loading…
108 114
 						</p>
@@ -115,7 +121,11 @@  discard block
 block discarded – undo
115 121
 							<div>
116 122
 								<h2>Position / Hashtag</h2>
117 123
 								<form method="get">
118
-									<input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required>
124
+									<input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus))
125
+{
126
+	echo $newPositionStatus;
127
+}
128
+?>" required>
119 129
 									<label>try: #jhj</label><br>
120 130
 									<input type="submit" value="Set Location" /> 
121 131
 								</form>
@@ -131,7 +141,9 @@  discard block
 block discarded – undo
131 141
 
132 142
 						<article>
133 143
 							<div>
134
-								<?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?>
144
+								<?php if(isset($_GET['postId']) && isset($_GET['getPostDetails']))
145
+{
146
+?>
135 147
 								<h2>Comment on Jodel</h2>
136 148
 								<form method="POST">				
137 149
 										<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" />
@@ -139,7 +151,10 @@  discard block
 block discarded – undo
139 151
 									<br />
140 152
 									<input type="submit" value="SEND" /> 
141 153
 								</form>
142
-									<?php } else { ?>
154
+									<?php }
155
+else
156
+{
157
+?>
143 158
 								<h2>New Jodel</h2>
144 159
 								<form method="POST">
145 160
 									<textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> 
@@ -171,13 +186,25 @@  discard block
 block discarded – undo
171 186
 				<div class="col-xs-12">
172 187
 					<div class="row">
173 188
 						<div class="col-xs-3">
174
-							<a href="<?php echo $baseUrl;?>index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a>
189
+							<a href="<?php echo $baseUrl;?>index.php" <?php if($view=='time')
190
+{
191
+	echo 'class="active"';
192
+}
193
+?>><i class="fa fa-clock-o fa-3x"></i></a>
175 194
 						</div>
176 195
 						<div class="col-xs-3">
177
-							<a href="<?php echo $baseUrl;?>index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a>
196
+							<a href="<?php echo $baseUrl;?>index.php?view=comment" <?php if($view=='comment')
197
+{
198
+	echo 'class="active"';
199
+}
200
+?>><i class="fa fa-commenting-o fa-3x"></i></a>
178 201
 						</div>
179 202
 						<div class="col-xs-3">
180
-							<a href="<?php echo $baseUrl;?>index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a>
203
+							<a href="<?php echo $baseUrl;?>index.php?view=upVote" <?php if($view=='upVote')
204
+{
205
+	echo 'class="active"';
206
+}
207
+?>><i class="fa fa-angle-up fa-3x"></i></a>
181 208
 						</div>
182 209
 						<div class="col-xs-3">
183 210
 							<nav>
@@ -218,7 +245,9 @@  discard block
 block discarded – undo
218 245
 				    $('html,body').animate({scrollTop: aTag.offset().top-90},'slow');
219 246
 				}
220 247
 
221
-				<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?>
248
+				<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails']))
249
+{
250
+?>
222 251
 
223 252
 				
224 253
 
Please login to merge, or discard this patch.
php/JodelAccount.php 1 patch
Braces   +12 added lines, -7 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         if($location->getLat() == $lat && $location->getLng() == $lng && $location->getCityName() == $name)
88 88
         {
89 89
             return TRUE;
90
-        }  
90
+        }
91 91
         else
92 92
         {
93 93
             return FALSE;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         if(substr($_GET['city'], 0, 1) === '#')
101 101
         {
102 102
             return htmlspecialchars($_GET['city']) . " " . $this->location->cityName;
103
-        }                
103
+        }
104 104
         else
105 105
         {
106 106
             $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w';
@@ -262,7 +262,8 @@  discard block
 block discarded – undo
262 262
         if(isset($_POST['color']))
263 263
         {
264 264
             $color = $_POST['color'];
265
-            switch ($color) {
265
+            switch ($color)
266
+            {
266 267
                 case '8ABDB0':
267 268
                     $color = '8ABDB0';
268 269
                     break;
@@ -355,7 +356,8 @@  discard block
 block discarded – undo
355 356
                                     expiration_date='" . $expiration_date . "'
356 357
                                 WHERE device_uid='" . $device_uid . "'");
357 358
 
358
-        if($result === false){
359
+        if($result === false)
360
+        {
359 361
                 error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
360 362
         }   
361 363
     }
@@ -435,14 +437,16 @@  discard block
 block discarded – undo
435 437
         $result = $db->query("INSERT INTO votes (device_uid, postId, type)
436 438
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
437 439
         
438
-        if($result === false){
440
+        if($result === false)
441
+        {
439 442
                 $error = db_error();
440 443
                 echo $error;
441 444
                 echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
442 445
         }       
443 446
     }
444 447
 
445
-    function registerAccount($location) {
448
+    function registerAccount($location)
449
+    {
446 450
         $accountCreator = new CreateUser();
447 451
         $accountCreator->setLocation($location);
448 452
         $data = $accountCreator->execute();
@@ -467,7 +471,8 @@  discard block
 block discarded – undo
467 471
                         "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
468 472
 
469 473
         $success = TRUE;
470
-        if($result === false){
474
+        if($result === false)
475
+        {
471 476
                 $error = db_error();
472 477
                 echo $error;
473 478
                 echo "Adding account failed: (" . $result->errno . ") " . $result->error;
Please login to merge, or discard this patch.