?> " style="font-size: 10px"><?php echo html_encode($result["commenter_fullname"]); ?> </a></td> <td style="border-bottom: none"> <div style="float: left"> <span class="content-small"><strong>Commented:</strong> <?php echo date(DEFAULT_DATE_FORMAT, $result["updated_date"]); ?> </span> </div> <div style="float: right"> <?php echo shares_comment_module_access($result["cscomment_id"], "edit-comment") ? " (<a class=\"action\" href=\"" . COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=edit-comment&id=" . $result["cscomment_id"] . "\">edit</a>)" : ""; echo shares_comment_module_access($result["cscomment_id"], "delete-comment") ? " (<a class=\"action\" href=\"javascript:commentDelete('" . $result["cscomment_id"] . "')\">delete</a>)" : ""; ?> </div> </td> </tr> <tr> <td colspan="2" class="content"> <a name="comment-<?php echo (int) $result["cscomment_id"]; ?> "></a> <?php echo trim($result["comment_title"]) ? "<div style=\"font-weight: bold\">" . html_encode(trim($result["comment_title"])) . "</div>" : ""; echo $result["comment_description"]; if ($result["release_date"] != $result["updated_date"]) { echo "<div class=\"content-small\" style=\"margin-top: 15px\">\n";
* @copyright Copyright 2010 Queen's University. All Rights Reserved. * */ if (!defined("COMMUNITY_INCLUDED") || !defined("IN_SHARES")) { exit; } elseif (!$COMMUNITY_LOAD) { exit; } $HEAD[] = "<script type=\"text/javascript\" src=\"" . COMMUNITY_URL . "/javascript/shares.js?release=" . html_encode(APPLICATION_VERSION) . "\"></script>"; echo "<h1>Edit File Comment</h1>\n"; if ($RECORD_ID) { $query = "\n\t\t\t\t\tSELECT a.*, b.`file_title`, c.`folder_title`, c.`admin_notifications`\n\t\t\t\t\tFROM `community_share_comments` AS a\n\t\t\t\t\tLEFT JOIN `community_share_files` AS b\n\t\t\t\t\tON a.`cshare_id` = b.`cshare_id`\n\t\t\t\t\tLEFT JOIN `community_shares` AS c\n\t\t\t\t\tON a.`cshare_id` = c.`cshare_id`\n\t\t\t\t\tWHERE a.`community_id` = " . $db->qstr($COMMUNITY_ID) . "\n\t\t\t\t\tAND a.`cscomment_id` = " . $db->qstr($RECORD_ID) . "\n\t\t\t\t\tAND c.`cpage_id` = " . $db->qstr($PAGE_ID) . "\n\t\t\t\t\tAND a.`comment_active` = '1'\n\t\t\t\t\tAND b.`file_active` = '1'\n\t\t\t\t\tAND c.`folder_active` = '1'"; $comment_record = $db->GetRow($query); if ($comment_record) { if ((int) $comment_record["comment_active"]) { if (shares_comment_module_access($RECORD_ID, "edit-comment")) { $BREADCRUMB[] = array("url" => COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-folder&id=" . $comment_record["cshare_id"], "title" => limit_chars($comment_record["folder_title"], 32)); $BREADCRUMB[] = array("url" => COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-file&id=" . $comment_record["csfile_id"], "title" => limit_chars($comment_record["file_title"], 32)); $BREADCRUMB[] = array("url" => COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=edit-comment&id=" . $RECORD_ID, "title" => "Edit File Comment"); communities_load_rte(); // Error Checking switch ($STEP) { case 2: /** * Required field "title" / Comment Title. */ if (isset($_POST["comment_title"]) && ($title = clean_input($_POST["comment_title"], array("notags", "trim")))) { $PROCESSED["comment_title"] = $title; } else { $PROCESSED["comment_title"] = ""; }
* @author Unit: School of Medicine * @author Developer: Brandon Thorn <*****@*****.**> * @copyright Copyright 2012 Queen's University. All Rights Reserved. * */ if (!defined("COMMUNITY_INCLUDED") || !defined("IN_SHARES")) { exit; } elseif (!$COMMUNITY_LOAD) { exit; } if ($RECORD_ID) { $query = "\tSELECT * FROM `community_share_comments` as a\n\t\t\t\t\t\tLEFT JOIN `community_shares` as b\n\t\t\t\t\t\tON a.`cshare_id` = b.`cshare_id`\n\t \t\t\t\t\tWHERE a.`cscomment_id` = " . $db->qstr($RECORD_ID) . " \n\t \t\t\t\t\tAND a.`community_id` = " . $db->qstr($COMMUNITY_ID) . "\n\t \t\t\t\t\tAND b.`cpage_id` = " . $db->qstr($PAGE_ID); $comment_record = $db->GetRow($query); if ($comment_record) { if ((int) $comment_record["comment_active"]) { if (shares_comment_module_access($RECORD_ID, "delete-comment")) { if ($db->AutoExecute("community_share_comments", array("comment_active" => 0, "updated_date" => time(), "updated_by" => $ENTRADA_USER->getID()), "UPDATE", "`cscomment_id` = " . $db->qstr($RECORD_ID) . " AND `csfile_id` = " . $db->qstr($comment_record["csfile_id"]) . " AND `cshare_id` = " . $db->qstr($comment_record["cshare_id"]) . " AND `community_id` = " . $db->qstr($COMMUNITY_ID))) { communities_deactivate_history($COMMUNITY_ID, $PAGE_ID, $RECORD_ID); delete_notifications("shares:file_comment:{$RECORD_ID}"); add_statistic("community:" . $COMMUNITY_ID . ":shares", "comment_delete", "cscomment_id", $RECORD_ID); } else { application_log("error", "Failed to deactivate [" . $RECORD_ID . "] file comment from community. Database said: " . $db->ErrorMsg()); } } } else { application_log("error", "The provided file comment id [" . $RECORD_ID . "] is already deactivated."); } header("Location: " . COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-file&id=" . $comment_record["csfile_id"]); exit; } else { application_log("error", "The provided file comment id [" . $RECORD_ID . "] was invalid.");