Добро пожаловать, Гость!
:: + Добавить ссылку через биллинг
:: + Добавить ссылку анонимно
❤️МИР, ЯРКИХ ЗНАКОМСТВ И ОБЩЕНИЯ!❤️
❤️МИР, ЯРКИХ ЗНАКОМСТВ И ОБЩЕНИЯ!❤️
Файлы группы - Страница 1
Баги/обновления движка | Файлы группы
Искатель
:
Подскажите где здесь ошибка страницу открывает только вверх.
<?
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/user.php';
$group=mysql_fetch_assoc(mysql_query("SELECT * FROM `group` where `id` = '".intval($_GET['id_group'])."' LIMIT 1"));
if(mysql_result(mysql_query("SELECT COUNT(`id`) FROM `group` WHERE `id` = '$group[id]'"), 0)==NULL){
include_once '../sys/inc/thead.php';
msg('Такой Группы нет');
include_once '../sys/inc/tfoot.php';
exit;
}
if(mysql_result(mysql_query("SELECT COUNT(`id`) FROM `group` WHERE `id` = '$group[id]' AND `files` = '1'"), 0)==1){
include_once '../sys/inc/thead.php';
msg('Файлы выключены');
include_once '../sys/inc/tfoot.php';
exit;
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `group` WHERE `id` = '$group[id]' AND `read` = '0'"), 0)==0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND`act` = '1'"), 0)==0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `group` WHERE `id` = '$group[id]' AND `admin` = ''"), 0)==0){
include_once '../sys/inc/thead.php';
msg('Читать могут только участники');
include_once '../sys/inc/tfoot.php';
exit;
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `group_ban` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND `time` > '".time()."'"), 0)==1){
include_once '../sys/inc/thead.php';
$ban=mysql_fetch_assoc(mysql_query("SELECT * FROM `group_ban` where `id_user` = '".$user['id']."' LIMIT 1"));
echo 'Вы забанены до '.vremja($ban['time']).' <br />Причина '.output_text($ban['opis']).'<br />';
include_once '../sys/inc/tfoot.php';
exit;
}
only_reg();
if(isset($_GET['id']))$v=mysql_fetch_assoc(mysql_query("SELECT * FROM `group_file_user` WHERE `id` = '".intval($_GET['id'])."' AND `id_group`='$group[id]'"));
$files=mysql_fetch_assoc(mysql_query("SELECT * FROM `group_file_album` WHERE `id` = '".$v['id_album']."' AND `id_group`='$group[id]'"));
$set['title']='Файлы - '.output_text($v['name']);
include_once '../sys/inc/thead.php';
title();
err();
//aut();
if(!$v)header("Location: index.php");
if(isset($files['pass']) && $files['pass']!=NULL && @$_SESSION['pass']!=$files['pass'] && $files['id_user']!=$user['id'] && $user['level']<4 && mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND `level` > '0'"), 0)==0)header("Location: dir.php?id_group=".$group['id']."&id=".$files['id']);
$file=H."gp/file/files/$v[id].file";
$anks=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '".$v['id_user']."' LIMIT 1"));
########download######
if(isset($_GET['download'])){
include_once '../sys/inc/downloadfile.php';
DownloadFile($file, $v['name'].'.'.$v['ras'], ras_to_mime($v['ras']));
exit;
}
###########end########
######Редактирование#####
if(isset($_GET['edit'])){
if($v['id_user']!=$user['id'] || $user['level']<1 || mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND `level` > '0'"), 0)==0)header("Location: files.php?id_group=".$group['id']."&id=".$v['id']);
if(isset($_POST['add'])){
$name=mysql_real_escape_string($_POST['name']);
$opis=mysql_real_escape_string($_POST['opis']);
if(strlen2($name)<2)$err='Название не менее 2 символов';
if(!isset($err)){
mysql_query("UPDATE `group_file_user` SET `name` = '".$name."',`opis` = '".$opis."' WHERE `id` = '$v[id]' AND `id_group`='$group[id]' LIMIT 1");
header("Location: files.php?id_group=".$group['id']."&id=".$v['id']);
}
}
echo "<form class='p_m' method='post' action='?id_group=$group[id]&id=$v[id]&edit'>n";
echo "Название:<br />n<input type="text" name="name" value="$v[name]" /><br />n";
echo "Описание:<br />n<textarea name="opis">$v[opis]</textarea><br />n";
echo "<input value="Изменить" name="add" type="submit" />n";
echo "</form>n";
echo "<div class='foot'>n";
echo "<img src='back.png' /> <a href='files.php?id_group=$group[id]∓id=$v[id]'>Назад</a><br />n";
echo "<img src='back.png' /> <a href='dir.php?id_group=$group[id]&id=$v[id_album]'>В категорию</a><br />n";
echo "<img src='back.png' /> <a href='index.php?id_group=$group[id]'>Файлы</a><br />n";
echo "<img src='back.png' /> <a href='/gp/group.php?id=$group[id]'>В группу</a><br />n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
}
######end#######
#####del audio####
if (isset($_GET['delete']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `group_file_user` WHERE `id` = '".$v['id']."' AND `id_group`='$group[id]'"),0)==1)
{
if (isset($user) && ($user['level']>1 || $v['id_user']==$user['id'] || mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND `level` > '0'"), 0)==0)){
unlink(H."gp/file/files/$v[id].audio");
mysql_query("DELETE FROM `group_file_komm` WHERE `id_album` = '$v[id_album]' AND `id_group`='$group[id]'");
mysql_query("DELETE FROM `group_file_user` WHERE `id` = '$v[id]' AND `id_group`='$group[id]'");
header("Location: dir.php?id_group=".$group['id']."&id=".$v['id_album']);
}
}
if (isset($_GET['delv']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `group_file_user` WHERE `id` = '".$v['id']."' AND `id_group`='$group[id]'"),0)==1)
{
if (isset($user) && ($user['level']>1 || $v['id_user']==$user['id'] || mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND `level` > '0'"), 0)==0)){
echo "<div class='err'>Вы уверены? <a href='?id_group=$group[id]&id=$v[id]&delete'>Да</a> | <a href='?id_group=$group[id]&id=$v[id]'>Нет</a></div>";
}
}
#########
echo "<div class='p_m'>";
echo "<img src='name.gif' /> ".output_text($v['name'])."<br />";
if($v['opis']!=NULL)echo "<img src='opis.gif' /> ".output_text($v['opis'])."<br />";
echo "<img src='user.gif' /> ";
echo online($anks['id'])." ".name($anks['id'])."<br />";
echo "<img src='time.png' /> ".vremja($v['time'])."<br />";
echo "<img src='down.png' /> <a href='?id_group=$group[id]&id=$v[id]&download'>Скачать</a> (".size_file(filesize($file)).")<br />";
$rating=mysql_result(mysql_query("SELECT SUM(rating) FROM `group_file_rating` WHERE `id_file` = '$v[id]' AND `id_group`='$group[id]' "),0);
if($rating==NULL)$rating=0;
echo "<img src='votes.png' /> ".$rating."%<br />";
#############raiting##########
if(isset($user) && isset($_GET['up']) && $_GET['up']>0 && $_GET['up']<6 && mysql_result(mysql_query("SELECT COUNT(*) FROM `group_file_rating` WHERE `id_file` = '$v[id]' AND `id_user` = '$user[id]' AND `id_group`='$group[id]'"),0)==0){
mysql_query("INSERT INTO `group_file_rating` (`id_user`, `id_file`, `rating`, `id_group`) values('$user[id]', '$v[id]', '".intval($_GET['up'])."','$group[id]')");
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `group_file_rating` WHERE `id_file` = '$v[id]' AND `id_user` = '$user[id]' AND `id_group`='$group[id]'"),0)==0)echo "<a href='?id_group=$group[id]&id=$v[id]&up=1'><img src='rating/1.png' alt='+1'></a><a href='?id_group=$group[id]&id=$v[id]&up=2'><img src='rating/2.png' alt='+2'></a><a href='?id_group=$group[id]&id=$v[id]&up=3'><img src='rating/3.png' alt='+3'></a><a href='?id_group=$group[id]&id=$v[id]&up=4'><img src='rating/4.png' alt='+4'></a><a href='?id_group=$group[id]&id=$v[id]&up=5'><img src='rating/5.png' alt='+5'></a><br />";
$q=mysql_query("SELECT * FROM `group_file_user` WHERE `id_album` = '$v[id_album]' AND `id` < '$v[id]' AND `id_group`='$group[id]' ORDER BY `id` DESC LIMIT 1");
echo "<center>";
while ($post = mysql_fetch_assoc($q))
{
echo "<a href='files.php?id_group=$group[id]&id=$post[id]'>« ".output_text($post['name'])."</a>";
}
echo " | ";
$q=mysql_query("SELECT * FROM `group_file_user` WHERE `id_album` = '$v[id_album]' AND `id` > '$v[id]' AND `id_group`='$group[id]' ORDER BY `id` ASC LIMIT 1");
while ($post = mysql_fetch_assoc($q))
{
echo " <a href='files.php?id_group=$group[id]&id=$post[id]'>".output_text($post['name'])." »</a>";
}
echo "</center>";
echo "</div>";
############################
if (isset($user) && (isset($_POST['msg']) || isset($_GET['otvet']))){
if(isset($_GET['otvet']))$otvet=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '".intval($_GET['otvet'])."' LIMIT 1"));
$msg=mysql_real_escape_string($_POST['msg']);
if (isset($_POST['translit']) && $_POST['translit']==1)$msg=translit($msg);
if (strlen2($msg)>512){$err='Сообщение слишком длинное';}
elseif (strlen2($msg)<2){$err='Короткое сообщение';}
elseif (mysql_result(mysql_query("SELECT COUNT(*) FROM `group_file_komm` WHERE `id_album` = '$v[id]' AND `id_user` = '$user[id]' AND `msg` = '".$msg."'AND `id_group`='$group[id]' LIMIT 1"),0)!=0){$err='Ваше сообщение повторяет предыдущее';}
elseif(!isset($err)){
mysql_query("INSERT INTO `group_file_komm` (`id_user`, `time`, `msg`, `id_album`, `id_group`) values('$user[id]', '$time', '".$msg."',
Файлы группы
6 Июня 2013Подскажите где здесь ошибка страницу открывает только вверх.
<?
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/user.php';
$group=mysql_fetch_assoc(mysql_query("SELECT * FROM `group` where `id` = '".intval($_GET['id_group'])."' LIMIT 1"));
if(mysql_result(mysql_query("SELECT COUNT(`id`) FROM `group` WHERE `id` = '$group[id]'"), 0)==NULL){
include_once '../sys/inc/thead.php';
msg('Такой Группы нет');
include_once '../sys/inc/tfoot.php';
exit;
}
if(mysql_result(mysql_query("SELECT COUNT(`id`) FROM `group` WHERE `id` = '$group[id]' AND `files` = '1'"), 0)==1){
include_once '../sys/inc/thead.php';
msg('Файлы выключены');
include_once '../sys/inc/tfoot.php';
exit;
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `group` WHERE `id` = '$group[id]' AND `read` = '0'"), 0)==0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND`act` = '1'"), 0)==0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `group` WHERE `id` = '$group[id]' AND `admin` = ''"), 0)==0){
include_once '../sys/inc/thead.php';
msg('Читать могут только участники');
include_once '../sys/inc/tfoot.php';
exit;
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `group_ban` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND `time` > '".time()."'"), 0)==1){
include_once '../sys/inc/thead.php';
$ban=mysql_fetch_assoc(mysql_query("SELECT * FROM `group_ban` where `id_user` = '".$user['id']."' LIMIT 1"));
echo 'Вы забанены до '.vremja($ban['time']).' <br />Причина '.output_text($ban['opis']).'<br />';
include_once '../sys/inc/tfoot.php';
exit;
}
only_reg();
if(isset($_GET['id']))$v=mysql_fetch_assoc(mysql_query("SELECT * FROM `group_file_user` WHERE `id` = '".intval($_GET['id'])."' AND `id_group`='$group[id]'"));
$files=mysql_fetch_assoc(mysql_query("SELECT * FROM `group_file_album` WHERE `id` = '".$v['id_album']."' AND `id_group`='$group[id]'"));
$set['title']='Файлы - '.output_text($v['name']);
include_once '../sys/inc/thead.php';
title();
err();
//aut();
if(!$v)header("Location: index.php");
if(isset($files['pass']) && $files['pass']!=NULL && @$_SESSION['pass']!=$files['pass'] && $files['id_user']!=$user['id'] && $user['level']<4 && mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND `level` > '0'"), 0)==0)header("Location: dir.php?id_group=".$group['id']."&id=".$files['id']);
$file=H."gp/file/files/$v[id].file";
$anks=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '".$v['id_user']."' LIMIT 1"));
########download######
if(isset($_GET['download'])){
include_once '../sys/inc/downloadfile.php';
DownloadFile($file, $v['name'].'.'.$v['ras'], ras_to_mime($v['ras']));
exit;
}
###########end########
######Редактирование#####
if(isset($_GET['edit'])){
if($v['id_user']!=$user['id'] || $user['level']<1 || mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND `level` > '0'"), 0)==0)header("Location: files.php?id_group=".$group['id']."&id=".$v['id']);
if(isset($_POST['add'])){
$name=mysql_real_escape_string($_POST['name']);
$opis=mysql_real_escape_string($_POST['opis']);
if(strlen2($name)<2)$err='Название не менее 2 символов';
if(!isset($err)){
mysql_query("UPDATE `group_file_user` SET `name` = '".$name."',`opis` = '".$opis."' WHERE `id` = '$v[id]' AND `id_group`='$group[id]' LIMIT 1");
header("Location: files.php?id_group=".$group['id']."&id=".$v['id']);
}
}
echo "<form class='p_m' method='post' action='?id_group=$group[id]&id=$v[id]&edit'>n";
echo "Название:<br />n<input type="text" name="name" value="$v[name]" /><br />n";
echo "Описание:<br />n<textarea name="opis">$v[opis]</textarea><br />n";
echo "<input value="Изменить" name="add" type="submit" />n";
echo "</form>n";
echo "<div class='foot'>n";
echo "<img src='back.png' /> <a href='files.php?id_group=$group[id]∓id=$v[id]'>Назад</a><br />n";
echo "<img src='back.png' /> <a href='dir.php?id_group=$group[id]&id=$v[id_album]'>В категорию</a><br />n";
echo "<img src='back.png' /> <a href='index.php?id_group=$group[id]'>Файлы</a><br />n";
echo "<img src='back.png' /> <a href='/gp/group.php?id=$group[id]'>В группу</a><br />n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
}
######end#######
#####del audio####
if (isset($_GET['delete']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `group_file_user` WHERE `id` = '".$v['id']."' AND `id_group`='$group[id]'"),0)==1)
{
if (isset($user) && ($user['level']>1 || $v['id_user']==$user['id'] || mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND `level` > '0'"), 0)==0)){
unlink(H."gp/file/files/$v[id].audio");
mysql_query("DELETE FROM `group_file_komm` WHERE `id_album` = '$v[id_album]' AND `id_group`='$group[id]'");
mysql_query("DELETE FROM `group_file_user` WHERE `id` = '$v[id]' AND `id_group`='$group[id]'");
header("Location: dir.php?id_group=".$group['id']."&id=".$v['id_album']);
}
}
if (isset($_GET['delv']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `group_file_user` WHERE `id` = '".$v['id']."' AND `id_group`='$group[id]'"),0)==1)
{
if (isset($user) && ($user['level']>1 || $v['id_user']==$user['id'] || mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]' AND `id_user` = '$user[id]' AND `level` > '0'"), 0)==0)){
echo "<div class='err'>Вы уверены? <a href='?id_group=$group[id]&id=$v[id]&delete'>Да</a> | <a href='?id_group=$group[id]&id=$v[id]'>Нет</a></div>";
}
}
#########
echo "<div class='p_m'>";
echo "<img src='name.gif' /> ".output_text($v['name'])."<br />";
if($v['opis']!=NULL)echo "<img src='opis.gif' /> ".output_text($v['opis'])."<br />";
echo "<img src='user.gif' /> ";
echo online($anks['id'])." ".name($anks['id'])."<br />";
echo "<img src='time.png' /> ".vremja($v['time'])."<br />";
echo "<img src='down.png' /> <a href='?id_group=$group[id]&id=$v[id]&download'>Скачать</a> (".size_file(filesize($file)).")<br />";
$rating=mysql_result(mysql_query("SELECT SUM(rating) FROM `group_file_rating` WHERE `id_file` = '$v[id]' AND `id_group`='$group[id]' "),0);
if($rating==NULL)$rating=0;
echo "<img src='votes.png' /> ".$rating."%<br />";
#############raiting##########
if(isset($user) && isset($_GET['up']) && $_GET['up']>0 && $_GET['up']<6 && mysql_result(mysql_query("SELECT COUNT(*) FROM `group_file_rating` WHERE `id_file` = '$v[id]' AND `id_user` = '$user[id]' AND `id_group`='$group[id]'"),0)==0){
mysql_query("INSERT INTO `group_file_rating` (`id_user`, `id_file`, `rating`, `id_group`) values('$user[id]', '$v[id]', '".intval($_GET['up'])."','$group[id]')");
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `group_file_rating` WHERE `id_file` = '$v[id]' AND `id_user` = '$user[id]' AND `id_group`='$group[id]'"),0)==0)echo "<a href='?id_group=$group[id]&id=$v[id]&up=1'><img src='rating/1.png' alt='+1'></a><a href='?id_group=$group[id]&id=$v[id]&up=2'><img src='rating/2.png' alt='+2'></a><a href='?id_group=$group[id]&id=$v[id]&up=3'><img src='rating/3.png' alt='+3'></a><a href='?id_group=$group[id]&id=$v[id]&up=4'><img src='rating/4.png' alt='+4'></a><a href='?id_group=$group[id]&id=$v[id]&up=5'><img src='rating/5.png' alt='+5'></a><br />";
$q=mysql_query("SELECT * FROM `group_file_user` WHERE `id_album` = '$v[id_album]' AND `id` < '$v[id]' AND `id_group`='$group[id]' ORDER BY `id` DESC LIMIT 1");
echo "<center>";
while ($post = mysql_fetch_assoc($q))
{
echo "<a href='files.php?id_group=$group[id]&id=$post[id]'>« ".output_text($post['name'])."</a>";
}
echo " | ";
$q=mysql_query("SELECT * FROM `group_file_user` WHERE `id_album` = '$v[id_album]' AND `id` > '$v[id]' AND `id_group`='$group[id]' ORDER BY `id` ASC LIMIT 1");
while ($post = mysql_fetch_assoc($q))
{
echo " <a href='files.php?id_group=$group[id]&id=$post[id]'>".output_text($post['name'])." »</a>";
}
echo "</center>";
echo "</div>";
############################
if (isset($user) && (isset($_POST['msg']) || isset($_GET['otvet']))){
if(isset($_GET['otvet']))$otvet=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '".intval($_GET['otvet'])."' LIMIT 1"));
$msg=mysql_real_escape_string($_POST['msg']);
if (isset($_POST['translit']) && $_POST['translit']==1)$msg=translit($msg);
if (strlen2($msg)>512){$err='Сообщение слишком длинное';}
elseif (strlen2($msg)<2){$err='Короткое сообщение';}
elseif (mysql_result(mysql_query("SELECT COUNT(*) FROM `group_file_komm` WHERE `id_album` = '$v[id]' AND `id_user` = '$user[id]' AND `msg` = '".$msg."'AND `id_group`='$group[id]' LIMIT 1"),0)!=0){$err='Ваше сообщение повторяет предыдущее';}
elseif(!isset($err)){
mysql_query("INSERT INTO `group_file_komm` (`id_user`, `time`, `msg`, `id_album`, `id_group`) values('$user[id]', '$time', '".$msg."',
Комментарии:
Монстрик
6 Июня 2013
Не скрывал бы ошибки, сразу показало где. Я в двух местах увидел.
Первая
echo online($anks['id'])
." ".name($anks['id'])
вторая, при ответе будет вылазить
echo "Сообщение:<br /
>n<textarea name="msg
">$otvet[ank_name] $
otvet[ank_family], </
textarea><br />n";
функции name нету, туда писать $anks['nick'] надо, во втором случае $ank[nick].
Не скрывал бы ошибки, сразу показало где. Я в двух местах увидел.
Первая
echo online($anks['id'])
." ".name($anks['id'])
вторая, при ответе будет вылазить
echo "Сообщение:<br /
>n<textarea name="msg
">$otvet[ank_name] $
otvet[ank_family], </
textarea><br />n";
функции name нету, туда писать $anks['nick'] надо, во втором случае $ank[nick].