Файл: group.php
Строк: 53
<?php
/**
* @author [FaNiska]
* @copyright 2009
* Загруз центр
* Предложения, идеи, вопросы и об ошибках писать в icq 65-64-538 или на mobi-m-ru@ya.ru
*/
include 'inc/db_connect.php';
include 'inc/function.php';
include 'inc/set.php';
if (isset($_GET['id']) && isset($_GET['c']))
{
$id = valid_int($_GET['id']);
$table = clean($_GET['c']);
} else
{
header("location: index.php?error=invalid_id");
exit();
}
$group_info = mysql_fetch_array(mysql_query('SELECT * FROM `' . $table . '` WHERE `id` = ' . $id . ' LIMIT 1'));
if (!is_dir($group_info['s_name']))
{
header("location: index.php?error=group_not_found");
exit();
}
include 'inc/head.php';
$head_cat = mysql_fetch_array(mysql_query("SELECT `s_name`, `sizetime` FROM `$table` WHERE `id`='$id';"));
if ($head_cat['sizetime'] < ($time - 3600))
{
$allfiles = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `' . $table . '` WHERE `folder` LIKE "' . $head_cat['s_name'] . '%" AND `type`=2;'));
$allfiles = $allfiles['0'];
$allnew = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `' . $table . '` WHERE `folder` LIKE "' . $head_cat['s_name'] . '%" AND `type`=2 AND `up_time`>' . $new_time . ';'));
$allnew = '/+' . $allnew['0'];
if ($id != 0)
{
mysql_query("UPDATE `$table` SET `p_i_f`='" . $allfiles . "i" . $allnew . "', `sizetime`='$time' WHERE `id`=$id LIMIT 1;");
} else
{
mysql_query("UPDATE `category` SET `p_i_f`='" . $allfiles . "i" . $allnew . "', `sizetime`='$time' WHERE `s_name` = 'files/$table' LIMIT 1;");
}
}
switch ($group_info['gr_id'])
{
case '1':
include ('inc_group/img_albom.php');
break;
case '2':
include ('inc_group/java_group.php');
break;
case '3':
include ('inc_group/muz_albom.php');
break;
case '4':
include ('inc_group/soft_pack.php');
break;
case '5':
include ('inc_group/vid_group.php');
break;
}
include_once 'inc/str_g.php';
echo '<div><img src='ico/101.gif' alt='+' width='16' height='16'/> <a href="comment.php?c=' . $table . '&id=' . $id . '">Комментарии (' . mysql_result(mysql_query("SELECT COUNT(*) FROM `comment` WHERE `file`='$table|$id'"), 0) . ')</a></div>';
echo '<div><img src='ico/96.gif' alt='+' width='16' height='16'/> <a href="mail.php?c=' . $table . '&id=' . $id . '">Отправить ссылку на e-mail</a></div>';
include 'inc/foot.php';
?>