public function postComment($id, $type, $authorName, $authorEmail, $authorWebsite, $content, $approved, $visibilityToken) { $id = (int) $id; $approved = (bool) $approved; $authorWebsite = (string) $authorWebsite; $authorWebsite = empty($authorWebsite) ? null : $authorWebsite; // NULL if empty //-- $commentID = DB::insert('comments', array('record' => $id, 'type' => (string) $type, 'authorName' => (string) $authorName, 'authorEmail' => (string) $authorEmail, 'authorWebsite' => $authorWebsite, 'authorIP' => ClientIP(), 'content' => (string) $content, 'created' => time(), 'approved' => $approved, 'visibilityToken' => (string) $visibilityToken)); // update counters DB::query('UPDATE __? SET commentsCount = commentsCount + 1 WHERE id = ?', $type . 's', $id); if ($approved) { DB::query('UPDATE __? SET approvedCommentsCount = approvedCommentsCount + 1 WHERE id = ?', $type . 's', $id); } //-- return $commentID; }
exit; } if (isset($_GET["group-ExcludeURL-LIST"])) { ExcludeURL_list(); exit; } if (isset($_POST["group-ExcludeURL-ADD"])) { ExcludeURL_add(); exit; } if (isset($_POST["group-ExcludeURL-DEL"])) { ExcludeURL_del(); exit; } if (isset($_GET["group-ClientIP"])) { ClientIP(); exit; } if (isset($_GET["group-ClientIP-LIST"])) { ClientIP_list(); exit; } if (isset($_POST["group-ClientIP-ADD"])) { ClientIP_add(); exit; } if (isset($_POST["group-ClientIP-DEL"])) { ClientIP_del(); exit; } if (isset($_GET["group-ClientURI"])) {