Файл: groups/forum/handler/edit_theme.php
Строк: 25
<?php
if (!empty($_GET['del']))
{
if (in_array($user_id, explode("||", substr($arr_group['admins'], 1, -1))))
{
if ($_GET['del'] == 'stop')
{
$title = lang('Удалить','Видалити').' тему';
echo '<div class="title">'.$title.'?</div>
<div class="block">'.lang('Вы действительно хотите удалить эту тему?','Ви дійсно хочете видалити цю тему?').'<br/><br/>
<a id="bg_orange" class="button2" href="'.URL.'/groups/forum/edit_theme.php?id='.$id.'&del=yes" onclick="Page.Go(this.href); return false">'.lang('Удалить','Видалити').'</a>
<a class="button2" href="'.URL.'/groups/forum/edit_theme.php?id='.$id.'" onclick="Page.Go(this.href); return false">'.lang('Отменить','Скасувати').'</a>
</div>';
require_once '../../incfiles/foot.php'; exit;
}
else if ($_GET['del'] == 'yes')
{
if (mysql_query("DELETE FROM `groups_forum` WHERE `id` = '".$id."' LIMIT 1") == true)
{
mysql_query("DELETE FROM `groups_forum_post` WHERE `tid` = '".$id."'");
mysql_query("UPDATE `groups` SET count_forum=count_forum-1 WHERE `id` = '".$arr_group['id']."' LIMIT 1");
go(URL.'/groups/forum/?id='.$arr_group['id']);
}
}
}
}
if (!empty($_GET['del_photo']))
{
$del = check($_GET['del_photo']);
if (in_array($del, explode("||", substr($arr_theme['photos'], 1, -1))))
{
$new_post_photos = str_replace("|".$del."|", "", $arr_theme['photos']);
mysql_query("UPDATE `groups_forum` SET `photos` = '".$new_post_photos."' WHERE `id` = '".$id."' LIMIT 1");
}
if ($ajax == 'yes') exit;
else go(URL.'/groups/forum/edit_theme.php?id='.$id);
}
else if (!empty($_GET['del_audio']))
{
$del = abs(intval($_GET['del_audio']));
if (in_array($del, explode("||", substr($arr_theme['audio'], 1, -1))))
{
$new_post_audio = str_replace("|".$del."|", "", $arr_theme['audio']);
mysql_query("UPDATE `groups_forum` SET `audio` = '".$new_post_audio."' WHERE `id` = '".$id."' LIMIT 1");
}
if ($ajax == 'yes') exit;
else go(URL.'/groups/forum/edit_theme.php?id='.$id);
}
if (!empty($_POST['title']) && !empty($_POST['text']))
{
$tit = check($_POST['title']);
$text = check($_POST['text']);
$tit = substr($tit, 0, 200);
$text = substr($text, 0, 10000);
if (!empty($tit) && !empty($text)) mysql_query("UPDATE `groups_forum` SET `title` = '".$tit."', `text` = '".$text."', `photos` = '".$arr_theme['photos']."', `audio` = '".$arr_theme['audio']."' WHERE `id` = '".$id."' LIMIT 1");
if ($ajax == 'yes') exit;
else go(URL.'/groups/forum/theme.php?id='.$id);
}
?>