Completed
Push — master ( be2f09...62cb27 )
by mains
03:13
created
php/Requests/GetCaptcha.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php
2 2
 class GetCaptcha extends AbstractRequest
3 3
 {		
4
-    function getApiEndPoint()
5
-    {
6
-        return '/v3/user/verification/imageCaptcha/';
7
-    }
8
-    function getPayload()
9
-    {
10
-        return array(
11
-        );
12
-    }
13
-    function getMethod()
14
-    {
15
-        return 'GET';
16
-    }
4
+	function getApiEndPoint()
5
+	{
6
+		return '/v3/user/verification/imageCaptcha/';
7
+	}
8
+	function getPayload()
9
+	{
10
+		return array(
11
+		);
12
+	}
13
+	function getMethod()
14
+	{
15
+		return 'GET';
16
+	}
17 17
 }
18 18
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 class GetCaptcha extends AbstractRequest
3
-{		
3
+{
4 4
     function getApiEndPoint()
5 5
     {
6 6
         return '/v3/user/verification/imageCaptcha/';
Please login to merge, or discard this patch.
php/Jodel.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 class Jodel
4 4
 {
5
-    public $jodel;
5
+	public $jodel;
6 6
 
7 7
    
8 8
 }
9 9
\ No newline at end of file
Please login to merge, or discard this patch.
php/jodel-web.php 5 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 {
44 44
     preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches);
45 45
 
46
-    return (isset($matches[0])) ? true : false;
46
+    return (isset($matches[0])) ? TRUE : FALSE;
47 47
 }
48 48
 
49 49
 function configPropertyExists($config, $property)
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -37,6 +37,9 @@  discard block
 block discarded – undo
37 37
 	die();
38 38
 }
39 39
 
40
+/**
41
+ * @param string $msg
42
+ */
40 43
 function user_log($msg)
41 44
 {
42 45
     $log  = $msg . PHP_EOL;
@@ -51,6 +54,9 @@  discard block
 block discarded – undo
51 54
     return (isset($matches[0])) ? true : false;
52 55
 }
53 56
 
57
+/**
58
+ * @param string $property
59
+ */
54 60
 function configPropertyExists($config, $property)
55 61
 {
56 62
     if(!array_key_exists($property, $config) || !isset($config[$property]) || $config[$property] == '' || $config[$property] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 function isUserVoter()
76 76
 {
77 77
 	if(isset($_COOKIE['JodelVoterPassword']))
78
-	{	
78
+	{
79 79
 		$db = new DatabaseConnect();
80 80
 		$result = $db->query("SELECT id FROM users WHERE user_token = '" . $_COOKIE['JodelVoterPassword'] . "'");
81 81
 		if($result->num_rows == 0)
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	}
148 148
 	
149 149
 	if(configPropertyExists($config, 'karmaDeviceUid'))
150
-    {
150
+	{
151 151
     	$jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']);
152 152
     }
153 153
     else
@@ -220,7 +220,8 @@  discard block
 block discarded – undo
220 220
 	
221 221
 	if(isset($_GET['view']))
222 222
 	{
223
-		switch ($_GET['view']) {
223
+		switch ($_GET['view'])
224
+		{
224 225
 			case 'discussed':
225 226
 				$view = 'discussed';
226 227
 				break;
Please login to merge, or discard this patch.
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -49,27 +49,27 @@  discard block
 block discarded – undo
49 49
 
50 50
 function user_log($msg)
51 51
 {
52
-    $log  = $msg . PHP_EOL;
53
-    file_put_contents(realpath(__DIR__ . '/..') . '/logs/user_log-' . date("j.n.Y") . '.txt', $log, FILE_APPEND);
52
+	$log  = $msg . PHP_EOL;
53
+	file_put_contents(realpath(__DIR__ . '/..') . '/logs/user_log-' . date("j.n.Y") . '.txt', $log, FILE_APPEND);
54 54
 }
55 55
 
56 56
 function isUserBot()
57 57
 {
58
-    preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches);
58
+	preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches);
59 59
 
60
-    return (isset($matches[0])) ? true : false;
60
+	return (isset($matches[0])) ? true : false;
61 61
 }
62 62
 
63 63
 function configPropertyExists($config, $property)
64 64
 {
65
-    if(!array_key_exists($property, $config) || !isset($config[$property]) || $config[$property] == '' || $config[$property] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
66
-    {
67
-        return FALSE;
68
-    }
69
-    else
70
-    {
71
-        return TRUE;
72
-    }
65
+	if(!array_key_exists($property, $config) || !isset($config[$property]) || $config[$property] == '' || $config[$property] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
66
+	{
67
+		return FALSE;
68
+	}
69
+	else
70
+	{
71
+		return TRUE;
72
+	}
73 73
 }
74 74
 
75 75
 function isUserVoter()
@@ -110,19 +110,19 @@  discard block
 block discarded – undo
110 110
 
111 111
 function isDeviceUidInDatabase($deviceUid)
112 112
 {
113
-    $db = new DatabaseConnect();  
114
-    $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid  . "'");
113
+	$db = new DatabaseConnect();  
114
+	$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid  . "'");
115 115
 
116
-    if ($result->num_rows > 0)
117
-    {
118
-    	$db->close();
119
-        return TRUE;
120
-    }
121
-    else
122
-    {
123
-    	$db->close();
124
-        return FALSE;
125
-    }
116
+	if ($result->num_rows > 0)
117
+	{
118
+		$db->close();
119
+		return TRUE;
120
+	}
121
+	else
122
+	{
123
+		$db->close();
124
+		return FALSE;
125
+	}
126 126
 }
127 127
 
128 128
 	//Check if it's a Spider or Google Bot
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 	}
150 150
 	
151 151
 	if(configPropertyExists($config, 'karmaDeviceUid'))
152
-    {
153
-    	$jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']);
154
-    }
155
-    else
156
-    {
157
-    	error_log("No Karma deviceUid set in config file");
152
+	{
153
+		$jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']);
154
+	}
155
+	else
156
+	{
157
+		error_log("No Karma deviceUid set in config file");
158 158
 		$jodelAccountForKarma = new JodelAccount($deviceUid);
159
-    }
159
+	}
160 160
 
161 161
 	/*
162 162
 	 * Cunstruct View
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 function user_log($msg)
51 51
 {
52
-    $log  = $msg . PHP_EOL;
52
+    $log = $msg . PHP_EOL;
53 53
     file_put_contents(realpath(__DIR__ . '/..') . '/logs/user_log-' . date("j.n.Y") . '.txt', $log, FILE_APPEND);
54 54
 }
55 55
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 {
58 58
     preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches);
59 59
 
60
-    return (isset($matches[0])) ? true : false;
60
+    return (isset($matches[0]))?true : false;
61 61
 }
62 62
 
63 63
 function configPropertyExists($config, $property)
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 function isUserAdmin()
99 99
 {
100 100
 	global $config;
101
-	if (isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword'])
101
+	if(isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword'])
102 102
 	{
103 103
 		return TRUE;
104 104
 	}
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
 function isDeviceUidInDatabase($deviceUid)
112 112
 {
113 113
     $db = new DatabaseConnect();  
114
-    $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid  . "'");
114
+    $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'");
115 115
 
116
-    if ($result->num_rows > 0)
116
+    if($result->num_rows > 0)
117 117
     {
118 118
     	$db->close();
119 119
         return TRUE;
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 		if(!isset($_COOKIE['JodelDeviceId']) || !isDeviceUidInDatabase($_COOKIE['JodelDeviceId']))
138 138
 		{
139 139
 			$jodelAccountForView = new JodelAccount();
140
-			setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time()+60*60*24*365*10);
141
-			user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid .  ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
140
+			setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time() + 60 * 60 * 24 * 365 * 10);
141
+			user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
142 142
 			
143 143
 		}
144 144
 		else
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	if(isset($_GET['search']))
168 168
 	{
169 169
 
170
-		user_log('User with JodelDeviceId:' . $jodelAccountForView->deviceUid .  ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] searched for ' . $_GET['search']);
170
+		user_log('User with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] searched for ' . $_GET['search']);
171 171
 
172 172
 		if(substr($_GET['search'], 0, 1) === "#")
173 173
 		{
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	
223 223
 	if(isset($_GET['view']))
224 224
 	{
225
-		switch ($_GET['view']) {
225
+		switch($_GET['view']) {
226 226
 			case 'discussed':
227 227
 				$view = 'discussed';
228 228
 				break;
Please login to merge, or discard this patch.
php/JodelAccount.php 5 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -385,6 +385,9 @@
 block discarded – undo
385 385
         }       
386 386
     }
387 387
 
388
+    /**
389
+     * @param Location $location
390
+     */
388 391
     function registerAccount($location) {
389 392
         $accountCreator = new CreateUser();
390 393
         $accountCreator->setLocation($location);
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         {
36 36
             $this->refreshToken();
37 37
         }
38
-        $this->accessToken  = $this->getAccessToken();
38
+        $this->accessToken = $this->getAccessToken();
39 39
 
40 40
        /* if($this->isAccountVerified() != 1)
41 41
         {
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
         }
107 107
 
108 108
         $db = new DatabaseConnect();
109
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
109
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
110 110
         
111 111
         $location = new Location();
112 112
         
113
-        if ($result->num_rows > 0)
113
+        if($result->num_rows > 0)
114 114
         {
115 115
             // output data of each row
116 116
             while($row = $result->fetch_assoc())
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                     }
183 183
                     else
184 184
                     {
185
-                        user_log('User with JodelDeviceId:' . $this->deviceUid .  ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
185
+                        user_log('User with JodelDeviceId:' . $this->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
186 186
                     }
187 187
                 }
188 188
 
@@ -194,11 +194,11 @@  discard block
 block discarded – undo
194 194
     function getLocation()
195 195
     {
196 196
         $db = new DatabaseConnect();
197
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
197
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
198 198
         
199 199
         $location = new Location();
200 200
         
201
-        if ($result->num_rows > 0)
201
+        if($result->num_rows > 0)
202 202
         {
203 203
             // output data of each row
204 204
             while($row = $result->fetch_assoc())
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
         if(isset($_POST['color']))
322 322
         {
323 323
             $color = $_POST['color'];
324
-            switch ($color) {
324
+            switch($color) {
325 325
                 case '8ABDB0':
326 326
                     $color = '8ABDB0';
327 327
                     break;
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
         $db = new DatabaseConnect();  
390 390
         $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
391 391
 
392
-        if ($result->num_rows > 0)
392
+        if($result->num_rows > 0)
393 393
         {
394 394
             // output data of each row
395 395
             while($row = $result->fetch_assoc())
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
                                     expiration_date='" . $expiration_date . "'
429 429
                                 WHERE device_uid='" . $device_uid . "'");
430 430
 
431
-        if($result === false){
431
+        if($result === false) {
432 432
                 error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
433 433
         }   
434 434
     }
@@ -438,11 +438,11 @@  discard block
 block discarded – undo
438 438
     function getAccessToken()
439 439
     {
440 440
         $db = new DatabaseConnect();
441
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
441
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
442 442
         
443 443
         $accessToken;
444 444
         
445
-        if ($result->num_rows > 0)
445
+        if($result->num_rows > 0)
446 446
         {
447 447
             // output data of each row
448 448
             while($row = $result->fetch_assoc())
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
         $result = $db->query("INSERT INTO votes (device_uid, postId, type)
509 509
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
510 510
         
511
-        if($result === false){
511
+        if($result === false) {
512 512
                 $error = db_error();
513 513
                 echo $error;
514 514
                 echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
@@ -536,11 +536,11 @@  discard block
 block discarded – undo
536 536
         $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type,
537 537
                         expires_in, expiration_date, distinct_id, device_uid, name, lat, lng)
538 538
                         VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type .
539
-                        "','" .  $expires_in . "','" . $expiration_date . "','" . $distinct_id .
539
+                        "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id .
540 540
                         "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
541 541
 
542 542
         $success = TRUE;
543
-        if($result === false){
543
+        if($result === false) {
544 544
                 $error = $db->error();
545 545
                 echo $error;
546 546
                 echo "Adding account failed: (" . $result->errno . ") " . $result->error;
Please login to merge, or discard this patch.
Braces   +12 added lines, -7 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         if($location->getLat() == $lat && $location->getLng() == $lng && $location->getCityName() == $name)
146 146
         {
147 147
             return TRUE;
148
-        }  
148
+        }
149 149
         else
150 150
         {
151 151
             return FALSE;
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         if(substr($_GET['city'], 0, 1) === '#')
159 159
         {
160 160
             return htmlspecialchars($_GET['city']) . " " . $this->location->cityName;
161
-        }                
161
+        }
162 162
         else
163 163
         {
164 164
             $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=' . $this->getGeocodingToken();
@@ -338,7 +338,8 @@  discard block
 block discarded – undo
338 338
         if(isset($_POST['color']))
339 339
         {
340 340
             $color = $_POST['color'];
341
-            switch ($color) {
341
+            switch ($color)
342
+            {
342 343
                 case '8ABDB0':
343 344
                     $color = '8ABDB0';
344 345
                     break;
@@ -451,7 +452,8 @@  discard block
 block discarded – undo
451 452
                                     expiration_date='" . $expiration_date . "'
452 453
                                 WHERE device_uid='" . $device_uid . "'");
453 454
 
454
-        if($result === false){
455
+        if($result === false)
456
+        {
455 457
                 error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
456 458
         }   
457 459
     }
@@ -531,14 +533,16 @@  discard block
 block discarded – undo
531 533
         $result = $db->query("INSERT INTO votes (device_uid, postId, type)
532 534
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
533 535
         
534
-        if($result === false){
536
+        if($result === false)
537
+        {
535 538
                 $error = db_error();
536 539
                 echo $error;
537 540
                 echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
538 541
         }       
539 542
     }
540 543
 
541
-    function registerAccount($location) {
544
+    function registerAccount($location)
545
+    {
542 546
         $accountCreator = new CreateUser();
543 547
         $accountCreator->setLocation($location);
544 548
         $data = $accountCreator->execute();
@@ -563,7 +567,8 @@  discard block
 block discarded – undo
563 567
                         "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
564 568
 
565 569
         $success = TRUE;
566
-        if($result === false){
570
+        if($result === false)
571
+        {
567 572
                 $error = $db->error();
568 573
                 echo $error;
569 574
                 echo "Adding account failed: (" . $result->errno . ") " . $result->error;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -110,16 +110,16 @@  discard block
 block discarded – undo
110 110
     {
111 111
         $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($city) . '&key=' . $this->getGeocodingToken();
112 112
         $result = Requests::post($url);
113
-        if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
113
+        if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST')
114 114
         {
115 115
             error_log('Error locationEquals');
116 116
             return FALSE;
117 117
         }
118 118
         else
119 119
         {
120
-            $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name'];
121
-            $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat'];
122
-            $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng'];
120
+            $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name'];
121
+            $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat'];
122
+            $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng'];
123 123
         }
124 124
 
125 125
         $db = new DatabaseConnect();
@@ -163,15 +163,15 @@  discard block
 block discarded – undo
163 163
         {
164 164
             $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=' . $this->getGeocodingToken();
165 165
             $result = Requests::post($url);
166
-            if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
166
+            if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST')
167 167
             {
168 168
                 return "0 results";
169 169
             }
170 170
             else
171 171
             {
172
-                $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name'];
173
-                $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat'];
174
-                $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng'];
172
+                $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name'];
173
+                $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat'];
174
+                $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng'];
175 175
 
176 176
                 $location = new Location();
177 177
                 $location->setLat($lat);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                                 lng='" . $lng . "'
194 194
                             WHERE access_token='" . $this->accessToken . "'");
195 195
 
196
-                    if($result === false)
196
+                    if($result === FALSE)
197 197
                     {
198 198
                             echo "Updating location failed: (" . $db->errno . ") " . $db->error;
199 199
                     }
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
                 $accountCreator->postId = htmlspecialchars($postId);
294 294
                 $data = $accountCreator->execute();
295 295
 
296
-                user_log('User voted: ' . print_r($data, true));
296
+                user_log('User voted: ' . print_r($data, TRUE));
297 297
 
298 298
                 if(array_key_exists('post', $data))
299 299
                 {
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                 }
307 307
                 else
308 308
                 {
309
-                    error_log('Could not vote: ' . print_r($data, true));
309
+                    error_log('Could not vote: ' . print_r($data, TRUE));
310 310
                     return FALSE;
311 311
                 } 
312 312
             }
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
         
372 372
 		if($data != 'Success')
373 373
 		{
374
-			error_log('Could not set location befor Post: ' . print_r($data, true));
374
+			error_log('Could not set location befor Post: ' . print_r($data, TRUE));
375 375
 		}
376 376
 
377 377
         $accountCreator->location = $this->location;
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
             return $errorMsg;
394 394
         }
395 395
 
396
-        user_log('User posted: ' . print_r($data, true));
396
+        user_log('User posted: ' . print_r($data, TRUE));
397 397
 
398 398
         if(isset($_POST['ancestor']))
399 399
         {
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
                                     expiration_date='" . $expiration_date . "'
452 452
                                 WHERE device_uid='" . $device_uid . "'");
453 453
 
454
-        if($result === false){
454
+        if($result === FALSE){
455 455
                 error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
456 456
         }   
457 457
     }
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 
500 500
         $result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')");
501 501
         
502
-        if($result === false)
502
+        if($result === FALSE)
503 503
         {
504 504
             $error = db_error();
505 505
             echo $error;
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
         $result = $db->query("INSERT INTO votes (device_uid, postId, type)
532 532
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
533 533
         
534
-        if($result === false){
534
+        if($result === FALSE){
535 535
                 $error = db_error();
536 536
                 echo $error;
537 537
                 echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
                         "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
564 564
 
565 565
         $success = TRUE;
566
-        if($result === false){
566
+        if($result === FALSE){
567 567
                 $error = $db->error();
568 568
                 echo $error;
569 569
                 echo "Adding account failed: (" . $result->errno . ") " . $result->error;
Please login to merge, or discard this patch.
Indentation   +481 added lines, -481 removed lines patch added patch discarded remove patch
@@ -2,47 +2,47 @@  discard block
 block discarded – undo
2 2
 
3 3
 class JodelAccount
4 4
 {
5
-    public $accessToken;
6
-    public $expirationDate;
7
-    public $refreshToken;
8
-    public $distinctId;
9
-    public $deviceUid;
10
-
11
-    //is the Account a Bot or Spider?
12
-    public $isBot;
5
+	public $accessToken;
6
+	public $expirationDate;
7
+	public $refreshToken;
8
+	public $distinctId;
9
+	public $deviceUid;
10
+
11
+	//is the Account a Bot or Spider?
12
+	public $isBot;
13 13
     
14
-    // array of voted Jodels
15
-    public $votes;
14
+	// array of voted Jodels
15
+	public $votes;
16 16
 
17
-    //Location of the Account
18
-    public $location;
17
+	//Location of the Account
18
+	public $location;
19 19
 
20
-    function __construct($deviceUid = NULL, $isBot = FALSE)
21
-    {
22
-        if($deviceUid == NULL)
23
-        {
24
-            $this->deviceUid = $this->createAccount();
25
-        }
26
-        else
27
-        {
28
-            $this->deviceUid = $deviceUid;
29
-        }
20
+	function __construct($deviceUid = NULL, $isBot = FALSE)
21
+	{
22
+		if($deviceUid == NULL)
23
+		{
24
+			$this->deviceUid = $this->createAccount();
25
+		}
26
+		else
27
+		{
28
+			$this->deviceUid = $deviceUid;
29
+		}
30 30
 
31
-        $this->isBot        = $isBot;
32
-        $this->location     = $this->getLocation();
31
+		$this->isBot        = $isBot;
32
+		$this->location     = $this->getLocation();
33 33
 
34
-        if(!$this->isTokenFresh())
35
-        {
36
-            $this->refreshToken();
37
-        }
38
-        $this->accessToken  = $this->getAccessToken();
34
+		if(!$this->isTokenFresh())
35
+		{
36
+			$this->refreshToken();
37
+		}
38
+		$this->accessToken  = $this->getAccessToken();
39 39
 
40
-       /* if($this->isAccountVerified() != 1)
40
+	   /* if($this->isAccountVerified() != 1)
41 41
         {
42 42
             $this->showCaptcha();
43 43
             //$this->verifyCaptcha();
44 44
         }*/
45
-    }
45
+	}
46 46
 
47 47
 /*
48 48
     function showCaptcha()
@@ -71,527 +71,527 @@  discard block
 block discarded – undo
71 71
     }
72 72
     */
73 73
 
74
-    function getCaptcha()
75
-    {
76
-        $accountCreator = new GetCaptcha();
77
-        $accountCreator->setAccessToken($this->accessToken);
78
-        $captcha = $accountCreator->execute();
79
-
80
-        return array("image_url" => $captcha['image_url'], "key" => $captcha['key']);
81
-    }
82
-
83
-    function isAccountVerified()
84
-    {
85
-        $accountCreator = new GetUserConfig();
86
-        $accountCreator->setAccessToken($this->accessToken);
87
-        $data = $accountCreator->execute();
88
-
89
-        //error_log(print_r($data, true));
90
-
91
-        return $data['verified'];
92
-    }
93
-
94
-    function getGeocodingToken()
95
-    {
96
-        $config = parse_ini_file('config/config.ini.php');
97
-        if(!isset($config['geocodingToken']) ||
98
-            $config['geocodingToken'] == NULL ||
99
-            $config['geocodingToken'] == '' ||
100
-            $config['geocodingToken'] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
101
-        {
102
-            error_log("Please set a Google Maps Geocoding Token!");
103
-        }
104
-        else
105
-        {
106
-            return $config['geocodingToken'];
107
-        }
108
-    }
74
+	function getCaptcha()
75
+	{
76
+		$accountCreator = new GetCaptcha();
77
+		$accountCreator->setAccessToken($this->accessToken);
78
+		$captcha = $accountCreator->execute();
79
+
80
+		return array("image_url" => $captcha['image_url'], "key" => $captcha['key']);
81
+	}
82
+
83
+	function isAccountVerified()
84
+	{
85
+		$accountCreator = new GetUserConfig();
86
+		$accountCreator->setAccessToken($this->accessToken);
87
+		$data = $accountCreator->execute();
88
+
89
+		//error_log(print_r($data, true));
90
+
91
+		return $data['verified'];
92
+	}
93
+
94
+	function getGeocodingToken()
95
+	{
96
+		$config = parse_ini_file('config/config.ini.php');
97
+		if(!isset($config['geocodingToken']) ||
98
+			$config['geocodingToken'] == NULL ||
99
+			$config['geocodingToken'] == '' ||
100
+			$config['geocodingToken'] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
101
+		{
102
+			error_log("Please set a Google Maps Geocoding Token!");
103
+		}
104
+		else
105
+		{
106
+			return $config['geocodingToken'];
107
+		}
108
+	}
109 109
 
110
-    function locationEquals($city)
111
-    {
112
-        $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($city) . '&key=' . $this->getGeocodingToken();
113
-        $result = Requests::post($url);
114
-        if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
115
-        {
116
-            error_log('Error locationEquals');
117
-            return FALSE;
118
-        }
119
-        else
120
-        {
121
-            $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name'];
122
-            $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat'];
123
-            $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng'];
124
-        }
110
+	function locationEquals($city)
111
+	{
112
+		$url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($city) . '&key=' . $this->getGeocodingToken();
113
+		$result = Requests::post($url);
114
+		if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
115
+		{
116
+			error_log('Error locationEquals');
117
+			return FALSE;
118
+		}
119
+		else
120
+		{
121
+			$name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name'];
122
+			$lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat'];
123
+			$lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng'];
124
+		}
125 125
 
126
-        $db = new DatabaseConnect();
127
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
126
+		$db = new DatabaseConnect();
127
+		$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
128 128
         
129
-        $location = new Location();
129
+		$location = new Location();
130 130
         
131
-        if ($result->num_rows > 0)
132
-        {
133
-            // output data of each row
134
-            while($row = $result->fetch_assoc())
135
-            {
136
-                $location->setLat($row['lat']);
137
-                $location->setLng($row['lng']);
138
-                $location->setCityName($row['name']);
139
-            }
140
-        }
141
-        else
142
-        {
143
-            error_log("Error no Location found - getLocation");
144
-        }
131
+		if ($result->num_rows > 0)
132
+		{
133
+			// output data of each row
134
+			while($row = $result->fetch_assoc())
135
+			{
136
+				$location->setLat($row['lat']);
137
+				$location->setLng($row['lng']);
138
+				$location->setCityName($row['name']);
139
+			}
140
+		}
141
+		else
142
+		{
143
+			error_log("Error no Location found - getLocation");
144
+		}
145 145
 
146
-        if($location->getLat() == $lat && $location->getLng() == $lng && $location->getCityName() == $name)
147
-        {
148
-            return TRUE;
149
-        }  
150
-        else
151
-        {
152
-            return FALSE;
153
-        }
154
-    }
146
+		if($location->getLat() == $lat && $location->getLng() == $lng && $location->getCityName() == $name)
147
+		{
148
+			return TRUE;
149
+		}  
150
+		else
151
+		{
152
+			return FALSE;
153
+		}
154
+	}
155 155
 
156
-    function setLocation()
157
-    {
158
-        //Is Channel or City
159
-        if(substr($_GET['city'], 0, 1) === '#')
160
-        {
161
-            return htmlspecialchars($_GET['city']) . " " . $this->location->cityName;
162
-        }                
163
-        else
164
-        {
165
-            $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=' . $this->getGeocodingToken();
166
-            $result = Requests::post($url);
167
-            if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
168
-            {
169
-                return "0 results";
170
-            }
171
-            else
172
-            {
173
-                $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name'];
174
-                $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat'];
175
-                $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng'];
176
-
177
-                $location = new Location();
178
-                $location->setLat($lat);
179
-                $location->setLng($lng);
180
-                $location->setCityName($name);
181
-                $accountCreator = new UpdateLocation();
182
-                $accountCreator->setLocation($location);
183
-                $accountCreator->setAccessToken($this->accessToken);
184
-                $data = $accountCreator->execute();
185
-
186
-                //safe location to db
187
-                $db = new DatabaseConnect();
188
-
189
-                if($data == 'Success')
190
-                {
191
-                    $result = $db->query("UPDATE accounts 
156
+	function setLocation()
157
+	{
158
+		//Is Channel or City
159
+		if(substr($_GET['city'], 0, 1) === '#')
160
+		{
161
+			return htmlspecialchars($_GET['city']) . " " . $this->location->cityName;
162
+		}                
163
+		else
164
+		{
165
+			$url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=' . $this->getGeocodingToken();
166
+			$result = Requests::post($url);
167
+			if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
168
+			{
169
+				return "0 results";
170
+			}
171
+			else
172
+			{
173
+				$name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name'];
174
+				$lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat'];
175
+				$lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng'];
176
+
177
+				$location = new Location();
178
+				$location->setLat($lat);
179
+				$location->setLng($lng);
180
+				$location->setCityName($name);
181
+				$accountCreator = new UpdateLocation();
182
+				$accountCreator->setLocation($location);
183
+				$accountCreator->setAccessToken($this->accessToken);
184
+				$data = $accountCreator->execute();
185
+
186
+				//safe location to db
187
+				$db = new DatabaseConnect();
188
+
189
+				if($data == 'Success')
190
+				{
191
+					$result = $db->query("UPDATE accounts 
192 192
                             SET name='" . $name . "',
193 193
                                 lat='" . $lat . "',
194 194
                                 lng='" . $lng . "'
195 195
                             WHERE access_token='" . $this->accessToken . "'");
196 196
 
197
-                    if($result === false)
198
-                    {
199
-                            echo "Updating location failed: (" . $db->errno . ") " . $db->error;
200
-                    }
201
-                    else
202
-                    {
203
-                        user_log('User with JodelDeviceId:' . $this->deviceUid .  ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
204
-                    }
205
-                }
206
-
207
-                return $name;
208
-            }
209
-        }
210
-    }
197
+					if($result === false)
198
+					{
199
+							echo "Updating location failed: (" . $db->errno . ") " . $db->error;
200
+					}
201
+					else
202
+					{
203
+						user_log('User with JodelDeviceId:' . $this->deviceUid .  ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
204
+					}
205
+				}
206
+
207
+				return $name;
208
+			}
209
+		}
210
+	}
211 211
 
212
-    function getLocation()
213
-    {
214
-        $db = new DatabaseConnect();
215
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
212
+	function getLocation()
213
+	{
214
+		$db = new DatabaseConnect();
215
+		$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
216 216
         
217
-        $location = new Location();
217
+		$location = new Location();
218 218
         
219
-        if ($result->num_rows > 0)
220
-        {
221
-            // output data of each row
222
-            while($row = $result->fetch_assoc())
223
-            {
224
-                $location->setLat($row['lat']);
225
-                $location->setLng($row['lng']);
226
-                $location->setCityName($row['name']);
227
-            }
228
-        }
229
-        else
230
-        {
231
-            echo "Error: 0 results";
232
-            error_log("Error no Location found - getLocation");
233
-        }
219
+		if ($result->num_rows > 0)
220
+		{
221
+			// output data of each row
222
+			while($row = $result->fetch_assoc())
223
+			{
224
+				$location->setLat($row['lat']);
225
+				$location->setLng($row['lng']);
226
+				$location->setCityName($row['name']);
227
+			}
228
+		}
229
+		else
230
+		{
231
+			echo "Error: 0 results";
232
+			error_log("Error no Location found - getLocation");
233
+		}
234 234
 
235
-        return $location;
236
-    }
235
+		return $location;
236
+	}
237 237
 
238
-    function verifyCaptcha()
239
-    {
240
-        if(isset($_GET['deviceUid']))
241
-        {
242
-            $deviceUid = $_GET['deviceUid'];
243
-            $jodelAccountForVerify = new JodelAccount($deviceUid);
244
-        }
245
-        else if(isset($_POST['deviceUid']))
246
-        {
247
-            $deviceUid = $_POST['deviceUid'];
248
-            $jodelAccountForVerify = new JodelAccount($deviceUid);
249
-        }
250
-        else
251
-        {
252
-            $deviceUid = $this->deviceUid;
253
-            $jodelAccountForVerify = $this;
254
-        }
238
+	function verifyCaptcha()
239
+	{
240
+		if(isset($_GET['deviceUid']))
241
+		{
242
+			$deviceUid = $_GET['deviceUid'];
243
+			$jodelAccountForVerify = new JodelAccount($deviceUid);
244
+		}
245
+		else if(isset($_POST['deviceUid']))
246
+		{
247
+			$deviceUid = $_POST['deviceUid'];
248
+			$jodelAccountForVerify = new JodelAccount($deviceUid);
249
+		}
250
+		else
251
+		{
252
+			$deviceUid = $this->deviceUid;
253
+			$jodelAccountForVerify = $this;
254
+		}
255 255
 
256
-        $solution = $_GET['solution'];
257
-        $solution = array_map('intval', explode('-', $solution));
256
+		$solution = $_GET['solution'];
257
+		$solution = array_map('intval', explode('-', $solution));
258 258
 
259
-        $accountCreator = new PostCaptcha();
260
-        $accountCreator->setAccessToken($jodelAccountForVerify->accessToken);
261
-        $accountCreator->captchaKey = $_GET['key'];
262
-        $accountCreator->captchaSolution = $solution;
263
-        $verified = $accountCreator->execute();
259
+		$accountCreator = new PostCaptcha();
260
+		$accountCreator->setAccessToken($jodelAccountForVerify->accessToken);
261
+		$accountCreator->captchaKey = $_GET['key'];
262
+		$accountCreator->captchaSolution = $solution;
263
+		$verified = $accountCreator->execute();
264 264
 
265
-        if(isset($verified->status_code))
266
-        {
267
-            return $verified->status_code;
268
-        }
269
-        return $verified['verified'];
270
-    }
265
+		if(isset($verified->status_code))
266
+		{
267
+			return $verified->status_code;
268
+		}
269
+		return $verified['verified'];
270
+	}
271 271
 
272
-    //ToDo Spider Check
273
-    function votePostId($postId, $vote)
274
-    {
275
-        if(!$this->isBot)
276
-        {
277
-            if(!$this->isAccountVerified())
278
-            {
279
-                error_log('Account is not Verified! jodelAccount.php Line 279');
280
-                return FALSE;
281
-            }
282
-            else
283
-            {
272
+	//ToDo Spider Check
273
+	function votePostId($postId, $vote)
274
+	{
275
+		if(!$this->isBot)
276
+		{
277
+			if(!$this->isAccountVerified())
278
+			{
279
+				error_log('Account is not Verified! jodelAccount.php Line 279');
280
+				return FALSE;
281
+			}
282
+			else
283
+			{
284 284
                 
285
-            }
286
-
287
-            if(!$this->hasVoted($postId))
288
-            {
289
-                if($vote == "up")
290
-                {
291
-                    $accountCreator = new Upvote();
292
-                }
293
-                else if($vote == "down")
294
-                {
295
-                    $accountCreator = new Downvote();
296
-                }
297
-
298
-                $accountCreator->setAccessToken($this->accessToken);
299
-                $accountCreator->postId = htmlspecialchars($postId);
300
-                $data = $accountCreator->execute();
301
-
302
-                user_log('User voted: ' . print_r($data, true));
303
-
304
-                if(array_key_exists('post', $data))
305
-                {
306
-                    $this->addVoteWithPostIdAndType($postId, $vote);
307
-                    return TRUE;
308
-                }
309
-                else if(array_key_exists('error', $data))
310
-                {
311
-                    error_log('Could not vote - Error: ' . $data['error']);
312
-                    return FALSE;
313
-                }
314
-                else
315
-                {
316
-                    error_log('Could not vote: ' . print_r($data, true));
317
-                    return FALSE;
318
-                } 
319
-            }
320
-            else
321
-            {
322
-                return FALSE;
323
-            }
324
-        }
325
-        else
326
-        {
327
-            return FALSE;
328
-        }
329
-    }
285
+			}
286
+
287
+			if(!$this->hasVoted($postId))
288
+			{
289
+				if($vote == "up")
290
+				{
291
+					$accountCreator = new Upvote();
292
+				}
293
+				else if($vote == "down")
294
+				{
295
+					$accountCreator = new Downvote();
296
+				}
297
+
298
+				$accountCreator->setAccessToken($this->accessToken);
299
+				$accountCreator->postId = htmlspecialchars($postId);
300
+				$data = $accountCreator->execute();
301
+
302
+				user_log('User voted: ' . print_r($data, true));
303
+
304
+				if(array_key_exists('post', $data))
305
+				{
306
+					$this->addVoteWithPostIdAndType($postId, $vote);
307
+					return TRUE;
308
+				}
309
+				else if(array_key_exists('error', $data))
310
+				{
311
+					error_log('Could not vote - Error: ' . $data['error']);
312
+					return FALSE;
313
+				}
314
+				else
315
+				{
316
+					error_log('Could not vote: ' . print_r($data, true));
317
+					return FALSE;
318
+				} 
319
+			}
320
+			else
321
+			{
322
+				return FALSE;
323
+			}
324
+		}
325
+		else
326
+		{
327
+			return FALSE;
328
+		}
329
+	}
330 330
 
331
-    //ToDo Spider Check
332
-    function sendJodel($location, $view)
333
-    {
334
-        if($this->isAccountVerified() != 1)
335
-        {
336
-            $this->showCaptcha();
337
-            //$this->verifyCaptcha();
338
-        }
331
+	//ToDo Spider Check
332
+	function sendJodel($location, $view)
333
+	{
334
+		if($this->isAccountVerified() != 1)
335
+		{
336
+			$this->showCaptcha();
337
+			//$this->verifyCaptcha();
338
+		}
339 339
 
340
-        $accountCreator = new SendJodel();
340
+		$accountCreator = new SendJodel();
341 341
 
342
-        if(isset($_POST['ancestor']))
343
-        {
344
-            $ancestor = $_POST['ancestor'];
345
-            $accountCreator->ancestor = $ancestor;
346
-        }
347
-        if(isset($_POST['color']))
348
-        {
349
-            $color = $_POST['color'];
350
-            switch ($color) {
351
-                case '8ABDB0':
352
-                    $color = '8ABDB0';
353
-                    break;
354
-                case '9EC41C':
355
-                    $color = '9EC41C';
356
-                    break;
357
-                case '06A3CB':
358
-                    $color = '06A3CB';
359
-                    break;
360
-                case 'FFBA00':
361
-                    $color = 'FFBA00';
362
-                    break;
363
-                case 'DD5F5F':
364
-                    $color = 'DD5F5F';
365
-                    break;
366
-                case 'FF9908':
367
-                    $color = 'FF9908';
368
-                    break;
369
-                default:
370
-                    $color = '8ABDB0';
371
-                    break;
372
-            }
373
-            $accountCreator->color = $color;
374
-        }
375
-
376
-        $accountCreatorLocation = new UpdateLocation();
377
-        $accountCreatorLocation->setLocation($location);
378
-        $accountCreatorLocation->setAccessToken($this->accessToken);
379
-        $data = $accountCreatorLocation->execute();
342
+		if(isset($_POST['ancestor']))
343
+		{
344
+			$ancestor = $_POST['ancestor'];
345
+			$accountCreator->ancestor = $ancestor;
346
+		}
347
+		if(isset($_POST['color']))
348
+		{
349
+			$color = $_POST['color'];
350
+			switch ($color) {
351
+				case '8ABDB0':
352
+					$color = '8ABDB0';
353
+					break;
354
+				case '9EC41C':
355
+					$color = '9EC41C';
356
+					break;
357
+				case '06A3CB':
358
+					$color = '06A3CB';
359
+					break;
360
+				case 'FFBA00':
361
+					$color = 'FFBA00';
362
+					break;
363
+				case 'DD5F5F':
364
+					$color = 'DD5F5F';
365
+					break;
366
+				case 'FF9908':
367
+					$color = 'FF9908';
368
+					break;
369
+				default:
370
+					$color = '8ABDB0';
371
+					break;
372
+			}
373
+			$accountCreator->color = $color;
374
+		}
375
+
376
+		$accountCreatorLocation = new UpdateLocation();
377
+		$accountCreatorLocation->setLocation($location);
378
+		$accountCreatorLocation->setAccessToken($this->accessToken);
379
+		$data = $accountCreatorLocation->execute();
380 380
         
381 381
 		if($data != 'Success')
382 382
 		{
383 383
 			error_log('Could not set location befor Post: ' . print_r($data, true));
384 384
 		}
385 385
 
386
-        $accountCreator->location = $this->location;
386
+		$accountCreator->location = $this->location;
387 387
 
388
-        $image = '';
389
-        if(isset($_FILES['image']) && $_FILES['image']['size'] > 0)
390
-        {
391
-            $image = file_get_contents($_FILES['image']['tmp_name']);
392
-        }
388
+		$image = '';
389
+		if(isset($_FILES['image']) && $_FILES['image']['size'] > 0)
390
+		{
391
+			$image = file_get_contents($_FILES['image']['tmp_name']);
392
+		}
393 393
         
394
-        $accountCreator->image = $image;
394
+		$accountCreator->image = $image;
395 395
         
396
-        $accountCreator->setAccessToken($this->accessToken);
397
-        $data = $accountCreator->execute();
396
+		$accountCreator->setAccessToken($this->accessToken);
397
+		$data = $accountCreator->execute();
398 398
 
399
-        if(isset($data['error']) && $data['error'] == 'length')
400
-        {
401
-            $errorMsg = 'Error: The input was to long';
402
-            return $errorMsg;
403
-        }
399
+		if(isset($data['error']) && $data['error'] == 'length')
400
+		{
401
+			$errorMsg = 'Error: The input was to long';
402
+			return $errorMsg;
403
+		}
404 404
 
405
-        user_log('User posted: ' . print_r($data, true));
405
+		user_log('User posted: ' . print_r($data, true));
406 406
 
407
-        if(isset($_POST['ancestor']))
408
-        {
409
-            header('Location: ' . $view->toUrl());
410
-            exit;
411
-        }
412
-        else
413
-        {
414
-            header('Location: ' . $view->baseUrl);
415
-            exit;
416
-        }
417
-    }
407
+		if(isset($_POST['ancestor']))
408
+		{
409
+			header('Location: ' . $view->toUrl());
410
+			exit;
411
+		}
412
+		else
413
+		{
414
+			header('Location: ' . $view->baseUrl);
415
+			exit;
416
+		}
417
+	}
418 418
 
419
-    function isTokenFresh()
420
-    {
421
-        $db = new DatabaseConnect();  
422
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
419
+	function isTokenFresh()
420
+	{
421
+		$db = new DatabaseConnect();  
422
+		$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
423 423
 
424
-        if ($result->num_rows > 0)
425
-        {
426
-            // output data of each row
427
-            while($row = $result->fetch_assoc())
428
-            {
429
-                    $expiration_date = $row["expiration_date"];
430
-            }
431
-        }
432
-        else
433
-        {
434
-            error_log('0 results');
435
-        }
424
+		if ($result->num_rows > 0)
425
+		{
426
+			// output data of each row
427
+			while($row = $result->fetch_assoc())
428
+			{
429
+					$expiration_date = $row["expiration_date"];
430
+			}
431
+		}
432
+		else
433
+		{
434
+			error_log('0 results');
435
+		}
436 436
 
437
-        if($expiration_date <= time())
438
-        {
439
-           return FALSE;
440
-        }
437
+		if($expiration_date <= time())
438
+		{
439
+		   return FALSE;
440
+		}
441 441
         
442
-        return TRUE;
443
-    }
444
-
445
-    function refreshToken()
446
-    {
447
-        $accountCreator = new CreateUser();
448
-        $accountCreator->setAccessToken($this->accessToken);
449
-        $accountCreator->setDeviceUid($this->deviceUid);
450
-        $accountCreator->setLocation($this->location);
451
-        $data = $accountCreator->execute();
452
-
453
-        $access_token = (string)$data[0]['access_token'];
454
-        $expiration_date = $data[0]['expiration_date'];
455
-        $device_uid = (string)$data[1];
442
+		return TRUE;
443
+	}
444
+
445
+	function refreshToken()
446
+	{
447
+		$accountCreator = new CreateUser();
448
+		$accountCreator->setAccessToken($this->accessToken);
449
+		$accountCreator->setDeviceUid($this->deviceUid);
450
+		$accountCreator->setLocation($this->location);
451
+		$data = $accountCreator->execute();
452
+
453
+		$access_token = (string)$data[0]['access_token'];
454
+		$expiration_date = $data[0]['expiration_date'];
455
+		$device_uid = (string)$data[1];
456 456
         
457
-        $db = new DatabaseConnect();  
458
-        $result = $db->query("UPDATE accounts 
457
+		$db = new DatabaseConnect();  
458
+		$result = $db->query("UPDATE accounts 
459 459
                                 SET access_token='" . $access_token . "',
460 460
                                     expiration_date='" . $expiration_date . "'
461 461
                                 WHERE device_uid='" . $device_uid . "'");
462 462
 
463
-        if($result === false){
464
-                error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
465
-        }   
466
-    }
463
+		if($result === false){
464
+				error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
465
+		}   
466
+	}
467 467
 
468 468
 
469 469
 
470
-    function getAccessToken()
471
-    {
472
-        $db = new DatabaseConnect();
473
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
470
+	function getAccessToken()
471
+	{
472
+		$db = new DatabaseConnect();
473
+		$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
474 474
         
475
-        $accessToken;
475
+		$accessToken;
476 476
         
477
-        if ($result->num_rows > 0)
478
-        {
479
-            // output data of each row
480
-            while($row = $result->fetch_assoc())
481
-            {
482
-                $accessToken = $row['access_token'];
483
-            }
484
-        }
485
-        else
486
-        {
487
-            error_log('Error: 0 results');
488
-        }
477
+		if ($result->num_rows > 0)
478
+		{
479
+			// output data of each row
480
+			while($row = $result->fetch_assoc())
481
+			{
482
+				$accessToken = $row['access_token'];
483
+			}
484
+		}
485
+		else
486
+		{
487
+			error_log('Error: 0 results');
488
+		}
489 489
 
490
-        return $accessToken;
491
-    }
490
+		return $accessToken;
491
+	}
492 492
 
493 493
 
494
-    function getKarma()
495
-    {
496
-        $accountCreator = new GetKarma();
497
-        $accountCreator->setAccessToken($this->accessToken);
498
-        $data = $accountCreator->execute();
494
+	function getKarma()
495
+	{
496
+		$accountCreator = new GetKarma();
497
+		$accountCreator->setAccessToken($this->accessToken);
498
+		$data = $accountCreator->execute();
499 499
         
500
-        return $data['karma'];
501
-    }
500
+		return $data['karma'];
501
+	}
502 502
 
503
-    function hasVoted($postId)
504
-    {
505
-        $db = new DatabaseConnect();
503
+	function hasVoted($postId)
504
+	{
505
+		$db = new DatabaseConnect();
506 506
 
507
-        $postId = $db->real_escape_string($postId);
507
+		$postId = $db->real_escape_string($postId);
508 508
 
509
-        $result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')");
509
+		$result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')");
510 510
         
511
-        if($result === false)
512
-        {
513
-            $error = db_error();
514
-            echo $error;
515
-            error_log("Adding Vote failed: (" . $result->errno . ") " . $result->error);
516
-        }
511
+		if($result === false)
512
+		{
513
+			$error = db_error();
514
+			echo $error;
515
+			error_log("Adding Vote failed: (" . $result->errno . ") " . $result->error);
516
+		}
517 517
 
518
-        if($result->num_rows == 0)
519
-        {
520
-            return FALSE;
521
-        }
522
-        else
523
-        {
524
-            return TRUE;
525
-        }
526
-    }
518
+		if($result->num_rows == 0)
519
+		{
520
+			return FALSE;
521
+		}
522
+		else
523
+		{
524
+			return TRUE;
525
+		}
526
+	}
527 527
 
528
-    function addVoteWithPostIdAndType($postId, $voteType)
529
-    {
530
-        $db = new DatabaseConnect();
528
+	function addVoteWithPostIdAndType($postId, $voteType)
529
+	{
530
+		$db = new DatabaseConnect();
531 531
 
532
-        $postId = $db->real_escape_string($postId);
533
-        $voteType = $db->real_escape_string($voteType);
532
+		$postId = $db->real_escape_string($postId);
533
+		$voteType = $db->real_escape_string($voteType);
534 534
         
535
-        if($this->hasVoted($postId))
536
-        {
537
-            return "Already voted";
538
-        }
535
+		if($this->hasVoted($postId))
536
+		{
537
+			return "Already voted";
538
+		}
539 539
 
540
-        $result = $db->query("INSERT INTO votes (device_uid, postId, type)
540
+		$result = $db->query("INSERT INTO votes (device_uid, postId, type)
541 541
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
542 542
         
543
-        if($result === false){
544
-                $error = db_error();
545
-                echo $error;
546
-                echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
547
-        }       
548
-    }
549
-
550
-    function registerAccount($location) {
551
-        $accountCreator = new CreateUser();
552
-        $accountCreator->setLocation($location);
553
-        $data = $accountCreator->execute();
543
+		if($result === false){
544
+				$error = db_error();
545
+				echo $error;
546
+				echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
547
+		}       
548
+	}
549
+
550
+	function registerAccount($location) {
551
+		$accountCreator = new CreateUser();
552
+		$accountCreator->setLocation($location);
553
+		$data = $accountCreator->execute();
554 554
         
555
-        $access_token = (string)$data[0]['access_token'];
556
-        $refresh_token = (string)$data[0]['refresh_token'];
557
-        $token_type = (string)$data[0]['token_type'];
558
-        $expires_in = $data[0]['expires_in'];
559
-        $expiration_date = $data[0]['expiration_date'];
560
-        $distinct_id = (string)$data[0]['distinct_id'];
561
-        $device_uid = (string)$data[1];
562
-
563
-        $name = $location->cityName;
564
-        $lat = $location->lat;
565
-        $lng = $location->lng;
555
+		$access_token = (string)$data[0]['access_token'];
556
+		$refresh_token = (string)$data[0]['refresh_token'];
557
+		$token_type = (string)$data[0]['token_type'];
558
+		$expires_in = $data[0]['expires_in'];
559
+		$expiration_date = $data[0]['expiration_date'];
560
+		$distinct_id = (string)$data[0]['distinct_id'];
561
+		$device_uid = (string)$data[1];
562
+
563
+		$name = $location->cityName;
564
+		$lat = $location->lat;
565
+		$lng = $location->lng;
566 566
         
567
-        $db = new DatabaseConnect();  
568
-        $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type,
567
+		$db = new DatabaseConnect();  
568
+		$result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type,
569 569
                         expires_in, expiration_date, distinct_id, device_uid, name, lat, lng)
570 570
                         VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type .
571
-                        "','" .  $expires_in . "','" . $expiration_date . "','" . $distinct_id .
572
-                        "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
573
-
574
-        $success = TRUE;
575
-        if($result === false){
576
-                $error = $db->error();
577
-                echo $error;
578
-                echo "Adding account failed: (" . $result->errno . ") " . $result->error;
579
-                $success = FALSE;
580
-        }   
571
+						"','" .  $expires_in . "','" . $expiration_date . "','" . $distinct_id .
572
+						"','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
573
+
574
+		$success = TRUE;
575
+		if($result === false){
576
+				$error = $db->error();
577
+				echo $error;
578
+				echo "Adding account failed: (" . $result->errno . ") " . $result->error;
579
+				$success = FALSE;
580
+		}   
581 581
         
582
-        return $device_uid;
583
-    }
582
+		return $device_uid;
583
+	}
584 584
 
585
-    function createAccount()
586
-    {
587
-        $config = parse_ini_file('config/config.ini.php');
588
-        $location = new Location();
589
-        $location->setLat($config['default_lat']);
590
-        $location->setLng($config['default_lng']);
591
-        $location->setCityName($config['default_location']);
585
+	function createAccount()
586
+	{
587
+		$config = parse_ini_file('config/config.ini.php');
588
+		$location = new Location();
589
+		$location->setLat($config['default_lat']);
590
+		$location->setLng($config['default_lng']);
591
+		$location->setCityName($config['default_location']);
592 592
 
593
-        $deviceUid = $this->registerAccount($location);
593
+		$deviceUid = $this->registerAccount($location);
594 594
 
595
-        return $deviceUid;
596
-    }
595
+		return $deviceUid;
596
+	}
597 597
 }
598 598
\ No newline at end of file
Please login to merge, or discard this patch.
php/Requests/GetChannel.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -2,41 +2,41 @@
 block discarded – undo
2 2
 
3 3
 class GetChannel extends AbstractRequest
4 4
 {
5
-    /**
6
-     * @var Location
7
-     */
8
-    public $location;
9
-    public $channel;
10
-    public $hasPayload = FALSE;
11
-    public $lastPostId = '';
12
-    public $view = 'combo';
5
+	/**
6
+	 * @var Location
7
+	 */
8
+	public $location;
9
+	public $channel;
10
+	public $hasPayload = FALSE;
11
+	public $lastPostId = '';
12
+	public $view = 'combo';
13 13
 		
14
-    function getApiEndPoint()
15
-    {
16
-        if($this->lastPostId == '')
17
-        {
18
-            $apiEndPoint = '/v3/posts/hashtag/' . $this->view . '?hashtag=' . $this->channel;
19
-        }
20
-        else
21
-        {
22
-            if($this->view == 'combo')
23
-            {
24
-                $apiEndPoint = '/v3/posts/hashtag?hashtag=' . $this->channel . '&after=' . $this->lastPostId;
25
-            }
26
-            else
27
-            {
28
-                $apiEndPoint = '/v3/posts/hashtag/' . $this->view . '?hashtag=' . $this->channel . '&after=' . $this->lastPostId;
29
-            }
30
-        }
31
-        return $apiEndPoint;
32
-    }
33
-    function getPayload()
34
-    {
35
-        return array(
36
-        );
37
-    }
38
-    function getMethod()
39
-    {
40
-        return 'GET';
41
-    }
14
+	function getApiEndPoint()
15
+	{
16
+		if($this->lastPostId == '')
17
+		{
18
+			$apiEndPoint = '/v3/posts/hashtag/' . $this->view . '?hashtag=' . $this->channel;
19
+		}
20
+		else
21
+		{
22
+			if($this->view == 'combo')
23
+			{
24
+				$apiEndPoint = '/v3/posts/hashtag?hashtag=' . $this->channel . '&after=' . $this->lastPostId;
25
+			}
26
+			else
27
+			{
28
+				$apiEndPoint = '/v3/posts/hashtag/' . $this->view . '?hashtag=' . $this->channel . '&after=' . $this->lastPostId;
29
+			}
30
+		}
31
+		return $apiEndPoint;
32
+	}
33
+	function getPayload()
34
+	{
35
+		return array(
36
+		);
37
+	}
38
+	function getMethod()
39
+	{
40
+		return 'GET';
41
+	}
42 42
 }
Please login to merge, or discard this patch.
templates/nav-bottom.php 2 patches
Braces   +15 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,12 +1,24 @@
 block discarded – undo
1 1
 <div id="sortJodelBy" class="row">
2 2
 	<div class="col-3">
3
-		<a <?php if($view->view == 'combo')echo 'class="active"';?> href="<?php echo $view->changeView('combo')->back()->toUrl();?>"><i class="fa fa-clock-o fa-3x"></i></a>
3
+		<a <?php if($view->view == 'combo')
4
+{
5
+	echo 'class="active"';
6
+}
7
+?> href="<?php echo $view->changeView('combo')->back()->toUrl();?>"><i class="fa fa-clock-o fa-3x"></i></a>
4 8
 	</div>
5 9
 	<div class="col-3">
6
-		<a <?php if($view->view == 'discussed') echo 'class="active"';?> href="<?php echo $view->changeView('discussed')->back()->toUrl();?>"><i class="fa fa-commenting-o fa-3x"></i></a>
10
+		<a <?php if($view->view == 'discussed')
11
+{
12
+	echo 'class="active"';
13
+}
14
+?> href="<?php echo $view->changeView('discussed')->back()->toUrl();?>"><i class="fa fa-commenting-o fa-3x"></i></a>
7 15
 	</div>
8 16
 	<div class="col-3">
9
-		<a <?php if($view->view == 'popular') echo 'class="active"';?> href="<?php echo $view->changeView('popular')->back()->toUrl();?>"><i class="fa fa-angle-up fa-3x"></i></a>
17
+		<a <?php if($view->view == 'popular')
18
+{
19
+	echo 'class="active"';
20
+}
21
+?> href="<?php echo $view->changeView('popular')->back()->toUrl();?>"><i class="fa fa-angle-up fa-3x"></i></a>
10 22
 	</div>
11 23
 	<div class="col-3">
12 24
 		<nav>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <div id="sortJodelBy" class="row">
2 2
 	<div class="col-3">
3
-		<a <?php if($view->view == 'combo')echo 'class="active"';?> href="<?php echo $view->changeView('combo')->back()->toUrl();?>"><i class="fa fa-clock-o fa-3x"></i></a>
3
+		<a <?php if($view->view == 'combo')echo 'class="active"'; ?> href="<?php echo $view->changeView('combo')->back()->toUrl(); ?>"><i class="fa fa-clock-o fa-3x"></i></a>
4 4
 	</div>
5 5
 	<div class="col-3">
6
-		<a <?php if($view->view == 'discussed') echo 'class="active"';?> href="<?php echo $view->changeView('discussed')->back()->toUrl();?>"><i class="fa fa-commenting-o fa-3x"></i></a>
6
+		<a <?php if($view->view == 'discussed') echo 'class="active"'; ?> href="<?php echo $view->changeView('discussed')->back()->toUrl(); ?>"><i class="fa fa-commenting-o fa-3x"></i></a>
7 7
 	</div>
8 8
 	<div class="col-3">
9
-		<a <?php if($view->view == 'popular') echo 'class="active"';?> href="<?php echo $view->changeView('popular')->back()->toUrl();?>"><i class="fa fa-angle-up fa-3x"></i></a>
9
+		<a <?php if($view->view == 'popular') echo 'class="active"'; ?> href="<?php echo $view->changeView('popular')->back()->toUrl(); ?>"><i class="fa fa-angle-up fa-3x"></i></a>
10 10
 	</div>
11 11
 	<div class="col-3">
12 12
 		<nav>
13
-			<a href="<?php echo $baseUrl;?>about-us.php">about</a>
13
+			<a href="<?php echo $baseUrl; ?>about-us.php">about</a>
14 14
 		</nav>
15 15
 	</div>
16 16
 </div>
Please login to merge, or discard this patch.
templates/header.php 2 patches
Braces   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,11 @@
 block discarded – undo
74 74
 
75 75
 				<div id="location_mobile" class="hidden-sm-up">
76 76
 					<form method="get">
77
-						<input type="text" id="city_mobile" name="search" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required>
77
+						<input type="text" id="city_mobile" name="search" placeholder="<?php if(isset($newPositionStatus))
78
+{
79
+	echo $newPositionStatus;
80
+}
81
+?>" required>
78 82
 
79 83
 						<input type="submit" id="submit_mobile" class="fa" value="&#xf0ac;" />
80 84
 					</form>
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,53 +1,53 @@
 block discarded – undo
1 1
 <!DOCTYPE html>
2 2
 <html lang="en">
3 3
 	<head>
4
-		<title><?php echo $title;?></title>
4
+		<title><?php echo $title; ?></title>
5 5
 		
6 6
 		<meta charset="utf-8">
7 7
 		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8 8
 		<meta http-equiv="x-ua-compatible" content="ie=edge">
9 9
 		
10
-		<meta name="description" content="<?php echo $description;?>">
10
+		<meta name="description" content="<?php echo $description; ?>">
11 11
 		<meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client, web-app, browser, app">
12 12
 		
13 13
 		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
14 14
 		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.1.1/ekko-lightbox.min.css" integrity="sha256-8aNQFtmxcOMVoOhLD4mrHqaKC2Ui++LmlQsoKTqxwIE=" crossorigin="anonymous" />
15
-		<link rel="stylesheet" href="<?php echo $baseUrl;?>css/font-awesome.min.css">
16
-		<link rel="stylesheet" href="<?php echo $baseUrl;?>style.css" type="text/css">
15
+		<link rel="stylesheet" href="<?php echo $baseUrl; ?>css/font-awesome.min.css">
16
+		<link rel="stylesheet" href="<?php echo $baseUrl; ?>style.css" type="text/css">
17 17
 		
18
-		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
19
-		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
20
-		<link rel="icon" type="image/gif" href="<?php echo $baseUrl;?>img/favicon/favicon.gif">
21
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon.png">
22
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon.png">
23
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
24
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
25
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
26
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
27
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
28
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
29
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
30
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
31
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
32
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
33
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-precomposed.png">
34
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-16x16.png" sizes="16x16">
35
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-32x32.png" sizes="32x32">
36
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-96x96.png" sizes="96x96">
37
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-160x160.png" sizes="160x160">
38
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-192x192.png" sizes="192x192">
39
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-196x196.png" sizes="196x196">
40
-		<meta name="msapplication-TileImage" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
18
+		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
19
+		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
20
+		<link rel="icon" type="image/gif" href="<?php echo $baseUrl; ?>img/favicon/favicon.gif">
21
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon.png">
22
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon.png">
23
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
24
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
25
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
26
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
27
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
28
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
29
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
30
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
31
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
32
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
33
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-precomposed.png">
34
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-16x16.png" sizes="16x16">
35
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-32x32.png" sizes="32x32">
36
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-96x96.png" sizes="96x96">
37
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-160x160.png" sizes="160x160">
38
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-192x192.png" sizes="192x192">
39
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-196x196.png" sizes="196x196">
40
+		<meta name="msapplication-TileImage" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
41 41
 		<meta name="msapplication-TileColor" content="#5682a3"> 
42 42
 		<meta name="msapplication-navbutton-color" content="#5682a3"> 
43 43
 		<meta name="application-name" content="JodelBlue"/> 
44 44
 		<meta name="msapplication-tooltip" content="JodelBlue"/> 
45 45
 		<meta name="apple-mobile-web-app-title" content="JodelBlue"/> 
46
-		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-70x70.png"> 
47
-		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
48
-		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-150x150.png"> 
49
-		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x150.png"> 
50
-		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x310.png"> 
46
+		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-70x70.png"> 
47
+		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
48
+		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-150x150.png"> 
49
+		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x150.png"> 
50
+		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x310.png"> 
51 51
 	</head>
52 52
 
53 53
 	<body>
Please login to merge, or discard this patch.
about-us.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,6 +47,6 @@
 block discarded – undo
47 47
 			</content>
48 48
 		</article>
49 49
 	</div>
50
-	<?php include 'templates/nav-bottom.php';?>
50
+	<?php include 'templates/nav-bottom.php'; ?>
51 51
 </div>
52
-<?php include 'templates/footer.php';?>
53 52
\ No newline at end of file
53
+<?php include 'templates/footer.php'; ?>
54 54
\ No newline at end of file
Please login to merge, or discard this patch.
templates/footer.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
 		<?php  
130 130
 			if(is_file(realpath(__DIR__ . '/..') . '/piwik-script.html'))
131 131
 			{
132
-			    include(realpath(__DIR__ . '/..') . '/piwik-script.html');
132
+				include(realpath(__DIR__ . '/..') . '/piwik-script.html');
133 133
 			}
134 134
 		?>
135 135
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 			  crossorigin="anonymous"></script>
6 6
 	    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
7 7
 	    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
8
-	    <script src="<?php echo $baseUrl;?>js/jQueryEmoji.js"></script>
8
+	    <script src="<?php echo $baseUrl; ?>js/jQueryEmoji.js"></script>
9 9
 	    <script src="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.1.1/ekko-lightbox.min.js" integrity="sha256-1odJPEl+KoMUaA1T7QNMGSSU/r5LCKCRC6SL8P0r2gY=" crossorigin="anonymous"></script>
10 10
 
11 11
 		<script>
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 			console.log(solution);
38 38
 			$.ajax({
39 39
 			  type: "POST",
40
-			  url: "<?php echo $baseUrl;?>vote-ajax.php?solution=" + solution + "&key="+key,
40
+			  url: "<?php echo $baseUrl; ?>vote-ajax.php?solution=" + solution + "&key="+key,
41 41
 			  data: {"deviceUid" : deviceUid},
42 42
 			  success: function(result){
43 43
 				  	var response = JSON.parse(result);
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 			{
62 62
 				window.history.back();
63 63
 			}
64
-		<?php if(isset($includeEmojiAndAjax)){ ?>
64
+		<?php if(isset($includeEmojiAndAjax)) { ?>
65 65
 
66 66
 			function vote(postId, vote, obj)
67 67
 			{
68 68
 				$.ajax({
69
-					url: '<?php echo $baseUrl;?>vote-ajax.php?postId=' + postId + '&vote=' + vote,
69
+					url: '<?php echo $baseUrl; ?>vote-ajax.php?postId=' + postId + '&vote=' + vote,
70 70
 					dataType: 'json',
71 71
 					async: true,
72 72
 					success: function(json)
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 			{
94 94
 				<?php if(isset($errorMsg)) { ?>
95 95
 				//Error Msg
96
-				if('<?php echo $errorMsg;?>' != '')
96
+				if('<?php echo $errorMsg; ?>' != '')
97 97
 				{
98
-					alert('<?php echo $errorMsg;?>');
98
+					alert('<?php echo $errorMsg; ?>');
99 99
 				}
100 100
 				<?php } ?>
101 101
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 				function getMorePosts(lastPostId, view, hashtag, old_lastPostId)
129 129
 				{
130 130
 					$.ajax({
131
-						url: '<?php echo $baseUrl;?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURIComponent(hashtag),
131
+						url: '<?php echo $baseUrl; ?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURIComponent(hashtag),
132 132
 						dataType: 'html',
133 133
 						async: false,
134 134
 						success: function(html) {
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,9 @@  discard block
 block discarded – undo
61 61
 			{
62 62
 				window.history.back();
63 63
 			}
64
-		<?php if(isset($includeEmojiAndAjax)){ ?>
64
+		<?php if(isset($includeEmojiAndAjax))
65
+{
66
+?>
65 67
 
66 68
 			function vote(postId, vote, obj)
67 69
 			{
@@ -91,7 +93,9 @@  discard block
 block discarded – undo
91 93
 
92 94
 			$(document).ready(function()
93 95
 			{
94
-				<?php if(isset($errorMsg)) { ?>
96
+				<?php if(isset($errorMsg))
97
+{
98
+?>
95 99
 				//Error Msg
96 100
 				if('<?php echo $errorMsg;?>' != '')
97 101
 				{
@@ -155,7 +159,9 @@  discard block
 block discarded – undo
155 159
 					return {"lastPostId":lastPostId, "old_lastPostId":old_lastPostId};
156 160
 				}
157 161
 
158
-				<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?>
162
+				<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails']))
163
+{
164
+?>
159 165
 
160 166
 				if(window.location.hash)
161 167
 				{
Please login to merge, or discard this patch.