forked from PRNDA/you2php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ajax.php
355 lines (318 loc) · 21.9 KB
/
ajax.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<?php
require_once "../lang.conf.php";
error_reporting(E_ALL);
ini_set('display_errors', '1');
//将出错信息输出到一个文本文件
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
if(!is_array($_GET)&&count($_GET)<=0){
exit();
}
include('../lib.php');
$type=$_GET['type'];
@$q=urlencode($_GET['q']);
$ptk= isset($_GET['ptk']) ? $_GET['ptk'] : '';
$order=isset($_GET['order'])?$_GET['order']:'relevance';
$sortid=$_GET['sortid'];
switch($type){
case 'video':
$videodata=get_search_video($q,APIKEY,$ptk,'video',$order,GJ_CODE);
if($videodata['pageInfo']['totalResults']<=1){
echo'<div class="alert alert-danger h4 p-3 m-2" role="alert">'.$lang['AJAX_ERR1'].'<strong>'.urldecode($q).'</strong>'.$lang['AJAX_TEXT1'].'</div>';
exit;
}
echo '<ul class="list-unstyled video-list-thumbs row pt-1">';
foreach($videodata["items"] as $v) {
echo '<li class="col-xs-6 col-sm-6 col-md-4 col-lg-4" ><a href="./watch.php?v='.$v["id"]["videoId"].'" target="_black" class="hhh" title="'.$v["snippet"]["title"].'" >
<img src="./thumbnail.php?type=mqdefault&vid='.$v["id"]["videoId"].'" class="img-responsive" />
<p class="fa fa-play-circle-o kkk" ></p>
<span class="text-dark text-overflow font2 my-2">'.$v["snippet"]["title"].'</span></a>
<div class="pull-left pull-left1 icontext"><i class="fa fa-user icoys"></i><span class="pl-1"><a href="./channel.php?channelid='.$v["snippet"]["channelId"].'" class="icoys" title="'.$v["snippet"]["channelTitle"].'" >'.$v["snippet"]["channelTitle"].'</a>
</span></div>
<div class="pull-right pull-right1 icontext">
<i class="fa fa-clock-o pl-1 icoys "></i><span class="pl-1 icoys">'.format_date($v["snippet"]["publishedAt"]).'</span></div>
</li>';
}
echo '</ul> ';
echo '<div class="col-md-12">';
if (array_key_exists("nextPageToken",$videodata) && array_key_exists("prevPageToken",$videodata) ) {
echo'<a class="btn btn-outline-primary w-25 pull-left" href="./search.php?q='.$_GET["q"].'&order='.$_GET["order"].'&type='.$_GET['type'].'&pageToken='.$videodata["prevPageToken"].'" data-toggle="">'.$lang['AJAX_PREVIOUS'].'</a>
<a class="btn btn-outline-primary w-25 pull-right" href="./search.php?q='.$_GET["q"].'&order='.$_GET["order"].'&type='.$_GET['type'].'&pageToken='.$videodata["nextPageToken"].'" data-toggle="">'.$lang['AJAX_NEXT'].'</a>
';
} elseif (array_key_exists("nextPageToken",$videodata) && !array_key_exists("prevPageToken",$videodata)) {
echo '<a class="btn btn-outline-primary btn-block" href="./search.php?q='.$_GET["q"].'&order='.$_GET["order"].'&type='.$_GET['type'].'&pageToken='.$videodata["nextPageToken"].'" data-toggle="">'.$lang['AJAX_NEXT'].'</a>
';
} elseif (!array_key_exists("nextPageToken",$videodata) && !array_key_exists("prevPageToken",$videodata)) {} else {
echo '<a class="btn btn-outline-primary btn-block" href="./search.php?q='.$_GET["q"].'&order='.$_GET["order"].'&type='.$_GET['type'].'&pageToken='.$videodata["prevPageToken"].'" data-toggle="">'.$lang['AJAX_PREVIOUS'].'</a>' ;
}
echo'</div>';
break;
case 'recommend':
$random=random_recommend();
foreach($random as $v) {
echo '<span class="txt2 ricon h5">'.$v['t'].'</span>';
echo'<ul class="list-unstyled video-list-thumbs row pt-1">';
foreach ($v['dat'] as $value) {
echo '<li class="col-xs-6 col-sm-6 col-md-4 col-lg-4" ><a href="./watch.php?v='. $value['id'].'" class="hhh" >
<img src="./thumbnail.php?type=mqdefault&vid='.$value['id'].'" class=" img-responsive" /><p class="fa fa-play-circle-o kkk" ></p>
<span class="text-dark text-overflow font2 my-2" title="'.$value['title'].'">'.$value['title'].'</span></a>';
}
echo '</ul>';
}
break;
case 'channel':
$videodata=get_search_video($q,APIKEY,$ptk,'channel',$order,GJ_CODE);
echo'<div class="row">';
foreach($videodata['items'] as $v) {
echo '<div class="col-md-6 col-sm-12 col-lg-6 col-xs-6 p-3 offset"><div class="media">
<img class="col-4 d-flex align-self-center mr-3 mtpd" src="./thumbnail.php?type=photo&vid='.$v['snippet']['channelId'].'">
<div class="media-body col-8 chaneelit">
<a href="./channel.php?channelid='.$v['snippet']['channelId'].'" class="mtpda"><h5 class="mt-0">'.$v['snippet']['channelTitle'].'</h5></a>
<p class="mb-0">'.$v['snippet']['description'].'</p>
</div>
</div></div>';
}
echo'</div>';
echo '<div class="col-md-12 pt-3">';
if (array_key_exists("nextPageToken",$videodata) && array_key_exists("prevPageToken",$videodata) ) {
echo'<a class="btn btn-outline-primary w-25 pull-left" href="./search.php?q='.$_GET["q"].'&order='.$_GET["order"].'&type='.$_GET['type'].'&pageToken='.$videodata["prevPageToken"].'" data-toggle="">'.$lang['AJAX_PREVIOUS'].'</a>
<a class="btn btn-outline-primary w-25 pull-right" href="./search.php?q='.$_GET["q"].'&order='.$_GET["order"].'&type='.$_GET['type'].'&pageToken='.$videodata["nextPageToken"].'" data-toggle="">'.$lang['AJAX_NEXT'].'</a>
';
} elseif (array_key_exists("nextPageToken",$videodata) && !array_key_exists("prevPageToken",$videodata)) {
echo '<a class="btn btn-outline-primary btn-block" href="./search.php?q='.$_GET["q"].'&order='.$_GET["order"].'&type='.$_GET['type'].'&pageToken='.$videodata["nextPageToken"].'" data-toggle="">'.$lang['AJAX_NEXT'].'</a>
';
} elseif (!array_key_exists("nextPageToken",$videodata) && !array_key_exists("prevPageToken",$videodata)) {} else {
echo '<a class="btn btn-outline-primary btn-block" href="./search.php?q='.$_GET["q"].'&order='.$_GET["order"].'&type='.$_GET['type'].'&pageToken='.$videodata["prevPageToken"].'" data-toggle="">'.$lang['AJAX_PREVIOUS'].'</a>' ;
}
echo'</div>';
break;
case 'channels':
$video=get_channel_video($_GET['channelid'],$ptk,APIKEY,GJ_CODE);
if($video['pageInfo']['totalResults']<=1){
echo'<p>'.$lang['AJAX_ERR2'].'</p>';
exit;
}
foreach($video['items'] as $v) {
echo ' <div class="media height1 py-3 pt-3">
<div class="media-left" style="width:30%;min-width:30%;">
<a href="./watch.php?v='. $v['id']['videoId'].'" target="_blank" class="d-block" style="position:relative">
<img src="./thumbnail.php?type=mqdefault&vid='. $v['id']['videoId'].'" width="100%">
<p class="small smallp"><i class="fa fa-clock-o pr-1 text-white"></i>'.format_date($v['snippet']['publishedAt']).'</p>
</a>
</div>
<div class="media-body pl-2" style="width:70%;max-width:70%;">
<h5 class="media-heading listfont">
<a href="./watch.php?v='. $v['id']['videoId'].'" target="_blank" class="font30" title="'.$v["snippet"]["title"].'">'.$v["snippet"]["title"].'</a>
</h5>
<p class="listfont1">'.$v['snippet']['description'].'</p>
</div>
</div>';
}
if (array_key_exists("nextPageToken",$video) && array_key_exists("prevPageToken",$video) ) {
echo'<a class="btn btn-outline-primary m-1 w-25 pull-left" href="./channel.php?channelid='.$_GET['channelid'].'&pageToken='.$video['prevPageToken'].'" data-toggle="">'.$lang['AJAX_PREVIOUS'].'</a>
<a class="btn btn-outline-primary m-1 w-25 pull-right" href="./channel.php?channelid='.$_GET['channelid'].'&pageToken='.$video['nextPageToken'].'" data-toggle="">'.$lang['AJAX_NEXT'].'</a>
';
} elseif (array_key_exists("nextPageToken",$video) && !array_key_exists("prevPageToken",$video)) {
echo '<a class="btn btn-outline-primary m-1 btn-block" href="./channel.php?channelid='.$_GET['channelid'].'&pageToken='.$video['nextPageToken'].'" data-toggle="">'.$lang['AJAX_NEXT'].'</a>
';
} elseif (!array_key_exists("nextPageToken",$video) && !array_key_exists("prevPageToken",$video)) {} else {
echo '<a class="btn btn-outline-primary m-1 btn-block" href="./channel.php?channelid='.$_GET['channelid'].'&pageToken='.$video['prevPageToken'].'" data-toggle="">'.$lang['AJAX_PREVIOUS'].'</a>' ;
}
echo'</div>';
break;
case 'related':
$related=get_related_video($_GET['v'],APIKEY);
foreach($related["items"] as $v) {
echo'<div class="media height1">
<div class="media-left" style="width:40%">
<a href="./watch.php?v='.$v["id"]["videoId"].'" >
<img src="./thumbnail.php?type=mqdefault&vid='.$v["id"]["videoId"].'" width="100%">
</a>
</div>
<div class="media-body pl-2">
<h5 class="media-heading height2">
<a href="./watch.php?v='.$v["id"]["videoId"].'" class="text-dark">'.$v["snippet"]["title"].'</a>
</h5>
<p class="small mb-0 pt-2">'
.format_date($v["snippet"]["publishedAt"]).
'</p>
</div>
</div>';
}
break;
case 'menu':
$vica=videoCategories();
echo '<ul class="list-group text-dark">
<li class="list-group-item font-weight-bold"><i class="fa fa-home fa-fw pr-4"></i><a href="./" class="text-dark">'.$lang['AJAX_BTN1'].'</a></li>
<li class="list-group-item"><i class="fa fa-fire fa-fw pr-4"></i><a href="./content.php?cont=trending" class="text-dark">'.$lang['AJAX_BTN2'].'</a></li>
<li class="list-group-item"><i class="fa fa-history fa-fw pr-4"></i><a href="./content.php?cont=history" class="text-dark">'.$lang['AJAX_BTN3'].'</a></li>
<li class="list-group-item"><i class="fa fa-gavel fa-fw pr-4"></i><a href="./content.php?cont=DMCA"class="text-dark">'.$lang['AJAX_BTN4'].'</a></li>
<li class="list-group-item"><i class="fa fa-cloud-download fa-fw pr-4"></i><a href="./content.php?cont=video" class="text-dark">'.$lang['AJAX_BTN5'].'</a></li>
<li class="list-group-item"><i class="fa fa-file-code-o fa-fw pr-4 pr-4"></i><a href="./content.php?cont=api" class="text-dark">'.$lang['AJAX_BTN6'].'</a></li>
</ul>
<ul class="list-group pt-3">
<li class="list-group-item font-weight-bold"></i>'.$lang['AJAX_T1'].'</li>
';
foreach($vica as $v){
echo '<li class="list-group-item"><a href="./content.php?cont=category&sortid='.$v['id'].'" class="text-dark">'.$v['snippet']['title'].'</a></li>';
}
echo '</ul>';
break;
case 'trending':
$home_data=get_trending(APIKEY,'18','',GJ_CODE);
echo'<ul class="list-unstyled video-list-thumbs row pt-1">';
foreach($home_data["items"] as $v) {
echo '<li class="col-xs-6 col-sm-6 col-md-4 col-lg-4" ><a href="./watch.php?v='. $v["id"].'" class="hhh" >
<img src="./thumbnail.php?type=mqdefault&vid='.$v["id"].'" class=" img-responsive" /><p class="fa fa-play-circle-o kkk" ></p>
<span class="text-dark text-overflow font2 my-2" title="'.$v["snippet"]["title"].'">'.$v["snippet"]["title"].'</span></a>
<div class="pull-left pull-left1 icontext"><i class="fa fa-user icoys"></i><span class="pl-1"><a href="./channel.php?channelid='.$v["snippet"]["channelId"].'" class=" icoys" title="'.$v["snippet"]["channelTitle"].'">'.$v["snippet"]["channelTitle"].'</a></span></div>
<div class="pull-right pull-right1 icontext icoys">
<i class="fa fa-clock-o pl-1"></i><span class="pl-1">'.format_date($v["snippet"]["publishedAt"]).'</span></div>
<span class="duration">'.covtime($v["contentDetails"]["duration"]).'</span></li>';
}
echo '</ul>';
break;
case 'DMCA':
echo '<div class="font-weight-bold h6 pb-1">'.$lang['AJAX_DMCA_DIS'].'</div>';
echo '<h6><b>'.$lang['AJAX_DMCA_B'].'</b><h6>';
echo '<p class="h6" style="line-height: 1.7">'.$lang['AJAX_DMCA_M1'].'<br>
'.$lang['AJAX_DMCA_M2'].'<br>
'.$lang['AJAX_DMCA_M3'].' '.EMAIL.'! '.$lang['AJAX_DMCA_M4'].'<br></p>';
echo '<h6 class="pt-3"><b>'.$lang['AJAX_USER_NOTICE'].'</b><h6>';
echo '<p class="h6" style="line-height: 1.7">'.$lang['AJAX_USER_NOTICE_M1'].'<br>
'.$lang['AJAX_USER_NOTICE_M2'].'<br>
'.$lang['AJAX_USER_NOTICE_M3'].'<br>
'.$lang['AJAX_USER_NOTICE_M4'].'<br>
'.$lang['AJAX_USER_NOTICE_M5'].'<br></p>';
echo '<h6 class="pt-3"><b>'.$lang['AJAX_DIS'].'</b><h6>';
echo '<p class="h6" style="line-height: 1.7">'.$lang['AJAX_DIS_M1'].'<br>
'.$lang['AJAX_DIS_M2'].'<br>
</p>';
break;
case 'api':
echo '<div class="font-weight-bold h6 pb-1">'.$lang['AJAX_API'].'</div>';
echo '<p>'.$lang['AJAX_API_IA'].'</p>
<div class="alert table-inverse" role="alert">'.dirname('http://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"]).'/api.php</div><p>'.$lang['AJAX_API_RM'].'</p><table class="table table-bordered table-active"><thead><tr><th>'.$lang['AJAX_API_PN'].'</th><th>'.$lang['AJAX_API_PD'].'</th></tr> </thead><tbody><tr><td>type</td><td>'.$lang['AJAX_API_RT'].'</td></tr><tr><td>v</td><td>'.$lang['AJAX_API_YTVID'].'</td></tr></tbody></table>'
;
echo '<h5>'.$lang['AJAX_API_GVINF'].'</h5>';
echo '<p>'.$lang['AJAX_API_EXAMPLE'].dirname('http://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"]).'/api.php?type=info&v=LsDwn06bwjM</p>
<p>'.$lang['AJAX_API_RVALJSON'].'</p>';
echo '<h5>'.$lang['AJAX_API_SDL'].'</h5>';
echo '<p>'.$lang['AJAX_API_EXAMPLE'].dirname('http://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"]).'/api.php?type=downlink&v=LsDwn06bwjM</p>
<p>'.$lang['AJAX_API_RVALJSON'].'</p>';
break;
case 'videos':
echo '<div class="font-weight-bold h6 pb-1">'.$lang['AJAX_VIDDOW'].'</div>';
echo '<form onsubmit="return false" id="ipt">
<div class="form-group text-center" >
<input name="type" value="videodownload" style="display: none;">
<input type="text" name="link" placeholder="'.$lang['AJAX_PEYTVL'].'" id="soinpt" autocomplete="off" /><button type="submit" id="subu" style="width: 24%;vertical-align:middle;border: none;height: 50px;background-color: #e62117;color: #fff;font-size: 18px;display: inline-block;" ><i class="fa fa-download fa-lg pr-1"></i>'.$lang['AJAX_DOWN'].'</button>
</div>
</form>';
if(isset($_GET['type']) && isset($_GET['v'])){
echo '<div id="videoslist" class="text-center">';
$viddata=get_video_info($_GET['v'],APIKEY);
echo '<h5>'.$viddata['items']['0']['snippet']['title'].'</h5>';
echo '<div class="p-3"><img src="./thumbnail.php?type=0&vid='.$_GET['v'].'" class="rounded img-fluid"></div>';
echo video_down($_GET['v'],$viddata['items']['0']['snippet']['title']);
echo '</div>';
}else{
echo '<div id="videoslist" class="text-center"><p>'.$lang['AJAX_TIP1'].'<p></div>';
}
echo '<script>
$("#subu").click(function() {$("#videoslist").load(\'./ajax/ajax.php\',$("#ipt").serialize());});
</script>
';
break;
case 'trendinglist':
$home=get_trending(APIKEY,'48',$ptk,GJ_CODE);
echo '<div class="font-weight-bold h6 pb-1">'.$lang['AJAX_POPULAR'].'</div> ';
echo'<ul class="list-unstyled video-list-thumbs row pt-1">';
foreach($home["items"] as $v) {
echo '<li class="col-xs-6 col-sm-6 col-md-4 col-lg-4" ><a href="./watch.php?v='. $v["id"].'" class="hhh" >
<img src="./thumbnail.php?type=mqdefault&vid='.$v["id"].'" class=" img-responsive" /><p class="fa fa-play-circle-o kkk" ></p>
<span class="text-dark text-overflow font2 my-2">'.$v["snippet"]["title"].'</span></a>
<div class="pull-left pull-left1 icontext"><i class="fa fa-user icoys"></i><span class="pl-1"><a href="./channel.php?channelid='.$v["snippet"]["channelId"].'" class="icoys">'.$v["snippet"]["channelTitle"].'</a></span></div>
<div class="pull-right pull-right1 icoys icontext">
<i class="fa fa-clock-o"></i><span class="pl-1">'.format_date($v["snippet"]["publishedAt"]).'</span>
</div>
<span class="duration">'.covtime($v["contentDetails"]["duration"]).'</span>
</li>';
}
echo '</ul>';
if (array_key_exists("nextPageToken",$home) && array_key_exists("prevPageToken",$home) ) {
echo'<a class="btn btn-outline-primary m-1 w-25 pull-left" href="./content.php?cont=trending&pageToken='.$home['prevPageToken'].'" data-toggle="">'.$lang['AJAX_PREVIOUS'].'</a>
<a class="btn btn-outline-primary m-1 w-25 pull-right" href="./content.php?cont=trending&pageToken='.$home['nextPageToken'].'" data-toggle="">'.$lang['AJAX_NEXT'].'</a>
';
} elseif (array_key_exists("nextPageToken",$home) && !array_key_exists("prevPageToken",$home)) {
echo '<a class="btn btn-outline-primary m-1 btn-block" href="./content.php?cont=trending&pageToken='.$home['nextPageToken'].'" data-toggle="">'.$lang['AJAX_NEXT'].'</a>
';
} elseif (!array_key_exists("nextPageToken",$home) && !array_key_exists("prevPageToken",$home)) {} else {
echo '<a class="btn btn-outline-primary m-1 btn-block" href="./content.php?cont=trending&pageToken='.$home['prevPageToken'].'" data-toggle="">'.$lang['AJAX_PREVIOUS'].'</a>' ;
}
break;
case 'history':
$hisdata=Hislist($_COOKIE['history'],APIKEY);
echo '<div class="font-weight-bold h6 pb-1">'.$lang['AJAX_HIST_REC'].'</div> ';
if($hisdata['pageInfo']['totalResults'] ==0){echo '<div class="alert alert-warning" role="alert"><h4 class="alert-heading">'.$lang['AJAX_HIST_REC'].'</h4>
<p>'.$lang['AJAX_HIST_ERR1'].'</p>
<p class="mb-0">'.$lang['AJAX_HIST_MESS1'].'</p>
</div>';exit();}
foreach($hisdata["items"] as $v) {
$description = strlen($v['snippet']['description']) > 250 ? substr($v['snippet']['description'],0,250)."...." : $v['snippet']['description'];
echo '<div class="media height1 py-3 pt-3 ">
<div class="media-left" style="width:30%;min-width:30%;">
<a href="./watch.php?v='.$v['id'].'" target="_blank" class="d-block" style="position:relative">
<img src="./thumbnail.php?type=mqdefault&vid='.$v["id"].'" width="100%">
<p class="small smallp"><i class="fa fa-clock-o pr-1 text-white"></i>'.covtime($v['contentDetails']['duration']).'</p>
</a>
</div>
<div class="media-body pl-2" style="width:70%;max-width:70%;">
<h5 class="media-heading listfont">
<a href="./watch.php?v='.$v['id'].'" target="_blank" class="font30">'.$v["snippet"]["title"].'</a>
</h5>
<p class="listfont1">'.$description.'</p>
</div>
</div>';
}
break;
case 'videodownload':
if(stripos($_GET['link'],'youtu.be') !== false || stripos($_GET['link'],'youtube.com') !== false || stripos($_GET['link'],'watch?v=') !== false ){}else{echo '<h6>'.$lang['AJAX_ERR3'].'</h6>';break;exit();}
preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $_GET['link'], $mats);
$viddata=get_video_info($mats[1],APIKEY);
echo '<h5>'.$viddata['items']['0']['snippet']['title'].'</h5>';
echo '<div class="text-center p-3"><img src="./thumbnail.php?type=0&vid='.$mats[1].'" class="rounded img-fluid"></div>';
echo video_down($mats[1],$viddata['items']['0']['snippet']['title']);
break;
case 'category':
$category=Categories($sortid,APIKEY,$ptk,$order,GJ_CODE);
if($category['pageInfo']['totalResults']=='0'){
echo '<div class="alert alert-danger m-2" role="alert">
<strong>'.$lang['AJAX_SORRY'] .'</strong> '.$lang['AJAX_CRCNA'].'
</div>';
exit();
}
echo'<ul class="list-unstyled video-list-thumbs row pt-1">';
foreach($category['items'] as $v) {
echo '<li class="col-xs-6 col-sm-6 col-md-4 col-lg-4" ><a href="./watch.php?v='. $v['id']['videoId'].'" class="hhh" >
<img src="./thumbnail.php?type=mqdefault&vid='.$v['id']['videoId'].'" class=" img-responsive" /><p class="fa fa-play-circle-o kkk" ></p>
<span class="text-dark text-overflow font2 my-2">'.$v['snippet']['title'].'</span></a>
<div class="pull-left pull-left1 icontext"><i class="fa fa-user"></i><span class="pl-1 icoys"><a href="./channel.php?channelid='.$v['snippet']['channelId'].'" class="icoys">'.$v['snippet']['channelTitle'].'</a></span></div>
<div class="pull-right pull-right1 icontext icoys">
<i class="fa fa-clock-o pl-1"></i><span class="pl-1">'.format_date($v["snippet"]["publishedAt"]).'</span>
</div>
';
}
echo '</ul>';
if (array_key_exists("nextPageToken",$category) && array_key_exists("prevPageToken",$category) ) {
echo'<a class="btn btn-outline-primary m-1 w-25 pull-left" href="./content.php?cont=category&sortid='.$sortid.'&order='.$_GET["order"].'&pageToken='.$category['prevPageToken'].'" data-toggle="">'.$lang['AJAX_PREVIOUS'].'</a>
<a class="btn btn-outline-primary m-1 w-25 pull-right" href="./content.php?cont=category&sortid='.$sortid.'&order='.$_GET["order"].'&pageToken='.$category['nextPageToken'].'" data-toggle="">'.$lang['AJAX_NEXT'].'</a>
';
} elseif (array_key_exists("nextPageToken",$category) && !array_key_exists("prevPageToken",$category)) {
echo '<a class="btn btn-outline-primary m-1 btn-block" href="./content.php?cont=category&sortid='.$sortid.'&order='.$_GET["order"].'&pageToken='.$category['nextPageToken'].'" data-toggle="">'.$lang['AJAX_NEXT'].'</a>
';
} elseif (!array_key_exists("nextPageToken",$category) && !array_key_exists("prevPageToken",$category)) {} else {
echo '<a class="btn btn-outline-primary m-1 btn-block" href="./content.php?cont=category&sortid='.$sortid.'&order='.$_GET["order"].'&pageToken='.$category['prevPageToken'].'" data-toggle="">'.$lang['AJAX_PREVIOUS'].'</a>' ;
}
break;
}
?>