Code Duplication    Length = 31-35 lines in 2 locations

index.php 2 locations

@@ 133-163 (lines=31) @@
130
		if(array_key_exists('recent', $posts))
131
		{
132
			$posts = $posts['recent'];
133
			if(!array_key_exists(0, $posts))
134
			{
135
				$posts[0] = array(
136
			    "post_id" => "0",
137
			    "discovered_by" => 0,
138
			    "message" => "Not found",
139
			    "created_at" => "2017-02-11T16:44:50.385Z",
140
			    "updated_at" => "2017-02-11T16:44:50.385Z",
141
			    "pin_count" => 0,
142
			    "color" => "FFBA00",
143
			    "got_thanks" => FALSE,
144
			    "post_own" => "friend",
145
			    "discovered" => 0,
146
			    "distance" => 9,
147
			    "vote_count" => 0,
148
			    "location" =>
149
			    array("name" => "Berlin",
150
			      "loc_coordinates" =>
151
			      array(
152
			        "lat" => 0,
153
			        "lng" => 0
154
			      ),
155
			      "loc_accuracy" => 0,
156
			      "country" => "",
157
			      "city" => "",
158
			    ),
159
			    "tags" =>
160
			    array(),
161
			    "user_handle" => "0"
162
			 );
163
			}
164
		}
165
		else
166
		{
@@ 165-199 (lines=35) @@
162
			 );
163
			}
164
		}
165
		else
166
		{
167
			$posts = array();
168
			$posts[0] = 
169
			array(
170
			    "post_id" => "0",
171
			    "discovered_by" => 0,
172
			    "message" => "Bad Request",
173
			    "created_at" => "2017-02-11T16:44:50.385Z",
174
			    "updated_at" => "2017-02-11T16:44:50.385Z",
175
			    "pin_count" => 0,
176
			    "color" => "FFBA00",
177
			    "got_thanks" => FALSE,
178
			    "post_own" => "friend",
179
			    "discovered" => 0,
180
			    "distance" => 9,
181
			    "vote_count" => 0,
182
			    "location" =>
183
			    array("name" => "Berlin",
184
			      "loc_coordinates" =>
185
			      array(
186
			        "lat" => 0,
187
			        "lng" => 0
188
			      ),
189
			      "loc_accuracy" => 0,
190
			      "country" => "",
191
			      "city" => "",
192
			    ),
193
			    "tags" =>
194
			    array(),
195
			    "user_handle" => "0"
196
			 );
197
198
199
		}
200
		$loops = 29;
201
		$isDetailedView = FALSE;
202
	}