-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
42 lines (38 loc) · 1.66 KB
/
index.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
<?php
require "static/header.xhtml";
$config = require "config.php";
require "misc/tools.php";
require "results/search_results.php";
$query = $_REQUEST["q"];
$results = array();
get_search_results($query);
if (empty($query))
{
echo "<p>No popular video feed here, don't be a consoomer.</p>";
}
else
{
echo "<div class=\"video-results\">";
foreach ($results as $result)
{
echo "<div>";
if ($result["is_video"])
{
echo "<a href=\"watch.php?v=" . $result["video_id"] . "\">";
echo "<img src=\"/image_proxy.php?url=" . $result["thumbnail"] . "\" />";
echo "<p>" . $result["title"] . "</p>";
echo "</a>";
echo "<small class=\"channel-name\"><a href=\"channel.php?id=" . $result["channel_id"] . "\">" . $result["channel_name"] . "</a> - " . $result["date"] . " - " . $result["views"] . "</small>";
}
else
{
echo "<a href=\"channel.php?id=" . $result["channel_id"] . "\">";
echo "<img src=\"/image_proxy.php?url=" . $result["thumbnail"] . "\" />";
echo "<p>" . $result["channel_name"] . "</p></a>";
}
echo "</div>";
}
echo "</div>";
}
require "static/footer.xhtml";
?>