From 98be190dd56ff7fa422311f910e700069568db4c Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sat, 21 Feb 2009 10:26:52 -0500 Subject: Added comment editing and deleting --- includes/comments.php | 8 ++++++++ includes/functions.php | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'includes') diff --git a/includes/comments.php b/includes/comments.php index 3a64321..e050073 100755 --- a/includes/comments.php +++ b/includes/comments.php @@ -73,6 +73,14 @@ while ($getcomments3[$i] = mysql_fetch_array($getcomments2)) 'DATE' => date("F dS Y \a\\t g:i:s a",strtotime($getcomments3[$i]['posttime'])), 'ID' => $getcomments3[$i]['id'], 'TEXT' => parseText($getcomments3[$i]['comment']))); + + if (isLoggedIn()) + { + if ((isAdmin()) || (($getcomments3[$i]['is_anon'] == 0) && (getSessionUserID() === $getcomments3[$i]['user_id']))) + { + $template->adds_ref_sub($curID, 'EDITOR', array('BEFORE' => $getcomments3[$i]['comment'])); + } + } } $i++; } diff --git a/includes/functions.php b/includes/functions.php index 16de184..9eb1634 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -282,4 +282,26 @@ function displayRelated($title, $avoid = 0) } } +function getCommentUrl($getcomment3) +{ + $page_id = $getcomment3['page_id']; + $comType = substr($page_id,0,strpos($page_id,'-')); + $comID = substr($page_id,strpos($page_id,'-')+1); + + if ($comType == 'updates') + { + $getupdate = "SELECT * FROM updates WHERE id = " . $comID; + $getupdate2 = mysql_query($getupdate); + $getupdate3 = mysql_fetch_array($getupdate2); + + return '/blog/' . $getupdate3['slug'] . '/'; + } else if ($comType == 'polloftheweek') + { + return '/poll/' . $comID . '.php'; + } else if ($comType == 'quote') + { + return '/quotes/' . $comID . '.php'; + } +} + ?> -- cgit 1.4.1