forked from forkiesassds/poktube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresults.php
executable file
·69 lines (68 loc) · 3.09 KB
/
results.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
<?php
include("header.php");
$con = $connect;
if( $con->connect_error){
die('Error: ' . $con->connect_error);
}
$sql = "SELECT * FROM `videodb`";
if( isset($_GET['search']) ){
$name = mysqli_real_escape_string($connect, htmlspecialchars($_GET['search']));
$sql = "SELECT * FROM `videodb` WHERE VideoName LIKE '%{$name}%' AND `isApproved`='1'";
}
$result = $connect->query($sql);
echo "<html>
<head>
<title>Search results for ".$_GET['search']."</title>";
?>
<div style="margin: auto; width: 95%;">
<!-- begin recently featured -->
<h1 id="hpVideoListHead">Search results for <?php echo $name?></h1>
<div id='homepage-video-list' class='list-view'>
<div id='hpFeatured'>
<div class='video-entry'>
<?php
$sql = mysqli_query($connect, "SELECT * FROM `videodb` WHERE VideoName LIKE '%{$name}%' AND `isApproved`='1'"); //instructions for sql, also WHERE with ORDER BY works, icty, you said that it didn't in FEB 24 2021, you're wrong.
while ($fetch = mysqli_fetch_assoc($sql)) { //go forward with instructions
$idvideolist = $fetch['VideoID'];
$lengthlist = 0;
if($fetch['VideoLength'] > 3600) {
$lengthlist = floor($fetch['VideoLength'] / 3600) . ":" . gmdate("i:s", $fetch['VideoLength'] % 3600);
} else {
$lengthlist = gmdate("i:s", $fetch['VideoLength'] % 3600) ;
};
$namevideolist = htmlspecialchars($fetch['VideoName']);
$uploadervideolist = htmlspecialchars($fetch['Uploader']); // get recommendations information
$uploadvideolist = htmlspecialchars($fetch['UploadDate']); // get recommendations information
$descvideolist = htmlspecialchars($fetch['VideoDesc']);
$viewsvideolist = htmlspecialchars($fetch['ViewCount']);
echo "<div class='video-entry'>
<div class='v120WideEntry'>
<div class='v120WrapperOuter'>
<div class='v120WrapperInner'>
<a id='video-url-muP9eH2p2PI' href='watch.php?v=$idvideolist' rel='nofollow'><img title='$namevideolist' src='content/thumbs/".$idvideolist.".png' onerror=\"this.src='img/default.png'\" class='vimg120' qlicon='muP9eH2p2PI' alt='$namevideolist'></a>
<div class='video-time'><span id='video-run-time-muP9eH2p2PI'>$lengthlist</span></div>
</div>
</div>
</div>
<div class='video-main-content' id='video-main-content-muP9eH2p2PI'>
<div class='video-title '>
<div class='video-long-title'>
<a id='video-long-title-muP9eH2p2PI' href='watch.php?v=$idvideolist&player=0' title='$namevideolist' rel='nofollow'>$namevideolist</a>
</div>
</div>
<div id='video-description-muP9eH2p2PI' class='video-description'>
$descvideolist
</div>
<div class='video-facets'>
Uploaded on $uploadvideolist by: <span class='video-username'><a id='video-from-username-muP9eH2p2PI' class='hLink' href='profile.php?user=$uploadervideolist'>$uploadervideolist</a></span>
</div>
</div>
<div class='video-clear-list-left'></div>
</div>";
};
//<a href='watch.php?v=$idvideolist&player=1'>Flash Player</a> - <a href='watch.php?v=$idvideolist&player=2'>ActiveX</a>
?>
<!-- end recently featured -->
</div></div></div></div>
<!-- end recently featured -->
<?php include("footer.php"); ?>