Файл: users/zona/index.php
Строк: 389
<?
if(isset($_GET['rules']))
{
include_once 'rules.php';
exit;
}
if(isset($_GET['moders']))
{
include_once 'moder.php';
exit;
}
require_once ("../../core/cuctema/core.php");
require_once ("../../core/cuctema/shif.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']='Зона обмена - Информация о файле';
require_once ("../../core/cuctema/head.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='hide'>Ошибка!</div>n";
require_once ("../../core/cuctema/foot.php");
}
echo "<div class='d1'><font color='green'>Файл: </font> <b><a href='".($file_akt['type']=='mysite/file'?"mysite/files/?file=$file[id]":"/foto/$ank[id]/$gallery[id]/$file[id]/")."'>".($file_akt['type']=='file'?"".($file['ras']=='jar' && is_file(H."mysite/files/java_icons/$file[id].png")?"<img src='/mysite/files/java_icons/$file[id].png' height='16'/>":"".(is_file(H."/mysite/files/file_icons/$file[ras].png")?"<img src='/mysite/files/file_icons/$file[ras].png'/>":"<img src='/mysite/files/unknown_file.png'/>")."")."":"<img src='/mysite/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'?"/mysite/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)."</div>n";
if($dir_situated['mother']!=0)echo "<div class='d2'><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></div>n";
else echo "<div class='d2'><font color='green'>Категория ЗО:</font> <b><a href='?dir=$dir_situated[id]'>".htmlspecialchars($dir_situated['name'])."</a></b></div>n";
if($ank['pol']==0)$a='a';else $a=null;
echo "<div class='d2'><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 "<a href='?replace=$file_akt[id]'>[переместить]</a> <a href='?dir=$file_akt[mother]&mf=$file_akt[id]&del_f'>[удалить]</a></div>";
echo "<div class='d1'><img src='/images/others/back.png'> <a href='?dir=$file_akt[mother]'>Назад</a></div>n";
require_once ("../../core/cuctema/foot.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 = array();
$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(mysql_result(mysql_query("SELECT COUNT(*) FROM `shared_zone` WHERE `id` = '$dir[id]' LIMIT 1"),0)==0 && $dir['id']!=0)
{
$set['title']='Зона обмена - Ошибка';
require_once ("../../core/cuctema/head.php");
title();
aut();
err();
echo"<div class='hide'>Ошибка!</div>n";
require_once ("../../core/cuctema/foot.php");
}
$set['title']="Зона обмена".(isset($soo)?" - Сообщество "$soo[name]"":null)."".($dir['id']!=0?" - ".htmlspecialchars($dir['name'])."":null)."";
require_once ("../../core/cuctema/head.php");
title();
aut();
err();
echo "<div class='time'>n";
if($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)))
{
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=my_esc(stripcslashes(htmlspecialchars($_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]' class='d2'>n";
echo"Название:<br/><input type='text' name='dir_name' value=''><br/>n";
echo"<input type='submit' value='Создать' name='add_dir'></form><br/>n";
require_once ("../../core/cuctema/foot.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]' class='d2'>Имя папки:(от 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='d1'><img src='/style/icons/delete.png'/> <a href='?dir=$dir[id]&uprav=pre_del'><span style='color:red'>×</span> Удалить папку</a></div>n";
require_once ("../../core/cuctema/foot.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='d1'>Вы уверены, что хотите удалить эту папку и все вложенные в неё файлы?<br /><a href='?dir=$dir[id]'>Нет</a> <a href='?dir=$dir[id]&del_dir'>Да</a></div>n";
require_once ("../../core/cuctema/foot.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='d1'>Вы уверены, что хотите удалить этот файл?<br /><a href='?dir=$dir[mother]'>Нет</a> <a href='?dir=$dir[id]&mf=$mf&del_f_ok'>Да</a></div>n";
require_once ("../../core/cuctema/foot.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)."");
$num = 0;
while($post=mysql_fetch_assoc($q))
{
if ($num==1){
echo "<div class='d1'>";
$num=0;
}else{
echo "<div class='d2'>";
$num=1;}
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='dir.png' /> <a href='?dir=$post[id]&replace=$replace[id]'>".htmlspecialchars($post['name'])."</a> ($k_p$k_n)<br/>n";
else echo "<img src='/mysite/files/images/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='/images/others/up.png' alt='o'></a> <a href='?dir=$dir[id]&moderate&page=$page&down=$post[id]'><img src='/images/others/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='/mysite/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."mysite/files/screens/$file[id].png"))echo "<div><a href='/mysite/files/?file=$file[id]&user=$ank[id]'><img class='show_foto' src='/mysite/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='/mysite/files/?file=$file[id]&user=$ank[id]'>n";
echo "".($file['ras']=='jar' && is_file(H."/mysite/files/java_icons/$file[id].png")?"<img src='/mysite/files/java_icons/$file[id].png' height='16'/>":"".(is_file(H."/mysite/files/file_icons/$file[ras].png")?"<img src='/mysite/files/file_icons/$file[ras].png'/>":"<img src='/mysite/files/images/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='black123'>";
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>";
}
echo "<div class='d2'><script type='text/javascript'> document.write('Ваше разрешение экрана: <b>'+screen.width+'×'+screen.height+'</b>'); </script></div>";
if(isset($soo) && (isset($help) || isset($adm)) || !isset($soo) && (!isset($_GET['replace']) && ($user['group_access']==4 || $user['group_access']>=7)))
{
echo "<div class='d2'><img src='/mysite/files/images/dir+.png' /><a href='?dir=$dir[id]&uprav=new_dir'> Создать папку</a>";
echo "<br/><img src='/mysite/files/images/multi_choice.png'/> <a href='?dir=$dir[id]&page=$page&activate_multichecker=1&CK=".rand(1000000,9999999)."'>Мультивыбор файлов</a>";
echo "<br/><img src='/mysite/files/images/dir_management.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='foot'><img src='/style/icons/back.png'> <a href='?dir=$dir[mother]&replace=$replace[id]'>Назад</a></div>n";
elseif($dir['id']!=0)echo "<div class='d1'><img src='/images/others/back.png'> <a href='?dir=$dir[mother]'>Назад</a></div>";
if(isset($dz))echo "<div class='d1'><a href='?moders'>Модераторы</a> | <a href='?rules'>Правила</a></div>";
require_once ("../../core/cuctema/foot.php");
?>