+ {Comment_Author}
+{Comment}
+diff --git a/admin/comments.php b/admin/comments.php new file mode 100644 index 0000000..29ca416 --- /dev/null +++ b/admin/comments.php @@ -0,0 +1,203 @@ + + + =========================== */ +?> +isAdmin(); +$isEdition = isset($_GET["edit"]); +$commentId = ($isEdition) ? $_GET["edit"] : NULL; + +if(isset($_POST["btnAdd"])) { + unset($_POST["btnAdd"]); + $_POST["username"] = strip_tags($_POST["username"]); + $_POST["email"] = strip_tags($_POST["email"]); + $_POST["web"] = strip_tags($_POST["web"]); + + if (isset($_POST["id_comment"])) { + if ($isAdmin) { + if ($comment->modifyComment($_POST, $_POST["id_comment"])) { + header("Location: comments.php?modified=true"); + die(); + } else { + header("Location: comments.php?modified=false"); + die(); + } + } + } else { + $comment->generateCookie($_POST); + $_POST["spam"] = ($comment->isSpam($_POST)) ? "1" : "0"; + $_POST["ip_user"] = $_SERVER["REMOTE_ADDR"]; + + if ($comment->addComment($_POST)) { + header("Location: ".$conf->urlGelato."/index.php/post/".$_POST["id_post"]); + die(); + } + } +} + +if ($isAdmin) { + + if (isset($_GET["delete"])) { + if ($comment->deleteComment($_GET['delete'])) { + header("Location: comments.php?deleted=true"); + die(); + } else { + header("Location: comments.php?deleted=false"); + die(); + } + } + +?> + + +
++".__("The comment has been eliminated successfully.")."
+ {Comment_Author}
+{Comment}
+- +
-
- el <*Fecha*>
- <*TextoComentario*> + at {Date}
+ {Comment}