-
Notifications
You must be signed in to change notification settings - Fork 35
/
chat_edit.php
47 lines (36 loc) · 1.05 KB
/
chat_edit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
define('INSIDE', true);
$_DontCheckPolls = TRUE;
$_EnginePath = './';
include($_EnginePath.'common.php');
loggedCheck();
includeLang('chat');
$BodyTPL = gettemplate('chat_edit');
if(!CheckAuth('supportadmin'))
{
message($_Lang['sys_noalloaw'], $_Lang['sys_noaccess']);
}
$EditID = (isset($_GET['mode']) ? round($_GET['mode']) : 0);
if($EditID > 0 && isset($_GET['save']))
{
$NewMessage = getDBLink()->escape_string($_POST['message']);
doquery(
"UPDATE {{table}} SET `Text` = '{$NewMessage}', `TimeStamp_Edit` = UNIX_TIMESTAMP() WHERE `ID` = {$EditID} LIMIT 1;",
'chat_messages'
);
header('Location: chat.php');
}
else if($EditID > 0)
{
$GetMessage = doquery("SELECT `Text` FROM {{table}} WHERE `ID` = {$EditID} LIMIT 1;", "chat_messages", true);
$_Lang['EditID'] = $EditID;
$_Lang['OldText'] = stripslashes($GetMessage['Text']);
$_Lang['SubmitButton'] = $_Lang['chat_save'];
}
else
{
header('Location: chat.php');
}
$page = parsetemplate($BodyTPL, $_Lang);
display($page, $_Lang['Chat'], false);
?>