Completed
Push — master ( 2ca5fd...7b8c34 )
by mains
02:56
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.
Indentation   +467 added lines, -467 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,518 +71,518 @@  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();
74
+	function getCaptcha()
75
+	{
76
+		$accountCreator = new GetCaptcha();
77
+		$accountCreator->setAccessToken($this->accessToken);
78
+		$captcha = $accountCreator->execute();
79 79
 
80
-        return array("image_url" => $captcha['image_url'], "key" => $captcha['key']);
81
-    }
80
+		return array("image_url" => $captcha['image_url'], "key" => $captcha['key']);
81
+	}
82 82
 
83
-    function isAccountVerified()
84
-    {
85
-        $accountCreator = new GetUserConfig();
86
-        $accountCreator->setAccessToken($this->accessToken);
87
-        $data = $accountCreator->execute();
83
+	function isAccountVerified()
84
+	{
85
+		$accountCreator = new GetUserConfig();
86
+		$accountCreator->setAccessToken($this->accessToken);
87
+		$data = $accountCreator->execute();
88 88
 
89
-        //error_log(print_r($data, true));
89
+		//error_log(print_r($data, true));
90 90
 
91
-        return $data['verified'];
92
-    }
91
+		return $data['verified'];
92
+	}
93 93
 
94
-    function getGeocodingToken()
95
-    {
96
-        if(!isset($config['geocodingToken']) ||
97
-            $config['geocodingToken'] == NULL ||
98
-            $config['geocodingToken'] == '' ||
99
-            $config['geocodingToken'] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
100
-        {
101
-            error_log("Please set a Google Maps Geocoding Token!");
102
-        }
103
-        else
104
-        {
105
-            return $config['geocodingToken'];
106
-        }
107
-    }
94
+	function getGeocodingToken()
95
+	{
96
+		if(!isset($config['geocodingToken']) ||
97
+			$config['geocodingToken'] == NULL ||
98
+			$config['geocodingToken'] == '' ||
99
+			$config['geocodingToken'] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
100
+		{
101
+			error_log("Please set a Google Maps Geocoding Token!");
102
+		}
103
+		else
104
+		{
105
+			return $config['geocodingToken'];
106
+		}
107
+	}
108 108
 
109
-    function locationEquals($city)
110
-    {
111
-        $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($city) . '&key=' . $this->getGeocodingToken();
112
-        $result = Requests::post($url);
113
-        if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
114
-        {
115
-            error_log('Error locationEquals');
116
-            return FALSE;
117
-        }
118
-        else
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'];
123
-        }
109
+	function locationEquals($city)
110
+	{
111
+		$url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($city) . '&key=' . $this->getGeocodingToken();
112
+		$result = Requests::post($url);
113
+		if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
114
+		{
115
+			error_log('Error locationEquals');
116
+			return FALSE;
117
+		}
118
+		else
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'];
123
+		}
124 124
 
125
-        $db = new DatabaseConnect();
126
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
125
+		$db = new DatabaseConnect();
126
+		$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
127 127
         
128
-        $location = new Location();
128
+		$location = new Location();
129 129
         
130
-        if ($result->num_rows > 0)
131
-        {
132
-            // output data of each row
133
-            while($row = $result->fetch_assoc())
134
-            {
135
-                $location->setLat($row['lat']);
136
-                $location->setLng($row['lng']);
137
-                $location->setCityName($row['name']);
138
-            }
139
-        }
140
-        else
141
-        {
142
-            error_log("Error no Location found - getLocation");
143
-        }
130
+		if ($result->num_rows > 0)
131
+		{
132
+			// output data of each row
133
+			while($row = $result->fetch_assoc())
134
+			{
135
+				$location->setLat($row['lat']);
136
+				$location->setLng($row['lng']);
137
+				$location->setCityName($row['name']);
138
+			}
139
+		}
140
+		else
141
+		{
142
+			error_log("Error no Location found - getLocation");
143
+		}
144 144
 
145
-        if($location->getLat() == $lat && $location->getLng() == $lng && $location->getCityName() == $name)
146
-        {
147
-            return TRUE;
148
-        }  
149
-        else
150
-        {
151
-            return FALSE;
152
-        }
153
-    }
145
+		if($location->getLat() == $lat && $location->getLng() == $lng && $location->getCityName() == $name)
146
+		{
147
+			return TRUE;
148
+		}  
149
+		else
150
+		{
151
+			return FALSE;
152
+		}
153
+	}
154 154
 
155
-    function setLocation()
156
-    {
157
-        //Is Channel or City
158
-        if(substr($_GET['city'], 0, 1) === '#')
159
-        {
160
-            return htmlspecialchars($_GET['city']) . " " . $this->location->cityName;
161
-        }                
162
-        else
163
-        {
164
-            $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=' . $this->getGeocodingToken();
165
-            $result = Requests::post($url);
166
-            if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
167
-            {
168
-                return "0 results";
169
-            }
170
-            else
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'];
175
-
176
-                $location = new Location();
177
-                $location->setLat($lat);
178
-                $location->setLng($lng);
179
-                $location->setCityName($name);
180
-                $accountCreator = new UpdateLocation();
181
-                $accountCreator->setLocation($location);
182
-                $accountCreator->setAccessToken($this->accessToken);
183
-                $data = $accountCreator->execute();
184
-
185
-                //safe location to db
186
-                $db = new DatabaseConnect();
187
-
188
-                if($data == 'Success')
189
-                {
190
-                    $result = $db->query("UPDATE accounts 
155
+	function setLocation()
156
+	{
157
+		//Is Channel or City
158
+		if(substr($_GET['city'], 0, 1) === '#')
159
+		{
160
+			return htmlspecialchars($_GET['city']) . " " . $this->location->cityName;
161
+		}                
162
+		else
163
+		{
164
+			$url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=' . $this->getGeocodingToken();
165
+			$result = Requests::post($url);
166
+			if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
167
+			{
168
+				return "0 results";
169
+			}
170
+			else
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'];
175
+
176
+				$location = new Location();
177
+				$location->setLat($lat);
178
+				$location->setLng($lng);
179
+				$location->setCityName($name);
180
+				$accountCreator = new UpdateLocation();
181
+				$accountCreator->setLocation($location);
182
+				$accountCreator->setAccessToken($this->accessToken);
183
+				$data = $accountCreator->execute();
184
+
185
+				//safe location to db
186
+				$db = new DatabaseConnect();
187
+
188
+				if($data == 'Success')
189
+				{
190
+					$result = $db->query("UPDATE accounts 
191 191
                             SET name='" . $name . "',
192 192
                                 lat='" . $lat . "',
193 193
                                 lng='" . $lng . "'
194 194
                             WHERE access_token='" . $this->accessToken . "'");
195 195
 
196
-                    if($result === false)
197
-                    {
198
-                            echo "Updating location failed: (" . $db->errno . ") " . $db->error;
199
-                    }
200
-                    else
201
-                    {
202
-                        user_log('User with JodelDeviceId:' . $this->deviceUid .  ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
203
-                    }
204
-                }
205
-
206
-                return $name;
207
-            }
208
-        }
209
-    }
196
+					if($result === false)
197
+					{
198
+							echo "Updating location failed: (" . $db->errno . ") " . $db->error;
199
+					}
200
+					else
201
+					{
202
+						user_log('User with JodelDeviceId:' . $this->deviceUid .  ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
203
+					}
204
+				}
205
+
206
+				return $name;
207
+			}
208
+		}
209
+	}
210 210
 
211
-    function getLocation()
212
-    {
213
-        $db = new DatabaseConnect();
214
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
211
+	function getLocation()
212
+	{
213
+		$db = new DatabaseConnect();
214
+		$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
215 215
         
216
-        $location = new Location();
216
+		$location = new Location();
217 217
         
218
-        if ($result->num_rows > 0)
219
-        {
220
-            // output data of each row
221
-            while($row = $result->fetch_assoc())
222
-            {
223
-                $location->setLat($row['lat']);
224
-                $location->setLng($row['lng']);
225
-                $location->setCityName($row['name']);
226
-            }
227
-        }
228
-        else
229
-        {
230
-            echo "Error: 0 results";
231
-            error_log("Error no Location found - getLocation");
232
-        }
218
+		if ($result->num_rows > 0)
219
+		{
220
+			// output data of each row
221
+			while($row = $result->fetch_assoc())
222
+			{
223
+				$location->setLat($row['lat']);
224
+				$location->setLng($row['lng']);
225
+				$location->setCityName($row['name']);
226
+			}
227
+		}
228
+		else
229
+		{
230
+			echo "Error: 0 results";
231
+			error_log("Error no Location found - getLocation");
232
+		}
233 233
 
234
-        return $location;
235
-    }
234
+		return $location;
235
+	}
236 236
 
237
-    function verifyCaptcha()
238
-    {
239
-        if(isset($_GET['deviceUid']))
240
-        {
241
-            $deviceUid = $_GET['deviceUid'];
242
-            $jodelAccountForVerify = new JodelAccount($deviceUid);
243
-        }
244
-        else if(isset($_POST['deviceUid']))
245
-        {
246
-            $deviceUid = $_POST['deviceUid'];
247
-            $jodelAccountForVerify = new JodelAccount($deviceUid);
248
-        }
249
-        else
250
-        {
251
-            $deviceUid = $this->deviceUid;
252
-            $jodelAccountForVerify = $this;
253
-        }
237
+	function verifyCaptcha()
238
+	{
239
+		if(isset($_GET['deviceUid']))
240
+		{
241
+			$deviceUid = $_GET['deviceUid'];
242
+			$jodelAccountForVerify = new JodelAccount($deviceUid);
243
+		}
244
+		else if(isset($_POST['deviceUid']))
245
+		{
246
+			$deviceUid = $_POST['deviceUid'];
247
+			$jodelAccountForVerify = new JodelAccount($deviceUid);
248
+		}
249
+		else
250
+		{
251
+			$deviceUid = $this->deviceUid;
252
+			$jodelAccountForVerify = $this;
253
+		}
254 254
 
255
-        $solution = $_GET['solution'];
256
-        $solution = array_map('intval', explode('-', $solution));
255
+		$solution = $_GET['solution'];
256
+		$solution = array_map('intval', explode('-', $solution));
257 257
 
258
-        $accountCreator = new PostCaptcha();
259
-        $accountCreator->setAccessToken($jodelAccountForVerify->accessToken);
260
-        $accountCreator->captchaKey = $_GET['key'];
261
-        $accountCreator->captchaSolution = $solution;
262
-        $verified = $accountCreator->execute();
258
+		$accountCreator = new PostCaptcha();
259
+		$accountCreator->setAccessToken($jodelAccountForVerify->accessToken);
260
+		$accountCreator->captchaKey = $_GET['key'];
261
+		$accountCreator->captchaSolution = $solution;
262
+		$verified = $accountCreator->execute();
263 263
 
264
-        if(isset($verified->status_code))
265
-        {
266
-            return $verified->status_code;
267
-        }
268
-        return $verified['verified'];
269
-    }
264
+		if(isset($verified->status_code))
265
+		{
266
+			return $verified->status_code;
267
+		}
268
+		return $verified['verified'];
269
+	}
270 270
 
271
-    //ToDo Spider Check
272
-    function votePostId($postId, $vote)
273
-    {
274
-        if(!$this->isBot)
275
-        {
276
-            if(!$this->isAccountVerified())
277
-            {
271
+	//ToDo Spider Check
272
+	function votePostId($postId, $vote)
273
+	{
274
+		if(!$this->isBot)
275
+		{
276
+			if(!$this->isAccountVerified())
277
+			{
278 278
                 
279
-            }
280
-
281
-            if(!$this->hasVoted($postId))
282
-            {
283
-                if($vote == "up")
284
-                {
285
-                    $accountCreator = new Upvote();
286
-                }
287
-                else if($vote == "down")
288
-                {
289
-                    $accountCreator = new Downvote();
290
-                }
291
-
292
-                $accountCreator->setAccessToken($this->accessToken);
293
-                $accountCreator->postId = htmlspecialchars($postId);
294
-                $data = $accountCreator->execute();
295
-
296
-                user_log('User voted: ' . print_r($data, true));
297
-
298
-                if(array_key_exists('post', $data))
299
-                {
300
-                    $this->addVoteWithPostIdAndType($postId, $vote);
301
-                    return TRUE;
302
-                }
303
-                else if(array_key_exists('error', $data))
304
-                {
305
-                    error_log('Could not vote - Error: ' . $data['error']);
306
-                }
307
-                else
308
-                {
309
-                    error_log('Could not vote: ' . print_r($data, true));
310
-                    return FALSE;
311
-                } 
312
-            }
313
-            else
314
-            {
315
-                return FALSE;
316
-            }
317
-        }
318
-
319
-        return FALSE;
320
-    }
279
+			}
280
+
281
+			if(!$this->hasVoted($postId))
282
+			{
283
+				if($vote == "up")
284
+				{
285
+					$accountCreator = new Upvote();
286
+				}
287
+				else if($vote == "down")
288
+				{
289
+					$accountCreator = new Downvote();
290
+				}
291
+
292
+				$accountCreator->setAccessToken($this->accessToken);
293
+				$accountCreator->postId = htmlspecialchars($postId);
294
+				$data = $accountCreator->execute();
295
+
296
+				user_log('User voted: ' . print_r($data, true));
297
+
298
+				if(array_key_exists('post', $data))
299
+				{
300
+					$this->addVoteWithPostIdAndType($postId, $vote);
301
+					return TRUE;
302
+				}
303
+				else if(array_key_exists('error', $data))
304
+				{
305
+					error_log('Could not vote - Error: ' . $data['error']);
306
+				}
307
+				else
308
+				{
309
+					error_log('Could not vote: ' . print_r($data, true));
310
+					return FALSE;
311
+				} 
312
+			}
313
+			else
314
+			{
315
+				return FALSE;
316
+			}
317
+		}
321 318
 
322
-    //ToDo Spider Check
323
-    function sendJodel($location, $view)
324
-    {
325
-        if($this->isAccountVerified() != 1)
326
-        {
327
-            $this->showCaptcha();
328
-            //$this->verifyCaptcha();
329
-        }
319
+		return FALSE;
320
+	}
330 321
 
331
-        $accountCreator = new SendJodel();
322
+	//ToDo Spider Check
323
+	function sendJodel($location, $view)
324
+	{
325
+		if($this->isAccountVerified() != 1)
326
+		{
327
+			$this->showCaptcha();
328
+			//$this->verifyCaptcha();
329
+		}
332 330
 
333
-        if(isset($_POST['ancestor']))
334
-        {
335
-            $ancestor = $_POST['ancestor'];
336
-            $accountCreator->ancestor = $ancestor;
337
-        }
338
-        if(isset($_POST['color']))
339
-        {
340
-            $color = $_POST['color'];
341
-            switch ($color) {
342
-                case '8ABDB0':
343
-                    $color = '8ABDB0';
344
-                    break;
345
-                case '9EC41C':
346
-                    $color = '9EC41C';
347
-                    break;
348
-                case '06A3CB':
349
-                    $color = '06A3CB';
350
-                    break;
351
-                case 'FFBA00':
352
-                    $color = 'FFBA00';
353
-                    break;
354
-                case 'DD5F5F':
355
-                    $color = 'DD5F5F';
356
-                    break;
357
-                case 'FF9908':
358
-                    $color = 'FF9908';
359
-                    break;
360
-                default:
361
-                    $color = '8ABDB0';
362
-                    break;
363
-            }
364
-            $accountCreator->color = $color;
365
-        }
366
-
367
-        $accountCreatorLocation = new UpdateLocation();
368
-        $accountCreatorLocation->setLocation($location);
369
-        $accountCreatorLocation->setAccessToken($this->accessToken);
370
-        $data = $accountCreatorLocation->execute();
331
+		$accountCreator = new SendJodel();
332
+
333
+		if(isset($_POST['ancestor']))
334
+		{
335
+			$ancestor = $_POST['ancestor'];
336
+			$accountCreator->ancestor = $ancestor;
337
+		}
338
+		if(isset($_POST['color']))
339
+		{
340
+			$color = $_POST['color'];
341
+			switch ($color) {
342
+				case '8ABDB0':
343
+					$color = '8ABDB0';
344
+					break;
345
+				case '9EC41C':
346
+					$color = '9EC41C';
347
+					break;
348
+				case '06A3CB':
349
+					$color = '06A3CB';
350
+					break;
351
+				case 'FFBA00':
352
+					$color = 'FFBA00';
353
+					break;
354
+				case 'DD5F5F':
355
+					$color = 'DD5F5F';
356
+					break;
357
+				case 'FF9908':
358
+					$color = 'FF9908';
359
+					break;
360
+				default:
361
+					$color = '8ABDB0';
362
+					break;
363
+			}
364
+			$accountCreator->color = $color;
365
+		}
366
+
367
+		$accountCreatorLocation = new UpdateLocation();
368
+		$accountCreatorLocation->setLocation($location);
369
+		$accountCreatorLocation->setAccessToken($this->accessToken);
370
+		$data = $accountCreatorLocation->execute();
371 371
         
372 372
 		if($data != 'Success')
373 373
 		{
374 374
 			error_log('Could not set location befor Post: ' . print_r($data, true));
375 375
 		}
376 376
 
377
-        $accountCreator->location = $this->location;
377
+		$accountCreator->location = $this->location;
378 378
 
379
-        $image = '';
380
-        if(isset($_FILES['image']) && $_FILES['image']['size'] > 0)
381
-        {
382
-            $image = file_get_contents($_FILES['image']['tmp_name']);
383
-        }
379
+		$image = '';
380
+		if(isset($_FILES['image']) && $_FILES['image']['size'] > 0)
381
+		{
382
+			$image = file_get_contents($_FILES['image']['tmp_name']);
383
+		}
384 384
         
385
-        $accountCreator->image = $image;
385
+		$accountCreator->image = $image;
386 386
         
387
-        $accountCreator->setAccessToken($this->accessToken);
388
-        $data = $accountCreator->execute();
387
+		$accountCreator->setAccessToken($this->accessToken);
388
+		$data = $accountCreator->execute();
389 389
 
390
-        if(isset($data['error']) && $data['error'] == 'length')
391
-        {
392
-            $errorMsg = 'Error: The input was to long';
393
-            return $errorMsg;
394
-        }
390
+		if(isset($data['error']) && $data['error'] == 'length')
391
+		{
392
+			$errorMsg = 'Error: The input was to long';
393
+			return $errorMsg;
394
+		}
395 395
 
396
-        user_log('User posted: ' . print_r($data, true));
396
+		user_log('User posted: ' . print_r($data, true));
397 397
 
398
-        if(isset($_POST['ancestor']))
399
-        {
400
-            header('Location: ' . $view->toUrl());
401
-            exit;
402
-        }
403
-        else
404
-        {
405
-            header('Location: ' . $view->baseUrl);
406
-            exit;
407
-        }
408
-    }
398
+		if(isset($_POST['ancestor']))
399
+		{
400
+			header('Location: ' . $view->toUrl());
401
+			exit;
402
+		}
403
+		else
404
+		{
405
+			header('Location: ' . $view->baseUrl);
406
+			exit;
407
+		}
408
+	}
409 409
 
410
-    function isTokenFresh()
411
-    {
412
-        $db = new DatabaseConnect();  
413
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
410
+	function isTokenFresh()
411
+	{
412
+		$db = new DatabaseConnect();  
413
+		$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
414 414
 
415
-        if ($result->num_rows > 0)
416
-        {
417
-            // output data of each row
418
-            while($row = $result->fetch_assoc())
419
-            {
420
-                    $expiration_date = $row["expiration_date"];
421
-            }
422
-        }
423
-        else
424
-        {
425
-            error_log('0 results');
426
-        }
415
+		if ($result->num_rows > 0)
416
+		{
417
+			// output data of each row
418
+			while($row = $result->fetch_assoc())
419
+			{
420
+					$expiration_date = $row["expiration_date"];
421
+			}
422
+		}
423
+		else
424
+		{
425
+			error_log('0 results');
426
+		}
427 427
 
428
-        if($expiration_date <= time())
429
-        {
430
-           return FALSE;
431
-        }
428
+		if($expiration_date <= time())
429
+		{
430
+		   return FALSE;
431
+		}
432 432
         
433
-        return TRUE;
434
-    }
435
-
436
-    function refreshToken()
437
-    {
438
-        $accountCreator = new CreateUser();
439
-        $accountCreator->setAccessToken($this->accessToken);
440
-        $accountCreator->setDeviceUid($this->deviceUid);
441
-        $accountCreator->setLocation($this->location);
442
-        $data = $accountCreator->execute();
443
-
444
-        $access_token = (string)$data[0]['access_token'];
445
-        $expiration_date = $data[0]['expiration_date'];
446
-        $device_uid = (string)$data[1];
433
+		return TRUE;
434
+	}
435
+
436
+	function refreshToken()
437
+	{
438
+		$accountCreator = new CreateUser();
439
+		$accountCreator->setAccessToken($this->accessToken);
440
+		$accountCreator->setDeviceUid($this->deviceUid);
441
+		$accountCreator->setLocation($this->location);
442
+		$data = $accountCreator->execute();
443
+
444
+		$access_token = (string)$data[0]['access_token'];
445
+		$expiration_date = $data[0]['expiration_date'];
446
+		$device_uid = (string)$data[1];
447 447
         
448
-        $db = new DatabaseConnect();  
449
-        $result = $db->query("UPDATE accounts 
448
+		$db = new DatabaseConnect();  
449
+		$result = $db->query("UPDATE accounts 
450 450
                                 SET access_token='" . $access_token . "',
451 451
                                     expiration_date='" . $expiration_date . "'
452 452
                                 WHERE device_uid='" . $device_uid . "'");
453 453
 
454
-        if($result === false){
455
-                error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
456
-        }   
457
-    }
454
+		if($result === false){
455
+				error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
456
+		}   
457
+	}
458 458
 
459 459
 
460 460
 
461
-    function getAccessToken()
462
-    {
463
-        $db = new DatabaseConnect();
464
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
461
+	function getAccessToken()
462
+	{
463
+		$db = new DatabaseConnect();
464
+		$result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
465 465
         
466
-        $accessToken;
466
+		$accessToken;
467 467
         
468
-        if ($result->num_rows > 0)
469
-        {
470
-            // output data of each row
471
-            while($row = $result->fetch_assoc())
472
-            {
473
-                $accessToken = $row['access_token'];
474
-            }
475
-        }
476
-        else
477
-        {
478
-            error_log('Error: 0 results');
479
-        }
468
+		if ($result->num_rows > 0)
469
+		{
470
+			// output data of each row
471
+			while($row = $result->fetch_assoc())
472
+			{
473
+				$accessToken = $row['access_token'];
474
+			}
475
+		}
476
+		else
477
+		{
478
+			error_log('Error: 0 results');
479
+		}
480 480
 
481
-        return $accessToken;
482
-    }
481
+		return $accessToken;
482
+	}
483 483
 
484 484
 
485
-    function getKarma()
486
-    {
487
-        $accountCreator = new GetKarma();
488
-        $accountCreator->setAccessToken($this->accessToken);
489
-        $data = $accountCreator->execute();
485
+	function getKarma()
486
+	{
487
+		$accountCreator = new GetKarma();
488
+		$accountCreator->setAccessToken($this->accessToken);
489
+		$data = $accountCreator->execute();
490 490
         
491
-        return $data['karma'];
492
-    }
491
+		return $data['karma'];
492
+	}
493 493
 
494
-    function hasVoted($postId)
495
-    {
496
-        $db = new DatabaseConnect();
494
+	function hasVoted($postId)
495
+	{
496
+		$db = new DatabaseConnect();
497 497
 
498
-        $postId = $db->real_escape_string($postId);
498
+		$postId = $db->real_escape_string($postId);
499 499
 
500
-        $result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')");
500
+		$result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')");
501 501
         
502
-        if($result === false)
503
-        {
504
-            $error = db_error();
505
-            echo $error;
506
-            error_log("Adding Vote failed: (" . $result->errno . ") " . $result->error);
507
-        }
502
+		if($result === false)
503
+		{
504
+			$error = db_error();
505
+			echo $error;
506
+			error_log("Adding Vote failed: (" . $result->errno . ") " . $result->error);
507
+		}
508 508
 
509
-        if($result->num_rows == 0)
510
-        {
511
-            return FALSE;
512
-        }
513
-        else
514
-        {
515
-            return TRUE;
516
-        }
517
-    }
509
+		if($result->num_rows == 0)
510
+		{
511
+			return FALSE;
512
+		}
513
+		else
514
+		{
515
+			return TRUE;
516
+		}
517
+	}
518 518
 
519
-    function addVoteWithPostIdAndType($postId, $voteType)
520
-    {
521
-        $db = new DatabaseConnect();
519
+	function addVoteWithPostIdAndType($postId, $voteType)
520
+	{
521
+		$db = new DatabaseConnect();
522 522
 
523
-        $postId = $db->real_escape_string($postId);
524
-        $voteType = $db->real_escape_string($voteType);
523
+		$postId = $db->real_escape_string($postId);
524
+		$voteType = $db->real_escape_string($voteType);
525 525
         
526
-        if($this->hasVoted($postId))
527
-        {
528
-            return "Already voted";
529
-        }
526
+		if($this->hasVoted($postId))
527
+		{
528
+			return "Already voted";
529
+		}
530 530
 
531
-        $result = $db->query("INSERT INTO votes (device_uid, postId, type)
531
+		$result = $db->query("INSERT INTO votes (device_uid, postId, type)
532 532
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
533 533
         
534
-        if($result === false){
535
-                $error = db_error();
536
-                echo $error;
537
-                echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
538
-        }       
539
-    }
540
-
541
-    function registerAccount($location) {
542
-        $accountCreator = new CreateUser();
543
-        $accountCreator->setLocation($location);
544
-        $data = $accountCreator->execute();
534
+		if($result === false){
535
+				$error = db_error();
536
+				echo $error;
537
+				echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
538
+		}       
539
+	}
540
+
541
+	function registerAccount($location) {
542
+		$accountCreator = new CreateUser();
543
+		$accountCreator->setLocation($location);
544
+		$data = $accountCreator->execute();
545 545
         
546
-        $access_token = (string)$data[0]['access_token'];
547
-        $refresh_token = (string)$data[0]['refresh_token'];
548
-        $token_type = (string)$data[0]['token_type'];
549
-        $expires_in = $data[0]['expires_in'];
550
-        $expiration_date = $data[0]['expiration_date'];
551
-        $distinct_id = (string)$data[0]['distinct_id'];
552
-        $device_uid = (string)$data[1];
553
-
554
-        $name = $location->cityName;
555
-        $lat = $location->lat;
556
-        $lng = $location->lng;
546
+		$access_token = (string)$data[0]['access_token'];
547
+		$refresh_token = (string)$data[0]['refresh_token'];
548
+		$token_type = (string)$data[0]['token_type'];
549
+		$expires_in = $data[0]['expires_in'];
550
+		$expiration_date = $data[0]['expiration_date'];
551
+		$distinct_id = (string)$data[0]['distinct_id'];
552
+		$device_uid = (string)$data[1];
553
+
554
+		$name = $location->cityName;
555
+		$lat = $location->lat;
556
+		$lng = $location->lng;
557 557
         
558
-        $db = new DatabaseConnect();  
559
-        $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type,
558
+		$db = new DatabaseConnect();  
559
+		$result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type,
560 560
                         expires_in, expiration_date, distinct_id, device_uid, name, lat, lng)
561 561
                         VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type .
562
-                        "','" .  $expires_in . "','" . $expiration_date . "','" . $distinct_id .
563
-                        "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
564
-
565
-        $success = TRUE;
566
-        if($result === false){
567
-                $error = $db->error();
568
-                echo $error;
569
-                echo "Adding account failed: (" . $result->errno . ") " . $result->error;
570
-                $success = FALSE;
571
-        }   
562
+						"','" .  $expires_in . "','" . $expiration_date . "','" . $distinct_id .
563
+						"','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
564
+
565
+		$success = TRUE;
566
+		if($result === false){
567
+				$error = $db->error();
568
+				echo $error;
569
+				echo "Adding account failed: (" . $result->errno . ") " . $result->error;
570
+				$success = FALSE;
571
+		}   
572 572
         
573
-        return $device_uid;
574
-    }
573
+		return $device_uid;
574
+	}
575 575
 
576
-    function createAccount()
577
-    {
578
-        $config = parse_ini_file('config/config.ini.php');
579
-        $location = new Location();
580
-        $location->setLat($config['default_lat']);
581
-        $location->setLng($config['default_lng']);
582
-        $location->setCityName($config['default_location']);
576
+	function createAccount()
577
+	{
578
+		$config = parse_ini_file('config/config.ini.php');
579
+		$location = new Location();
580
+		$location->setLat($config['default_lat']);
581
+		$location->setLng($config['default_lng']);
582
+		$location->setCityName($config['default_location']);
583 583
 
584
-        $deviceUid = $this->registerAccount($location);
584
+		$deviceUid = $this->registerAccount($location);
585 585
 
586
-        return $deviceUid;
587
-    }
586
+		return $deviceUid;
587
+	}
588 588
 }
589 589
\ No newline at end of file
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.
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.