-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·413 lines (321 loc) · 15.3 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
<?php
@session_start ();
@ob_start ();
@ob_implicit_flush ( 0 );
@error_reporting ( E_ALL ^ E_NOTICE );
@ini_set ( 'display_errors', true );
@ini_set ( 'html_errors', false );
@ini_set ( 'error_reporting', E_ALL ^ E_NOTICE );
define ( 'ROOT_DIR', dirname ( __FILE__ ) );
define ( 'INCLUDE_DIR', ROOT_DIR . '/includes' );
@include (INCLUDE_DIR . '/config.inc.php');
require_once INCLUDE_DIR . '/class/_class_mysql.php';
require_once INCLUDE_DIR . '/db.php';
require_once ROOT_DIR . '/modules/functions.php';
require_once INCLUDE_DIR . '/member.php';
if( $_REQUEST['oauth_token'] ){
header("Location: " . $config['siteurl'] . "create-account/twitter/?oauth_token=" . $_REQUEST['oauth_token'] . "&oauth_verifier=" . $_REQUEST['oauth_verifier'] );
}
if( $_REQUEST['action'] == 'logout' ){
$member_id = array ();
set_cookie( "user_id", "", 0 );
set_cookie( "login_pass", "", 0 );
$_SESSION['user_id'] = 0;
$_SESSION['login_pass'] = "";
@session_destroy();
@session_unset();
header("Location:" . $config['siteurl']);
die();
}
//Load genres
$genres = $db->query("SELECT name FROM `vass_genres` WHERE stick= 1 ORDER by id ASC LIMIT 0,20");
while($genre = $db->get_row($genres)){
$genre_list .= '"' . $genre['name'] . '",';
}
$genre_list = substr( $genre_list, 0, ( strLen( $genre_list ) - 1 ) );
if($logged){
$playlists_query = $db->query("SELECT id, name FROM `vass_playlists` WHERE user_id = '" . $member_id ['user_id'] . "' ORDER by id DESC");
while($row = $db->get_row($playlists_query)){
$playlists .= "<li class=\"playlist_click\" data-playlist-id=\"{$row['id']}\"><span>{$row['name']}</span></li>";
$playlists_queue .= "<span class=\"queue_to_playlist_dropdown_link\" data-playlist-id=\"{$row['id']}\">{$row['name']}</span>";
$playlistleft .="<li><a class=\"left_row_custom left_row_text left_row_text2 nnnn\" href=\"/playlist/{$row['id']}\"><i class=\"icon-list-1\"></i>{$row['name']}</a></li>";
}
}
if(!$_COOKIE['lang']) $_COOKIE['lang'] = "ru";
$ajax = <<<HTML
<script language="javascript" type="text/javascript">
var player_root = '{$config['siteurl']}';
var genre_list = [{$genre_list}];
var mail_contact = '{$config['email']}';
var default_lang = '{$_COOKIE['lang']}';
</script>
HTML;
$metatags = <<<HTML
<title>{$config['sitetitle']}</title>
<meta name="title" content="{$config['sitetitle']}" />
<meta property="og:title" name="title" content="{$config['sitetitle']}" />
<meta property="og:url" content="{$config['sitetitle']}" />
<meta property="og:image" content="{$config['facebook_icon']}" />
<meta property="og:site_name" content="{$config['sitetitle']}" />
<meta property="og:locale" content="en_US" />
<meta property="fb:app_id" content="{$config['facebook_app_id']}" />
<meta property="og:type" content="musician" />
<meta name="description" property="og:description" content="{$config['webdesc']}" />
<meta name="keywords" content="{$config['keywords']}" />
HTML;
$thistime = time();
$analytics = str_replace( "$", "$", $config['analytics'] );
$analytics = str_replace( "{", "{", $analytics );
$analytics = str_replace( "}", "}", $analytics );
$username1 = $_SESSION['user_id'];
$mydataq = $db->query("SELECT username FROM `vass_users` WHERE user_id = '$username1'");
while ($mydata1 = $db->get_row($mydataq)) {
$mydatar .= '' . $mydata1['username'] .'';
}
$mydatar = substr($mydatar, 0, ( strLen( $mydatar ) ) );
$mydataq1 = $db->query("SELECT email FROM `vass_users` WHERE user_id = '$username1'");
while ($mydata2 = $db->get_row($mydataq1)) {
$mydatar1 .= '' . $mydata2['email'] .'';
}
$mydatar1 = substr($mydatar1, 0, ( strLen( $mydatar1 ) ) );
echo <<<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
{$metatags}
<link rel="stylesheet" href="/assets/css/app.css?{$thistime}" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="/assets/css/style.css?{$thistime}" />
<link rel="stylesheet" type="text/css" href="/assets/css/fontello/css/ks.css?{$thistime}" />
<link rel="stylesheet" type="text/css" href="/assets/css/bootstrap-tour-standalone.min.css" />
<!--[if IE 8]><link rel="stylesheet" type="text/css" media="screen" href="/assets/css/lala-app-ie8.css" /><![endif]-->
<link rel="shortcut icon" href="{$config['site_icon']}" />
{$ajax}
<script type="text/javascript">
var FRAGMENT = 'None';var _gaq = _gaq || [];
</script>
<script type="text/javascript">
<![CDATA[
var mobile = (/iphone|ipod|android|blackberry|mini|windows (ce|phone)|palm/i.test(navigator.userAgent.toLowerCase()));
if (mobile) {
document.location = {$config['siteurl']};
} ]]>
</script>
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<svg height="0" xmlns="http://www.w3.org/2000/svg">
<filter id="svgBlur" x="-5%" y="-5%" width="110%" height="110%">
<feGaussianBlur in="SourceGraphic" stdDeviation="15" />
</filter>
</svg>
<div id="altContent">
<h1>Nota is the best way to listening and sharing the music.</h1>
<h2>Collection million songs.</h2>
<noscript>
<ul class="links">
<li><a href="{$config['siteurl']}trending">Trending</a></li>
<li><a href="{$config['siteurl']}explore">Explore</a></li>
</ul>
</noscript>
<ul class="links">
<li><a href="{$config['siteurl']}trending">Trending</a></li>
<li><a href="{$config['siteurl']}explore">Explore</a></li>
</ul>
</div>
<div id="top"> <a id="logo" href="/"><span class="left_row_icon"></span>Nota</a>
<div id="top_right"></div>
<div id="top_search">
<form id="top_search_form" data-translate-text="search_placeholder">
<input type="text" id="top_search_input" placeholder="Поиск" />
</form>
</div>
</div>
<div id="middle">
<div id="left">
<div id="user_nav">
<nav>
<ul id="navigation_left">
<li><a class="left_row_custom left_row_text left_row_text2 nnnn" href="/trending" data-translate-text="left_trending"> Популярное</a></li>
<li><a class="left_row_custom left_row_text left_row_text2 nnnn" href="/newrelease" data-translate-text="left_newreleases"> Новое</a></li>
<li><a class="left_row_custom left_row_text left_row_text2 nnnn" href="/explore/top-of-the-week" data-translate-text="left_explore"> Сборники</a></li>
<li><a class="left_row_custom left_row_text left_row_text2 nnnn" href="/artists" data-translate-text="left_artists"> Исполнители</a></li>
<li><a class="left_row_custom left_row_text left_row_text2 nnnn" href="/radio" data-translate-text="left_radio">Радио</a></li>
<li><a class="left_row_custom left_row_text left_row_text2 nnnn" href="/settings/social" data-translate-text="left_findfriends"> Поиск Друзей</a></li>
</ul>
</nav>
<div class="left_row_text spp"></div>
<div class="left_row_text left_row_discover left_row_discover_playlist collectsnow" data-translate-text="left_playlists">Сборники</div>
<ul id="navigation_left_playlist">
<li class="left_row_custom left_row_text left_row_text2 nnnn"><a id="create_playlist_click" data-translate-text="left_createnew"><i class="icon-list-add"></i> Создать Сборник</a></li>
<li class="left_row_custom left_row_text left_row_text2 nnnn"><a id="playlist_click" href="/playlist" > Сборник</a></li>
</ul>
</div>
</div>
<div id="right">
<div id="home_section" class="display_none"></div>
<div id="song_list" class="display_none"></div>
<div id="sites_list" class="display_none">sites</div>
<div id="settings" class="display_none"></div>
</div>
<!-- end right -->
<div id="current_playlist">
<div id="current_playlist_header">
<div id="current_playlist_clear">Очистить очередь</div>
<div id="current_playlist_save">Сохранить как плейлист ...</div>
<div id="history_songs">История</div>
<div id="to_queue">В очередь</div>
<div id="current_playlist_close"></div>
<div id="queue_to_playlist_dropdown" class="display_none">
<li class="queue_to_new_playlist_dropdown_link" data-playlist-id="NEW"><span>Создать плейлист</span></li>
{$playlists_queue}
</div>
</div>
<ul id="current_playlist_rows" class="display"></ul>
<ul id="current_playlist_history" class="display_none">
</ul>
</div>
<div id="resort_playlist">
<div id="resort_playlist_header">
<div id="resort_playlist_close"></div>
</div>
<ul id="resort_playlist_rows">
</ul>
</div>
<div id="right_cover" class="display_none">
<!-- <div id="right_cover_loading">Loading...</div> -->
</div>
</div>
<!-- end middle -->
<!--<div id="blurredplayer">
<div id="blurredplayer_color">
<div id="blurredplayer_effect">
</div>
</div>
</div>
-->
<div id="bottom">
<div id="bottom_controls">
<div id="prev_button" class="controls_button"></div>
<div id="play_button" class="play_button controls_button"></div>
<div id="next_button" class="controls_button"></div>
</div>
<div id="volume">
<div id="volume_speaker" class="volume_on"></div>
<div id="volume_back">
<div id="volume_thumb"></div>
</div>
</div>
<div id="display">
<div id="display_coverart" class="hide_when_stopped display_none"> <img src="/assets/images/glare_45x45.png" width="40" height="40" class="display_coverart_glare" /></div>
<div id="display_logo" class="hide_when_playing"></div>
<div id="display_text" class="hide_when_stopped display_none"> <a id="display_song"></a> <a id="display_artist"></a>
<div id="display_album"></div>
<a id="display_domain" target="_blank" outbound_type="bottom_player_source"></a> </div>
<div id="display_time" class="hide_when_stopped display_none">
<div id="display_time_count"></div>
<div id="display_progress"></div>
<div id="display_progressed"></div>
<div id="display_seek_thumb"></div>
<div id="display_time_total"></div>
</div>
<a class="Download_songs hide_when_stopped display_none tooltip" tooltip="Загрузить"><i class="icon icon-download"></i></a>
<div id="current_song_lyrics_icon" class="hide_when_stopped display_none tooltip" tooltip="Посмотрите текст песни"></div>
<div id="current_song_love_icon" class="hide_when_stopped display_none tooltip" tooltip="Мне нравится"></div>
<div id="current_song_share_icon" class="hide_when_stopped display_none tooltip" tooltip="Поделиться этой песней"></div>
</div>
<div id="playlist_button" tooltip="Открыть или закрыть очередь" class="tooltip"></div>
<div id="shuffle_button" tooltip="Перемешать" class="tooltip"></div>
<div class="mainblurr collectsnow">
<div class="currentartpic"></div>
</div>
<svg height="0" xmlns="http://www.w3.org/2000/svg">
<filter id="svgBlur" x="-5%" y="-5%" width="110%" height="110%">
<feGaussianBlur in="SourceGraphic" stdDeviation="35" />
</filter>
</svg>
</div>
<div id="tooltip_display"></div>
<div id="top_right_dropdown" class="display_none">
<a href="/settings" class="top_right_dropdown_link">Настройки</a>
<a href="/sign-out" class="top_right_dropdown_link" id="sign_out_link">Выйти</a>
</div>
<div id="full_cover" class="display_none"></div>
<div id="tutorial_container" class="display_none"></div>
<script>loggedInUser = null;userBackground = {};</script>
<script type="text/javascript" src="/assets/js/core.js?{$thistime}"></script>
<script type="text/javascript" src="/assets/js/templates.js?{$thistime}"></script>
<script type="text/javascript" src="/assets/js/app.js?{$thistime}"></script>
<script type="text/javascript" src="/assets/js/bootstrap-tour-standalone.min.js"></script>
<!--<script type="text/javascript" src="/assets/js/snowfall.jquery.js"></script>-->
<script type="text/javascript" src="/assets/js/style.js?{$thistime}"></script>
<div style="margin-left: -250px; width: 500px;" class="modal_box display_none" id="lyrics_box">
<div id="lyrics_box_close_button" class="modal_close_button"></div>
<div class="modal_top" id="lyrics_box_title"></div>
<div style="padding: 10px; text-align: center; font-size: inherit; font-family: DINRegular;" id="lyrics_box_content" class="modal_middle">
</div>
</div>
<div id="dropdown-1" class="dropdown dropdown-tip">
<ul class="dropdown-menu" id="all_playlist_menu">
<li id="create_playlist_click"><span>Создать плейлист</span></li>
<li id="add_to_queue_click"><span>Добавить в очередь</span></li>
<li class="dropdown-divider"></li>
{$playlists}
</ul>
</div>
</body>
</html>
HTML;
// die();
?>
<script type="text/javascript">
// console.log()
// $('#current_download_songs').click(function(e) {
// e.preventDefault(); //stop the browser from following
// window.location.href = '/static/songs/100.mp3';
// });
</script>
<?php
//
//ignore_user_abort(true);
//set_time_limit(0); // disable the time limit for this script
//
//$path = ""; // change the path to fit your websites document structure
//$dl_file = preg_replace("([^\w\s\d\-_~,;:\[\]\(\].]|[\.]{2,})", '', $_GET['download_file']); // simple file name validation
//$dl_file = filter_var($dl_file, FILTER_SANITIZE_URL); // Remove (more) invalid characters
//$fullPath = $path.$dl_file;
//
//if ($fd = fopen ($fullPath, "r")) {
// $fsize = filesize($fullPath);
// $path_parts = pathinfo($fullPath);
// $ext = strtolower($path_parts["extension"]);
// switch ($ext) {
// case "pdf":
// header("Content-type: application/pdf");
// header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\""); // use 'attachment' to force a file download
// break;
// // add more headers for other content types here
// default;
// header("Content-type: application/octet-stream");
// header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
// break;
// }
// header("Content-length: $fsize");
// header("Cache-control: private"); //use this to open files directly
// while(!feof($fd)) {
// $buffer = fread($fd, 2048);
// echo $buffer;
// }
//}
//fclose ($fd);
//exit;
//
//?>