View file forum/editpost.php

File size: 1.39Kb
<?php
/*
------------------------------
##############################
-       Загруз Центр         -
-         by Kemel           -
-		   Форум			 -
##############################
------------------------------
*/
define('ROOT','../');
define('Loads',true);
require_once (ROOT.'system/power.php');
if ($aut == true and $id != false) {
$sql = $db -> query("SELECT `fid`,`name`,`text` FROM `forum` WHERE `id` = '".$id."' AND `type` = 'm' LIMIT 1");
if ($sql -> num_rows > 0) {
$ass = $sql -> fetch_assoc();
if ($ya['login'] == $ass['name'] or $admin == true or $moder == true) {
if (empty($_POST['text'])) {
$diz -> head('Форум');
$diz -> title('Изменяем сообщение');
$msg .= '<form action="editpost.php?id='.$id.'" method="post"><div>
Введите сообщение:<br/><textarea name="text" cols="25" rows="4">'.$ass['text'].'</textarea><br/>
<input type="submit" value="Изменить"/>
</div></form>';
$diz -> out($msg);
} else {
$text = $func -> check($_POST['text']);
$text = $func -> tags($text);
$db -> query("UPDATE `forum` SET `text` = '".$text."', `edit` = '".$ya['login']."', `timeedit` = '".time()."' WHERE `id` = '".$id."' AND `type` = 'm' LIMIT 1");
header('location: index.php?id='.$ass['fid']);
}
} else header('location: index.php?id='.$ass['fid']);
} else header('location: index.php');
} else header('location: index.php');
?>