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

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