summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprashant2015-02-24 17:16:10 +0530
committerprashant2015-02-24 17:16:10 +0530
commitd5a46f344d9b5434830e4e00dab72d92cab0ef19 (patch)
treefbc96c14fe3786724b2d7a6a9ad71ab6f622ac05
parent2ac0e2d6b395d641809bfccdceb54e7328b506c1 (diff)
downloadcloud-comments-d5a46f344d9b5434830e4e00dab72d92cab0ef19.tar.gz
cloud-comments-d5a46f344d9b5434830e4e00dab72d92cab0ef19.tar.bz2
cloud-comments-d5a46f344d9b5434830e4e00dab72d92cab0ef19.zip
done minor changes
-rwxr-xr-xcloud_comments.module12
1 files changed, 9 insertions, 3 deletions
diff --git a/cloud_comments.module b/cloud_comments.module
index cb02710..5eb556b 100755
--- a/cloud_comments.module
+++ b/cloud_comments.module
@@ -86,7 +86,11 @@ function cloud_comments_all($example_id=0) {
$page_content .= t("<div class='comment'> <br><b>Comment:</b><br>") . $row->comment . t("</div>");
if ($row->reply) {
- $page_content .= t("<div class='reply'> <br><b>Reply Sent:</b><br>") . $row->reply . t("</div>");
+ if(!$row->user){
+ $page_content .= t("<div class='reply'> <br><b>Reply Sent:</b><br>") . $row->reply . t("</div>");
+ }else{
+ $page_content .= t("<div class='reply'> <br><b>Reply Sent By ".$row->user.":</b><br>") . $row->reply . t("</div>");
+ }
}
else {
if (user_access("reply cloud_comments")) {
@@ -136,8 +140,10 @@ function cloud_comments_reply_form($form_state, $comment_id) {
} // function reply_form
function cloud_comments_reply_form_submit($form, &$form_state) {
- $query = "UPDATE {scilab_cloud_comment} SET reply = '%s', reply_status = 1 WHERE id = %d";
- $query_result = db_query($query, $form_state["values"]["content"], $form_state["values"]["hidden"]);
+ global $user;
+
+ $query = "UPDATE {scilab_cloud_comment} SET reply = '%s', user= '%s' reply_status = 1 WHERE id = %d";
+ $query_result = db_query($query, $form_state["values"]["content"], $user->name, $form_state["values"]["hidden"]);
$email_query = "SELECT email FROM {scilab_cloud_comment} WHERE id = %d";
$result = db_query($email_query, $form_state["values"]["hidden"]);