Completed
Push — master ( af5052...240863 )
by mains
02:56
created
get-posts-ajax.php 1 patch
Braces   +29 added lines, -13 removed lines patch added patch discarded remove patch
@@ -17,18 +17,22 @@  discard block
 block discarded – undo
17 17
 require_once 'php/Requests/libary/Requests.php';
18 18
 Requests::register_autoloader();
19 19
 
20
-function getPosts($lastPostId, $url) {
20
+function getPosts($lastPostId, $url)
21
+{
21 22
 	$db = new DatabaseConnect();
22
-	if ($db->connect_errno) {
23
+	if ($db->connect_errno)
24
+	{
23 25
 		echo 'Sorry, die Verbindung zu unserem superfetten endgeilen 
24 26
 					Server ist hops gegangen. Wegen '. $db -> connect_error;
25 27
 	}
26 28
 	
27 29
 	$result = $db->query("SELECT * FROM accounts WHERE id='1'");
28 30
 	
29
-	if ($result->num_rows > 0) {
31
+	if ($result->num_rows > 0)
32
+	{
30 33
 		// output data of each row
31
-		while($row = $result->fetch_assoc()) {
34
+		while($row = $result->fetch_assoc())
35
+		{
32 36
 			$access_token = $row["access_token"];
33 37
 		}
34 38
 	}
@@ -66,7 +70,8 @@  discard block
 block discarded – undo
66 70
 		}
67 71
 	}
68 72
 
69
-	if(isset($_GET['lastPostId'])) {
73
+	if(isset($_GET['lastPostId']))
74
+	{
70 75
 	
71 76
 		$lastPostId = $_GET['lastPostId'];
72 77
 		
@@ -76,9 +81,11 @@  discard block
 block discarded – undo
76 81
 		?>
77 82
 		<div class="nextPosts">
78 83
 		<?php
79
-		for($i = 0; $i<$loops; $i++) {
84
+		for($i = 0; $i<$loops; $i++)
85
+		{
80 86
 		
81
-			if(isset($posts[$i])) {
87
+			if(isset($posts[$i]))
88
+			{
82 89
 				$lastPostId = $posts[$i]['post_id'];
83 90
 
84 91
 				
@@ -94,7 +101,8 @@  discard block
 block discarded – undo
94 101
 							$timediff_inHours = (string)$timediff->format('%h');
95 102
 							$timediff_inDays = (string)$timediff->format('%d');
96 103
 							$timediff_inMonth = (string)$timediff->format('%m');
97
-							if($timediff_inMonth!=0) {
104
+							if($timediff_inMonth!=0)
105
+							{
98 106
 									$timediff = $timediff_inMonth . "m";
99 107
 							}
100 108
 							else
@@ -127,10 +135,12 @@  discard block
 block discarded – undo
127 135
 				<article class="jodel" style="background-color: #<?php echo $posts[$i]["color"];?>;">
128 136
 					<content>
129 137
 						<?php 
130
-						if(isset($posts[$i]["image_url"])) {
138
+						if(isset($posts[$i]["image_url"]))
139
+						{
131 140
 							echo '<img src="' . $posts[$i]["image_url"] . '">';
132 141
 						}
133
-						else {
142
+						else
143
+						{
134 144
 							echo nl2br($posts[$i]["message"]);
135 145
 						}
136 146
 						?>
@@ -156,13 +166,19 @@  discard block
 block discarded – undo
156 166
 									</span> 
157 167
 								</td>
158 168
 								<td class="comments">
159
-									<?php if($showCommentIcon) {?>
169
+									<?php if($showCommentIcon)
170
+{
171
+?>
160 172
 									<span data-tooltip="Comments">
161 173
 										<a href="index.php?getPostDetails=true&postID=<?php echo $posts[$i]["post_id"];?>">
162 174
 											<i class="fa fa-commenting-o"></i>
163
-											<?php if(array_key_exists("child_count", $posts[$i])) {
175
+											<?php if(array_key_exists("child_count", $posts[$i]))
176
+{
164 177
 														echo $posts[$i]["child_count"];
165
-													} else echo "0";
178
+													}
179
+													else {
180
+														echo "0";
181
+													}
166 182
 											?>
167 183
 											</a>
168 184
 									</span>
Please login to merge, or discard this patch.