-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
57 lines (46 loc) · 1.42 KB
/
index.php
File metadata and controls
57 lines (46 loc) · 1.42 KB
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
<?php
require_once("partials/functions.php");
$title = $nav["top"]->title;
$description = $nav["top"]->description;
require_once("partials/templates.php");
require_once("Mustache/Autoloader.php");
Mustache_Autoloader::register();
$m = new Mustache_Engine;
connect();
//$lastTrack = getLastTrack();
$topTracks = getTrendingTracks();
disconnect();
// $lastTrack->className=" now-playing";
// $lastTrack->title="Now playing: ";
// $topTracks[0]->className=" most-played";
// $topTracks[0]->title="Most played track: ";
$shuffledTracks = $topTracks;
//array_push($shuffledTracks, $lastTrack);
shuffle ( $shuffledTracks);
?><!doctype html>
<html lang="en" itemscope itemtype="http://schema.org/Website">
<head>
<?php /*Header */ ?>
<?php require_once("partials/header.php"); ?>
<?php /*CSS */ ?>
<style type="text/css" media="all">
<?php require_once("css/top_inline.css"); ?>
</style>
</head>
<?php flush(); ?>
<body id="top" class="no-js">
<?php
echo $m->render($templates["topgrid"], array("tracks" => $shuffledTracks, "id"=>"grid"));
echo $m->render($templates["toplisting"], array("tracks" => $topTracks));
require_once("partials/copy.php");
?>
<script>
<?php
echo "var cacheBuster = '". $cacheBuster . "';";
require_once("js/inline-top.min.js");
?>
</script>
<script type="text/javascript" async src="js/script.min.<?php echo $cacheBuster; ?>.js"></script>
<?php require_once("partials/footer.php"); ?>
</body>
</html>