当前位置: 首页>>代码示例>>PHP>>正文


PHP deleteComment函数代码示例

本文整理汇总了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);
 }
开发者ID:AhmedAtef07,项目名称:Vacebook,代码行数:11,代码来源:posts.php

示例2: commentCon

function commentCon($id, $action)
{
    switch ($action) {
        case '1':
            deleteComment($id);
            break;
        case '2':
            cancleInformComment($id);
        default:
            break;
    }
}
开发者ID:dalinhuang,项目名称:HCI-forum,代码行数:12,代码来源:informResult.php

示例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);
}
开发者ID:BackupTheBerlios,项目名称:loquacity-svn,代码行数:52,代码来源:admin.comments.php

示例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);
}
开发者ID:BackupTheBerlios,项目名称:bblog-svn,代码行数:56,代码来源:admin.comments.php

示例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;
开发者ID:ChayneThrash,项目名称:DCSP_Group_Project,代码行数:15,代码来源:deleteComment.php

示例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 
开发者ID:ragi79,项目名称:Textcube,代码行数:31,代码来源:index.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);
开发者ID:aryalprakash,项目名称:rroute,代码行数:31,代码来源:ajaxDispatcher.php

示例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()
{
开发者ID:neequole,项目名称:sp2,代码行数:30,代码来源:commentFunc.php

示例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">
开发者ID:hardihuang,项目名称:zihuaxiang,代码行数:31,代码来源:doAction.php

示例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>';
}
开发者ID:nilvisa,项目名称:litter,代码行数:31,代码来源:request.php

示例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() {
开发者ID:CSchool,项目名称:AIBattle,代码行数:31,代码来源:comments.php

示例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']);
    }
}
开发者ID:up201306506,项目名称:LTW20152016,代码行数:10,代码来源:addremoveComment.php

示例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 = "";
开发者ID:uniteddiversity,项目名称:LiteMap,代码行数:31,代码来源:service.php

示例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'];
开发者ID:samterer,项目名称:Nsore,代码行数:31,代码来源:devotionHandler.php

示例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';
开发者ID:Rbeuque74,项目名称:boutiqueMvc,代码行数:31,代码来源:delete-comment.php


注:本文中的deleteComment函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。