Файл: modules/zc/index.php
Строк: 845
<?php
include '../../system/core.php';
include '../../system/header.php';
if(!$user['id'])
{
header('Location: /index.php/?m=guest'); exit;
}
switch($_GET['m'])
{
case 'new':
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Новые файлы </span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
////////////////////////////////////////////////////// include '../../system/nvg.php';
$cop = 10;
$ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `zc_f` where `time` > '".(time()-((60*60)*24))."'"),0);
$cp = ceil($ca/$cop);
if(isset($_GET['p']) && is_numeric($_GET['p'])){
$p = $_GET['p'];
if($_GET['p']>$cp) $p = $cp;
if($_GET['p']<1)$p = 1;
}else{
$p = 1;
}
$start = $p*$cop-$cop;
$new = mysql_query("select * from `zc_f` where `time` > '".(time()-((60*60)*24))."' and `status`='0' order by `time` desc limit $start,$cop");
while($new2 = mysql_fetch_assoc($new)){
echo '<div class="post2"><img src="/images/box.png"/> <a href="/zc/f'.$new2['id'].'">'.$new2['name'].'</a>';
echo '</div>';
}
echo '</div><div class="spis">Стр. ';
if($p-2>0) echo '<a href="/zc/new?p=1"><<</a> ';
if($p-1>0) echo '<a href="/zc/new?p='.($p-1).'"><</a> ';
if($p-3>0) echo '<a href="/pc/new?p='.($p-3).'">'.($p-3).'</a> | ';
if($p-2>0) echo '<a href="/zc/new?p='.($p-2).'">'.($p-2).'</a> | ';
if($p-1>0) echo '<a href="/zc/new?p='.($p-1).'">'.($p-1).'</a> | ';
echo '<b>'.$p.'</b>';
if($p+1<=$cp) echo ' | <a href="/zc/new?p='.($p+1).'">'.($p+1).'</a>';
if($p+2<=$cp) echo ' | <a href="/zc/new?p='.($p+2).'">'.($p+2).'</a>';
if($p+3<=$cp) echo ' | <a href="/zc/new?p='.($p+3).'">'.($p+3).'</a>';
if($p+1<=$cp) echo ' <a href="/zc/new?p='.($p+1).'">></a>';
if($p+2<=$cp) echo ' <a href="/zc/new?p='.ceil($ca/$cop).'">>></a>';
echo '</div>';
break;
default:
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Загруз-центр</span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
include '../../system/nvg.php';
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `moder` = '.$user['id'].''));
if($zc_r != 0){
echo '<div class="msg"><a href="/zc/moder"><b>Панель управления</b></a></div>';
}
if($user['status'] == 4){
echo '<div class="msg"><a href="/zc/nr"><b>Новый раздел</b></a></div>';
}
echo '<div class="post2"><img src="/images/newcod.png"/> <a href="/zc/new">Новые файлы</a> ('.mysql_result(mysql_query('select count(`id`) from `zc_f` where `time` > "'.(time()-((60*60)*24)).'" and `status` = "0"'),0).')<br></div>';
echo '<div class="post2"><img src="/modules/forum/images/cod.png" alt="*"> <a href="/us'.$user['id'].'?m=files"> Мои файлы </a></div>';
echo '<div class="tegi"><b>Категории:</b></div>';
$cop = $user['on_page'];
$ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `zc_r`"),0);
$cp = ceil($ca/$cop);
if(isset($_GET['p']) && is_numeric($_GET['p'])){
$p = $_GET['p'];
if($_GET['p']>$cp) $p = $cp;
if($_GET['p']<1)$p = 1;
}else{
$p = 1;
}
$start = $p*$cop-$cop;
$zc_r = mysql_query("SELECT * FROM `zc_r` ORDER BY `id` LIMIT $start,$cop");
while($zc_r2 = mysql_fetch_assoc($zc_r)){
echo '<div class="post2"><img src="/images/forloads.png"/> <a href="/zc/r'.$zc_r2['id'].'">'.$zc_r2['name'].'</a> ('.mysql_result(mysql_query('select count(`id`) from `zc_f` where `r` = "'.$zc_r2['id'].'" and `status` = "0"'),0).')<font color="red"><b>+'.mysql_result(mysql_query('select count(`id`) from `zc_f` where `r` = "'.$zc_r2['id'].'" and `status` = "0" and `time` > "'.(time()-((60*60)*24)).'"'),0).'</b></font>';
if($user['status'] == 4) echo ' [<a href="/zc/prdel'.$zc_pr2['id'].'">уд</a>] [<a href="/zc/red'.$zc_r2['id'].'">ред</a>]';
echo '</br><small>Раздел модерирует: '.ustatus($zc_r2['moder']).' <a href="/us'.$zc_r2['moder'].'">'.uname($zc_r2['moder']).'</a> '.uaccess($zc_r2['moder']).'
</small></div>';
}
//////////////////////////////////////////////////////////
if(mysql_result(mysql_query('select count(`id`) from `zc_f` where `time` > "'.(time()-((60*60)*24)).'" and `status` = "0"'),0) != 0) $files_new = '/<font color="red"><b>+'.mysql_result(mysql_query('select count(`id`) from `zc_f` where `time` > "'.(time()-((60*60)*24)).'" and `status` = "0"'),0).'</b></font>';
echo '<div class="tegi"><b>Последние файлы</b></a></div>';
if(mysql_result(mysql_query('select count(`id`) from `zc_f`'),0) != 0)
{
$zc = mysql_query('select * from `zc_f` where `status` = "0" order by `time` desc limit 3');
while($zc2 = mysql_fetch_array($zc))
{
echo '<div class="post2"><img src="/images/box.png"/> <a href="/zc/f'.$zc2['id'].'">'.$zc2['name'].'</a> ('.round(filesize('files/'.$zc2['file'].'')/1024).' кб)</div>';
}
}
else
{
echo '<div class="err">Еще нет.</div>';
}
/////////////////////////////////////////////////////////
echo '</div><div class="spis">Стр. ';
if($p-2>0) echo '<a href="/zc/p1"><<</a> ';
if($p-1>0) echo '<a href="/zc/p'.($p-1).'"><</a> ';
if($p-3>0) echo '<a href="/zc/p'.($p-3).'">'.($p-3).'</a> | ';
if($p-2>0) echo '<a href="/zc/p'.($p-2).'">'.($p-2).'</a> | ';
if($p-1>0) echo '<a href="/zc/p'.($p-1).'">'.($p-1).'</a> | ';
echo '<b>'.$p.'</b>';
if($p+1<=$cp) echo ' | <a href="/zc/p'.($p+1).'">'.($p+1).'</a>';
if($p+2<=$cp) echo ' | <a href="/zc/p'.($p+2).'">'.($p+2).'</a>';
if($p+3<=$cp) echo ' | <a href="/zc/p'.($p+3).'">'.($p+3).'</a>';
if($p+1<=$cp) echo ' <a href="/zc/p'.($p+1).'">></a>';
if($p+2<=$cp) echo ' <a href="/zc/p'.ceil($ca/$cop).'">>></a>';
echo '</div>';
break;
case 'r':
$id = TextGuard($id);
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$id.''));
if(empty($id) or !is_numeric($id) or $zc_r == 0){
header('Location: /zc'); exit;
}
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Загруз-центр</span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
include '../../system/nvg.php';
if($user['status'] == 4){
echo '<div class="msg"><a href="/zc/npr'.$id.'">Новый подраздел</a></div>';
}
$cop = $user['on_page'];
$ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `zc_pr` where `r` = '".$id."'"),0);
$cp = ceil($ca/$cop);
if(isset($_GET['p']) && is_numeric($_GET['p'])){
$p = $_GET['p'];
if($_GET['p']>$cp) $p = $cp;
if($_GET['p']<1)$p = 1;
}else{
$p = 1;
}
$start = $p*$cop-$cop;
$zc_pr = mysql_query("SELECT * FROM `zc_pr` where `r` = '".$id."' ORDER BY `id` DESC LIMIT $start,$cop");
while($zc_pr2 = mysql_fetch_assoc($zc_pr)){
echo '<div class="post2"><img src="/modules/zc/images/unknown.png"/> <a href="/zc/pr'.$zc_pr2['id'].'">'.$zc_pr2['name'].'</a> ('.mysql_result(mysql_query('select count(`id`) from `zc_f` where `pr` = "'.$zc_pr2['id'].'" and `status` = "0"'),0).')';
if($user['status'] == 4) echo ' [<a href="/zc/pred'.$zc_pr2['id'].'">ред</a>]';
echo '</div>';
}
echo '</div><div class="spis">Стр. ';
if($p-2>0) echo '<a href="/zc/r'.$id.'?p=1"><<</a> ';
if($p-1>0) echo '<a href="/zc/r'.$id.'?p='.($p-1).'"><</a> ';
if($p-3>0) echo '<a href="/zc/r'.$id.'?p='.($p-3).'">'.($p-3).'</a> | ';
if($p-2>0) echo '<a href="/zc/r'.$id.'?p='.($p-2).'">'.($p-2).'</a> | ';
if($p-1>0) echo '<a href="/zc/r'.$id.'?p='.($p-1).'">'.($p-1).'</a> | ';
echo '<b>'.$p.'</b>';
if($p+1<=$cp) echo ' | <a href="/zc/r'.$id.'?p='.($p+1).'">'.($p+1).'</a>';
if($p+2<=$cp) echo ' | <a href="/zc/r'.$id.'?p='.($p+2).'">'.($p+2).'</a>';
if($p+3<=$cp) echo ' | <a href="/zc/r'.$id.'?p='.($p+3).'">'.($p+3).'</a>';
if($p+1<=$cp) echo ' <a href="/zc/r'.$id.'?p='.($p+1).'">></a>';
if($p+2<=$cp) echo ' <a href="/zc/r'.$id.'?p='.ceil($ca/$cop).'">>></a>';
echo '</div>';
break;
case 'pr':
$id = TextGuard($id);
$zc_pr = mysql_fetch_array(mysql_query('select * from `zc_pr` where `id` = '.$id.''));
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$zc_pr['r'].''));
if(empty($id) or !is_numeric($id) or $zc_pr == 0 or $zc_r == 0){
header('Location: /zc'); exit;
}
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Загруз-центр</span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
include '../../system/nvg.php';
echo '<div class="msg"><img src="/images/uploaders.png" alt="*"> <a href="/zc/up'.$id.'"><b>Загрузить файл</b></a>
</div>';
$cop = $user['on_page'];
$ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `zc_f` where `pr` = '".$id."' and `status` = '0'"),0);
$cp = ceil($ca/$cop);
if(isset($_GET['p']) && is_numeric($_GET['p'])){
$p = $_GET['p'];
if($_GET['p']>$cp) $p = $cp;
if($_GET['p']<1)$p = 1;
}else{
$p = 1;
}
$start = $p*$cop-$cop;
$zc_f = mysql_query("SELECT * FROM `zc_f` where `pr` = '".$id."' and `status` = '0' ORDER BY `id` DESC LIMIT $start,$cop");
while($zc_f2 = mysql_fetch_assoc($zc_f)){
echo '<div class="post2"><img src="/modules/zc/images/archive.png"/> <a href="/zc/f'.$zc_f2['id'].'">'.$zc_f2['name'].'</a> ('.round(filesize('files/'.$zc_f2['file'].'')/1024).' кб)</div>';
}
echo '</div><div class="spis">Стр. ';
if($p-2>0) echo '<a href="/zc/pr'.$id.'?p=1"><<</a> ';
if($p-1>0) echo '<a href="/zc/pr'.$id.'?p='.($p-1).'"><</a> ';
if($p-3>0) echo '<a href="/zc/pr'.$id.'?p='.($p-3).'">'.($p-3).'</a> | ';
if($p-2>0) echo '<a href="/zc/pr'.$id.'?p='.($p-2).'">'.($p-2).'</a> | ';
if($p-1>0) echo '<a href="/zc/pr'.$id.'?p='.($p-1).'">'.($p-1).'</a> | ';
echo '<b>'.$p.'</b>';
if($p+1<=$cp) echo ' | <a href="/zc/pr'.$id.'?p='.($p+1).'">'.($p+1).'</a>';
if($p+2<=$cp) echo ' | <a href="/zc/pr'.$id.'?p='.($p+2).'">'.($p+2).'</a>';
if($p+3<=$cp) echo ' | <a href="/zc/pr'.$id.'?p='.($p+3).'">'.($p+3).'</a>';
if($p+1<=$cp) echo ' <a href="/zc/pr'.$id.'?p='.($p+1).'">></a>';
if($p+2<=$cp) echo ' <a href="/zc/pr'.$id.'?p='.ceil($ca/$cop).'">>></a>';
echo '</div>';
break;
case 'up':
$id = TextGuard($id);
$zc_pr = mysql_fetch_array(mysql_query('select * from `zc_pr` where `id` = '.$id.''));
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$zc_pr['r'].''));
if(empty($id) or !is_numeric($id) or $zc_pr == 0 or $zc_r == 0){
header('Location: /zc'); exit;
}
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Загруз-центр</span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
include '../../system/nvg.php';
if(isset($_POST['submit'])){
$name = TextGuard($_POST['name']);
if(empty($name)) $err[] = 'Название осталось пустым...';
$about = TextGuard($_POST['about']);
if(empty($about)) $err[] = 'Описание осталось пустым...';
$rating = TextGuard($_POST['rating']);
if(empty($rating)) $rating = 0;
if($rating > $user['rating']) $err[] = 'Вы не можете поставить рейтинг для скачивание больше чем ваш.';
if(!is_numeric($rating)) $err[] = 'Ошибка ввода рейтинга...';
if(!@file_exists($_FILES['filename']['tmp_name'])) $err[] = 'Вы не выбрали файл...';
if($_FILES['filename']['size'] != 0 and $_FILES['filename']['size'] > 1002400000) $err[] = 'Слишком большой файл...';
$filetype = array ( 'jpg', 'gif', 'png', 'jpeg', 'bmp', 'zip', 'rar', '7z', 'txt', 'mp3', 'avi', 'mp4', '3gp' );
$upfiletype = substr($_FILES['filename']['name'], strrpos( $_FILES['filename']['name'], "." )+1);
if(!in_array($upfiletype,$filetype)) $err[] = 'Вы пытаетесь загрузить недопустимый формат файла...';
if(!$err){
$fn = date('dmY').'_fn'.rand(1234,5678).'_'.$_FILES['filename']['name'];
move_uploaded_file($_FILES['filename']['tmp_name'], "files/".$fn."");
mysql_query("INSERT INTO `zc_f`(
`r`,
`pr`,
`name`,
`about`,
`author`,
`rating`,
`downs`,
`ldown`,
`time`,
`status`,
`file`
)VALUES(
'".$zc_r['id']."',
'".$zc_pr['id']."',
'".$name."',
'".$about."',
'".$user['id']."',
'".$rating."',
'0',
'".time()."',
'".time()."',
'1',
'".$fn."'
)");
$fid = mysql_insert_id();
mysql_query("INSERT INTO `op`(
`who`,
`ho`,
`text`,
`time`,
`read`,
`sort`
)VALUES(
'".$zc_r['moder']."',
'".$user['id']."',
'загрузил файл в [url=/zc/moder]Загруз-Центр[/url]!',
'".time()."',
'0',
'3'
)");
echo '<div class="msg"><b>Файл успешно выставлен на модерацию.</b></div>';
}else{
echo '<div class="err"><b>';
foreach($err as $err_info){
echo $err_info.'<br>';
}
echo '</b></div>';
}
}
echo '<div class="post2">
<form action="/zc/up'.$id.'" method="post" enctype="multipart/form-data">
Название:<br><input name="name"/><br>
Описание:<br><textarea name="about" style="width:98%;" rows="3"></textarea><br>
Рейтинг для скачивания файла: <input name="rating" size="2"/><br>
Файл:<br><input type="file" name="filename"/><br>
<input type="submit" value="Загрузить" name="submit"/>
</form></div></div>';
break;
case 'f':
$id = TextGuard($id);
$zc_f = mysql_fetch_array(mysql_query('select * from `zc_f` where `id` = '.$id.' and `status` = "0"'));
$zc_pr = mysql_fetch_array(mysql_query('select * from `zc_pr` where `id` = '.$zc_f['pr'].''));
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$zc_f['r'].''));
if(empty($id) or !is_numeric($id) or $zc_pr == 0 or $zc_r == 0 or $zc_f == 0){
header('Location: /zc'); exit;
}
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Загруз-центр</span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
include '../../system/nvg.php';
if($zc_r['moder'] == $user['id']){
if(isset($_GET['del'])){
unlink('files/'.$zc_f['file'].'');
mysql_query("DELETE FROM `zc_f` WHERE `id`='".$id."'");
header('Location: /zc/pr'.$zc_pr['id'].''); exit;
}
if(isset($_GET['red'])){
if(isset($_GET['ok'])){
$name = TextGuard($_POST['name']);
$about = TextGuard($_POST['about']);
mysql_query("UPDATE `zc_f` SET `name` = '".$name."', `about` = '".$about."' WHERE `id`='".$id."'");
header('Location: /zc/'); exit;
}
echo '<div class=""><form action="" method="POST">
*Название файла:<br /><input type="text" name="name" /><br />
*Описание файла:<br /><input type="text" name="about" /><br />
<input type="submit" name="ok" value="Изменить" /></form>
</div>';
}
echo '<div class="msg"><b><center><small><a href="/zc/f'.$id.'?del">Удалить</a> | <a href="/zc/f'.$id.'?red">Изменить</a></small></b></center></div>';
}
echo '<div class="post2"><font color="red"><b>'.$zc_f['name'].'</b></font><br>';
echo 'Описание: '.smiles(bbcode($zc_f['about'])).'</div>';
//////////////////////////
if(!$zc_f['scrin']){
}else{
echo '<div class="post2"><b>Скриншот:</b></br><a href="/modules/zc/scrin/'.$zc_f['scrin'].'">
<img src="/modules/zc/scrin/'.$zc_f['scrin'].'" alt="*" width="80" height="80"/></a></div>';
}
///////////////////////////
echo '<div class="post2">Загрузил: '.ustatus($zc_f['author']).' <a href="/us'.$zc_f['author'].'">'.uname($zc_f['author']).'</a> '.uaccess($zc_f['author']).'</div>
<div class="post2">Скачиваний: '.$zc_f['downs'].'</div>
<div class="post2">Последнее скачивание: '.times($zc_f['ldown']).'</div>
<div class="post2">Добавлен: '.times($zc_f['time']).'</div>';
if($zc_f['rating'] > 0) echo '<div class="err">Для скачки необходимо рейтинга: <font color="green">'.$zc_f['rating'].'</font></div>';
if($zc_f['rating'] <= $user['rating']){
echo '<div class="msg"><img src="/images/download.png" alt="*">
<a href="/zc/upf'.$id.'"><b>Скачать Файл</b></a> <b>('.round(filesize('files/'.$zc_f['file'].'')/1024).' кб)
</b></div><div class="post2">
Ссылка на файл: <input type="text" value="/zc/f'.$id.'"/>
</div>
<div class="post2">
Экспорт: <input type="text" value="/modules/zc/files/'.$zc_f['file'].'"/>
</div>';
}
if(isset($_GET['v'])){
$go = TextGuard($_GET['go']);
$zc_frating = mysql_fetch_array(mysql_query('select * from `zc_frating` where `f` = '.$id.' and `who` = "'.$user['id'].'"'));
if(empty($go) or $go != "p" && $go != "m" or $zc_frating != 0 or $user['id'] == $zc_f['author']){
header('Location: /zc/f'.$id.''); exit;
}
if($go == "p") $status = 1; elseif($go == "m") $status = 2;
mysql_query("INSERT INTO `zc_frating`(
`f`,
`who`,
`status`,
`time`
)VALUES(
'".$id."',
'".$user['id']."',
'".$status."',
'".time()."'
)");
$zc_f_author = mysql_fetch_array(mysql_query('select * from `user` where `id` = "'.$zc_f['author'].'"'));
if($zc_f_author != 0){
if($status == 1){
mysql_query("UPDATE `user` SET `rating`='".($zc_f_author['rating']+0.01)."' WHERE `id`='".$zc_f_author['id']."' limit 1");
mysql_query("INSERT INTO `op`(
`who`,
`ho`,
`text`,
`time`,
`read`,
`sort`
)VALUES(
'".$zc_f_author['id']."',
'".$user['id']."',
'оценил [b]положительно[/b] ваш [url=/zc/f".$id."]файл[/url]!',
'".time()."',
'0',
'3'
)");
}elseif($status == 2){
mysql_query("UPDATE `user` SET `rating`='".($zc_f_author['rating']-0.01)."' WHERE `id`='".$zc_f_author['id']."' limit 1");
mysql_query("INSERT INTO `op`(
`who`,
`ho`,
`text`,
`time`,
`read`,
`sort`
)VALUES(
'".$zc_f_author['id']."',
'".$user['id']."',
'оценил [b]отрицательно[/b] ваш [url=/zc/f".$id."]файл[/url]!',
'".time()."',
'0',
'3'
)");
}
}
}
echo '<div class="post2">
Рейтинг: ';
$all = mysql_result(mysql_query('select count(`id`) from `zc_frating` where `f`= "'.$id.'" and `status` = "1"'),0)-mysql_result(mysql_query('select count(`id`) from `zc_frating` where `f`= "'.$id.'" and`status` = "2"'),0);
$zc_frating = mysql_fetch_array(mysql_query('select * from `zc_frating` where `f` = '.$id.' and `who` = "'.$user['id'].'"'));
if($zc_frating == 0 && $user['id'] != $zc_f['author']) echo '<a href="/zc/f'.$id.'?v&go=p">+</a> | <a href="/zc/f'.$id.'?v&go=m">-</a>';
echo ' ';
if($all < 0) echo '<font color="red"><big><b>'.$all.'</b></big></font>';
elseif($all == 0) echo '<font color="red"><big><b>0</b></big></font>';
elseif($all > 0) echo '<font color="green"><big><b>'.$all.'</b></big></font>';
echo ' (<font color="green">'.mysql_result(mysql_query('select count(`id`) from `zc_frating` where `f`= "'.$id.'" and `status` = "1"'),0).'</font>/<font color="red">'.mysql_result(mysql_query('select count(`id`) from `zc_frating` where `f`= "'.$id.'" and`status` = "2"'),0).'</font>)<br>
</div><div class="post2"><a href="/zc/fcom'.$id.'"><b>Комментарии</a> ('.mysql_result(mysql_query('select count(`id`) from `zc_fcom` where `f` = "'.$id.'"'),0).')
</b></div></div>';
break;
case 'upf':
$id = TextGuard($id);
$zc_f = mysql_fetch_array(mysql_query('select * from `zc_f` where `id` = '.$id.' and `status` = "0"'));
$zc_pr = mysql_fetch_array(mysql_query('select * from `zc_pr` where `id` = '.$zc_f['pr'].''));
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$zc_f['r'].''));
if(empty($id) or !is_numeric($id) or $zc_pr == 0 or $zc_r == 0 or $zc_f == 0){
header('Location: /zc'); exit;
}
if($zc_f['rating'] > $user['rating']){
header('Location: /zc/f'.$id.''); exit;
}
mysql_query("UPDATE `zc_f` SET `downs`='".($zc_f['downs']+1)."',`ldown`='".time()."' WHERE `id` = '".$id."' limit 1");
header('Location: /modules/zc/files/'.$zc_f['file'].'');
break;
case 'moder':
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `moder` = '.$user['id'].''));
if($zc_r == 0){
header('Location: /zc'); exit;
}
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Загруз-центр</span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
include '../../system/nvg.php';
if(isset($_GET['ok0'])){
$id = TextGuard($id);
$zc_f = mysql_fetch_array(mysql_query('select * from `zc_f` where `id` = "'.$id.'"'));
if(empty($id) or $zc_f == 0){
header('Location: /zc/moder'); exit;
}
mysql_query("UPDATE `zc_f` SET `status`='0' WHERE `id`='".$id."' limit 1");
mysql_query("INSERT INTO `op`(
`who`,
`ho`,
`text`,
`time`,
`read`,
`sort`
)VALUES(
'".$zc_f['author']."',
'".$user['id']."',
'добавил ваш [url=/zc/f".$id."]файл[/url] в Загруз-Центр!',
'".time()."',
'0',
'3'
)");
header('Location: /zc/f'.$id.''); exit;
}
if(isset($_GET['ok1'])){
$id = TextGuard($id);
$zc_f = mysql_fetch_array(mysql_query('select * from `zc_f` where `id` = "'.$id.'"'));
if(empty($id) or $zc_f == 0){
header('Location: /zc/moder'); exit;
}
unlink('files/'.$zc_f['file'].'');
mysql_query("DELETE FROM `zc_f` WHERE `id`='".$id."'");
header('Location: /zc/moder'); exit;
}
$cop = $user['on_page'];
$ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `zc_f` where `r` = '".$zc_r['id']."' and `status` = '1'"),0);
$cp = ceil($ca/$cop);
if(isset($_GET['p']) && is_numeric($_GET['p'])){
$p = $_GET['p'];
if($_GET['p']>$cp) $p = $cp;
if($_GET['p']<1)$p = 1;
}else{
$p = 1;
}
$start = $p*$cop-$cop;
$zc_f = mysql_query("SELECT * FROM `zc_f` where `r` = '".$zc_r['id']."' and `status` = '1' ORDER BY `id` DESC LIMIT $start,$cop");
while($zc_f2 = mysql_fetch_assoc($zc_f)){
echo '<div class="post2">'.$zc_f2['name'].' (<a href="/modules/zc/files/'.$zc_f2['file'].'">'.$zc_f2['file'].'</a>) ('.round(filesize('files/'.$zc_f2['file'].'')/1024).' кб)<br>
Описание: '.smiles(bbcode($zc_f2['about'])).'<br>
Загрузил: '.ustatus($zc_f2['author']).' <a href="/us'.$zc_f2['author'].'">'.uname($zc_f2['author']).'</a> '.uaccess($zc_f2['author']).'</div><div class="cit">
<a href="/zc/moder?ok0&id='.$zc_f2['id'].'"><input type="submit" value="принять"/></a> <a href="/zc/moder?ok1&id='.$zc_f2['id'].'"><input type="submit" value="отклонить"/></a></div>';
}
echo '</div><div class="spis">Стр. ';
if($p-2>0) echo '<a href="/zc/moder?p=1"><<</a> ';
if($p-1>0) echo '<a href="/zc/moder?p='.($p-1).'"><</a> ';
if($p-3>0) echo '<a href="/zc/moder?p'.($p-3).'">'.($p-3).'</a> | ';
if($p-2>0) echo '<a href="/zc/moder?p='.($p-2).'">'.($p-2).'</a> | ';
if($p-1>0) echo '<a href="/zc/moder?p='.($p-1).'">'.($p-1).'</a> | ';
echo '<b>'.$p.'</b>';
if($p+1<=$cp) echo ' | <a href="/zc/moder?p='.($p+1).'">'.($p+1).'</a>';
if($p+2<=$cp) echo ' | <a href="/zc/moder?p='.($p+2).'">'.($p+2).'</a>';
if($p+3<=$cp) echo ' | <a href="/zc/moder?p='.($p+3).'">'.($p+3).'</a>';
if($p+1<=$cp) echo ' <a href="/zc/moder?p='.($p+1).'">></a>';
if($p+2<=$cp) echo ' <a href="/zc/moder?p='.ceil($ca/$cop).'">>></a>';
echo '</div>';
break;
case 'nr':
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Загруз-центр</span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
include '../../system/nvg.php';
if(isset($_POST['submit'])){
$name = TextGuard($_POST['name']);
if(empty($name)) $err[] = 'Вы не ввели название раздела...';
$about = TextGuard($_POST['about']);
if(empty($about)) $err[] = 'Вы не ввели описание раздела...';
$moder = TextGuard($_POST['moder']);
if(empty($moder) or !is_numeric($moder)) $err[] = 'Вы не выбрали модератора раздела...';
$moder_user = mysql_fetch_array(mysql_query('select * from `user` where `id` = "'.$moder.'"'));
if($moder_user == 0) $err[] = 'Такого пользователя не существует...';
if(!$err){
mysql_query("INSERT INTO `zc_r`(
`name`,
`about`,
`moder`
)VALUES(
'".$name."',
'".$about."',
'".$moder."'
)");
header('Location: /zc'); exit;
}else{
echo '<div class="err">';
foreach($err as $err_info){
echo $err_info.'<br>';
}
echo '</div>';
}
}
echo '<div class="post2">
<form action="?m=nr" method="post">
Название:<br><input name="name"/><br>
Описание:<br><textarea name="about" style="width:98%;" rows="3"></textarea><br>
Модератор:<br><input name="moder"/></div><div class="lst">
<input type="submit" value="Добавить" name="submit"/>
</form></div>';
break;
case 'red':
$id = TextGuard($id);
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$id.''));
if(empty($id) or !is_numeric($id) or $zc_r == 0){
header('Location: /zc'); exit;
}
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Загруз-центр</span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
include '../../system/nvg.php';
if(isset($_POST['submit'])){
$text = TextGuard($_POST['text']);
if(empty($text)) $err[] = 'Название осталось пустым...';
$about = TextGuard($_POST['about']);
if(empty($about)) $err[] = 'Описание осталось пустым...';
$moder = TextGuard($_POST['moder']);
if(empty($moder) or !is_numeric($moder)) $err[] = 'Вы не выбрали модератора раздела...';
$moder_user = mysql_fetch_array(mysql_query('select * from `user` where `id` = "'.$moder.'"'));
if($moder_user == 0) $err[] = 'Такого пользователя не существует...';
if(!$err){
mysql_query("UPDATE `zc_r` SET `name`='".$text."',`moder`='".$moder."',`about`='".$about."' WHERE `id` = '".$id."' limit 1");
header('Location: /zc'); exit;
}else{
echo '<div class="err">';
foreach($err as $err_info){
echo $err_info.'<br>';
}
echo '</div>';
}
}
echo '<div class="post2">
<form action="" method="post">
Название:<br><input name="text" value="'.$zc_r['name'].'"/><br>
Описание:<br><textarea name="about" style="width:98%;" rows="3">'.$zc_r['about'].'</textarea><br>
Модератор ('.ustatus($zc_r['moder']).' <a href="/us'.$zc_r['moder'].'">'.uname($zc_r['moder']).'</a> '.uaccess($zc_r['moder']).') <input name="moder" value="'.$zc_r['moder'].'" size="2"/><br>
<input type="submit" value="Сохранить" name="submit"/>
</form></div></div>';
break;
case 'rdel':
$id = TextGuard($id);
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$id.''));
if(empty($id) or !is_numeric($id) or $zc_r == 0 or $user['status'] < 4)
{
header('Location: /zc');
exit;
}
$zc_pr = mysql_query('select * from `forum_pr` where `r` = "'.$id.'"');
while($zc_pr2 = mysql_fetch_array($zc_pr)){
mysql_query("DELETE FROM `zc_pr` WHERE `id` = '".$zc_pr2['id']."'");
}
$zc_f = mysql_query('select * from `forum_f` where `r` = "'.$id.'"');
while($zc_f2 = mysql_fetch_array($zc_f)){
unlink('files/'.$zc_f2['file'].'');
mysql_query("DELETE FROM `zc_f` WHERE `id` = '".$zc_f2['id']."'");
}
mysql_query("DELETE FROM `zc_r` WHERE `id` = '$id'");
header('Location: /zc/'); exit;
break;
case 'npr':
$id = TextGuard($id);
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$id.''));
if(empty($id) or !is_numeric($id) or $zc_r == 0){
header('Location: /zc'); exit;
}
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Загруз-центр</span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
include '../../system/nvg.php';
if(isset($_POST['submit'])){
$name = TextGuard($_POST['name']);
if(empty($name)) $err[] = 'Вы не ввели название подраздела...';
if(!$err){
mysql_query("INSERT INTO `zc_pr`(
`r`,
`name`
)VALUES(
'".$id."',
'".$name."'
)");
header('Location: /zc/r'.$id.''); exit;
}else{
echo '<div class="err">';
foreach($err as $err_info){
echo $err_info.'<br>';
}
echo '</div>';
}
}
echo '<div class="post2">
<form action="" method="post">
Название:<br><input name="name"/><br>
<input type="submit" value="Добавить" name="submit"/>
</form></div></div>';
break;
case 'pred':
$id = TextGuard($id);
$zc_pr = mysql_fetch_array(mysql_query('select * from `zc_pr` where `id` = '.$id.''));
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$zc_pr['r'].''));
if(empty($id) or !is_numeric($id) or $zc_pr == 0 or $zc_r == 0){
header('Location: /zc'); exit;
}
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Загруз-центр</span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
include '../../system/nvg.php';
if(isset($_POST['submit'])){
$text = TextGuard($_POST['text']);
if(empty($text)) $err[] = 'Название осталось пустым...';
if(!$err){
mysql_query("UPDATE `zc_pr` SET `name`='".$text."' WHERE `id` = '".$id."' limit 1");
header('Location: /zc'); exit;
}else{
echo '<div class="pet">';
foreach($err as $err_info){
echo $err_info.'<br>';
}
echo '</div>';
}
}
echo '<div class="post2">
<form action="" method="post">
Название:<br><input name="text" value="'.$zc_pr['name'].'"/><br>
<input type="submit" value="Сохранить" name="submit"/>
</form></div></div>';
break;
case 'prdel':
$id = TextGuard($id);
$zc_pr = mysql_fetch_array(mysql_query('select * from `zc_pr` where `id` = '.$id.''));
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$zc_pr['r'].''));
if(empty($id) or !is_numeric($id) or $zc_pr == 0 or $zc_r == 0){
header('Location: /zc'); exit;
}
$zc_f = mysql_query('select * from `forum_f` where `pr` = "'.$id.'"');
while($zc_f2 = mysql_fetch_array($zc_f)){
unlink('files/'.$zc_f2['file'].'');
mysql_query("DELETE FROM `zc_f` WHERE `id` = '".$zc_f2['id']."'");
}
mysql_query("DELETE FROM `zc_pr` WHERE `id` = '$id'");
header('Location: /zc/r'.$zc_pr['r'].''); exit;
break;
case 'fcom':
$id = TextGuard($id);
$zc_f = mysql_fetch_array(mysql_query('select * from `zc_f` where `id` = '.$id.' and `status` = "0"'));
$zc_pr = mysql_fetch_array(mysql_query('select * from `zc_pr` where `id` = '.$zc_f['pr'].''));
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$zc_f['r'].''));
if(empty($id) or !is_numeric($id) or $zc_pr == 0 or $zc_r == 0 or $zc_f == 0){
header('Location: /zc'); exit;
}
echo "<a href='/'><div class='logo'><img src='/images/cornerhat.png' class='snoww'><span style='font-family: drunkC; font-size:22px;'>Загруз-центр</span></div> </a>";
echo '</div>';
echo '<div class="start">';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
include '../../system/nvg.php';
echo '<div class="post2">
Файл: <a href="/zc/f'.$id.'">'.$zc_f['name'].'</a>
</div><div class="post2">
Комментарии:
</div>';
echo '<div class="glav"><form action="" method="post">
Сообщение:<br><textarea name="text" style="width:98%;" rows="3"></textarea><br>
<input type="submit" name="submit" value="Написать"/>
</form></div>';
if(isset($_POST['submit'])){
$text = TextGuard($text);
if(empty($text)) $err[] = 'Сообщение осталось пустым...';
$ncm = mysql_query("SELECT * FROM `zc_fcom` WHERE `who`='".$user['id']."' ORDER BY `time` desc");
while($ncm2 = mysql_fetch_assoc($ncm)){
$ncm_timeout = $ncm2['time'];
if((time()-$ncm_timeout) < 5) $err[] = 'Писать можно только раз в 5 секунд...';
}
$ncm_rep = mysql_fetch_array(mysql_query('select * from `zc_fcom` where `who` = "'.$user['id'].'" and `text` = "'.$text.'"'));
if($ncm_rep != 0) $err[] = 'Вы уже писали подобное сообщение...';
if(!$err){
mysql_query("INSERT INTO `zc_fcom`(
`f`,
`who`,
`text`,
`time`
)VALUES(
'".$id."',
'".$user['id']."',
'".$text."',
'".time()."'
)");
mysql_query("INSERT INTO `op`(
`who`,
`ho`,
`text`,
`time`,
`read`,
`sort`
)VALUES(
'".$zc_f['author']."',
'".$user['id']."',
'написал [url=/zc/fcom".$id."]комментарий[/url] к вашему [url=/zc/f".$id."]файлу[/url]!',
'".time()."',
'0',
'3'
)");
header('Location: /zc/fcom'.$id.''); exit;
}else{
echo '<div class="err"><b>';
foreach($err as $err_info){
echo $err_info.'<br>';
}
echo '</b></div>';
}
}
$cop = $user['on_page'];
$ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `zc_fcom` where `f` = '".$id."'"),0);
$cp = ceil($ca/$cop);
if(isset($_GET['p']) && is_numeric($_GET['p']) && $ca != 0){
$p = $_GET['p'];
if($_GET['p']>$cp) $p = $cp;
if($_GET['p']<1)$p = 1;
}else{
$p = 1;
}
$start = $p*$cop-$cop;
if($ca != 0){
$zc_fcom = mysql_query("SELECT * FROM `zc_fcom` where `f` = '".$id."' ORDER BY `id` DESC LIMIT $start,$cop");
while($zc_fcom2 = mysql_fetch_assoc($zc_fcom)){
echo '<div class="post2">'.ustatus($zc_fcom2['who']).' <a href="/us'.$zc_fcom2['who'].'">'.uname($zc_fcom2['who']).'</a> '.uaccess($zc_fcom2['who']).' ('.times($zc_fcom2['time']).')';
if($user['status'] >= 1) echo ' [<a href="/zc/fcom'.$id.'?p='.$p.'&dp&pid='.$zc_fcom2['id'].'">уд</a>]';
echo '<br>'.smiles(bbcode($zc_fcom2['text'])).'</div>';
}}
if(isset($_GET['dp']) && $user['status'] >= 1){
$pid = TextGuard($_GET['pid']);
$posts = mysql_fetch_array(mysql_query('select * from `zc_fcom` where `id` = "'.$pid.'" limit 1'));
if($posts == 0 or empty($pid) or !is_numeric($pid)){
header('Location: /zc/fcom'.$id.'?p='.$p.''); exit;
}
mysql_query("DELETE FROM `zc_fcom` WHERE `id`='".$pid."'");
header('Location: /zc/fcom'.$id.'?p='.$p.''); exit;
}
echo '</div><div class="spis">Стр. ';
if($p-2>0) echo '<a href="/zc/fcom'.$id.'?p=1"><<</a> ';
if($p-1>0) echo '<a href="/zc/fcom'.$id.'?p='.($p-1).'"><</a> ';
if($p-3>0) echo '<a href="/zc/fcom'.$id.'?p'.($p-3).'">'.($p-3).'</a> | ';
if($p-2>0) echo '<a href="/zc/fcom'.$id.'?p='.($p-2).'">'.($p-2).'</a> | ';
if($p-1>0) echo '<a href="/zc/fcom'.$id.'?p='.($p-1).'">'.($p-1).'</a> | ';
echo '<b>'.$p.'</b>';
if($p+1<=$cp) echo ' | <a href="/zc/fcom'.$id.'?p='.($p+1).'">'.($p+1).'</a>';
if($p+2<=$cp) echo ' | <a href="/zc/fcom'.$id.'?p='.($p+2).'">'.($p+2).'</a>';
if($p+3<=$cp) echo ' | <a href="/zc/fcom'.$id.'?p='.($p+3).'">'.($p+3).'</a>';
if($p+1<=$cp) echo ' <a href="/zc/fcom'.$id.'?p='.($p+1).'">></a>';
if($p+2<=$cp) echo ' <a href="/zc/fcom'.$id.'?p='.ceil($ca/$cop).'">>></a>';
echo '</div>';
break;
case 'fe':
$id = TextGuard($id);
$zc_f = mysql_fetch_array(mysql_query('select * from `zc_f` where `id` = '.$id.' and `status` = "0"'));
$zc_pr = mysql_fetch_array(mysql_query('select * from `zc_pr` where `id` = '.$zc_f['pr'].''));
$zc_r = mysql_fetch_array(mysql_query('select * from `zc_r` where `id` = '.$zc_f['r'].''));
if(empty($id) or !is_numeric($id) or $zc_pr == 0 or $zc_r == 0 or $zc_f == 0)
{
header('Location: /zc'); exit;
}
echo '<div class="verh"><a href="/zc"><b>Загруз-Центр</a> | <a href="/zc/r'.$zc_r['id'].'">'.$zc_r['name'].'</a> | <a href="/zc/pr'.$zc_pr['id'].'">'.$zc_pr['name'].'</a> | <a href="/zc/f'.$id.'">'.$zc_f['name'].'</a></b></div>';
include '../../system/nvg.php';
break;
}
include '../../system/footer.php';
?>