summary refs log tree commit diff stats
path: root/pages/edit-comment.php
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-02-21 10:26:52 -0500
committerStarla Insigna <hatkirby@fourisland.com>2009-02-21 10:26:52 -0500
commit98be190dd56ff7fa422311f910e700069568db4c (patch)
tree621fb6cd794772bfaecff735883114731a3ef8d6 /pages/edit-comment.php
parent4f1cb78e3c3c1ecf568c275fad139fed94b24c35 (diff)
downloadfourisland-98be190dd56ff7fa422311f910e700069568db4c.tar.gz
fourisland-98be190dd56ff7fa422311f910e700069568db4c.tar.bz2
fourisland-98be190dd56ff7fa422311f910e700069568db4c.zip
Added comment editing and deleting
Diffstat (limited to 'pages/edit-comment.php')
-rw-r--r--pages/edit-comment.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/pages/edit-comment.php b/pages/edit-comment.php new file mode 100644 index 0000000..92a1aba --- /dev/null +++ b/pages/edit-comment.php
@@ -0,0 +1,54 @@
1<?php
2/*
3 444444444
4 4::::::::4
5 4:::::::::4
6 4::::44::::4
7 4::::4 4::::4 Four Island
8 4::::4 4::::4
9 4::::4 4::::4 Written and maintained by Starla Insigna
104::::444444::::444
114::::::::::::::::4 pages/edit-comment.php
124444444444:::::444
13 4::::4 Please do not use, reproduce or steal the
14 4::::4 contents of this file without explicit
15 4::::4 permission from Hatkirby.
16 44::::::44
17 4::::::::4
18 4444444444
19*/
20
21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22
23require('headerproc.php');
24
25if (!isset($_GET['id']) || !isset($_POST['comment']))
26{
27 generateError('404');
28} else {
29 if (isLoggedIn())
30 {
31 $getcomment = "SELECT * FROM comments WHERE id = " . $_GET['id'];
32 $getcomment2 = mysql_query($getcomment);
33 $getcomment3 = mysql_fetch_array($getcomment2);
34
35 if ($getcomment3['id'] == $_GET['id'])
36 {
37 if ((isAdmin()) || (($getcomment3['is_anon'] == 0) && (getSessionUserID() === $getcomment3['user_id'])))
38 {
39 $setcomment = "UPDATE comments SET comment = \"" . mysql_real_escape_string($_POST['comment']) . "\" WHERE id = " . $_GET['id'];
40 $setcomment2 = mysql_query($setcomment);
41
42 header('Location: ' . getCommentUrl($getcomment3) . '#comment-' . $getcomment3['id']);
43 } else {
44 generateError('404');
45 }
46 } else {
47 generateError('404');
48 }
49 } else {
50 generateError('404');
51 }
52}
53
54?>