Completed
Push — master ( 16e812...ea693b )
by mains
02:48
created
templates/footer.php 1 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.
php/Requests/AbstractRequest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $header = $this->getSignHeaders();
30 30
         $url = $this->getFullUrl();
31 31
 
32
-        if ($this->getAccessToken()) {
32
+        if($this->getAccessToken()) {
33 33
             $header['Authorization'] = "Bearer " . $this->getAccessToken();
34 34
         }
35 35
         //Comment out to debug the Request:
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             'proxy' => '186.103.169.165:8080',
53 53
         );*/
54 54
 
55
-        switch ($this->getMethod()) {
55
+        switch($this->getMethod()) {
56 56
             case 'POST':
57 57
                 $result = Requests::post($url, $header, $this->payLoad);
58 58
                 break;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         http_response_code($result->status_code);
75 75
 
76
-        switch ($result->status_code) {
76
+        switch($result->status_code) {
77 77
             case 200:
78 78
                 $result = json_decode($result->body, true);
79 79
                 break;
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             case 502:
117 117
                 error_log('Error 502 - ' . print_r($result, true));
118 118
                 $result = json_decode($result->body, true);
119
-                header('location:'.$_SERVER['PHP_SELF']);
119
+                header('location:' . $_SERVER['PHP_SELF']);
120 120
                 break;
121 121
             case 503:
122 122
                 error_log('Error 503 - ' . print_r($result, true));
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
 
125 125
                 if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable')
126 126
                 {
127
-                    header('location:'.$_SERVER['PHP_SELF']); 
127
+                    header('location:' . $_SERVER['PHP_SELF']); 
128 128
                 }
129 129
                 break;
130 130
             default:
131
-                error_log('Error '.$result->status_code.' - unknown error');
131
+                error_log('Error ' . $result->status_code . ' - unknown error');
132 132
                 $result = json_decode($result->body, true);
133 133
         }
134 134
 
Please login to merge, or discard this patch.
php/jodel-web.php 1 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/DatabaseConnect.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@
 block discarded – undo
17 17
 {
18 18
 	error_log('ER_TOO_MANY_USER_CONNECTIONS');
19 19
 	sleep(1);
20
-	header('location: '.$_SERVER['PHP_SELF']);
20
+	header('location: ' . $_SERVER['PHP_SELF']);
21 21
 }
22 22
 
23
-if ($db->connect_errno)
23
+if($db->connect_errno)
24 24
 {
25 25
 	error_log('Sorry, die Verbindung zu unserem 
26 26
         Server ist hops gegangen. Wegen '. $db -> connect_error);
Please login to merge, or discard this patch.
admin.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 
6 6
 if(isset($_GET['pw']))
7 7
 {
8
-	setcookie('JodelAdminPassword', $_GET['pw'], time()+60*60*24*365*10);
8
+	setcookie('JodelAdminPassword', $_GET['pw'], time() + 60 * 60 * 24 * 365 * 10);
9 9
 	error_log('admin password saved for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
10 10
 	header('Location: ' . $baseUrl . 'admin.php');
11 11
 	exit;
12 12
 }
13 13
 else if(isset($_GET['voterPw']))
14 14
 {
15
-	setcookie('JodelVoterPassword', $_GET['voterPw'], time()+60*60*24*365*10);
15
+	setcookie('JodelVoterPassword', $_GET['voterPw'], time() + 60 * 60 * 24 * 365 * 10);
16 16
 	error_log('voter password saved for [' . $_SERVER ['HTTP_USER_AGENT'] . ']');
17 17
 	header('Location: ' . $baseUrl);
18 18
 	exit;
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 }
43 43
 else
44 44
 {
45
-	error_log($_SERVER['REMOTE_ADDR']  . ' used a wrong voterPw / pw on admin.php');
45
+	error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong voterPw / pw on admin.php');
46 46
 	die();
47 47
 }
48 48
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                     	. "','" . $db->escape_string($_POST['device_uid'])
63 63
                     	. "','" . $db->escape_string($_POST['rights']) . "')");
64 64
     
65
-    if($result === false){
65
+    if($result === false) {
66 66
             $error = db_error();
67 67
             error_log($error);
68 68
             error_log("Adding Voter failed: (" . $result->errno . ") " . $result->error);
@@ -110,42 +110,42 @@  discard block
 block discarded – undo
110 110
 		<meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client">
111 111
 		
112 112
 		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi" crossorigin="anonymous">
113
-				<link rel="stylesheet" href="<?php echo $baseUrl;?>css/font-awesome.min.css">
114
-		<link rel="stylesheet" href="<?php echo $baseUrl;?>style.css" type="text/css">
113
+				<link rel="stylesheet" href="<?php echo $baseUrl; ?>css/font-awesome.min.css">
114
+		<link rel="stylesheet" href="<?php echo $baseUrl; ?>style.css" type="text/css">
115 115
 		
116
-		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
117
-		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
118
-		<link rel="icon" type="image/gif" href="<?php echo $baseUrl;?>img/favicon/favicon.gif">
119
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon.png">
120
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon.png">
121
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
122
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
123
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
124
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
125
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
126
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
127
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
128
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
129
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
130
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
131
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-precomposed.png">
132
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-16x16.png" sizes="16x16">
133
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-32x32.png" sizes="32x32">
134
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-96x96.png" sizes="96x96">
135
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-160x160.png" sizes="160x160">
136
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-192x192.png" sizes="192x192">
137
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-196x196.png" sizes="196x196">
138
-		<meta name="msapplication-TileImage" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
116
+		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
117
+		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
118
+		<link rel="icon" type="image/gif" href="<?php echo $baseUrl; ?>img/favicon/favicon.gif">
119
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon.png">
120
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon.png">
121
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
122
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
123
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
124
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
125
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
126
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
127
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
128
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
129
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
130
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
131
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-precomposed.png">
132
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-16x16.png" sizes="16x16">
133
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-32x32.png" sizes="32x32">
134
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-96x96.png" sizes="96x96">
135
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-160x160.png" sizes="160x160">
136
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-192x192.png" sizes="192x192">
137
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-196x196.png" sizes="196x196">
138
+		<meta name="msapplication-TileImage" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
139 139
 		<meta name="msapplication-TileColor" content="#5682a3"> 
140 140
 		<meta name="msapplication-navbutton-color" content="#5682a3"> 
141 141
 		<meta name="application-name" content="JodelBlue"/> 
142 142
 		<meta name="msapplication-tooltip" content="JodelBlue"/> 
143 143
 		<meta name="apple-mobile-web-app-title" content="JodelBlue"/> 
144
-		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-70x70.png"> 
145
-		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
146
-		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-150x150.png"> 
147
-		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x150.png"> 
148
-		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x310.png"> 
144
+		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-70x70.png"> 
145
+		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
146
+		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-150x150.png"> 
147
+		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x150.png"> 
148
+		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x310.png"> 
149 149
 	</head>
150 150
 	
151 151
 	<body>
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 						?>
218 218
 							<div class="row">								
219 219
 								<div class="col-12 col-sm-12">
220
-								<h2>Voting (<?php echo $votesRemaining;?> votes remaining)</h2>
220
+								<h2>Voting (<?php echo $votesRemaining; ?> votes remaining)</h2>
221 221
 									<form>
222 222
 										<div class="form-group">
223 223
 											<label for="quantityDelay">Quantity</label>
@@ -226,20 +226,20 @@  discard block
 block discarded – undo
226 226
 										<div class="form-group">
227 227
 											<label for="minDelay">Minimum delay</label>
228 228
 											<div class="input-group">
229
-												<input placeholder="min interval" class="form-control" id="minDelay" value="<?php echo $config['minInterval'];?>" type="number" name="min">
229
+												<input placeholder="min interval" class="form-control" id="minDelay" value="<?php echo $config['minInterval']; ?>" type="number" name="min">
230 230
 												<span class="input-group-addon">seconds</span>
231 231
 											</div>
232 232
 										</div>
233 233
 										<div class="form-group">
234 234
 											<label for="maxDelay">Maximum delay</label>
235 235
 											<div class="input-group">
236
-												<input placeholder="max interval" class="form-control" id="maxDelay" value="<?php echo $config['maxInterval'];?>" type="number" name="max">
236
+												<input placeholder="max interval" class="form-control" id="maxDelay" value="<?php echo $config['maxInterval']; ?>" type="number" name="max">
237 237
 												<span class="input-group-addon">seconds</span>
238 238
 											</div>
239 239
 										</div>
240 240
 										<div class="form-group">
241 241
 											<label for="postIdDelay">Post Id</label>
242
-											<input placeholder="postId" class="form-control" id="postIdDelay" value="<?php if(isset($_GET['postId'])) echo $_GET['postId'];?>" type="text" name="postId">
242
+											<input placeholder="postId" class="form-control" id="postIdDelay" value="<?php if(isset($_GET['postId'])) echo $_GET['postId']; ?>" type="text" name="postId">
243 243
 										</div>
244 244
 										<div class="row">
245 245
 											<div class="col-6 col-xs-6"><button type="button" name="vote" value="up" class="half" onclick="voteWithAjax('up');">Upvote</button></div>
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 			  crossorigin="anonymous"></script>
266 266
 	    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
267 267
 	    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
268
-	    <script src="<?php echo $baseUrl;?>js/jQueryEmoji.js"></script>
268
+	    <script src="<?php echo $baseUrl; ?>js/jQueryEmoji.js"></script>
269 269
 	    <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>
270 270
 
271 271
 		<script>
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 			{
310 310
 				$.ajax({
311 311
 				  type: "POST",
312
-				  url: "<?php echo $baseUrl;?>vote-ajax.php",
312
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php",
313 313
 				  data: {"vote" : data["vote"],
314 314
 						 "postId" : data["id"]},
315 315
 				  success: function(result){
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 				console.log(solution);
364 364
 				$.ajax({
365 365
 				  type: "POST",
366
-				  url: "<?php echo $baseUrl;?>vote-ajax.php?solution=" + solution + "&key="+key,
366
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php?solution=" + solution + "&key="+key,
367 367
 				  data: {"deviceUid" : deviceUid},
368 368
 				  success: function(result){
369 369
 					  var response = JSON.parse(result);
Please login to merge, or discard this patch.
php/JodelAccount.php 1 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
         {
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
     function locationEquals($city)
111 111
     {
112 112
         $db = new DatabaseConnect();
113
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
113
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
114 114
         
115 115
         $location = new Location();
116 116
         
117
-        if ($result->num_rows > 0)
117
+        if($result->num_rows > 0)
118 118
         {
119 119
             // output data of each row
120 120
             while($row = $result->fetch_assoc())
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
                     }
187 187
                     else
188 188
                     {
189
-                        user_log('User with JodelDeviceId:' . $this->deviceUid .  ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
189
+                        user_log('User with JodelDeviceId:' . $this->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
190 190
                     }
191 191
                 }
192 192
 
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
     function getLocation()
199 199
     {
200 200
         $db = new DatabaseConnect();
201
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
201
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
202 202
         
203 203
         $location = new Location();
204 204
         
205
-        if ($result->num_rows > 0)
205
+        if($result->num_rows > 0)
206 206
         {
207 207
             // output data of each row
208 208
             while($row = $result->fetch_assoc())
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
         if(isset($_POST['color']))
334 334
         {
335 335
             $color = $_POST['color'];
336
-            switch ($color) {
336
+            switch($color) {
337 337
                 case '8ABDB0':
338 338
                     $color = '8ABDB0';
339 339
                     break;
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
         $db = new DatabaseConnect();  
408 408
         $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
409 409
 
410
-        if ($result->num_rows > 0)
410
+        if($result->num_rows > 0)
411 411
         {
412 412
             // output data of each row
413 413
             while($row = $result->fetch_assoc())
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
                                     expiration_date='" . $expiration_date . "'
447 447
                                 WHERE device_uid='" . $device_uid . "'");
448 448
 
449
-        if($result === false){
449
+        if($result === false) {
450 450
                 error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
451 451
         }   
452 452
     }
@@ -456,11 +456,11 @@  discard block
 block discarded – undo
456 456
     function getAccessToken()
457 457
     {
458 458
         $db = new DatabaseConnect();
459
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
459
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
460 460
         
461 461
         $accessToken;
462 462
         
463
-        if ($result->num_rows > 0)
463
+        if($result->num_rows > 0)
464 464
         {
465 465
             // output data of each row
466 466
             while($row = $result->fetch_assoc())
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
         $result = $db->query("INSERT INTO votes (device_uid, postId, type)
527 527
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
528 528
         
529
-        if($result === false){
529
+        if($result === false) {
530 530
                 $error = db_error();
531 531
                 echo $error;
532 532
                 echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
@@ -554,11 +554,11 @@  discard block
 block discarded – undo
554 554
         $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type,
555 555
                         expires_in, expiration_date, distinct_id, device_uid, name, lat, lng)
556 556
                         VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type .
557
-                        "','" .  $expires_in . "','" . $expiration_date . "','" . $distinct_id .
557
+                        "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id .
558 558
                         "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
559 559
 
560 560
         $success = TRUE;
561
-        if($result === false){
561
+        if($result === false) {
562 562
                 $error = $db->error();
563 563
                 echo $error;
564 564
                 echo "Adding account failed: (" . $result->errno . ") " . $result->error;
Please login to merge, or discard this patch.
vote-ajax.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@
 block discarded – undo
29 29
 
30 30
 if(!$userIsVoter && !$userIsAdmin)
31 31
 {
32
-	error_log($_SERVER['REMOTE_ADDR']  . ' used a wrong password on vote-ajax.php');
33
-	$response = array("message" => $_SERVER['REMOTE_ADDR']  . ' used a wrong password on vote-ajax.php',"success" => false);
32
+	error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php');
33
+	$response = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php', "success" => false);
34 34
 	echo json_encode($response);
35 35
 	die();
36 36
 }
Please login to merge, or discard this patch.
php/View.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -63,25 +63,25 @@  discard block
 block discarded – undo
63 63
         $timediff_inDays = (string)$timediff->format('%d');
64 64
         $timediff_inMonth = (string)$timediff->format('%m');
65 65
 
66
-        if($timediff_inMonth!=0)
66
+        if($timediff_inMonth != 0)
67 67
         {
68 68
                 $timediff = $timediff_inMonth . "m";
69 69
         }
70 70
         else
71 71
         {
72
-            if($timediff_inDays!=0)
72
+            if($timediff_inDays != 0)
73 73
             {
74 74
                 $timediff = $timediff_inDays . "d";
75 75
             }
76 76
             else
77 77
             {
78
-                if($timediff_inHours!=0)
78
+                if($timediff_inHours != 0)
79 79
                 {
80 80
                     $timediff = $timediff_inHours . "h";
81 81
                 }
82 82
                 else
83 83
                 {
84
-                    if($timediff_inMinutes!=0)
84
+                    if($timediff_inMinutes != 0)
85 85
                     {
86 86
                         $timediff = $timediff_inMinutes . "m";
87 87
                     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 
97 97
         ?>
98
-        <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color'];?>;">
98
+        <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color']; ?>;">
99 99
             <content>
100 100
                 <?php 
101 101
                 if(isset($post['image_url']))
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
                 ?>
111 111
             </content>
112 112
             <aside>                    
113
-                <button onclick="vote('<?php echo $post['post_id'];?>', 'up', this)">
113
+                <button onclick="vote('<?php echo $post['post_id']; ?>', 'up', this)">
114 114
                     <i class="fa fa-angle-up fa-3x"></i>
115 115
                 </button>    
116
-                <br><span><?php echo $post["vote_count"];?></span><br>
116
+                <br><span><?php echo $post["vote_count"]; ?></span><br>
117 117
 
118
-                <button onclick="vote('<?php echo $post['post_id'];?>', 'down', this)">
118
+                <button onclick="vote('<?php echo $post['post_id']; ?>', 'down', this)">
119 119
                     <i class="fa fa-angle-down fa-3x"></i>
120 120
                 </button>
121 121
             </aside>
@@ -126,14 +126,14 @@  discard block
 block discarded – undo
126 126
                         <span class="time">
127 127
                             <span class="tip" data-tooltip="Time">
128 128
                                 <i class="fa fa-clock-o"></i>
129
-                                <?php echo $timediff;?>
130
-                                <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span>
129
+                                <?php echo $timediff; ?>
130
+                                <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s'); ?></span>
131 131
                             </span> 
132 132
                         </span>
133 133
 						<?php if(!$this->isDetailedView) {?>
134 134
                         <span class="comments">
135 135
                             <span data-tooltip="Comments">
136
-                                <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>">
136
+                                <a href="<?php echo $this->changePostId($post['post_id'])->toUrl(); ?>">
137 137
                                     <i class="fa fa-commenting-o"></i>
138 138
                                     <?php if(array_key_exists("child_count", $post))
139 139
                                     {
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 
175 175
                             <span class="tip" data-tooltip="Distance">
176 176
                                 <i class="fa fa-map-marker"></i>
177
-                                <?php echo $post['distance'];?> km
178
-                                <span class="tiptext"><?php echo $post['location']['name'];?></span>
177
+                                <?php echo $post['distance']; ?> km
178
+                                <span class="tiptext"><?php echo $post['location']['name']; ?></span>
179 179
                             </span>
180 180
                         </span>
181 181
                     
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
 		if($post != '' && array_key_exists('message', $post) && $post['message'] != '' && $this->isDetailedView)
216 216
 		{
217
-			$description = 'On JodelBlue in ' . htmlspecialchars($this->city) .  ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130);
217
+			$description = 'On JodelBlue in ' . htmlspecialchars($this->city) . ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130);
218 218
 		}
219 219
 
220 220
 		return $description;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         {
317 317
             return $data['recent'];
318 318
         }
319
-        else if(is_array($data) && array_key_exists('posts', $data)&& array_key_exists(0, $data['posts']))
319
+        else if(is_array($data) && array_key_exists('posts', $data) && array_key_exists(0, $data['posts']))
320 320
         {
321 321
             return $data['posts'];
322 322
         }
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 				</article>
106 106
 			
107 107
 				<aside class="topSidebar col-sm-4 sidebar-outer">
108
-					<div class="fixed<?php if(!$view->isDetailedView) echo(' hide-mobile');?>">
108
+					<div class="fixed<?php if(!$view->isDetailedView) echo(' hide-mobile'); ?>">
109 109
 						<article>
110 110
 							<div>
111 111
 								<h2>Position / Hashtag</h2>
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 									if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?>
141 141
 									<h2>Comment on Jodel</h2>
142 142
 									<form enctype="multipart/form-data" method="POST">				
143
-											<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" />
143
+											<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']); ?>" />
144 144
 											<textarea id="message" name="message" placeholder="Send a comment on a Jodel to all students within 10km" required></textarea>
145 145
 											<input type="hidden" name="MAX_FILE_SIZE" value="999990000" />
146 146
 											<input name="image" type="file" />
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 					</div>
182 182
 				</aside>
183 183
 			</div>
184
-			<?php include 'templates/nav-bottom.php';?>
184
+			<?php include 'templates/nav-bottom.php'; ?>
185 185
 		</div>
186 186
 		<?php
187 187
 			$includeEmojiAndAjax = TRUE;
Please login to merge, or discard this patch.