-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGMP.php
78 lines (70 loc) · 2.15 KB
/
GMP.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
require_once 'DbOperation.php';
require_once 'plike.php';
require_once 'Comment.php';
if($_SERVER['REQUEST_METHOD']=='POST'){
$istype="";
$temp="";
$count = "";
$url = "";
$s="";
$db = new DbOperation();
$l=new plike();
$c=new Comment();
$response = array();
if (isset($_POST['count'])) {
$count = $_POST['count'];
}
if (isset($_POST['userId'])) {
$userId = $_POST['userId'];
} else {
if (isset($_POST['token'])) {
$token = $_POST['token'];
}
=}
if ($userId == null && $token == null){
echo json_encode(['error' => true, 'message'=> 'Bad Request ' . $userId]);
return;
}
// $temp = array();
$url = $db->getMixPost($count);
while($sms = $url->fetch_assoc()){
$temp=array();
$t=array();
//echo json_encode($sms);
$temp['pid']=$sms['pid'];
$temp['uid']=$sms['uid'];
$type=$sms['mediatype'];
$temp['mediatype']=$sms['mediatype'];
//$temp['videoUrl']="http://lovegurupro.xyz/ItFeelsYou/PostData/".$sms['url'];
if($type=="image"){
$imgmedia=$db->getMultiMediaByPid($sms['pid'],$type);
while($s=$imgmedia->fetch_assoc()){
$s1 = "http://feeltunes.com/ItFeelsYou/PostData/".$s['url'];
array_push($t,$s1);
}
$temp['mediaurl']=$t;
}
if($type=="video"){
$media=$db->getMultiMediaByPid($sms['pid'],$type);
while($s=$media->fetch_assoc()){
$v1= "http://feeltunes.com/ItFeelsYou/PostData/".$s['url'];
$t1= "http://feeltunes.com/ItFeelsYou/thumb/".$s['thumb'];
}
$temp['videoUrl']=$v1;
$temp['thumb']=$t1;
}
$u= $db->getUProfileByUid($sms['uid']);
$temp['status']=$sms['status'];
$temp['addon']=$sms['addon'];
$temp['nickname']=$u[0];
$temp['profile']="http://feeltunes.com/ItFeelsYou/".$u[1];
$temp['plcount'] = $lcount;
$temp['cmtcount'] = $cmtcount[0];
$temp['isLiked'] = $userId == null ? false : $l->isLiked($sms['pid'], $userId);
array_push($response, $temp);
}
header('Content-Type: application/json');
echo json_encode($response);
}
?>