Файл: groups/forum/re_post.php
Строк: 61
<?php
require_once '../../incfiles/core.php';
require_once '../../incfiles/func.php';
require_once '../../incfiles/auth.php';
require_once '../../incfiles/user.php';
if (empty($user_id)) go(URL);
if (!empty($_GET['id']) && is_numeric($_GET['id']))
{
$id = abs(intval($_GET['id']));
$result = mysql_query("SELECT * FROM `groups_forum_post` WHERE `id` = '".$id."' AND `user_id` != '".$user_id."' LIMIT 1");
if (mysql_num_rows($result) == true) $arr_post = mysql_fetch_array($result);
else go(URL);
$arr_theme = mysql_fetch_array(mysql_query("SELECT * FROM `groups_forum` WHERE `id` = '".$arr_post['tid']."' LIMIT 1"));
$arr_group = mysql_fetch_array(mysql_query("SELECT * FROM `groups` WHERE `id` = '".$arr_theme['group_id']."' LIMIT 1"));
if (!in_array($user_id, explode("||", substr($arr_group['users'], 1, -1)))) go(URL.'/groups/forum/theme.php?id='.$arr_theme['id']);
}
else go(URL);
$title = checkout($arr_theme['title']).' :: '.lang('Ответить','Відповісти');
require_once '../../incfiles/head.php';
echo group_access($arr_group);
if ($arr_group['access_forum'] == 2) {echo err(lang('Страница не найдена','Сторінка не знайдена')); if ($ajax_query == false) require_once HOME.'/incfiles/foot.php'; exit;}
echo '<div class="title">'.lang('Ответить','Відповісти').'</div>';
echo '<div class="block">'.user_name($arr_post['user_id']).'<br/>'.vtime($arr_post['time']).'<div class="clear"></div><p>'.smiles(text($arr_post['text'])).'</p></div>';
if ($site_version == 'default')
{
?>
<script type="text/javascript">
$(function(){
$('#form').on('submit', function(e){
e.preventDefault();
var $that = $(this),
formData = new FormData($that.get(0));
$.ajax({
url: $that.attr('action'),
type: $that.attr('method'),
contentType: false,
processData: false,
data: formData,
success: function(response){
if(response){
Page.Go($that.attr('action'));
}
}
});
});
});
</script>
<?
}
$arr_wall_cache = false;
if (mysql_result(mysql_query("SELECT COUNT(`id`) FROM `wall_cache` WHERE `user_id` = '".$user_id."' LIMIT 1"),0) == true) $arr_wall_cache = mysql_fetch_array(mysql_query("SELECT * FROM `wall_cache` WHERE `user_id` = '".$user_id."' LIMIT 1"));
echo '<form id="form" action="'.URL.'/groups/forum/theme.php?id='.$arr_theme['id'].'&p='.ceil($arr_theme['cpost']/10).'" method="post">
<div class="block2">
<textarea id="textarea" class="input" name="re_post" rows="4"></textarea>
<input type="hidden" name="re_id" value="'.$id.'">
<input class="button2" type="submit" value="'.lang('Ответить','Відповісти').'">
<a class="button2" href="'.URL.'/groups/forum/theme.php?id='.$arr_theme['id'].'" onclick="Page.Go(this.href); return false">Назад</a>
<a class="button3" href="'.URL.'/ajax/smiles.php" onclick="FormContent.Smiles(this.href); return false"><img src="'.URL.'/design/img/smile.png"/></a>
</div></form>
<div id="form_content"></div>';
require_once '../../incfiles/foot.php';
?>