forked from PRNDA/you2php
-
Notifications
You must be signed in to change notification settings - Fork 2
/
search.php
66 lines (58 loc) · 2.39 KB
/
search.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
<?php
require_once "lang.conf.php";
if(!is_array($_GET)&&count($_GET)<=0){
exit();
}
include("./lib.php");
$headtitle=$_GET["q"].'-'.SITE_NAME;;
include("./header.php");
$order=isset($_GET['order'])?$_GET['order']:'relevance';
$order1=$order;
$q=urlencode($_GET["q"]);
$type=isset($_GET['type'])?$_GET['type']:'video';
if($type=='channel'){
$order1='channel';
}
?>
<div class="container">
<div class="py-2">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12 col-lg-12">
<span class="txt2 pt-1 pb-1" style="text-align: center;display:block;"><?php echo $lang['SEARCH_SFOR']?><?php echo $_GET["q"] ?></span>
<div class="row"> <div class="col-md-12 selectalign"> <?php echo $lang['SEARCH_SOPT']?> <select class="custom-select" id="paixu">
<?php
switch ($order1){
case 'relevance':
$relevance='selected';
break;
case 'date':
$date1='selected';
break;
case 'viewCount';
$viewCount='selected';
case 'channel';
$channel='selected';
break;
}
echo '<option '.$relevance.' data-url="./ajax/ajax.php?q='.$q.'&type=video&order=relevance&ptk='.$_GET['pageToken'].'">'.$lang['SEARCH_OPT1'].'</option>';
echo '<option '.$date1.' data-url="./ajax/ajax.php?q='.$q.'&type=video&order=date&ptk='.$_GET['pageToken'].'">'.$lang['SEARCH_OPT2'].'</option>';
echo '<option '.$viewCount.' data-url="./ajax/ajax.php?q='.$q.'&type=video&order=viewCount&ptk='.$_GET['pageToken'].'">'.$lang['SEARCH_OPT3'].'</option>';
echo '<option '.$channel.' data-url="./ajax/ajax.php?q='.$q.'&type=channel&order=relevance&ptk='.$_GET['pageToken'].'">'.$lang['SEARCH_OPT4'].'</option>';
?>
</select></div></div>
<div id="videocontent" class="pt-2 videocontentrow"></div>
</div>
<script>
$("#videocontent").load('<?php echo './ajax/ajax.php?q='.$q.'&type='.$type.'&order='.$order.'&ptk='.$_GET['pageToken']?>');
$('#paixu').on('change', function() {
loadPage($(this).find(':selected').data('url'));
});
function loadPage(url) {
$("#videocontent").load(url);
}
</script>
</div>
</div> </div>
<?php
include("./footer.php");
?>