Completed
Push — master ( 5b3e55...ba45f1 )
by mains
02:49
created
php/View.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -49,25 +49,25 @@  discard block
 block discarded – undo
49 49
         $timediff_inDays = (string)$timediff->format('%d');
50 50
         $timediff_inMonth = (string)$timediff->format('%m');
51 51
 
52
-        if($timediff_inMonth!=0)
52
+        if($timediff_inMonth != 0)
53 53
         {
54 54
                 $timediff = $timediff_inMonth . "m";
55 55
         }
56 56
         else
57 57
         {
58
-            if($timediff_inDays!=0)
58
+            if($timediff_inDays != 0)
59 59
             {
60 60
                 $timediff = $timediff_inDays . "d";
61 61
             }
62 62
             else
63 63
             {
64
-                if($timediff_inHours!=0)
64
+                if($timediff_inHours != 0)
65 65
                 {
66 66
                     $timediff = $timediff_inHours . "h";
67 67
                 }
68 68
                 else
69 69
                 {
70
-                    if($timediff_inMinutes!=0)
70
+                    if($timediff_inMinutes != 0)
71 71
                     {
72 72
                         $timediff = $timediff_inMinutes . "m";
73 73
                     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
 
83 83
         ?>
84
-        <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color'];?>;">
84
+        <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color']; ?>;">
85 85
             <content>
86 86
                 <?php 
87 87
                 if(isset($post['image_url']))
@@ -99,24 +99,24 @@  discard block
 block discarded – undo
99 99
                 <?php
100 100
                     if($this->isDetailedView)
101 101
                     {?>
102
-                        <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow">
102
+                        <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id']; ?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']); ?>" rel="nofollow">
103 103
               <?php }
104 104
                     else
105 105
                     {?>
106
-                        <a href="index.php?vote=up&postId=<?php echo $post['post_id'];?>" rel="nofollow">
106
+                        <a href="index.php?vote=up&postId=<?php echo $post['post_id']; ?>" rel="nofollow">
107 107
               <?php } ?>
108 108
                             <i class="fa fa-angle-up fa-3x"></i>
109 109
                         </a>    
110 110
                             <br />
111
-                        <?php echo $post["vote_count"];?><br />
111
+                        <?php echo $post["vote_count"]; ?><br />
112 112
                 <?php
113 113
                     if($this->isDetailedView)
114 114
                     {?>
115
-                        <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow">
115
+                        <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id']; ?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']); ?>" rel="nofollow">
116 116
               <?php }
117 117
                     else
118 118
                     {?>
119
-                        <a href="index.php?vote=down&postId=<?php echo $post['post_id'];?>" rel="nofollow">
119
+                        <a href="index.php?vote=down&postId=<?php echo $post['post_id']; ?>" rel="nofollow">
120 120
               <?php } ?>
121 121
                             <i class="fa fa-angle-down fa-3x"></i>
122 122
                         </a>
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
                         <span class="time">
129 129
                             <span class="tip" data-tooltip="Time">
130 130
                                 <i class="fa fa-clock-o"></i>
131
-                                <?php echo $timediff;?>
132
-                                <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span>
131
+                                <?php echo $timediff; ?>
132
+                                <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s'); ?></span>
133 133
                             </span> 
134 134
                         </span>
135 135
 						<?php if(!$this->isDetailedView) {?>
136 136
                         <span class="comments">
137 137
                             <span data-tooltip="Comments">
138
-                                <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>">
138
+                                <a href="<?php echo $this->changePostId($post['post_id'])->toUrl(); ?>">
139 139
                                     <i class="fa fa-commenting-o"></i>
140 140
                                     <?php if(array_key_exists("child_count", $post)) {
141 141
                                                 echo $post["child_count"];
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                         </span>
148 148
 						<?php
149 149
 						}															  
150
-						if (isUserAdmin())
150
+						if(isUserAdmin())
151 151
 						{
152 152
 						?>
153 153
 						<span class="voting">
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                                         {
178 178
                                             ?>
179 179
                                             <span data-tooltip="Author">
180
-                                                <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"];?> |
180
+                                                <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"]; ?> |
181 181
                                             </span>
182 182
                                             <?php
183 183
                                         }
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 
188 188
                             <span class="tip" data-tooltip="Distance">
189 189
                                 <i class="fa fa-map-marker"></i>
190
-                                <?php echo $post['distance'];?> km
191
-                                <span class="tiptext"><?php echo $post['location']['name'];?></span>
190
+                                <?php echo $post['distance']; ?> km
191
+                                <span class="tiptext"><?php echo $post['location']['name']; ?></span>
192 192
                             </span>
193 193
                         </span>
194 194
                     
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
 		if($post != '' && array_key_exists('message', $post) && $post['message'] != '' && $this->isDetailedView)
229 229
 		{
230
-			$description = 'On JodelBlue in ' . htmlspecialchars($this->city) .  ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130);
230
+			$description = 'On JodelBlue in ' . htmlspecialchars($this->city) . ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130);
231 231
 		}
232 232
 
233 233
 		return $description;
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         {
359 359
             return $data['recent'];
360 360
         }
361
-        else if(array_key_exists('posts', $data)&& array_key_exists(0, $data['posts']))
361
+        else if(array_key_exists('posts', $data) && array_key_exists(0, $data['posts']))
362 362
         {
363 363
             return $data['posts'];
364 364
         }
Please login to merge, or discard this patch.
Braces   +24 added lines, -12 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
                 ?>
@@ -98,11 +100,13 @@  discard block
 block discarded – undo
98 100
             <aside>
99 101
                 <?php
100 102
                     if($this->isDetailedView)
101
-                    {?>
103
+                    {
104
+?>
102 105
                         <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow">
103 106
               <?php }
104
-                    else
105
-                    {?>
107
+else
108
+                    {
109
+?>
106 110
                         <a href="index.php?vote=up&postId=<?php echo $post['post_id'];?>" rel="nofollow">
107 111
               <?php } ?>
108 112
                             <i class="fa fa-angle-up fa-3x"></i>
@@ -111,11 +115,13 @@  discard block
 block discarded – undo
111 115
                         <?php echo $post["vote_count"];?><br />
112 116
                 <?php
113 117
                     if($this->isDetailedView)
114
-                    {?>
118
+                    {
119
+?>
115 120
                         <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow">
116 121
               <?php }
117
-                    else
118
-                    {?>
122
+else
123
+                    {
124
+?>
119 125
                         <a href="index.php?vote=down&postId=<?php echo $post['post_id'];?>" rel="nofollow">
120 126
               <?php } ?>
121 127
                             <i class="fa fa-angle-down fa-3x"></i>
@@ -132,14 +138,20 @@  discard block
 block discarded – undo
132 138
                                 <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span>
133 139
                             </span> 
134 140
                         </span>
135
-						<?php if(!$this->isDetailedView) {?>
141
+						<?php if(!$this->isDetailedView)
142
+{
143
+?>
136 144
                         <span class="comments">
137 145
                             <span data-tooltip="Comments">
138 146
                                 <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>">
139 147
                                     <i class="fa fa-commenting-o"></i>
140
-                                    <?php if(array_key_exists("child_count", $post)) {
148
+                                    <?php if(array_key_exists("child_count", $post))
149
+{
141 150
                                                 echo $post["child_count"];
142
-                                            } else echo "0";
151
+                                            }
152
+                                            else {
153
+                                            	echo "0";
154
+                                            }
143 155
                                     ?>
144 156
                                 </a>
145 157
                             </span>
@@ -355,7 +367,7 @@  discard block
 block discarded – undo
355 367
             $data = $accountCreator->execute();
356 368
         }
357 369
     	if(array_key_exists('recent', $data) && array_key_exists(0, $data['recent']))
358
-        {
370
+    	{
359 371
             return $data['recent'];
360 372
         }
361 373
         else if(array_key_exists('posts', $data)&& array_key_exists(0, $data['posts']))
Please login to merge, or discard this patch.