Completed
Push — master ( 3c0e9a...ccb03a )
by mains
02:54
created
templates/header.php 1 patch
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.
php/Requests/AbstractRequest.php 1 patch
Braces   +13 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 abstract class AbstractRequest
4
-{	
4
+{
5 5
     const CLIENTID = '81e8a76e-1e02-4d17-9ba0-8a7020261b26';
6 6
     const APIURL = 'https://api.go-tellm.com/api';
7 7
     const SECRET = 'SDydTnTdqqaiAMfneLkqXYxamvNuUYOmkqpdiZTu';
@@ -20,7 +20,8 @@  discard block
 block discarded – undo
20 20
 		        
21 21
 		$this->payLoad = $this->getPayload();
22 22
 		$device_uid = '';
23
-		if(isset($this->payLoad['device_uid'])) {
23
+		if(isset($this->payLoad['device_uid']))
24
+		{
24 25
 			$device_uid = $this->payLoad['device_uid'];
25 26
 		}
26 27
 				
@@ -29,7 +30,8 @@  discard block
 block discarded – undo
29 30
         $header = $this->getSignHeaders();
30 31
         $url = $this->getFullUrl();
31 32
 
32
-        if ($this->getAccessToken()) {
33
+        if ($this->getAccessToken())
34
+        {
33 35
             $header['Authorization'] = "Bearer " . $this->getAccessToken();
34 36
         }
35 37
         //Comment out to debug the Request:
@@ -52,7 +54,8 @@  discard block
 block discarded – undo
52 54
             'proxy' => '186.103.169.165:8080',
53 55
         );*/
54 56
 
55
-        switch ($this->getMethod()) {
57
+        switch ($this->getMethod())
58
+        {
56 59
             case 'POST':
57 60
                 $result = Requests::post($url, $header, $this->payLoad);
58 61
                 break;
@@ -70,7 +73,8 @@  discard block
 block discarded – undo
70 73
                 $result = Requests::put($url, $header, $this->payLoad);
71 74
                 break;
72 75
         }
73
-        switch ($result->status_code) {
76
+        switch ($result->status_code)
77
+        {
74 78
             case 200:
75 79
                 $result = json_decode($result->body, true);
76 80
                 break;
@@ -127,10 +131,12 @@  discard block
 block discarded – undo
127 131
      */
128 132
     private function getSignHeaders()
129 133
     {
130
-			if($this->getAccessToken() == null) {
134
+			if($this->getAccessToken() == null)
135
+			{
131 136
 				$payload_accessToken = "";
132 137
 			}
133
-			else {
138
+			else
139
+			{
134 140
 				$payload_accessToken = $this->getAccessToken();
135 141
 			}
136 142
 			
Please login to merge, or discard this patch.
php/CustomError.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	public $varsToDump;
14 14
 
15 15
 	function __construct($msg = 'not Set', $varsToDump = 'not Set', $view = 'not Set', $actions = 'not Set', $accountId = 'not Set', $isVerified = 'not Set', $isTokenFresh = 'not Set', $page = 'not Set', $referrer = 'not Set')
16
-    {
16
+	{
17 17
         $this->view = $view;
18 18
         $this->actions = $actions;
19 19
         $this->accountId = $accountId;
Please login to merge, or discard this patch.
php/JodelAccount.php 1 patch
Braces   +12 added lines, -7 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         if($location->getLat() == $lat && $location->getLng() == $lng && $location->getCityName() == $name)
87 87
         {
88 88
             return TRUE;
89
-        }  
89
+        }
90 90
         else
91 91
         {
92 92
             return FALSE;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         if(substr($_GET['city'], 0, 1) === '#')
100 100
         {
101 101
             return htmlspecialchars($_GET['city']) . " " . $this->location->cityName;
102
-        }                
102
+        }
103 103
         else
104 104
         {
105 105
             $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w';
@@ -272,7 +272,8 @@  discard block
 block discarded – undo
272 272
         if(isset($_POST['color']))
273 273
         {
274 274
             $color = $_POST['color'];
275
-            switch ($color) {
275
+            switch ($color)
276
+            {
276 277
                 case '8ABDB0':
277 278
                     $color = '8ABDB0';
278 279
                     break;
@@ -369,7 +370,8 @@  discard block
 block discarded – undo
369 370
                                     expiration_date='" . $expiration_date . "'
370 371
                                 WHERE device_uid='" . $device_uid . "'");
371 372
 
372
-        if($result === false){
373
+        if($result === false)
374
+        {
373 375
                 error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
374 376
         }   
375 377
     }
@@ -449,14 +451,16 @@  discard block
 block discarded – undo
449 451
         $result = $db->query("INSERT INTO votes (device_uid, postId, type)
450 452
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
451 453
         
452
-        if($result === false){
454
+        if($result === false)
455
+        {
453 456
                 $error = db_error();
454 457
                 echo $error;
455 458
                 echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
456 459
         }       
457 460
     }
458 461
 
459
-    function registerAccount($location) {
462
+    function registerAccount($location)
463
+    {
460 464
         $accountCreator = new CreateUser();
461 465
         $accountCreator->setLocation($location);
462 466
         $data = $accountCreator->execute();
@@ -481,7 +485,8 @@  discard block
 block discarded – undo
481 485
                         "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
482 486
 
483 487
         $success = TRUE;
484
-        if($result === false){
488
+        if($result === false)
489
+        {
485 490
                 $error = $db->error();
486 491
                 echo $error;
487 492
                 echo "Adding account failed: (" . $result->errno . ") " . $result->error;
Please login to merge, or discard this patch.
php/DatabaseConnect.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,14 +13,18 @@
 block discarded – undo
13 13
 }
14 14
 $db = new DatabaseConnect();
15 15
 
16
-if($db->connect_errno == 1203)  // 1203 == ER_TOO_MANY_USER_CONNECTIONS (mysqld_error.h)
16
+if($db->connect_errno == 1203)
17
+{
18
+	// 1203 == ER_TOO_MANY_USER_CONNECTIONS (mysqld_error.h)
17 19
 {
18 20
 	error_log('ER_TOO_MANY_USER_CONNECTIONS');
21
+}
19 22
 	sleep(1);
20 23
 	header('location: '.$_SERVER['PHP_SELF']);
21 24
 }
22 25
 
23
-if ($db->connect_errno) {
26
+if ($db->connect_errno)
27
+{
24 28
   echo 'Sorry, die Verbindung zu unserem 
25 29
         Server ist hops gegangen. Wegen '. $db -> connect_error;
26 30
 }
Please login to merge, or discard this patch.
templates/footer.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,9 @@  discard block
 block discarded – undo
13 13
 			{
14 14
 				window.history.back();
15 15
 			}
16
-		<?php if(isset($includeEmojiAndAjax)){ ?>
16
+		<?php if(isset($includeEmojiAndAjax))
17
+{
18
+?>
17 19
 
18 20
 			function vote(postId, vote, obj)
19 21
 			{
@@ -99,7 +101,9 @@  discard block
 block discarded – undo
99 101
 					return {"lastPostId":lastPostId, "old_lastPostId":old_lastPostId};
100 102
 				}
101 103
 
102
-				<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?>
104
+				<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails']))
105
+{
106
+?>
103 107
 
104 108
 				if(window.location.hash)
105 109
 				{
Please login to merge, or discard this patch.
php/jodel-web.php 1 patch
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,7 +70,8 @@  discard block
 block discarded – undo
70 70
         return TRUE;
71 71
     }
72 72
 }
73
-function isUserAdmin() {
73
+function isUserAdmin()
74
+{
74 75
 	global $config;
75 76
 	if (isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword'])
76 77
 	{
@@ -121,7 +122,7 @@  discard block
 block discarded – undo
121 122
 	}
122 123
 	
123 124
 	if(configPropertyExists($config, 'karmaDeviceUid'))
124
-    {
125
+	{
125 126
     	$jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']);
126 127
     }
127 128
     else
@@ -194,7 +195,8 @@  discard block
 block discarded – undo
194 195
 	
195 196
 	if(isset($_GET['view']))
196 197
 	{
197
-		switch ($_GET['view']) {
198
+		switch ($_GET['view'])
199
+		{
198 200
 			case 'discussed':
199 201
 				$view = 'discussed';
200 202
 				break;
Please login to merge, or discard this patch.
php/View.php 1 patch
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@  discard block
 block discarded – undo
34 34
 	 * Compute HTML Code
35 35
 	 */
36 36
  	function jodelToHtml($post)
37
-    {   //ToDO
37
+ 	{
38
+//ToDO
38 39
         //Replace # with link
39 40
         //preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text);
40 41
 
@@ -90,7 +91,8 @@  discard block
 block discarded – undo
90 91
 
91 92
                     echo '<img src="' . $post['image_url'] . '" alt="' . htmlspecialchars(preg_replace($regexRest, '', $post['message'])) . '">';
92 93
                 }
93
-                else {
94
+                else
95
+                {
94 96
                     echo str_replace('  ', ' &nbsp;', nl2br(htmlspecialchars($post['message'])));
95 97
                 }
96 98
                 ?>
@@ -116,15 +118,20 @@  discard block
 block discarded – undo
116 118
                                 <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span>
117 119
                             </span> 
118 120
                         </span>
119
-						<?php if(!$this->isDetailedView) {?>
121
+						<?php if(!$this->isDetailedView)
122
+{
123
+?>
120 124
                         <span class="comments">
121 125
                             <span data-tooltip="Comments">
122 126
                                 <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>">
123 127
                                     <i class="fa fa-commenting-o"></i>
124 128
                                     <?php if(array_key_exists("child_count", $post))
125
-                                    {
129
+{
126 130
                                         echo $post["child_count"];
127
-                                    } else echo "0";
131
+                                    }
132
+                                    else {
133
+                                    	echo "0";
134
+                                    }
128 135
                                     ?>
129 136
                                 </a>
130 137
                             </span>
@@ -306,7 +313,7 @@  discard block
 block discarded – undo
306 313
             $data = $accountCreator->execute();
307 314
         }
308 315
     	if(array_key_exists('recent', $data) && array_key_exists(0, $data['recent']))
309
-        {
316
+    	{
310 317
             return $data['recent'];
311 318
         }
312 319
         else if(array_key_exists('posts', $data)&& array_key_exists(0, $data['posts']))
Please login to merge, or discard this patch.
index.php 1 patch
Braces   +21 added lines, -6 removed lines patch added patch discarded remove patch
@@ -96,7 +96,9 @@  discard block
 block discarded – undo
96 96
 							} ?>
97 97
 					</content>
98 98
 					
99
-					<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?>
99
+					<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails']))
100
+{
101
+?>
100 102
 						<p id="loading">
101 103
 							Loading…
102 104
 						</p>
@@ -104,12 +106,20 @@  discard block
 block discarded – undo
104 106
 				</article>
105 107
 			
106 108
 				<aside class="topSidebar col-sm-4 sidebar-outer">
107
-					<div class="fixed<?php if(!$view->isDetailedView) echo(' hide-mobile');?>">
109
+					<div class="fixed<?php if(!$view->isDetailedView)
110
+{
111
+	echo(' hide-mobile');
112
+}
113
+?>">
108 114
 						<article>
109 115
 							<div>
110 116
 								<h2>Position / Hashtag</h2>
111 117
 								<form action="index.php" method="get">
112
-									<input type="text" id="city" name="search" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required>
118
+									<input type="text" id="city" name="search" placeholder="<?php if(isset($newPositionStatus))
119
+{
120
+	echo $newPositionStatus;
121
+}
122
+?>" required>
113 123
 									<label>try: #jhj</label><br>
114 124
 									<input type="submit" value="Set Location" /> 
115 125
 								</form>
@@ -126,7 +136,7 @@  discard block
 block discarded – undo
126 136
 						<article>
127 137
 							<div>
128 138
 								<?php if(!$jodelAccountForView->isAccountVerified())
129
-								{
139
+{
130 140
 								?>
131 141
 								<h2>New Jodel</h2>
132 142
 								
@@ -138,7 +148,9 @@  discard block
 block discarded – undo
138 148
 								{
139 149
 
140 150
 
141
-									if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?>
151
+									if(isset($_GET['postId']) && isset($_GET['getPostDetails']))
152
+									{
153
+?>
142 154
 									<h2>Comment on Jodel</h2>
143 155
 									<form method="POST">				
144 156
 											<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" />
@@ -146,7 +158,10 @@  discard block
 block discarded – undo
146 158
 										<br />
147 159
 										<input type="submit" value="SEND" /> 
148 160
 									</form>
149
-										<?php } else { ?>
161
+										<?php }
162
+else
163
+{
164
+?>
150 165
 									<h2>New Jodel</h2>
151 166
 									<form enctype="multipart/form-data" method="POST">
152 167
 										<textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> 
Please login to merge, or discard this patch.