Файл: user/music/index.php
Строк: 94
<?php
define('H', $_SERVER['DOCUMENT_ROOT'].'/');
require H.'sys/inc/start.php'; $num = 0 ;
require H.'sys/inc/compress.php';
require H.'sys/inc/sess.php';
require H.'sys/inc/settings.php';
require H.'sys/inc/db_connect.php';
require H.'sys/inc/ipua.php';
require H.'sys/inc/fnc.php';
require H.'sys/inc/user.php';
/* Бан пользователя */
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `razdel` = 'files' AND `id_user` = '$user[id]' AND (`time` > '$time' OR `view` = '0' OR `navsegda` = '1')"), 0)!=0)
{
header('Location: /ban.php?');exit;
}
//---------------------------------------
$ank['id'] = (isset($_GET['id']) ? intval($_GET['id']) : $user['id']);
$ank = get_user($ank['id']); // Определяем id автора плейлиста
if(!$ank)
header('Location: /');
//---------------------------------------
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user_music` WHERE `id_user` = '$ank[id]' && `id_dir` = '0'"),0);
$k_post2=mysql_result(mysql_query("SELECT COUNT(*) FROM `user_music_album` WHERE `id_user` = '$ank[id]'"),0);
$set['title'] = "Аудиозаписи $ank[nick] | $k_post аудиозаписей";
require H.'sys/inc/thead.php';
title().aut();
require H.'user/music/includes.php';
echo "<div class='foot'><img src='/style/icons/str2.gif' alt='*'> <a href='/id$ank[id]'>$ank[nick]</a> | <b>Музыка</b></div>n";
if ($ank['id']==$user['id'])echo "<div class='main'><img src='/user/music/icons/add.png'> <a href='?id=$ank[id]&add'>Новый альбом</a></div>n";
//---------------------------
if (!$k_post2)
echo "<div class='mess'>Нет альбомов</div>n";
$k_page = k_page($k_post2,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
$q = mysql_query("SELECT * FROM `user_music_album` WHERE `id_user` = '$ank[id]' ORDER BY `id` DESC LIMIT $k_post2");
while ($post = mysql_fetch_assoc($q))
{
if ($ank['id']==$user['id'])
$set_at = " <span style='float: right;'>
<a href='/user/music/?id=$ank[id]&ed_alb=$post[id]'><img src='/user/music/icons/red_alb.png'></a>
<a href='/user/music/?id=$ank[id]&ida=$post[id]&del_alb'><img src='/user/music/icons/del_alb.png'></a>
</span>";
else $set_at = null;
echo "<div class='nav".($num++%2?'1':'2')."'><img src='/user/music/icons/dir.png'> <a href='/user/music/albom/?id=$post[id]'>".htmlspecialchars($post['name'])."</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `user_music` WHERE `id_user` = '$ank[id]' && `id_dir` = '$post[id]'"),0).") $set_at</div>";
}
//---------------------------
if (!$k_post)
echo "<div class='mess'>Нет треков в плейлисте</div>n";
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page); $track = 0;
$start = $set['p_str']*$page-$set['p_str'];
$q = mysql_query("SELECT * FROM `user_music` WHERE `id_user` = '$ank[id]' && `id_dir` = '0' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q))
{
$mp3 = mysql_fetch_assoc(mysql_query("SELECT * FROM `obmennik_files` WHERE `id` = '$post[id_file]' LIMIT 1"));
$dir = mysql_fetch_assoc(mysql_query("SELECT * FROM `obmennik_dir` WHERE `id` = '$mp3[id_dir]' LIMIT 1"));
$ras = $mp3['ras'];
if ($ank['id']==$user['id'])
$user_at = " <span style='float: right;'>
<a href='/user/music/?id=$ank[id]&edit=$post[id_file]'><img src='/user/music/icons/red.png'></a>
<a href='/user/music/?id=$ank[id]&aid=$post[id_file]&delete'><img src='/user/music/icons/del.png'></a></span>";
else $user_at = null;
?><div class='nav<?=($num++%2?'1':'2')?>'><?
if ($webbrowser=='web'){
?>
<div class="track">
<div class="button">
<div class="play" id="<?=$track?>" file="/obmen<?=$dir['dir']?>/<?=$mp3['id']?>.<?=$ras?>"></div>
<div class="pause"></div>
</div>
<div class="nameTrack"><a href="/obmen<?=$dir['dir'] . $mp3['id']?>.<?=$ras?>">
<img src="/style/icons/d.gif" alt="*"></a> <?=htmlspecialchars(mb_substr($mp3['name'],0,40,'utf-8'))?> (<?=size_file($mp3['size'])?>) <?=$user_at?></div>
<div class="clear"></div>
</div>
<?
}else{
?>
<a href="/obmen<?=$dir['dir'] . $mp3['id']?>.<?=$ras?>">
<img src="/style/icons/d.gif" alt="*"></a> <?=htmlspecialchars(mb_substr($mp3['name'],0,40,'utf-8'))?> (<?=size_file($mp3['size'])?>) <?=$user_at?>
<?
}
?></div><? $track++;
}
?></div><?
if ($k_page>1)str("?id=$ank[id]&",$k_page,$page); // Вывод страниц
echo "<div class='foot'><img src='/style/icons/str2.gif' alt='*'> <a href='/id$ank[id]'>$ank[nick]</a> | <b>Музыка</b></div>n";
require H.'sys/inc/tfoot.php';