Файл: setk/plugins/notes/list.php
Строк: 1114
<?
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';
/* Бан пользователя */
if (isset($user) && mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `razdel` = 'notes' AND `id_user` = '$user[id]' AND (`time` > '$time' OR `view` = '0')"), 0)!=0)
{
header('Location: /ban.php?'.SID);exit;
}
$po = mysql_query("SELECT * FROM `notes` WHERE `id` = '". intval($_GET['id']) ."'");
if (!mysql_num_rows($po)) {
header('Location: /index.php?');exit;
}
$notes = mysql_fetch_assoc(mysql_query("SELECT * FROM `notes` WHERE `id` = '". intval($_GET['id']) ."' LIMIT 1"));
$avtor=get_user($notes['id_user']);
if (isset($user))
$count=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_count` WHERE `id_user` = '".$user['id']."' AND `id_notes` = '".$notes['id']."' LIMIT 1"),0);
// Закладки
$markinfo=mysql_result(mysql_query("SELECT COUNT(*) FROM `mark_notes` WHERE `id_list` = '".$notes['id']."'"),0);
if (isset($user))
mysql_query("UPDATE `notification` SET `read` = '1' WHERE `type` = 'notes_komm' AND `id_user` = '$user[id]' AND `id_object` = '$notes[id]'");
if (isset($_GET['deletes']) && isset($_GET['true']) && ($user['id']==$avtor['id'] || user_access('notes_delete')) && mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_files` WHERE `id` = '".intval($_GET['deletes'])."'"),0)==1){
$file=mysql_fetch_assoc(mysql_query("SELECT * FROM `notes_files` WHERE `id` = '".intval($_GET['deletes'])."'LIMIT 1 "));
if (is_file(H.'sys/notes/files/'.$file['id'].'.dat')){
mysql_query("DELETE FROM `notes_files` WHERE `id` = '$file[id]' LIMIT 1 ");
unlink(H.'sys/notes/files/'.$file['id'].'.dat');
}
if (is_file(H.'sys/notes/screen/128/'.$file['id'].'.gif') && (H.'sys/notes/screen/320/'.$file['id'].'.gif') ){
unlink(H.'sys/notes/screen/128/'.$file['id'].'.gif');
unlink(H.'sys/notes/screen/320/'.$file['id'].'.gif');
}
header("Location: ?id=$notes[id]");
$_SESSION['message'] = 'Файл удален';
exit;
}
/*
================================
Создаем опрос
================================
*/
if(isset($_GET['vote_add']) && isset($user) && $notes['votes']=='0' && (user_access('notes_delete') || $user['id']==$avtor['id']))
{
$set['title']='Дневник - ' . htmlspecialchars($notes['name']) . ' ';
include_once '../../sys/inc/thead.php';
title();
aut();
if (isset($_POST['save']))
{
$vote_text=$_POST['vote_text'];
$variant_1=$_POST['variant_1'];
$variant_2=$_POST['variant_2'];
$variant_3=$_POST['variant_3'];
$variant_4=$_POST['variant_4'];
$variant_5=$_POST['variant_5'];
$variant_6=$_POST['variant_6'];
$variant_7=$_POST['variant_7'];
if (($_POST['times'])==NULL){
$times='0';
}
else
{
$times=$time+$_POST['times'];
}
if(strlen2($vote_text)<1)
{
$_SESSION['message'] = 'Заполните тему опроса !';
$err='';
header("Location: list.php?id=$notes[id]&vote_add");
exit;
}
if(strlen2($vote_text)>40)
{
$_SESSION['message'] = 'В теме опроса нужно писать меньше !';
$err='';
header("Location: list.php?id=$notes[id]&vote_add");
exit;
}
if(strlen2($variant_1)<1)
{
$_SESSION['message'] = 'Заполните варианты ответов !';
$err='';
header("Location: list.php?id=$notes[id]&vote_add");
}
if(strlen2($variant_2)<1)
{
$_SESSION['message'] = 'Заполните варианты ответов !';
$err='';
header("Location: list.php?id=$notes[id]&vote_add");
}
if (!isset($err)){
mysql_query("UPDATE `notes` SET `times` = '$times' WHERE `id` = '$notes[id]' LIMIT 1");
mysql_query("UPDATE `notes` SET `votes` = '1' WHERE `id` = '$notes[id]' LIMIT 1");
mysql_query("UPDATE `notes` SET `votes_text` = '".htmlspecialchars($vote_text)."' WHERE `id` = '$notes[id]' LIMIT 1");
mysql_query("INSERT INTO `notes_votes` (`id_notes`, `variant`, `number`) VALUES ('$notes[id]', '$variant_1', '1')");
mysql_query("INSERT INTO `notes_votes` (`id_notes`, `variant`, `number`) VALUES ('$notes[id]', '$variant_2', '2')");
mysql_query("INSERT INTO `notes_votes` (`id_notes`, `variant`, `number`) VALUES ('$notes[id]', '$variant_3', '3')");
mysql_query("INSERT INTO `notes_votes` (`id_notes`, `variant`, `number`) VALUES ('$notes[id]', '$variant_4', '4')");
mysql_query("INSERT INTO `notes_votes` (`id_notes`, `variant`, `number`) VALUES ('$notes[id]', '$variant_5', '5')");
mysql_query("INSERT INTO `notes_votes` (`id_notes`, `variant`, `number`) VALUES ('$notes[id]', '$variant_6', '6')");
mysql_query("INSERT INTO `notes_votes`(`id_notes`, `variant`, `number`) VALUES ('$notes[id]', '$variant_7', '7')");
$_SESSION['message'] = 'Опрос добавлен !';
header("Location: list.php?id=$notes[id]");
}
}
echo "<div class="foot">n";
echo "<img src='/style/icons/str2.gif' alt='*'> <a href='index.php'>Дневники</a> | <a href='/info.php?id=$avtor[id]'>$avtor[nick]</a>n";
echo " | <a href='list.php?id=$notes[id]'>" . с($notes['name']) . "</a> | <b>Добавить опрос</b>";
echo "</div>n";
echo "<div class='nav1'>";
echo "<img src='/style/icons/votes.png'> <b>Тема опроса:</b> (40 символов)<br />n";
echo "</div>";
echo "<div class='mess'>";
echo "<form action="list.php?id=$notes[id]&vote_add" method="post" >n";
echo "<textarea name='vote_text'></textarea></div>n";
echo "<div class='nav1'>";
echo "<img src='/style/icons/comment.png'> <b>Вариаты ответов:</b> (20 символов)<br />n";
echo "</div>";
echo "<div class='mess'>";
echo "1.<input type='text' name='variant_1' maxlength='20'/><br />n";
echo "2.<input type='text' name='variant_2' maxlength='20'/><br />n";
echo "3.<input type='text' name='variant_3' maxlength='20'/><br />n";
echo "4.<input type='text' name='variant_4' maxlength='20'/><br />n";
echo "5.<input type='text' name='variant_5' maxlength='20'/><br />n";
echo "6.<input type='text' name='variant_6' maxlength='20'/><br />n";
echo "7.<input type='text' name='variant_7' maxlength='20'/><br />n";
echo "Дата окончания:</br>";
echo "<select name='times'>n";
echo "<option value='' selected='selected'>Бессрочное</option><option value='86400'>1 День</option><option value='259200'>3 Дня</option><option value='604800'>1 Неделю</option><option value='2419200'>1 Месяц</option><option value='2419200'>3 Месяца</option></select></br>n";
echo "<small>* Два варианта оязательны для заполнения</small></br>";
echo "<input value="Добавить" name="save" type="submit" />n";
echo "</div>";
echo "</form>n";
echo "<div class="foot">n";
echo "<img src='/style/icons/str2.gif' alt='*'> <a href='index.php'>Дневники</a> | <a href='/info.php?id=$avtor[id]'>$avtor[nick]</a>n";
echo " | <a href='list.php?id=$notes[id]'>" . htmlspecialchars($notes['name']) . "</a> | <b>Добавить опрос</b>";
echo "</div>n";
include_once '../../sys/inc/tfoot.php';
}
/*
end
*/
/*
================================
Редактируем опрос
================================
*/
if(isset($_GET['vote_edit']) && isset($user) && $notes['votes']=='1' && (user_access('notes_delete') || $user['id']==$avtor['id']))
{
$set['title']='Дневник - ' . htmlspecialchars($notes['name']) . ' ';
include_once '../../sys/inc/thead.php';
title();
aut();
$vote=mysql_query("SELECT * FROM `notes_votes` WHERE `id_notes` = '$notes[id]' ORDER BY `number` ASC");
if (isset($_POST['ok']))
{
mysql_query("DELETE FROM `notes_votes` WHERE `id_notes` = '$notes[id]'");
mysql_query("DELETE FROM `notes_pollen` WHERE `id_notes` = '$notes[id]'");
mysql_query("UPDATE `notes` SET `votes` = '0' WHERE `id` = '$notes[id]'");
mysql_query("UPDATE `notes` SET `votes_text` = '' WHERE `id` = '$notes[id]'");
$_SESSION['message'] = 'Опрос удален !';
header("Location: list.php?id=$notes[id]");
exit;
}
if (isset($_POST['save']))
{
$vote_text=$_POST['vote_text'];
$variant_1=$_POST['variant_1'];
$variant_2=$_POST['variant_2'];
$variant_3=$_POST['variant_3'];
$variant_4=$_POST['variant_4'];
$variant_5=$_POST['variant_5'];
$variant_6=$_POST['variant_6'];
$variant_7=$_POST['variant_7'];
if (($_POST['times'])==NULL){
$times='0';
}
else
{
$times=$time+$_POST['times'];
}
if(strlen2($vote_text)<1)
{
$_SESSION['message'] = 'Заполните тему опроса !';
$err='';
header("Location: list.php?id=$notes[id]&vote_edit");
exit;
}
if(strlen2($vote_text)>40)
{
$_SESSION['message'] = 'В теме опроса нужно писать меньше !';
$err='';
header("Location: list.php?id=$notes[id]&vote_edit");
exit;
}
if(strlen2($variant_1)<1)
{
$_SESSION['message'] = 'Заполните варианты ответов !';
$err='';
header("Location: list.php?id=$notes[id]&vote_edit");
}
if(strlen2($variant_2)<1)
{
$_SESSION['message'] = 'Заполните варианты ответов !';
$err='';
header("Location: list.php?id=$notes[id]&vote_edit");
}
if($_POST['reset']=='1')
{
mysql_query("DELETE FROM `notes_pollen` WHERE `id_notes` = '$notes[id]'");
$_SESSION['message'] = 'Опрос успешно изменен (голоса удалены)';
header("Location: list.php?id=$notes[id]&vote_edit");
exit;
}
else
{
$_SESSION['message']= NULL;
}
if (!isset($err)){
mysql_query("UPDATE `notes` SET `times` = '".intval($times)."' WHERE `id` = '$notes[id]' LIMIT 1");
mysql_query("UPDATE `notes` SET `votes_text` = '".htmlspecialchars($vote_text)."' WHERE `id` = '$notes[id]' LIMIT 1");
mysql_query("UPDATE `notes_votes` SET `variant` = '".htmlspecialchars($variant_1)."' WHERE `id_notes` = '$notes[id]' and `number` = '1' LIMIT 1");
mysql_query("UPDATE `notes_votes` SET `variant` = '".htmlspecialchars($variant_2)."' WHERE `id_notes` = '$notes[id]' and `number` = '2' LIMIT 1");
mysql_query("UPDATE `notes_votes` SET `variant` = '".htmlspecialchars($variant_3)."' WHERE `id_notes` = '$notes[id]' and `number` = '3' LIMIT 1");
mysql_query("UPDATE `notes_votes` SET `variant` = '".htmlspecialchars($variant_4)."' WHERE `id_notes` = '$notes[id]' and `number` = '4' LIMIT 1");
mysql_query("UPDATE `notes_votes` SET `variant` = '".htmlspecialchars($variant_5)."' WHERE `id_notes` = '$notes[id]' and `number` = '5' LIMIT 1");
mysql_query("UPDATE `notes_votes` SET `variant` = '".htmlspecialchars($variant_6)."' WHERE `id_notes` = '$notes[id]' and `number` = '6' LIMIT 1");
mysql_query("UPDATE `notes_votes` SET `variant` = '".htmlspecialchars($variant_7)."' WHERE `id_notes` = '$notes[id]' and `number` = '7' LIMIT 1");
$_SESSION['message'] = 'Опрос успешно изменен';
header("Location: list.php?id=$notes[id]&vote_edit");
exit;
}
}
echo "<div class="foot">n";
echo "<img src='/style/icons/str2.gif' alt='*'> <a href='index.php'>Дневники</a> | <a href='/info.php?id=$avtor[id]'>$avtor[nick]</a>n";
echo " | <a href='list.php?id=$notes[id]'>" . htmlspecialchars($notes['name']) . "</a> | <b>Изменить опрос</b>";
echo "</div>n";
if (isset($_POST['delete']))
{
echo "<div class='mess'>";
echo "<center><img src='/style/icons/delete.png'> Вы действительно хотите удалить опрос?";
echo "<form action="list.php?id=$notes[id]&vote_edit" method="post" >n";
echo "<input value="Да" name="ok" type="submit" />n";
echo "<input value="Нет" name="back" type="submit" />n";
echo "</form>n";
echo "</div></center>";
}
echo "<div class='nav1'>";
echo "<img src='/style/icons/votes.png'> <b>Тема опроса:</b> (40 символов)<br />n";
echo "</div>";
echo "<div class='mess'>";
echo "<form action="list.php?id=$notes[id]&vote_edit" method="post" >n";
echo "<textarea name='vote_text'>".output_text($notes['votes_text'])."</textarea></div>n";
echo "<div class='nav1'>";
echo "<img src='/style/icons/comment.png'> <b>Вариаты ответов:</b> (20 символов)<br />n";
echo "</div>";
if (mysql_num_rows($vote)==0)
{
echo "Ошибка,не найдено ни одного варианта n";
}
else{
echo "<div class='mess'>";
$i=0;
while ($post = mysql_fetch_assoc($vote))
{
$i++;
echo "$i.<input type='text' name='variant_$i' maxlength='20' value='".htmlspecialchars($post['variant'])."' /><br />n";
}
echo "<small>* Два варианта оязательны для заполнения</small></br>";
echo "<select name='times'>n";
echo "<option value=''>Бессрочное</option>
<option value='86400'>1 День</option>
<option value='259200'>3 Дня</option>
<option value='604800' >1 Неделю</option>
<option value='2419200' >1 Месяц</option>
<option value='4838400' >3 Месяца</option>
</select></br>n";
echo "<label><input type="checkbox" name="reset" value="1" /> Обнулить результаты опроса</label><br />n";
echo "<input value="Изменить" name="save" type="submit" />n";
echo "<input value="Удалить опрос" name="delete" type="submit" />n";
echo "</div>";
}
echo "</form>n";
echo "<div class="foot">n";
echo "<img src='/style/icons/str2.gif' alt='*'> <a href='index.php'>Дневники</a> | <a href='/info.php?id=$avtor[id]'>$avtor[nick]</a>n";
echo " | <a href='list.php?id=$notes[id]'>" . htmlspecialchars($notes['name']) . "</a> | <b>Изменить опрос</b>";
echo "</div>n";
include_once '../../sys/inc/tfoot.php';
}
/*
end
*/
/*
================================
Список проголосовавших
================================
*/
if(isset($_GET['pollen']) && $notes['votes']=='1')
{
$set['title']='Список проголосовавших';
include_once '../../sys/inc/thead.php';
title();
aut();
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_pollen` WHERE `id_notes` = '$notes[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `notes_pollen` WHERE `id_notes` = '$notes[id]' ORDER BY `id` ASC LIMIT $start, $set[p_str]");
if (mysql_num_rows($q)==0)
{
echo "<div class='mess'>Никто еще не проголосовал!</div>";
}
while ($post = mysql_fetch_assoc($q))
{
if(isset($num) && $num==1){
echo "<div class='nav1'>";
$num=0;
}else{
echo "<div class='nav2'>";
$num=1;}
$ank2=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
echo "".avatar($ank2['id'])."".group($ank2['id'])." <a href='/info.php?id=$ank2[id]'>$ank2[nick]</a> ".online($ank2['id'])." (".vremja($post['time']).")<br/>n";
echo "</div>";
}
if ($k_page>1)str("/plugins/notes/list.php?id=$notes[id]&pollen",$k_page,$page); // Вывод страниц
echo "<div class='foot'><img src='/style/icons/str2.gif' alt=''/><a href='/plugins/notes/list.php?id=$notes[id]'>Назад</a></div>n";
include_once '../../sys/inc/tfoot.php';
}
/*
end
*/
/*
================================
Список проголосовавших
================================
*/
if(isset($_GET['markinfo']))
{
$set['title']='Кто добавил в закладки';
include_once '../../sys/inc/thead.php';
title();
aut();
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `mark_notes` WHERE `id_list` = '$notes[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `mark_notes` WHERE `id_list` = '$notes[id]' ORDER BY `id` ASC LIMIT $start, $set[p_str]");
if (mysql_num_rows($q)==0)
{
echo "<div class='mess'>Никто еще не добавлял в закладки!</div>";
}
while ($post = mysql_fetch_assoc($q))
{
if(isset($num) && $num==1){
echo "<div class='nav1'>";
$num=0;
}else{
echo "<div class='nav2'>";
$num=1;}
$ank2=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
echo "".avatar($ank2['id'])."".group($ank2['id'])." <a href='/info.php?id=$ank2[id]'>$ank2[nick]</a> ".online($ank2['id'])." (".vremja($post['time']).")<br/>n";
echo "</div>";
}
if ($k_page>1)str("/plugins/notes/list.php?id=$notes[id]&markinfo",$k_page,$page); // Вывод страниц
echo "<div class='foot'><img src='/style/icons/str2.gif' alt=''/><a href='/plugins/notes/list.php?id=$notes[id]'>Назад</a></div>n";
include_once '../../sys/inc/tfoot.php';
}
/*
end
*/
/*
================================
Модуль жалобы на пользователя
и его сообщение либо контент
в зависимости от раздела
================================
*/
if (isset($_GET['spam']) && isset($user))
{
$mess = mysql_fetch_assoc(mysql_query("SELECT * FROM `notes_komm` WHERE `id` = '".intval($_GET['spam'])."' limit 1"));
$spamer = get_user($mess['id_user']);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `spamus` WHERE `id_user` = '$user[id]' AND `id_spam` = '$spamer[id]' AND `razdel` = 'notes_komm' AND `spam` = '".$mess['msg']."'"),0)==0)
{
if (isset($_POST['msg']))
{
if ($mess['id_user']!=$user['id'])
{
$msg=htmlspecialchars($_POST['msg']);
if (strlen2($msg)<3)$err='Укажите подробнее причину жалобы';
if (strlen2($msg)>1512)$err='Длина текста превышает предел в 512 символов';
if(isset($_POST['types'])) $types=intval($_POST['types']);
else $types='0';
if (!isset($err))
{
mysql_query("INSERT INTO `spamus` (`id_object`, `id_user`, `msg`, `id_spam`, `time`, `types`, `razdel`, `spam`) values('$notes[id]', '$user[id]', '$msg', '$spamer[id]', '$time', '$types', 'notes_komm', '".htmlspecialchars($mess['msg'])."')");
$_SESSION['message'] = 'Заявка на рассмотрение отправлена';
header("Location: ?id=$notes[id]&page=".intval($_GET['page'])."&spam=$mess[id]");
exit;
}
}
}
}
$set['title']='Дневник ' . htmlspecialchars($notes['name']) . '';
include_once '../../sys/inc/thead.php';
title();
aut();
err();
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `spamus` WHERE `id_user` = '$user[id]' AND `id_spam` = '$spamer[id]' AND `razdel` = 'notes_komm'"),0)==0)
{
echo "<div class='mess'>Ложная информация может привести к блокировке ника.
Если вас постоянно достает один человек - пишет всякие гадости, вы можете добавить его в черный список.</div>";
echo "<form class='nav1' method='post' action='?id=$notes[id]&page=".intval($_GET['page'])."&spam=$mess[id]'>n";
echo "<b>Пользователь:</b> ";
echo " ".status($spamer['id'])." ".group($spamer['id'])." <a href="/info.php?id=$spamer[id]">$spamer[nick]</a>n";
echo "".medal($spamer['id'])." ".online($spamer['id'])." (".vremja($mess['time']).")<br />";
echo "<b>Нарушение:</b> <font color='green'>".htmlspecialchars($mess['msg'])."</font><br />";
echo "Причина:<br />n<select name='types'>n";
echo "<option value='1' selected='selected'>Спам/Реклама</option>n";
echo "<option value='2' selected='selected'>Мошенничество</option>n";
echo "<option value='3' selected='selected'>Оскорбление</option>n";
echo "<option value='0' selected='selected'>Другое</option>n";
echo "</select><br />n";
echo "Комментарий:$tPanel";
echo "<textarea name="msg"></textarea><br />";
echo "<input value="Отправить" type="submit" />n";
echo "</form>n";
}else{
echo "<div class='mess'>Жалоба на <font color='green'>$spamer[nick]</font> будет рассмотрена в ближайшее время.</div>";
}
echo "<div class='foot'>n";
echo "<img src='/style/icons/str2.gif' alt='*'> <a href='?id=$notes[id]&page=".intval($_GET['page'])."'>Назад</a><br />n";
echo "</div>n";
include_once '../../sys/inc/tfoot.php';
exit;
}
/*
==================================
The End
==================================
*/
// Запись просмотра
if (isset($user) && mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_count` WHERE `id_user` = '".$user['id']."' AND `id_notes` = '".$notes['id']."' LIMIT 1"),0)==0){
mysql_query("INSERT INTO `notes_count` (`id_notes`, `id_user`) VALUES ('$notes[id]', '$user[id]')");
mysql_query("UPDATE `notes` SET `count` = '".($notes['count']+1)."' WHERE `id` = '$notes[id]' LIMIT 1");
}
/*------------очищаем счетчик этого обсуждения-------------*/
if (isset($user))
{
mysql_query("UPDATE `discussions` SET `count` = '0' WHERE `id_user` = '$user[id]' AND `type` = 'notes' AND `id_sim` = '$notes[id]' LIMIT 1");
}
/*---------------------------------------------------------*/
$set['title']='Дневник - ' . htmlspecialchars($notes['name']) . '';
$set['meta_description'] = htmlspecialchars($notes['msg']);
include_once '../../sys/inc/thead.php';
if (isset($_POST['msg']) && isset($user))
{
$msg=htmlspecialchars($_POST['msg']);
if (strlen2($msg)>1024){$err='Сообщение слишком длинное';}
elseif (strlen2($msg)<2){$err='Короткое сообщение';}
elseif (mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_komm` WHERE `id_notes` = '".intval($_GET['id'])."' AND `id_user` = '$user[id]' AND `msg` = '".htmlspecialchars($msg)."' LIMIT 1"),0)!=0){$err='Ваше сообщение повторяет предыдущее';}
elseif(!isset($err)){
/*
==========================
Уведомления об ответах
==========================
*/
if (isset($user) && $respons==TRUE){
$notifiacation=mysql_fetch_assoc(mysql_query("SELECT * FROM `notification_set` WHERE `id_user` = '".$ank_otv['id']."' LIMIT 1"));
if ($notifiacation['komm'] == 1 && $ank_otv['id'] != $user['id'])
mysql_query("INSERT INTO `notification` (`avtor`, `id_user`, `id_object`, `type`, `time`) VALUES ('$user[id]', '$ank_otv[id]', '$notes[id]', 'notes_komm', '$time')");
}
/*
====================================
Обсуждения
====================================
*/
$q = mysql_query("SELECT * FROM `frends` WHERE `user` = '".$notes['id_user']."' AND `i` = '1'");
while ($f = mysql_fetch_array($q))
{
$a=get_user($f['frend']);
$discSet = mysql_fetch_array(mysql_query("SELECT * FROM `discussions_set` WHERE `id_user` = '".$a['id']."' LIMIT 1")); // Общая настройка обсуждений
if ($f['disc_notes']==1 && $discSet['disc_notes']==1) /* Фильтр рассылки */
{
//---------друзьям автора--------------//
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `discussions` WHERE `id_user` = '$a[id]' AND `type` = 'notes' AND `id_sim` = '$notes[id]' LIMIT 1"),0)==0)
{
if ($notes['id_user'] != $a['id'] || $a['id'] != $user['id'])
mysql_query("INSERT INTO `discussions` (`id_user`, `avtor`, `type`, `time`, `id_sim`, `count`) values('$a[id]', '$notes[id_user]', 'notes', '$time', '$notes[id]', '1')");
}
else
{
$disc = mysql_fetch_array(mysql_query("SELECT * FROM `discussions` WHERE `id_user` = '$a[id]' AND `type` = 'notes' AND `id_sim` = '$notes[id]' LIMIT 1"));
if ($notes['id_user'] != $a['id'] || $a['id'] != $user['id'])
mysql_query("UPDATE `discussions` SET `count` = '".($disc['count']+1)."', `time` = '$time' WHERE `id_user` = '$a[id]' AND `type` = 'notes' AND `id_sim` = '$notes[id]' LIMIT 1");
}
//-------------------------------------//
}
}
//-------------отправляем автору------------//
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `discussions` WHERE `id_user` = '$notes[id_user]' AND `type` = 'notes' AND `id_sim` = '$notes[id]' LIMIT 1"),0)==0)
{
if ($notes['id_user'] != $user['id'])
mysql_query("INSERT INTO `discussions` (`id_user`, `avtor`, `type`, `time`, `id_sim`, `count`) values('$notes[id_user]', '$notes[id_user]', 'notes', '$time', '$notes[id]', '1')");
}
else
{
$disc = mysql_fetch_array(mysql_query("SELECT * FROM `discussions` WHERE `id_user` = '$notes[id_user]' AND `type` = 'notes' AND `id_sim` = '$notes[id]' LIMIT 1"));
if ($notes['id_user'] != $user['id'])
mysql_query("UPDATE `discussions` SET `count` = '".($disc['count']+1)."', `time` = '$time' WHERE `id_user` = '$notes[id_user]' AND `type` = 'notes' AND `id_sim` = '$notes[id]' LIMIT 1");
}
mysql_query("INSERT INTO `notes_komm` (`id_user`, `time`, `msg`, `id_notes`) values('$user[id]', '$time', '".htmlspecialchars($msg)."', '".intval($_GET['id'])."')");
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+1)."' WHERE `id` = '$user[id]' LIMIT 1");
$_SESSION['message'] = 'Сообщение успешно отправлено';
header("Location: list.php?id=$notes[id]&page=".intval($_GET['page'])."");
exit;
}
}
if (isset($user))
$frend=mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE (`user` = '$user[id]' AND `frend` = '$avtor[id]') OR (`user` = '$avtor[id]' AND `frend` = '$user[id]') LIMIT 1"),0);
title();
aut(); // форма авторизации
err();
if ($notes['private']==1 && $user['id']!=$avtor['id'] && $frend!=2 && !user_access('notes_delete')){
msg('Дневник доступен только для друзей');
echo " <div class='foot'>n";
echo "<a href='index.php'>Назад</a><br />n";
echo " </div>n";
include_once '../../sys/inc/tfoot.php';
exit;
}
if ($notes['private']==2 && $user['id']!=$avtor['id'] && !user_access('notes_delete')){
msg('Пользователь запретил просмотр дневника');
echo " <div class='foot'>n";
echo "<a href='index.php'>Назад</a><br />n";
echo " </div>n";
include_once '../../sys/inc/tfoot.php';
exit;
}
if (isset($_GET['delete']) && ($user['id']==$avtor['id'] || user_access('notes_delete'))){
echo "<center>";
echo "Вы действительно хотите удалить дневник " . htmlspecialchars($notes['name']) . "?<br />";
echo "[<a href='delete.php?id=$notes[id]'><img src='/style/icons/ok.gif'> удалить</a>] [<a href='list.php?id=$notes[id]'><img src='/style/icons/delete.gif'> отмена</a>] n";
echo "</center>";
include_once '../../sys/inc/tfoot.php';
}
if (isset($user))
{
//------------------------like-----------------//
if (isset($_GET['like']) && $_GET['like'] == 1){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_like` WHERE `id_user` = '".$user['id']."' AND `id_notes` = '".$notes['id']."' LIMIT 1"),0)==0){
mysql_query("INSERT INTO `notes_like` (`id_notes`, `id_user`, `like`) VALUES ('$notes[id]', '$user[id]', '1')");
mysql_query("UPDATE `notes` SET `count` = '".($notes['count']+1)."' WHERE `id` = '$notes[id]' LIMIT 1");
$_SESSION['message'] = 'Ваш голос засчитан';
header("Location: list.php?id=$notes[id]&page=".intval($_GET['page'])."");
exit;
}
}
//-----------------------------------------------//
//------------------------dlike-----------------//
if (isset($_GET['like']) && $_GET['like'] == 0){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_like` WHERE `id_user` = '".$user['id']."' AND `id_notes` = '".$notes['id']."' LIMIT 1"),0)==0){
mysql_query("INSERT INTO `notes_like` (`id_notes`, `id_user`, `like`) VALUES ('$notes[id]', '$user[id]', '0')");
mysql_query("UPDATE `notes` SET `count` = '".($notes['count']-1)."' WHERE `id` = '$notes[id]' LIMIT 1");
$_SESSION['message'] = 'Ваш голос засчитан';
header("Location: list.php?id=$notes[id]&page=".intval($_GET['page'])."");
exit;
}
}
//-----------------------------------------------//
//-----------------------добавляем в закладки------------//
if (isset($_GET['fav']) && $_GET['fav']==1){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `mark_notes` WHERE `id_user` = '".$user['id']."' AND `id_list` = '".$notes['id']."' LIMIT 1"),0)==0){
mysql_query("INSERT INTO `mark_notes` (`id_list`, `id_user`, `time`) VALUES ('$notes[id]', '$user[id]', '$time')");
$_SESSION['message'] = 'Дневник добавлен в закладки';
header("Location: list.php?id=$notes[id]&page=".intval($_GET['page'])."");
exit;
}
}
//-------------------------------------------------------//
//-----------------------удаляем из закладок------------//
if (isset($_GET['fav']) && $_GET['fav']==0){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `mark_notes` WHERE `id_user` = '".$user['id']."' AND `id_list` = '".$notes['id']."' LIMIT 1"),0)==1){
mysql_query("DELETE FROM `mark_notes` WHERE `id_user` = '$user[id]' AND `id_list` = '$notes[id]' ");
$_SESSION['message'] = 'Дневник удален из закладок';
header("Location: list.php?id=$notes[id]&page=".intval($_GET['page'])."");
exit;
}
}
//-------------------------------------------------------//
}
echo "<div class="foot">n";
echo "<img src='/style/icons/str2.gif' alt='*'> <a href='index.php'>Дневники</a> | <a href='/info.php?id=$avtor[id]'>$avtor[nick]</a>n";
echo ' | <b>' . htmlspecialchars($notes['name']) . '</b>';
echo "</div>n";
echo "<div class="main">n";
echo "Cоздан: (".vremja($notes['time']).")n";
echo "</div>n";
if (isset($_GET['deletes']) && !isset($_GET['true']) && ($user['id']==$avtor['id'] || user_access('notes_delete')) && mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_files` WHERE `id` = '".intval($_GET['deletes'])."'"),0)==1){
$file=mysql_fetch_assoc(mysql_query("SELECT * FROM `notes_files` WHERE `id` = '".intval($_GET['deletes'])."'LIMIT 1 "));
echo "<div class='mess'><center>";
echo "Вы действительно желаете удалить файл ?<br />";
echo "<a href='list.php?id=$notes[id]&deletes=$file[id]&true'>Да</a> / <a href='?id=$notes[id]'>Нет</a> n";
echo "</center></div>";
}
$limit=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_pollen` WHERE `id_notes` = '$notes[id]' AND `id_user` = '$user[id]' ",$db), 0);
if(isset($_GET['golos']) && isset($user) && $user['id']!=$avtor['id'] && mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_votes` WHERE `id` = '".intval($_GET['golos'])."'"),0)==1 && $limit==0)
{
$golos=intval($_GET['golos']);
echo "<div class='mess'><center>";
echo "Вы действительно хотите проголосовать за данный вариант ?<br />";
echo "<a href='list.php?id=$notes[id]&golos=$golos&yes'>Да</a> / <a href='/plugins/notes/list.php?id=$notes[id]'>Нет</a> n";
echo "</center></div>";
}
////////////////////////////////////////
if(isset($_GET['golos']) && isset($_GET['yes']) && isset($user) && $user['id']!=$avtor['id'] && $limit==0)
{
$golos=intval($_GET['golos']);
$golos=mysql_fetch_array(mysql_query("SELECT * FROM `notes_votes` WHERE `id` = '$golos' AND `id_notes` = '$notes[id]' LIMIT 1"));
if($golos['variant']==NULL)header("Location: list.php?id=$notes[id]");
if($time>$notes['times'] && $notes['times']!='0' ){
$err[]='';
$_SESSION['message'] = 'Опрос уже закрыт!';
header("Location: list.php?id=$notes[id]");
exit;
}
if ($notes['votes']=='0')
{
$err[]='';
$_SESSION['message'] = ' К данному дневнику опрос не прикреплён!';
header("Location: list.php?id=$notes[id]");
exit;
}
if(!isset($err))
{
//////Отправка ленты
$q = mysql_query("SELECT * FROM `frends` WHERE `user` = '".$user['id']."' AND `i` = '1'");
while ($f = mysql_fetch_array($q))
{
$a=get_user($f['frend']);
$lentaSet = mysql_fetch_array(mysql_query("SELECT * FROM `tape_set` WHERE `id_user` = '".$a['id']."' LIMIT 1")); // Общая настройка ленты
if ($f['lenta_votes'] == 1 && $lentaSet['lenta_votes'] == 1 ) // фильтр рассылки
mysql_query("INSERT INTO `tape` (`id_user`,`avtor`, `type`, `time`, `id_file`) values('$a[id]', '$user[id]', 'notes_poll', '$time', '$notes[id]')");
}
//////////Стоп
mysql_query("INSERT INTO `notes_pollen` (id_user, id_variant, id_notes, time) values('$user[id]', '".intval($_GET['golos'])."', '$notes[id]', '$time')");
$_SESSION['message'] = 'Ваш голос успешно принят';
header("Location: list.php?id=$notes[id]");
exit;
}
}
////////////////////////////////////////////
$stat1 = $notes['msg'];
if (!$set['web'])$mn=20;else $mn=90; // количество слов выводится в зависимости от браузера
$stat=explode(' ', $stat1); // деление статьи на отдельные слова
$k_page=k_page(count($stat),$set['p_str']*$mn);
$page=page($k_page);
$start=$set['p_str']*$mn*($page-1);
$stat_1=NULL;
for ($i=$start;$i<$set['p_str']*$mn*$page && $i<count($stat);$i++){
$stat_1.=$stat[$i].' ';
}
echo '<div class="mess">' . output_text(htmlspecialchars($stat_1)) , '</br>'; // вывод статьи со всем форматированием
/*
==================================
Выводим файлы
==================================
*/
$f=mysql_query("SELECT * FROM `notes_files` WHERE `notes_id` = '$notes[id]'");
while ($file = mysql_fetch_assoc($f))
{
if (is_file(H.'plugins/notes/icons/'.$file['ras'].'.png'))
{
echo "<img src='/plugins/notes/icons/$file[ras].png' alt='$file[ras]' />n";
}
else
{
echo "<img src='/plugins/notes/icons/file.png' alt='' />n";
}
echo "<a href='/plugins/notes/load/$file[id]/' title='Скачать'>$file[name] .$file[ras] </a> (".size_file($file['size']).")n";
if ($user['id']==$avtor['id'] || user_access('notes_delete'))echo "<a href='?id=$notes[id]&deletes=$file[id]' title='Удалить файл'><img src='/style/icons/delete.gif' alt='' /></a>n";
echo '</br>';
$img_size = ($webbrowser == 'web' ? '320' : '128');
if (is_file(H."sys/notes/screen/$img_size/$file[id].gif"))
echo "<img src='/sys/notes/screen/$img_size/$file[id].gif' alt='Скрин...' /></br>";
}
/*
==================================
Выводим опросы
==================================
*/
echo '<div class="nav2"></div>';
if ($notes['votes']=='1')
{
echo 'Тема опроса: ';
echo "<b>".htmlspecialchars($notes['votes_text'])."</b><br />n";
$q2=mysql_query("SELECT * FROM `notes_votes` WHERE `id_notes` = '$notes[id]' ORDER BY `number` ASC");
if (mysql_num_rows($q2)==0)
{
echo "Ошибка,не найдено ни одного варианта n";
}
while ($post2 = mysql_fetch_assoc($q2))
{
$summa=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_pollen` WHERE `id_notes` = '$notes[id]' ",$db), 0);
$variant=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_pollen` WHERE `id_notes` = '$notes[id]' AND `id_variant` = '$post2[id]' ",$db), 0);
$prov=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_pollen` WHERE `id_notes` = '$notes[id]' AND `id_user` = '$user[id]'",$db), 0);
if($post2['variant']!=NULL)
{
if($summa==0)$poll=0;
elseif($variant==0)$poll=0;
else $poll=($variant/$summa)*100;
$limit=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_pollen` WHERE `id_notes` = '$notes[id]' AND `id_user` = '$user[id]' ",$db), 0);
if(isset($user) && $user['id']==$avtor['id'] || $limit!=0 || $notes['times']!='0' ){echo "".htmlspecialchars($post2['variant'])." - $variant (чел.)";}else{ echo "<a href='list.php?id=$notes[id]&golos=$post2[id]'>".htmlspecialchars($post2['variant'])."</a> - $variant (чел.)";}
echo "</br>n";
echo "<img src='img.php?img=$poll' alt=''/></br>";
}
}
echo "<a href='list.php?id=$notes[id]&pollen'><img src='/style/icons/comment.png'> Кто проголосовал?</a><br/>";
if($notes['times']>$time){echo "<img src='/style/icons/votes.png'> Опрос закончится ".vremja($notes['times'])."n";}
if($time>$notes['times'] && $notes['times']!='0' ){
echo "<img src='/style/icons/votes.png'> Опрос уже закончился!n";
}
echo '<div class="nav2"></div>';
}
///////======================================================================////////////
echo "</div>";
if ($k_page>1)str("?id=$notes[id]&",$k_page,$page); // Вывод страниц
/*----------------------листинг-------------------*/
$listr = mysql_fetch_assoc(mysql_query("SELECT * FROM `notes` WHERE `id` < '$notes[id]' ORDER BY `id` DESC LIMIT 1"));
$list = mysql_fetch_assoc(mysql_query("SELECT * FROM `notes` WHERE `id` > '$notes[id]' ORDER BY `id` ASC LIMIT 1"));
echo '<div class="c2" style="text-align: center;">';
echo '<span class="page">'.($list['id']?'<a href="list.php?id='.$list['id'].'">« Пред.</a> ':'« Пред. ').'</span>';
$k_1=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes` WHERE `id` > '$notes[id]'"),0)+1;
$k_2=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes`"),0);
echo ' ('.$k_1.' из '.$k_2.') ';
echo '<span class="page">' . ($listr['id'] ? '<a href="list.php?id=' . $listr['id'] . '">След. »</a>' : ' След. »') . '</span>';
echo '</div>';
/*----------------------alex-borisi---------------*/
if (isset($user) && (user_access('notes_delete') || $user['id']==$avtor['id'])){
echo "<div class='main2'>";
echo "Инструменты: ";
echo " <a href='edit.php?id=$notes[id]'> Изм.дневник</a> <a href='?id=$notes[id]&delete'> Удалить</a> ".($notes['votes']==1?'<a href="?id='.$notes['id'].'&vote_edit">Изм.опрос</a> ':'<a href="?id='.$notes['id'].'&vote_add">Доб.опрос</a>')."n";
echo "</div>";
}
echo "<div class='main'>";
echo "<b>Рейтинг: $notes[count]</b><br />";
echo "</div>";
if (isset($user) && $user['id']!=$avtor['id']){
echo "<div class='main'>";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_like` WHERE `id_user` = '".$user['id']."' AND `id_notes` = '".$notes['id']."' LIMIT 1"),0)==0)
echo "[<img src='/style/icons/like.gif' alt='*' /> <a href='list.php?id=$notes[id]&like=1'>Нравится</a>] [<a href='list.php?id=$notes[id]&like=0'><img src='/style/icons/dlike.gif' alt='*' /></a>]<br />n";
else
echo "[<img src='/style/icons/like.gif' alt='*' /> ".mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_like` WHERE `like` = '1' AND `id_notes` = '".$notes['id']."' LIMIT 1"),0)."] [<img src='/style/icons/dlike.gif' alt='*' /> ".mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_like` WHERE `like` = '0' AND `id_notes` = '".$notes['id']."' LIMIT 1"),0)."]n";
echo "</div>";
}else{
echo "<div class='main'>";
echo "[<img src='/style/icons/like.gif' alt='*' /> ".mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_like` WHERE `like` = '1' AND `id_notes` = '".$notes['id']."' LIMIT 1"),0)."] [<img src='/style/icons/dlike.gif' alt='*' /> ".mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_like` WHERE `like` = '0' AND `id_notes` = '".$notes['id']."' LIMIT 1"),0)."]n";
echo "</div>";
}
//--------------------------В закладки-----------------------------//
if (isset($user)){
echo "<div class='main_seriy'>";
echo "<div class='main'>";
echo "<img src='/style/icons/fav.gif' alt='*' /> ";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `mark_notes` WHERE `id_user` = '".$user['id']."' AND `id_list` = '".$notes['id']."' LIMIT 1"),0)==0)
echo "<a href='list.php?id=$notes[id]&fav=1'>Добавить в закладки</a><br />n";
else
echo "<a href='list.php?id=$notes[id]&fav=0'>Удалить из закладок</a><br />n";
echo "В закладках у <a href='list.php?id=$notes[id]&markinfo'>$markinfo</a> чел.";
echo "</div>";
echo "</div>";
}
//-------------------------------------------------------------//
echo "<div class='main'>";
echo 'Поделится:<script type="text/javascript" src="//yandex.st/share/share.js" charset="utf-8"></script>
<span class="yashare-auto-init" data-yashareL10n="ru" data-yashareType="none" data-yashareQuickServices="vkontakte,twitter,odnoklassniki,moimir"></span>';
echo "</div>";
/*
===================================
Комментарии дневников
===================================
*/
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes_komm` WHERE `id_notes` = '".intval($_GET['id'])."'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo '<div class="foot">';
echo "Комментарииn";
echo '</div>';
if ($k_post==0)
{
echo '<div class="mess">';
echo "Нет сообщенийn";
echo '</div>';
}else if (isset($user)){
/*------------сортировка по времени--------------*/
if (isset($user)){
echo "<div id='comments' class='menus'>";
echo "<div class='webmenu'>";
echo "<a href='list.php?id=$notes[id]&page=$page&sort=1' class='".($user['sort']==1?'activ':'')."'>Внизу</a>";
echo "</div>";
echo "<div class='webmenu'>";
echo "<a href='list.php?id=$notes[id]&page=$page&sort=0' class='".($user['sort']==0?'activ':'')."'>Вверху</a>";
echo "</div>";
echo "</div>";
}
/*---------------alex-borisi---------------------*/
}
$q=mysql_query("SELECT * FROM `notes_komm` WHERE `id_notes` = '".intval($_GET['id'])."' ORDER BY `time` $sort LIMIT $start, $set[p_str]");
echo "<table class='post'>n";
while ($post = mysql_fetch_assoc($q))
{
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
/*-----------зебра-----------*/
if ($num==0){
echo '<div class="nav1">';
$num=1;
}
elseif ($num==1){
echo '<div class="nav2">';
$num=0;
}
/*---------------------------*/
echo group($ank['id'])." <a href='/info.php?id=$ank[id]'>$ank[nick]</a> ";
if (isset($user) && $ank['id'] != $user['id'])echo "<a href='?id=$notes[id]&response=$ank[id]'>[*]</a> n";
echo "".medal($ank['id'])." ".online($ank['id'])." (".vremja($post['time']).")<br />";
$postBan = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE (`razdel` = 'all' OR `razdel` = 'notes') AND `post` = '1' AND `id_user` = '$ank[id]' AND (`time` > '$time' OR `navsegda` = '1')"), 0);
if ($postBan == 0) // Блок сообщения
{
echo output_text(htmlspecialchars($post['msg']))."<br />n";
}else{
echo output_text(htmlspecialchars($post['msg']))."<br />";
}
if (isset($user))
{
echo '<div style="text-align:right;">';
if ($ank['id']!=$user['id'])
echo "<a href="?id=$notes[id]&page=$page&spam=$post[id]"><img src='/style/icons/blicon.gif' alt='*' title='Это спам'></a> ";
if (isset($user) && (user_access('notes_delete') || $user['id']==$notes['id_user']))
echo '<a href="delete.php?komm='.$post['id'].'"><img src="/style/icons/delete.gif" alt="*"></a>';
echo "</div>n";
}
echo "</div>n";
}
echo "</table>n";
if ($k_page>1)str("list.php?id=".intval($_GET['id']).'&',$k_page,$page); // Вывод страниц
if ($notes['private_komm']==1 && $user['id']!=$avtor['id'] && $frend!=2 && !user_access('notes_delete')){
msg('Комментировать могут только друзья');
echo " <div class='foot'>n";
echo "<a href='index.php'>Назад</a><br />n";
echo " </div>n";
include_once '../../sys/inc/tfoot.php';
exit;
}
if ($notes['private_komm']==2 && $user['id']!=$avtor['id'] && !user_access('notes_delete')){
msg('Пользователь запретил комментирование дневника');
echo " <div class='foot'>n";
echo "<a href='index.php'>Назад</a><br />n";
echo " </div>n";
include_once '../../sys/inc/tfoot.php';
exit;
}
if (isset($user))
{
echo "<form method="post" name='message' action="?id=".intval($_GET['id'])."&page=$page".$go_otv."">n";
if ( is_file(H.'style/themes/'.$set['set_them'].'/altername_post_form.php'))
include_once H.'style/themes/'.$set['set_them'].'/altername_post_form.php';
else
echo "$tPanel<textarea name="msg">$otvet</textarea><br />n";
echo "<input value="Отправить" type="submit" />n";
echo "</form>n";
}
echo "<div class="foot">n";
echo "<img src='/style/icons/str2.gif' alt='*'> <a href='index.php'>Дневники</a> | <a href='/info.php?id=$avtor[id]'>$avtor[nick]</a>n";
echo ' | <b>' . htmlspecialchars($notes['name']) . '</b>';
echo "</div>n";
include_once '../../sys/inc/tfoot.php';
?>