Файл: mylaf.ru/user/conference/index.php
Строк: 107
<?php
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';
$ank=get_user($_GET['user']);
if ($ank['id']==0)header("location:/index.php");
if ($user['id']!=$ank['id'])header("location:/index.php");
$div="<div class='gmenu'>";
$d="<div class='forum'>";
if (isset($_GET['add'])){
if ($user['id']!=$ank['id'])header("location:/index.php");
$set['title']="Новая конференция";
include_once '../../sys/inc/thead.php';
title();
aut();
if (isset($_POST['ok'])){
$link="".rand(100000000000000,999999999999999)."";
$name=my_esc($_POST['name']);
if (strlen2($name)>30)$err[]="Длинная тема конференции";
if (strlen2($name)<3)$err[]="Короткая тема конференции";
if (!isset($err)){
mysql_query("INSERT INTO `conference` (`link`, `id_user`, `time`, `name`) values('$link', '$user[id]', '$time', '$name')");
$uid=mysql_insert_id();
mysql_query("INSERT INTO `conference_users` (`id_conference`, `id_user`) values('$uid', '$user[id]')");
header("location:conference.php?link=$link");
}
}
err();
echo "<form method='post' action='?user=$ank[id]&add'>";
echo "<b>Тема конференции:</b><br/><input type='text' name='name' style='width:90%'><br/>";
echo "<input type='submit' name='ok' style= 'width:90%' value='Создать конференцию'><a href='?user=$ank[id]'>Отмена</a></form>";
include_once '../../sys/inc/tfoot.php';
}
$set['title']="$ank[nick] - Мои конференции";
include_once '../../sys/inc/thead.php';
title();
aut();
echo "<a href='?user=$ank[id]&add'>$div<img src='img/new.png'> Начать новую конференцию</div></a>";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `conference` WHERE `id_user` = '".intval($_GET['user'])."'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($k_post==0){
msg("У вас еще небыло конференций");
}
$q=mysql_query("SELECT * FROM `conference` WHERE `id_user` = '".intval($_GET['user'])."' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_array($q)){
$icons=" <img src='img/conf.png'> ";
echo "<a href='conference.php?link=$post[link]'>$d $icons ".htmlspecialchars($post['name'])."</div></a>";
}
include_once '../../sys/inc/tfoot.php';
?>