This repository has been archived by the owner on Oct 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
114 lines (97 loc) · 2.99 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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* ZINA (Zina is not Andromeda)
*
* Zina is a graphical interface to your MP3 collection, a personal
* jukebox, an MP3 streamer. It can run on its own, embeded into an
* existing website, or as a Drupal/Joomla/Wordpress/etc. module.
*
* http://www.pancake.org/zina
* Author: Ryan Lathouwers <[email protected]>
* Support: http://sourceforge.net/projects/zina/
* License: GNU GPL2 <http://www.gnu.org/copyleft/gpl.html>
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
# BY DEFAULT: username is "admin" & password is "password"
# After you login in to Zina, change your password under "Settings"
# All settings are described and set through the GUI.
#$mem1 = memory_get_usage();
$conf['time'] = microtime(true);
#session_start();
#header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
$conf['embed'] = 'standalone';
$conf['index_abs'] = dirname(__FILE__);
require_once('zina/index.php');
if ($zina = zina($conf)) {
echo ztheme('page_complete', $zina);
}
#TODO:
#$mem2 = memory_get_peak_usage();
#printf("<pre>Max memory: %0.2f kbytes\nRunning time: %0.3f s</pre>",($mem2-$mem1)/1024.0, microtime(true) - $conf['time']);
function zina_access_denied() {
header('HTTP/1.1 403 Forbidden');
return zina_page_simple(zt('Access denied.'), zt('You are not authorized to access this page.'));
}
function zina_not_found() {
header('HTTP/1.1 404 Not Found');
return zina_page_simple(zt('Page not found.'), zt('The requested page could not be found.'));
}
function zina_token($type, $value) {
global $zc;
static $sitekey;
if (empty($sitekey)) {
$keyfile = $zc['cache_dir_private_abs'].'/sitekey.txt';
if (file_exists($keyfile)) {
$sitekey = file_get_contents($keyfile);
} else {
zina_debug(zt('Sitekey file does not exist'),'warn');
return false;
}
}
$sep = '|';
if ($type == 'get') {
return $value.$sep.md5($value.$sitekey);
} elseif ($type == 'verify') {
$x = explode($sep, $value);
if (md5($x[0].$sitekey) === $x[1]) {
return $x[0];
} else {
return false;
}
}
return false;
}
function zina_cms_access($type, $type_user_id = null) {
global $zc;
return $zc['is_admin'];
}
function zina_cms_user($user_id = false) {
global $zc;
return false;
/*
$uid = ($user_id) ? $user_id : $zc['user_id'];
if ($user_id != 1) return false;
return array(
'uid' => $zc['user_id'],
'name' => zt('Administrator'),
'profile_url' => false,
);
*/
}
/*
* Include various statistic blocks in parts of your website
*
* type = a=artist, t=album, f=song
* page = zina_get_stats_pages();
* stats, rating, votes, views, plays, downloads, latest
* period = zina_get_stats_periods();
* all, year, month, week, day
* number = number of items
*
* $results = zina_get_block_stat($type, $page, $period, $number);
*
* Example:
* $results = zina_get_block_stat('t', 'latest', 'all', 10);
* echo "<h3>Latest Played Albums</h3>";
* echo ztheme('zina_block', $results, 't');
*/
?>