<?php // configuration require "../includes/config.php"; verify_access(); if (!isset($_GET["soc"])) { redirect("home.php"); } // assoc array containing name, creator, date created, and description $soc = get_society($_GET["soc"]); if (!$soc) { apologize("Nothing here!"); } log_soc_activity($soc["soc_id"]); $title = $soc["soc_name"]; $status = soc_rel($soc); if (isset($_GET["saction"])) { if (strcasecmp($_GET["saction"], "sub") == 0 && !$status["sub"]) { sub_soc($soc); } elseif (strcasecmp($_GET["saction"], "unsub") == 0 && $status["sub"]) { unsub_soc($soc); } $status = soc_rel($soc); }
function del_comment($cid, $s, $comment = null) { if (!($c = get_comment($cid))) { apologize("Comment does not exist."); } if ($c["status"] == 'DELETED') { apologize("Comment already deleted."); } if (!am_mod(get_society($s))) { apologize("Access Denied."); } return tquery("\n\t\t\t\t\t\tupdate comments\n\t\t\t\t\t\tset status = ?\n\t\t\t\t\t\twhere comm_id = ?;\n\n\t\t\t\t\t\tinsert into comm_control_log(comm_id, mod_id, action, comment)\n\t\t\t\t\t\tvalues(?, ?, ?, ?);", ["DELETED", $c["comm_id"]], [$c["comm_id"], $_SESSION["user"]["user_id"], "DELETE", $comment]); }