Файл: mylaf.ru/shared_zone/index.php
Строк: 452
<?
if(isset($_GET['add_file']))
{
include_once 'md5_shif_g2m5ptw+add_to_sz.php';
exit;
}
if(isset($_GET['rules']))
{
include_once 'md5_shif_gm9p3rules.php';
exit;
}
if(isset($_GET['moders']))
{
include_once 'md5_shif_gmgwpagjmoder.php';
exit;
}
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/shif.php';
include_once '../sys/inc/user.php';
if(isset($_GET['activate_multichecker']) && isset($user))$_SESSION['mrshsh']=1;
if(isset($_GET['mrsh_cancel']))
{
unset($_SESSION['rpshs']);unset($_SESSION['mrsh']);
}
if(isset($_SESSION['mrsh']) && isset($user))$mrsh=1;
if(isset($_GET['file']) && ($user['group_access']==4 || $user['group_access']>=7))
{
$set['title']='Зона обмена - Информация о файле';
include_once '../sys/inc/thead.php';
title();
aut();
err();
$file_akt=intval($_GET['file']);
$file_akt=mysql_fetch_assoc(mysql_query("SELECT * FROM `shared_zone` WHERE `id` = '$file_akt' LIMIT 1"));
if($file_akt['type']=='file')
{
$file=mysql_fetch_assoc(mysql_query("SELECT * FROM `files` WHERE `id` = '$file_akt[id_my_file]' AND `type2` = 'file' AND `cat` = 'files' LIMIT 1"));
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$file[id_user]'"));
}
else
{
$file=mysql_fetch_array(mysql_query("SELECT * FROM `gallery_foto` WHERE `id` = '$file_akt[id_my_file]' LIMIT 1"));
$gallery=mysql_fetch_array(mysql_query("SELECT * FROM `gallery` WHERE `id` = '$file[id_gallery]' LIMIT 1"));
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$gallery[id_user]' LIMIT 1"));
}
$dir_situated=mysql_fetch_assoc(mysql_query("SELECT * FROM `shared_zone` WHERE `id` = '$file_akt[mother]' LIMIT 1"));
$dir_situated2=mysql_fetch_assoc(mysql_query("SELECT * FROM `shared_zone` WHERE `id` = '$dir_situated[mother]' LIMIT 1"));
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `id` = '$file_akt[id]' AND `dir` = '0' AND `id_soo` = '0' LIMIT 1"),0)==0)
{
echo "<div class='err'>Ошибка!</div>n";
include_once '../sys/inc/tfoot.php';
}
echo "<font color='green'>Файл: </font> <b><a href='".($file_akt['type']=='file'?"/files/?file=$file[id]":"/foto/$ank[id]/$gallery[id]/$file[id]/")."'>".($file_akt['type']=='file'?"".($file['ras']=='jar' && is_file(H."files/java_icons/$file[id].png")?"<img src='/files/java_icons/$file[id].png' height='16'/>":"".(is_file(H."files/file_icons/$file[ras].png")?"<img src='/files/file_icons/$file[ras].png'/>":"<img src='file_icons/unknown_file.png'/>")."")."":"<img src='/files/file_icons/jpg.png' alt='jpg'/>")." ".htmlspecialchars($file['name']).".$file[ras]</a></b>".($file['+18']==1?" <font color='red'>(+18)</font>":null)."".($file['sk']==0?" <a href='".($file_akt['type']=='file'?"/files/?file=$file[id]&user=$ank[id]&sk=1":"/foto/$ank[id]/$gallery[id]/$file[id]/?sk=1")."'><span style='color:red'>[заблокировать]</span></a>":null)."<br/>n";
if($dir_situated['mother']!=0)echo "<font color='green'>Категория ЗО:</font> <b><a href='?dir=$dir_situated2[id]'>".htmlspecialchars($dir_situated2['name'])."</a>/<a href='?dir=$dir_situated[id]'>".htmlspecialchars($dir_situated['name'])."</a></b><br/>n";
else echo "<font color='green'>Категория ЗО:</font> <b><a href='?dir=$dir_situated[id]'>".htmlspecialchars($dir_situated['name'])."</a></b><br/>n";
if($ank['pol']==0)$a='a';else $a=null;
echo "<font color='green'>Добавил$a:</font> <b>";
echo "<a href='/user/?id=$ank[id]'>$ank[nick]</a> ".online($ank['id'])."";
echo "</b>n";
echo " <font color='blue'>(".vremja($file_akt['time']).")</font><br/>n";
echo "<br/><a href='?replace=$file_akt[id]'>[переместить]</a> <a href='?dir=$file_akt[mother]&mf=$file_akt[id]&del_f'>[удалить]</a>";
echo "<div class='foot'><img src='/style/icons/back.png'> <a href='?dir=$file_akt[mother]'>Назад</a></div>n";
include_once '../sys/inc/tfoot.php';
}
if(isset($_GET['mf']))$mf=intval($_GET['mf']);
if(isset($_GET['dir']) && $_GET['dir']!=NULL && $_GET['dir']!=0)$dir=intval($_GET['dir']);
else{$dir=0;$dz=1;}
if(isset($_GET['replace']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `id` = '".intval($_GET['replace'])."' AND `dir` = '0' LIMIT 1"),0)!=0 && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
$replace=mysql_fetch_array(mysql_query("SELECT * FROM `shared_zone` WHERE `id` = '".intval($_GET['replace'])."' LIMIT 1"));
}
if($dir==0)
{
$dir['id']='0';
$dir['name']='Зона файлов';
$dir['mother']='0';
$dir['counter']='/0/';
}
else $dir=mysql_fetch_assoc(mysql_query("SELECT * FROM `shared_zone` WHERE `id` = '$dir' LIMIT 1"));
if($dir['id']!=0)$mother=mysql_fetch_assoc(mysql_query("SELECT * FROM `shared_zone` WHERE `id` = '$dir[mother]' LIMIT 1"));
if($dir['id_soo']!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `soo` WHERE `id` = '$dir[id_soo]'"),0)!=0)
{
$soo=mysql_fetch_array(mysql_query("SELECT * FROM `soo` WHERE `id` = '$dir[id_soo]'"));
$admid=get_user($soo['admid']);
$soo_shared_zone=mysql_fetch_array(mysql_query("SELECT * FROM `shared_zone` WHERE `id_soo` = '$soo[id]' AND `dir` = '1' AND `mother` = '0'"));
if($user['id']==$admid['id']){$adm=1;$help=1;}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `soo_users` WHERE `id_soo` = '$soo[id]' AND `id_user` = '$user[id]' AND `help` = '1'"),0)!=0)$help=1;
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `id` = '$dir[id]' LIMIT 1"),0)==0 && $dir['id']!=0)
{
$set['title']='Зона обмена - Ошибка';
include_once '../sys/inc/thead.php';
title();
aut();
err();
echo"<div class='err'>Ошибка!</div>n";
include_once '../sys/inc/tfoot.php';
}
if ($dir['dir']!=0)$set['title']="Зона обмена - ".htmlspecialchars($dir['name']).""; else $set['title']="Зона обмена";
include_once '../sys/inc/thead.php';
title();
aut();
err();
if ($dir['dir'])
echo "<div class='forum'><a href='?dir=$dir[id]'>".htmlspecialchars($dir['name'])."</a>n";
echo "<div style='float:right'>n";
if($user['group_access']>=4)
{
if($dir['dir'])echo "<a href='?dir=$dir[id]&uprav=edit_d'>[ред]</a>n";
}
echo "</div></div>n";
///////НОВАЯ ПАПКА///////
if (isset($_POST['add_dir']) && isset($_POST['dir_name']) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
$dir_name=$_POST['dir_name'];
if (strlen2($dir_name)<1)$err[]='Короткое название';
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `name` = '$dir_name' AND `dir` = '1' AND `mother` = '$dir[id]' LIMIT 1"),0)!=0)$err[]='Папка уже существует!';
err();
if(!isset($err))
{
$pos=mysql_result(mysql_query("SELECT MAX(`pos`) FROM `shared_zone` WHERE `mother` = '$dir[id]' AND `dir` = '1'"), 0)+1;
mysql_query("INSERT INTO `shared_zone` (`name`, `dir`, `mother`, `time`, `counter`, `pos`".(isset($soo)?", `id_soo`":null).") values ('$dir_name', '1', '$dir[id]', '$time', '$dir[counter]$dir[id]/', '$pos'".(isset($soo)?", '$soo[id]'":null).")");
msg("Папка <b>".htmlspecialchars($dir_name)."</b> успешно создана");
}
}
////////РЕДАКТИРОВАНИЕ ПАПКИ///////
if(isset($_POST['dir_edit']) && (isset($soo) && $dir['id']!=$soo_shared_zone['id'] && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
$dir_name=$_POST['name'];
if (strlen2($dir_name)<1)$err[]='Короткое название';
if (strlen2($dir_name)>50)$err[]='Название не должно быть длиннее 50 символов';
err();
if(!isset($err))
{
mysql_query("UPDATE `shared_zone` SET `name` = '$dir_name' WHERE `id` = '$dir[id]' LIMIT 1");
msg("Изменения успешно сохранены");
}
}
/////УДАЛЕНИЕ ФАЙЛА//////
if(isset($_GET['del_f_ok']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `id` = '".intval($_GET['mf'])."' AND `dir` = '0' AND `mother` = '$dir[id]'".(isset($soo)?" AND `id_soo` = '$soo[id]'":null)." LIMIT 1"),0)!=0 && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
mysql_query("DELETE FROM `shared_zone` WHERE `id`='".intval($_GET['mf'])."' AND `dir` = '0'");
msg("Файл успешно удален");
}
////////УДАЛЕНИЕ ПАПКИ///////
if(isset($_GET['del_dir']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `id` = '".intval($_GET['dir'])."' AND `dir` = '1' LIMIT 1"),0)!=0 && (isset($soo) && $dir['id']!=$soo_shared_zone['id'] && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
$del=mysql_fetch_assoc(mysql_query("SELECT * FROM `shared_zone` WHERE `id` = '".intval($_GET['dir'])."' AND `dir` = '1' LIMIT 1"));
$links = mysql_query("SELECT * FROM `shared_zone` WHERE `pos` > '$del[pos]' AND `mother` = '$dir[mother]' AND `dir` = '1' ORDER BY `pos` ASC");
while ($p = mysql_fetch_array($links))
{
mysql_query("UPDATE `shared_zone` SET `pos` = '".($p['pos']-1)."' WHERE `id` = '$p[id]' LIMIT 1");
}
mysql_query("DELETE FROM `shared_zone` WHERE `id`='$del[id]' AND `dir` = '1'");
mysql_query("DELETE FROM `shared_zone` WHERE `counter` like '%/$del[id]/%'");
header("Location: /shared_zone/?id=$dir[mother]");
exit;
}
////////ПЕРЕМЕЩЕНИЕ ОБЬЕКТА///////
if(isset($_GET['ok']) && isset($_GET['replace']) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)) && mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `id` = '$replace[id]' AND `dir` = '0' LIMIT 1"),0)!=0)
{
mysql_query("UPDATE `shared_zone` SET `mother` = '$dir[id]', `counter` = '$dir[counter]$dir[id]/' WHERE `id` = '".intval($_GET['replace'])."' LIMIT 1");
header("Location: ?dir=$replace[mother]");
exit;
}
////////НОВАЯ ПАПКА///////
if(isset($_GET['uprav']) && $_GET['uprav']=='new_dir' && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
echo"<form method='post' action='?dir=$dir[id]'>n";
echo"Название:<br/><input type='text' name='dir_name' value=''><br/>n";
echo"<input type='submit' value='Создать' name='add_dir'></form><br/>n";
include_once '../sys/inc/tfoot.php';
}
////////РЕДАКТИРОВАНИЕ ПАПКИ///////
elseif(isset($_GET['uprav']) && $_GET['uprav']=='edit_d' AND $dir['dir']==1 && (isset($soo) && $dir['id']!=$soo_shared_zone['id'] && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)) && $dir['id']>0)
{
echo "<form method='post' action='?dir=$dir[id]'>Имя папки:(от 3 до 50 символов)<br /><input type='text' name='name' value='".htmlspecialchars($dir['name'])."'/> <br />n";
echo "<input type='submit' name='dir_edit' value='Ок'/><br /></form><div class='foot'><img src='/style/icons/delete.png'/> <a href='?dir=$dir[id]&uprav=pre_del'><span style='color:red'>×</span> Удалить папку</a></div>n";
include_once '../sys/inc/tfoot.php';
}
////////УДАЛИТЬ ПАПКУ///////
elseif(isset($_GET['uprav']) && $dir['dir']==1 && $_GET['uprav']=='pre_del' && $dir['id']>0 && (isset($soo) && $dir['id']!=$soo_shared_zone['id'] && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
echo "<div class='err'>Вы уверены, что хотите удалить эту папку и все вложенные в неё файлы?<br /><a href='?dir=$dir[id]'>Нет</a> <a href='?dir=$dir[id]&del_dir'>Да</a></div>n";
include_once '../sys/inc/tfoot.php';
}
////////УДАЛИТЬ ФАЙЛ///////
elseif(isset($_GET['del_f']) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
echo "<div class='err'>Вы уверены, что хотите удалить этот файл?<br /><a href='?dir=$dir[mother]'>Нет</a> <a href='?dir=$dir[id]&mf=$mf&del_f_ok'>Да</a></div>n";
include_once '../sys/inc/tfoot.php';
}
/////// СПИСОК ОБЕКТОВ ////////
$coo=mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `mother` = '$dir[id]'"),0);
$co=mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `mother` = '$dir[id]' AND `dir` = '1'"),0);
if($coo==$co)$cm=1;
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `mother` = '$dir[id]'".(isset($_GET['moderate']) && ($user['group_access']==4 || $user['group_access']>=7)?" AND `dir` = '1'":null)."".($dir['id']!=0?null:" AND `id_soo` = '0'").""),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if(isset($dz))$dir['id']=0;
if (isset($_GET['up']) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
$up=mysql_fetch_assoc(mysql_query("SELECT * FROM `shared_zone` WHERE `id` = '".intval($_GET['up'])."' AND `mother` = '$dir[id]' AND `dir` = '1' LIMIT 1"));
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `pos` < '$up[pos]' AND `mother` = '$dir[id]' AND `dir` = '1'".(!isset($soo)?" AND `id_soo` = '0'":null)." LIMIT 1"),0)!=0)
{
mysql_query("UPDATE `shared_zone` SET `pos` = '$up[pos]' WHERE `pos` = '".($up['pos']-1)."' AND `mother` = '$dir[id]' AND `dir` = '1' LIMIT 1");
mysql_query("UPDATE `shared_zone` SET `pos` = '".($up['pos']-1)."' WHERE `id` = '".intval($_GET['up'])."' AND `mother` = '$dir[id]' AND `dir` = '1' LIMIT 1");
}
}
elseif (isset($_GET['down']) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
$down=mysql_fetch_assoc(mysql_query("SELECT * FROM `shared_zone` WHERE `id` = '".intval($_GET['down'])."' AND `mother` = '$dir[id]' AND `dir` = '1' LIMIT 1"));
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `pos` > '$down[pos]' AND `mother` = '$dir[id]' AND `dir` = '1'".(!isset($soo)?" AND `id_soo` = '0'":null)." LIMIT 1"),0)!=0)
{
mysql_query("UPDATE `shared_zone` SET `pos` = '$down[pos]' WHERE `pos` = '".($down['pos']+1)."' AND `mother` = '$dir[id]' AND `dir` = '1' LIMIT 1");
mysql_query("UPDATE `shared_zone` SET `pos` = '".($down['pos']+1)."' WHERE `id` = '".intval($_GET['down'])."' AND `mother` = '$dir[id]' AND `dir` = '1' LIMIT 1");
}
}
if(isset($_GET['mok']) && isset($mrsh) && isset($_SESSION['rpshs']) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
$array=explode(";", $_SESSION['rpshs']);
$count=0;
$count2=0;
foreach ($array as $key => $value)
{
if($value!=NULL)
{
$count2=$count2+1;
$file=mysql_fetch_assoc(mysql_query("SELECT * FROM `shared_zone` WHERE `id` = '$value'".(isset($soo)?" AND `id_soo` = '$soo[id]'":null)." LIMIT 1"));
mysql_query("UPDATE `shared_zone` SET `mother` = '$dir[id]', `counter` = '".($dir['id']==0?"/0/":"$dir[counter]$dir[id]/")."' WHERE `id` = '$file[id]'");
}
}
unset($_SESSION['rpshs']);unset($_SESSION['mrsh']);
}
/////
///////////
//////
if(isset($mrsh) && isset($_GET['drop']) && isset($_SESSION['rpshs']))unset($_SESSION['rpshs']);
////
if (isset($mrsh) && isset($_GET['add']) && isset($_POST['ok']) && ($user['group_access']==4 || $user['group_access']>=7))
{
//Очищаем список
$qq=mysql_query("SELECT * FROM `shared_zone` WHERE `mother` = '$dir[id]' ORDER BY `dir` DESC, `time` DESC LIMIT $start, $set[p_str]");
while($postt=mysql_fetch_array($qq))
{
if(isset($_SESSION['rpshs']))
{
$arrayy=explode(";", $_SESSION['rpshs']);
foreach ($arrayy as $keyy => $valuee)
{
if($postt['id']==$valuee && $valuee!=NULL)$_SESSION['rpshs']=str_replace(";$postt[id];", ';', $_SESSION['rpshs']);
}
}
}
//вводим в список новые данные
foreach ($_POST as $key => $value)
{
if (preg_match('#^mrsh_([0-9]*)$#',$key,$postnum) && $value='1')
{
if(isset($_SESSION['rpshs']))
{
$array1=explode(";", $_SESSION['rpshs']);
foreach ($array1 as $key1 => $value1)
{
if($postnum['1']==$value1 && $value1!=NULL)$bad=1;
}
}
if(!isset($bad))
{
$post[]=$postnum[1];
}
if(isset($bad))unset($bad);
}
}
if(isset($post))
{
if(isset($_SESSION['rpshs']))
{
$_SESSION['rpshs']="$_SESSION[rpshs]".($_SESSION['rpshs']!=NULL?";":null)."".implode(";", $post).";";
$_SESSION['rpshs']=str_replace(";;", ';', $_SESSION['rpshs']);
}
else $_SESSION['rpshs']="".implode(";", $post)."".($post==NULL?";":null)."";
}
$arraya=explode(";", $_SESSION['rpshs']);
$_SESSION['rpshs']=NULL;
foreach ($arraya as $keya => $valuea)
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `id` = '$valuea' AND `dir` = '0'".(isset($soo)?" AND `id_soo` = '$soo[id]'":null).""),0)!=0 && $valuea!=NULL)$_SESSION['rpshs']="$_SESSION[rpshs];".$valuea."";
}
$_SESSION['rpshs']="$_SESSION[rpshs];";
}
////
if(isset($mrsh) && isset($_SESSION['rpshs']))
{
$act=explode(";", $_SESSION['rpshs']);
$count=0;
foreach ($act as $keyc => $ca)
{
if($ca!=NULL)
{
$count=$count+1;
if($count<5)$cn=$ca;
}
}
}
else $count=0;
if(isset($mrsh) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
echo "<div class='busi'>Выберите файлы и нажмите ".($count!=0?"<a href='?dir=$dir[id]&page=$page&mok'>":null)."Переместить сюда".($count!=0?"</a>":null)."</div>";
}
else
{
if(isset($replace) && mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `id` = '$replace[id]' AND `dir` = '0' LIMIT 1"),0)!=0 && isset($_GET['replace']) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))echo "<b><a href='?dir=$dir[id]&replace=$replace[id]&ok'><span color='red'>>></span>Переместить сюда</a></b><br/>n";
}
if(isset($mrsh))echo "<form method='post' action='?dir=$dir[id]&page=$page&add'>";
$q=mysql_query("SELECT * FROM `shared_zone` WHERE `mother` = '$dir[id]'".(isset($_GET['moderate']) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7))?" AND `dir` = '1'":null)."".($dir['id']!=0?null:" AND `id_soo` = '0'")." ORDER BY `pos` ASC,`dl` DESC".(!isset($com)?" LIMIT $start, $set[p_str]":null)."");
while($post=mysql_fetch_assoc($q))
{
echo "<div class='gmenu'>";
if($post['dir']==0 && ($user['group_access']==4 || $user['group_access']>=7) && !isset($soo))echo "<span style='float:right'><a href='?file=$post[id]'>[i]</a></span>";
if (isset($mrsh) && $post['dir']=='0' && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))
{
if(isset($_SESSION['rpshs']))
{
$array=explode(";", $_SESSION['rpshs']);
foreach ($array as $key => $value)
{
if($post['id']==$value && $value!=NULL)$ych=1;
}
}
echo "<input type='checkbox' name='mrsh_$post[id]' value='1' ".(isset($ych)?" checked='checked'":null)."/> ";
if(isset($ych))unset($ych);
}
if($post['dir']==1 && $post['id']!=0)
{
$k_p=mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `counter` like '%/$post[id]/%' AND `dir` = '0'"), 0);
$k_n=mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `counter` like '%/$post[id]/%' AND `dir` = '0' AND `time` > '".(time()-86400)."'",$db), 0);
if ($k_n==0)$k_n=NULL;
else $k_n='/+'.$k_n;
if(isset($_GET['replace']))echo "<img src='/style/icons/dir.png' /> <a href='?dir=$post[id]&replace=$replace[id]'>".htmlspecialchars($post['name'])."</a> ($k_p$k_n)<br/>n";
else echo "<img src='/style/icons/dir.png' /> <a href='?dir=$post[id]'>".htmlspecialchars($post['name'])."</a> ".(isset($_GET['moderate']) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7))?"":"($k_p$k_n)")."n";
if(isset($_GET['moderate']) && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))echo "<span style='float:right'><a href='?dir=$dir[id]&moderate&page=$page&up=$post[id]'><img src='/style/icons/up.png' alt='o'></a> <a href='?dir=$dir[id]&moderate&page=$page&down=$post[id]'><img src='/style/icons/down.png' alt='o'></a></span>";
}
elseif($post['type']=='foto')
{
$foto=mysql_fetch_array(mysql_query("SELECT * FROM `gallery_foto` WHERE `id` = '$post[id_my_file]' LIMIT 1"));
$gallery=mysql_fetch_array(mysql_query("SELECT * FROM `gallery` WHERE `id` = '$foto[id_gallery]' LIMIT 1"));
$foto['size']=filesize(H.'sys/gallery/640/'.$foto['id'].'.jpg');$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$gallery[id_user]' LIMIT 1"));
echo "<div><a href='/foto/$ank[id]/$gallery[id]/$foto[id]/'>n";
echo "<img src='/foto/foto48/$foto[id].$foto[ras]' alt='Фото_$foto[id]' />";
echo "<br/></a></div><span style='color:#209143; font-size:small;float:right'>(".size_file($foto['size']).")</span><a href='/foto/$ank[id]/$gallery[id]/$foto[id]/'>n";
echo "<img src='/files/file_icons/jpg.png' alt='jpg'/>n";
echo "".htmlspecialchars($foto['name']).".$foto[ras]</a>n";
if($foto['+18']==1)echo " <font color='red'>[+18]</font>";
echo "<br/>n";
$count_komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_komm` WHERE `id_foto` = '$foto[id]'"),0);
echo "<span style='font-size:small;color:gray'>Оценка: $foto[rating], $count_komm комментариев.</span>";
if(isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7))echo "<br/><a href='?".(isset($soo)?"dir=$soo_shared_zone[id]&":null)."replace=$post[id]'>[переместить]</a>";
if(isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7))echo "<a href='?dir=".(isset($soo)?"$soo_shared_zone[id]":"$dir[id]")."&mf=$post[id]&del_f'>[удалить]</a>n";
}
elseif($post['type']=='file')
{
$file=mysql_fetch_assoc(mysql_query("SELECT * FROM `files` WHERE `id` = '$post[id_my_file]' AND `cat` = 'files' AND `type2` = 'file' LIMIT 1"));
$ank=get_user($file['id_user']);
$ras=$file['ras'];
if(is_file(H."files/screens/$file[id].png"))echo "<div><a href='/files/?file=$file[id]&user=$ank[id]'><img class='show_foto' src='/files/screens/$file[id].png' alt='Скрин...' /><br/></a></div>";
echo "<span style='color:#209143;font-size:small;float:right'>(".size_file(filesize(H."fd/$file[id].dat")).")</span>";
echo "<a href='/files/?file=$file[id]&user=$ank[id]'>n";
echo "".($file['ras']=='jar' && is_file(H."files/java_icons/$file[id].png")?"<img src='/files/java_icons/$file[id].png' height='16'/>":"".(is_file(H."files/file_icons/$file[ras].png")?"<img src='/files/file_icons/$file[ras].png'/>":"<img src='file_icons/unknown_file.png'/>")."")."";
echo "".htmlspecialchars($file['name']).".$ras</a>";
if($file['+18']==1)echo " <font color='red'>(+18)</font>";
echo "<br/>";
$count_komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `files_komm` WHERE `id_file` = '$file[id]'"),0);
echo "<span style='font-size:small;color:gray'>Скачано $file[dl] раз, $count_komm комментариев.</span>";
if(isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7))echo "<br/><a href='?".(isset($soo)?"dir=$soo_shared_zone[id]&":null)."replace=$post[id]'>[переместить]</a>";
if($post['dir']==0 && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && ($user['group_access']==4 || $user['group_access']>=7)))echo "<a href='?dir=".(isset($soo)?"$soo_shared_zone[id]":"$dir[id]")."&mf=$post[id]&del_f'>[удалить]</a>n";
}
echo'</div>';
}
if ($k_page>1)str("?dir=$dir[id]&",$k_page,$page); // Вывод страниц
if (isset($mrsh) && ($user['group_access']==4 || $user['group_access']>=7))
{
if(!isset($_SESSION['rpshs']))$_SESSION['rpshs']=NULL;
echo "<input type='submit' value='Выбрать' name='ok'></form>";
echo "<div class='foot'>";
if($count>=5)unset($cn);
if($count!=0)
{
///
$cnt=str_replace('', ';', $count);
$acnt=explode(";", $cnt);
foreach ($acnt as $kcnt => $vcnt)
{
if($vcnt!=NULL)$lcnt=$vcnt;
}
if(isset($lcnt))
{
if($lcnt==1)$ecnt='а';
else $ecnt=NULL;
}
else $ecnt=NULL;
///
echo "Выбрано файлы: ";
$arraya=explode(";", $_SESSION['rpshs']);
$ct=0;
foreach ($arraya as $keya => $valuea)
{
if(!isset($stop) && $valuea!=NULL)
{
$ct=$ct+1;
$file2=mysql_fetch_array(mysql_query("SELECT * FROM `shared_zone` WHERE `id` = '$valuea'"));
if($file2['type']=='foto')$file=mysql_fetch_array(mysql_query("SELECT * FROM `gallery_foto` WHERE `id` = '$file2[id_my_file]' LIMIT 1"));
elseif($file2['type']=='file')$file=mysql_fetch_array(mysql_query("SELECT * FROM `files` WHERE `id` = '$file2[id_my_file]'"));
echo "<a href='?file=$file2[id]'>".htmlspecialchars($file['name']).".".htmlspecialchars($file['ras'])."</a>".($ct<5?"".(isset($cn) && $cn==$file['id']?"":", ")."":null)."";
if($ct==5)$stop=1;
}
}
if(isset($stop) && $count>5)echo " и ещё ".($count-5)."";
}
else echo "Нет выбраных файлов";
echo "<br/><a href='?dir=$dir[id]&mrsh_cancel&page=$page'>[отмена]</a>".($count>0?" <a href='?dir=$dir[id]&mrsh&drop&page=$page'>[очистить]</a>":null)."";
echo "</div>";
}
if(isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && (!isset($_GET['replace']) && ($user['group_access']==4 || $user['group_access']>=7)))
{
echo "<div style='busi'><img src='/style/icons/add.png' /><a href='?dir=$dir[id]&uprav=new_dir'>Создать папку</a>";
echo "<br/><img src='/style/icons/select_content.png'/> <a href='?dir=$dir[id]&page=$page&activate_multichecker=1&CK=".rand(1000000,9999999)."'>Мультивыбор файлов</a>";
echo "<br/><img src='/style/icons/settings.png'/> <a href='?dir=$dir[id]".(!isset($_GET['moderate'])?"&moderate":null)."'>Управление</a></div>n";
}
if(isset($_GET['replace']) && $dir['id']!=0 && (isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && (!isset($_GET['replace']) && ($user['group_access']==4 || $user['group_access']>=7))))echo "<div class='forum'><img src='/style/glavnaya.gif'> <a href='?dir=$dir[mother]&replace=$replace[id]'>Назад</a></div>n";
elseif($dir['id']!=0)echo "<div class='forum'><img src='/style/glavnaya.gif'> <a href='?dir=$dir[mother]'>Назад</a></div>";
include_once '../sys/inc/tfoot.php';
?>