Code Duplication    Length = 18-18 lines in 2 locations

get-posts-ajax.php 1 location

@@ 50-67 (lines=18) @@
47
}
48
	$posts;
49
50
	if(isset($_GET['commentView']))
51
	{
52
		$commentView = true;
53
		$url = "/posts/location/discussed/";
54
	}
55
	else
56
	{
57
		if(isset($_GET['upVoteView']))
58
		{
59
			$upVoteView = true;
60
			$url = "/posts/location/popular/";
61
		}
62
		else
63
		{
64
			$timeView = true;
65
			$url = "/v2/posts";
66
		}
67
	}
68
69
	if(isset($_GET['lastPostId'])) {
70
	

index.php 1 location

@@ 160-177 (lines=18) @@
157
							}
158
							//Get Posts
159
							else {
160
								if(isset($_GET['commentView']))
161
								{
162
									$commentView = true;
163
									$url = "/v2/posts/location/discussed/";
164
								}
165
								else
166
								{
167
									if(isset($_GET['upVoteView']))
168
									{
169
										$upVoteView = true;
170
										$url = "/v2/posts/location/popular/";
171
									}
172
									else
173
									{
174
										$timeView = true;
175
										$url = "/v2/posts";
176
									}
177
								}
178
179
								$posts = getPosts($lastPostId, $accessToken, $url)['posts'];
180
								$loops = 29;