View file xmyx.ru/club/act/audios.php

File size: 7.03Kb
<?

/*
 * Author - Tw1nGo
 * VK - https://vk.com/tw1ngo93
*/

if (isset($_GET['id'])){
    $group = mysql_fetch_assoc(mysql_query("SELECT * FROM `groups` WHERE `id` = '".abs(intval($_GET['id']))."' LIMIT 1"));
}
if (!isset($_GET['id']) || !isset($group) || $group['id'] <= 0){
    header("Location: /groups");
    exit;
}

if (isset($_GET['r']) && $_GET['r'] == 'sav'){
if (isset($_GET['mus'])){
    $file = mysql_fetch_assoc(mysql_query("SELECT `id`,`name`,`ras` FROM `groups_files` WHERE `id` = '".abs(intval($_GET['mus']))."' LIMIT 1"));

if (!isset($_GET['mus']) || !isset($file) || $file['id'] <= 0 || !is_file(H.'files/groups/files/others/'.$file['id'].'.mp3'))
{
    header("Location: /");
    exit;
} 
else {
    include_once H.'sys/inc/downloadfile.php';
    $file_link = H.'files/groups/files/others/'.$file['id'].'.mp3';
    $file_name = stripcslashes(htmlspecialchars($file['name'])).'_xmyx.ru.'.stripcslashes(htmlspecialchars($file['ras']));
    $file_ras = stripcslashes(htmlspecialchars($file['ras']));
    DownloadFile($file_link, $file_name, ras_to_mime($file_ras));
    exit;
}
}
}

$set['title'] = 'Музыка '.text($group['title']);
include_once H.'sys/inc/thead.php';

?>
<link rel="stylesheet" href="/files/groups/player/style.css" type="text/css" />
<?

// Конфигурационный файл
require 'config.php';

shapka_VK(true, '/group'.$group['id'].'', ''.text($group['title']).'');


$config = array(
	'q' => array(
		'type' => array(
			'Не найдено ни одной Аудиозаписи.',
			'Не найдено ни одной Аудиозаписи.'
			),
		'text' => (isset($_GET['q']) ? implode(' ', explode('+', text($_GET['q']))) : false)
	),
);
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
	if(!empty($_POST['q']) && !preg_match("#(^\ )#ui", $_POST['q']) && !preg_match("#(^\')#ui", $_POST['q']))
	{
		$_POST['q'] = implode('+', explode(' ', my_esc($_POST['q'])));
		header('Location: ?act=audios&q='.$_POST['q'].'');
	}
	else
		header('Location: ?act=audios');
}

$sql = '';
if($config['q']['text'])
	$sql = " AND `name` like '%".$config['q']['text']."%'";


?>
<div class="pcont audioPage">

<div class="audioPage__header">
<div class="audioPage__search"><div class="hp_block">
<form action="/group<?= $group['id']?>?act=audios" method="POST" class="qsearch">
  <table class="row_table"><tbody><tr>
    <td class="row_table_main_column">
      <div class="qs_field_wrap">     
        <div class="iwrap">
        <input class="textfield qs_textfield" name="q" value="<?= $config['q']['text'] ?>" autocomplete="off" id="au_search_field" placeholder="Поиск" type="text"></div>
      </div>
    </td>
    <td class="row_table_last_column">
    <input class="button qs_button al_tab" value="Искать" id="au_search_btn" type="submit">
    </td>
  </tr></tbody></table>
</form>
</div>
</div></div>

<div class="upanel">
<div class="bl_cont" id="au_search_items">
<div class="audios_block audios_list _si_container">
<?

$set['p_str'] =  '20';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `groups_files` WHERE `id_group` = '".$group['id']."'$sql AND `type` = '3'"), 0);
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];



if ($k_post == 0){
?>
<div class="service_msg_box">
  <div class="service_msg service_msg_null">Нет ни одной аудиозаписи.</div>
</div>
<?
}
else{
$count_audios = array('аудиозапись', 'аудиозаписи', 'аудиозаписей');
?>
<div class="audioPage__count"><?= des2num($k_post, $count_audios)?></div>
  		<div id="resizePanel" style="display: block; padding: 0px; margin: 0px"></div>
  		<div id="isJavaScript" style="display: none" data-audio="false"></div>


<?
$q = mysql_query("SELECT * FROM `groups_files` WHERE `id_group` = '".$group['id']."'$sql AND `type` = '3' ORDER BY `time` DESC LIMIT $start, $set[p_str]");
static $i = 0;
while ($post_f = mysql_fetch_array($q)){
$i++;
	if($config['q']['text'] !== false) {
		$post_title = preg_replace('/' . $config['q']['text'] . '/i', '<em class="found">$0</em>', output_text($post_f['name']));
	}
	else
	$post_title = output_text($post_f['name']);


?>
<div class="pi_medias audios_list medias_audios_list">
    <div id="audio<?= $post_f['id_user'] ?>_<?= $post_f['id'] ?>_wall<?= $user['id'] ?>" data-id="<?= $post_f['id_user'] ?>_<?= $post_f['id'] ?>_wall<?= $user['id'] ?>" class="audio_item  ai_has_btn" onclick="audioplayer.playPause(event, '<?= $post_f['id_user'] ?>_<?= $post_f['id'] ?>_wall<?= $user['id'] ?>')">
        <div class="ai_info">
            <div class="ai_play" style=""><i class="i_play"></i></div>
            <div class="ai_download">
                <a href="?r=sav&mus=<?= $post_f['id']?>"><i class="i_download"></i></a>
            </div>
            <div class="ai_body">
                <div class="ai_dur" onclick="audioplayer.switchTimeFormat(this, event);"></div>
                <div class="ai_label">
                    <span class="ai_title"><?= $post_title?></span>
                    <span class="divider" style="display: none"></span>
                    <span class="ai_artist" style="display: none"></span>
                </div>
                <input type="hidden" value="<?echo '/files/groups/files/others/'.$post_f['id'].'.'.stripcslashes(htmlspecialchars($post_f['ras']));?>">
            </div>
        </div>
        <div class="ai_controls">
            <table class="row_table">
                <tbody><tr>
                    <td class="aic_progress_wrap">
                        <div class="aic_line" onmousedown="audioplayer.setPosition(this, event);" onclick="cancelEvent(event);">
                            <div class="aic_ln aic_back_line" onclick="cancelEvent(event);"></div>
                            <div class="aic_ln aic_load_line" onclick="cancelEvent(event);"></div>
                            <div class="aic_ln aic_pl_wrap" onclick="cancelEvent(event);">
                                <div class="aic_ln aic_progress_line" onclick="cancelEvent(event);">
                                    <div class="aic_slider" onclick="cancelEvent(event);"></div>
                                </div>
                            </div>
                        </div>
                    </td>
                    <td class="aic_volume_wrap">
                        <div class="aic_line" onmousedown="audioplayer.setVolume(this, event);" onclick="cancelEvent(event);">
                            <div class="aic_ln aic_back_line" onclick="cancelEvent(event);"></div>
                            <div class="aic_ln aic_pl_wrap" onclick="cancelEvent(event);">
                                <div class="aic_ln aic_progress_line" onclick="cancelEvent(event);">
                                    <div class="aic_slider" onclick="cancelEvent(event);"></div>
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
                </tbody></table>
        </div>
    </div>
</div>
<?

}

}
?>
</div></div></div>
<?
if ($k_post && $k_page > 1)
	str_vk("?act=audios&",$k_page,$page);
?>
</div>