本文整理汇总了PHP中deleteComment函数的典型用法代码示例。如果您正苦于以下问题:PHP deleteComment函数的具体用法?PHP deleteComment怎么用?PHP deleteComment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deleteComment函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteComment
public function deleteComment($commentId = -1)
{
$response['signed'] = false;
$response['succeeded'] = false;
if (isset($_SESSION["user_id"]) && strlen(trim($_SESSION["user_id"])) > 0 && $commentId != -1) {
$response['signed'] = true;
deleteComment($commentId);
$response['succeeded'] = true;
}
echo json_encode($response);
}
示例2: commentCon
function commentCon($id, $action)
{
switch ($action) {
case '1':
deleteComment($id);
break;
case '2':
cancleInformComment($id);
default:
break;
}
}
示例3: admin_plugin_comments_run
function admin_plugin_comments_run(&$loq)
{
// Again, the plugin API needs work.
$commentAmount = 50;
if (isset($_POST['commentsQuantity'])) {
if ($_POST['commentsQuantity'] == 'ALL') {
$commentAmount = 'ALL';
} else {
$commentAmount = intval($_POST['commentsQuantity']);
}
}
$commentAmount = isset($_POST['commentsQuantity']) ? intval($_POST['commentsQuantity']) : 50;
$articles = null;
if (isset($_POST['commentsPosts'])) {
$articles = $_POST['commentsPosts'] === 'All' ? null : intval($_POST['commentsPosts']);
}
$commentdo = isset($_POST['commentdo']) ? strtolower($_POST['commentdo']) : '';
if ($commentdo == '') {
$commentdo = isset($_GET['commentdo']) ? strtolower($_GET['commentdo']) : '';
}
switch ($commentdo) {
case "delete":
// delete comments
if (is_array($_POST['commentid'])) {
foreach ($_POST['commentid'] as $key => $val) {
deleteComment($loq, $val, $_POST['postid'][$val]);
}
}
break;
case "edit":
$commentid = intval($_GET['editComment']);
$postid = intval($_GET['postid']);
editComment($loq, $commentid, $postid);
break;
case "editsave":
saveEdit($loq);
break;
case "approve":
if (is_array($_POST['commentid'])) {
foreach ($_POST['commentid'] as $key => $val) {
$loq->_adb->Execute("UPDATE " . T_COMMENTS . " SET onhold='0' WHERE commentid='" . intval($val) . "'");
}
}
break;
case "filter":
default:
// show form
break;
}
retrieveComments($loq, $commentAmount, $articles);
populateSelectList($loq);
}
示例4: admin_plugin_comments_run
/**
* Main function of plugin
*
* @param object $bBlog Instance of bBlog object
* @return void
*
*/
function admin_plugin_comments_run(&$bBlog)
{
// Again, the plugin API needs work.
$commentAmount = 50;
if (isset($_GET['commentdo'])) {
$commentdo = $_GET['commentdo'];
} elseif (isset($_POST['commentdo'])) {
$commentdo = $_POST['commentdo'];
} else {
$commentdo = "";
}
switch ($commentdo) {
case "Delete":
// delete comments
if (is_array($_POST['commentid'])) {
foreach ($_POST['commentid'] as $key => $val) {
deleteComment(&$bBlog, $val);
}
}
break;
case "Edit":
$commentid = intval($_GET['editComment']);
$postid = intval($_GET['postid']);
editComment(&$bBlog, $commentid, $postid);
break;
case "editsave":
saveEdit(&$bBlog);
break;
case "Approve":
if (is_array($_POST['commentid'])) {
foreach ($_POST['commentid'] as $key => $val) {
$bBlog->query("UPDATE " . T_COMMENTS . " SET onhold='0' WHERE commentid='" . intval($val) . "'");
}
}
break;
case "25":
case "50":
case "100":
case "150":
case "200":
$commentAmount = intval($commentdo);
break;
default:
// show form
break;
}
retrieveComments(&$bBlog, $commentAmount);
populateSelectList(&$bBlog);
}
示例5: session_start
<?php
include "../util/DbUtil.php";
session_start();
$commentid = $_POST['commentid'];
$response = "";
$db_conn = getConnectedDb();
if (is_null($db_conn)) {
$response = "Error connecting to database. Try again later.";
} elseif (!deleteComment($db_conn, $commentid)) {
$response = "Comment unable to be deleted for unknown reason.";
} else {
$response = "success";
}
echo $response;
示例6: define
define('__TEXTCUBE_MOBILE__', true);
if (empty($suri['id'])) {
$IV = array('POST' => array('replyId' => array('id'), 'password' => array('string', 'mandatory' => false)));
}
require ROOT . '/library/preprocessor.php';
requireView('mobileView');
requireStrictRoute();
if (empty($suri['id'])) {
list($entryId) = getCommentAttributes($blogid, $_POST['replyId'], 'entry');
if (deleteComment($blogid, $_POST['replyId'], $entryId, isset($_POST['password']) ? $_POST['password'] : '') === false) {
printMobileErrorPage(_text('댓글을 삭제할 수 없습니다.'), _text('비밀번호가 일치하지 않습니다.'), $context->getProperty('uri.blog') . "/comment/delete/{$_POST['replyId']}");
exit;
}
} else {
list($entryId) = getCommentAttributes($blogid, $suri['id'], 'entry');
if (deleteComment($blogid, $suri['id'], $entryId, '') === false) {
printMobileErrorPage(_t('댓글을 삭제할 수 없습니다'), _t('관리자가 아닙니다'), $context->getProperty('uri.blog') . "/comment/delete/{$suri['id']}");
exit;
}
}
list($entries, $paging) = getEntryWithPaging($blogid, $entryId);
$entry = $entries ? $entries[0] : null;
printMobileHtmlHeader();
?>
<div id="content">
<h2><?php
echo _t('댓글이 삭제됐습니다');
?>
</h2>
</div>
<?php
示例7: json_encode
}
$responce['content'] = $content;
} else {
$responce['result'] = '';
}
echo json_encode($responce);
break;
case 'report-project':
require_once DIR_APP . 'projects.php';
reportProject($_POST['project_id'], $_POST['copyright'], $_POST['spam'], $_POST['violent'], $_POST['abusive'], $_POST['impersonation'], $_POST['harassment']);
$responce['result'] = 'OK';
echo json_encode($responce);
break;
case 'delete-comment':
require_once DIR_APP . 'projects.php';
deleteComment($_POST['comment_id']);
$responce['result'] = 'OK';
echo json_encode($responce);
break;
case 'delete-idea-comment':
require_once DIR_APP . 'projects.php';
deleteIdeaComment($_POST['comment_id']);
minusInteraction($_POST['ideathread_id']);
$responce['result'] = 'OK';
echo json_encode($responce);
break;
case 'delete-idea':
require_once DIR_APP . 'projects.php';
deleteIdea($_POST['ideathread_id']);
$response['result'] = 'OK';
echo json_encode($response);
示例8: session_start
/*
** Controls all User-specific functionalities
** E.g Create user, Delete user, Edit user, Search user, Logout user
*/
include "config.php";
session_start();
//get action var: action|''
$action = isset($_POST['action']) ? $_POST['action'] : "";
//controls what to show in the front page
switch ($action) {
case 'addComment':
addComment();
break;
case 'deleteComment':
deleteComment();
break;
case 'editComment':
editComment();
break;
default:
homepage();
}
function addComment()
{
$comment = new Comment();
$comment->storeFormValues($_POST);
$comment->insertComment();
}
function deleteComment()
{
示例9: signup
if ($act === 'signup') {
$msg = signup();
} elseif ($act === 'login') {
$msg = login();
} elseif ($act === 'logout') {
$msg = logout();
} elseif ($act === 'post') {
$msg = post();
} elseif ($act === 'deletePost') {
$msg = deletePost();
} elseif ($act === 'likePost') {
$msg = likePost();
} elseif ($act === 'commentPost') {
$msg = commentPost();
} elseif ($act === 'deleteComment') {
$msg = deleteComment();
} elseif ($act === 'changeInfo') {
$msg = changeInfo();
} elseif ($act === 'readNotify') {
$msg = readNotify();
} elseif ($act === 'markAllRead') {
$msg = markAllRead();
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="keywords" content="">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
示例10: replyComment
}
if (isset($_POST['reply'])) {
print replyComment();
}
if (isset($_POST['profile_pic'])) {
print changeProfilePic();
}
if (isset($_POST['changeInfo'])) {
print changeInfo();
}
if (isset($_POST['del_user'])) {
deleteUser();
}
if (isset($_POST['del_post'])) {
print deletePost();
}
if (isset($_POST['del_comment'])) {
print deleteComment();
}
if (isset($_POST['recycle'])) {
print recycle();
}
if (isset($_POST['follow'])) {
print follow();
}
if (isset($_POST['unfollow'])) {
print follow();
}
print '</h3><button type="button" id="hide_btn" class="button">close</button>';
print '</div>';
}
示例11: getNewsData
}
$currentNews = getNewsData($newsId);
if (isset($_POST['submit'])) {
$postNewsId = intval($_POST['newsId']);
$postCommentId = intval($_POST['commentId']);
if ($postCommentId == -1) {
sendComments($postNewsId, $_POST['userComment']);
} else {
updateComment($postCommentId, $_POST['userComment']);
}
header("Location: comments.php?news={$postNewsId}");
exit;
}
if (isset($_POST['delete'])) {
$postCommentId = intval($_POST['commentId']);
deleteComment($postCommentId);
}
?>
<script>
function deleteComment(newsId, commentId)
{
$.post
(
"comments.php",
{
'commentId' : commentId,
'delete' : true
}
).done(function() {
示例12: newComment
<?php
if (isset($_POST['NewComment']) && $_SESSION['csrf'] == $_POST['csrf']) {
newComment($_POST['Event_ID'], $_POST['User_ID'], $_POST['NewCommentText']);
}
if (isset($_POST['DeleteComment']) && $_SESSION['csrf'] == $_POST['csrf']) {
if (checkIfCommentExists($_POST['Comment_ID'])) {
deleteComment($_POST['Comment_ID']);
}
}
示例13: getVotes
$response = getVotes($itemid);
break;
/** FOLLOWING **/
/** FOLLOWING **/
case "addfollowing":
$itemid = required_param('itemid', PARAM_ALPHANUMEXT);
$response = addFollowing($itemid);
break;
case "deletefollowing":
$itemid = required_param('itemid', PARAM_ALPHANUMEXT);
$response = deleteFollowing($itemid);
break;
case "deletecomment":
$nodeid = required_param('nodeid', PARAM_ALPHANUMEXT);
$parentconnid = optional_param('parentconnid', "", PARAM_ALPHANUMEXT);
$response = deleteComment($nodeid, $parentconnid);
break;
case "connectnodetocomment":
$comment = required_param('comment', PARAM_TEXT);
$nodeid = required_param('nodeid', PARAM_ALPHANUMEXT);
$nodetypename = required_param('nodetypename', PARAM_TEXT);
$parentconnid = optional_param('parentconnid', "", PARAM_ALPHANUMEXT);
$parentid = optional_param('parentid', "", PARAM_ALPHANUMEXT);
$response = connectNodeToComment($nodeid, $nodetypename, $comment, $parentconnid, $parentid, $style);
break;
case "auditsearch":
$query = required_param('q', PARAM_TEXT);
$tagsonlyoption = optional_param('tagsonly', 'N', PARAM_TEXT);
$type = optional_param('type', 'main', PARAM_ALPHA);
$typeitemid = optional_param('typeitemid', '', PARAM_TEXT);
$searchid = "";
示例14: json_encode
$message = json_encode($message);
$gcm = new GCMmanager();
$type = "Group Feed Comment";
$gcm->sendPush($deviceIDs, $message, $type);
//echo alertForDevotionComment($cid,$devotionDetails,$churchID,$memberID,$username);
echo trim('Saved');
exit;
} else {
echo "Not saved";
exit;
}
} else {
if ($reason == "Delete Feed Comment") {
$cid = $_POST['topicid'];
//$query="Delete from `daily_guide_lessons_comments` where `daily_guide_lessons_comment_id`='$cid' ";
echo $results = deleteComment($cid);
exit;
} else {
if ($reason == "Save Nsore Group Feed") {
$username = "A user ";
$title = "";
if (isset($_POST['reason'])) {
$cid = $_POST['GID'];
$data = $_POST['userpost'];
if (isset($_POST['UN'])) {
$uname = $_POST['UN'];
}
$date = date('Y-m-d');
$memberID = $_POST['senderid'];
} else {
$cid = $_GET['GID'];
示例15: getComment
include_once 'modele/news/getComments.php';
$commentArray = getComment($id);
foreach ($commentArray as $com) {
$pseudo = $com['pseudo'];
$id_user = $com['ID_membre'];
$id_news = $com['ID_news'];
}
if (!isset($pseudo)) {
$js = false;
$redirect[0] = 'javascript:history.go(-1)';
$redirect[1] = '1';
$page = 'accueil';
$titreErreur = 'news - erreur';
$erreur = 'Ce commentaire n\'existe pas !';
include_once 'vue/erreur.php';
die;
}
$admin = areYouAdmin();
if (!$admin and (!$_SESSION['login'] or $id_user != $_SESSION['ID'])) {
$js = false;
$redirect[0] = 'javascript:history.go(-1)';
$redirect[1] = '1';
$page = 'accueil';
$titreErreur = 'news - erreur';
$erreur = 'Vous n\'êtes pas autorisé à supprimer un commentaire qui ne vous appartient pas!';
include_once 'vue/erreur.php';
die;
}
include_once 'modele/news/ajoutComment.php';
deleteComment($id);
include_once 'vue/news/delete-comment.php';