-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtop100.php
More file actions
68 lines (50 loc) · 1.66 KB
/
top100.php
File metadata and controls
68 lines (50 loc) · 1.66 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
58
59
60
61
62
63
64
65
66
67
68
<?php
require_once("partials/functions.php");
$title = $nav["top100"]->title;
$description = $nav["top100"]->description;
require_once("partials/templates.php");
require_once("Mustache/Autoloader.php");
Mustache_Autoloader::register();
$m = new Mustache_Engine;
connect();
//$lastTrack = getLastTrack();
//$topTracks = getTopTracks(100, 0);
$topAlbums = getTopAlbums();
disconnect();
// $lastTrack->className=" now-playing";
// $lastTrack->title="Now playing: ";
// $topTracks[0]->className=" most-played";
// $topTracks[0]->title="Most played track: ";
//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/top100_inline.css"); ?>
</style>
</head>
<?php flush(); ?>
<body id="top100" class="no-js">
<h1 id="title" data-text="<?php echo $title; ?>"><?php echo $title; ?></h1>
<?php
echo $m->render($templates["top100grid"], array("tracks" => $topAlbums, "id"=>"top100grid"));
//echo $m->render($templates["toplisting"], array("tracks" => $topTracks));
echo $m->render($templates["topgraph"]);
require_once("partials/copy.php");
?>
<script>
<?php
echo "var cacheBuster = '". $cacheBuster . "';\n";
require_once("js/inline-top100.min.js");
?>
var topAlbums = <?=json_encode($topAlbums);?>;
//console.log(topAlbums[0]);
</script>
<script type="text/javascript" async src="js/script.min.<?php echo $cacheBuster; ?>.js"></script>
<?php require_once("partials/footer.php"); ?>
</body>
</html>