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


PHP deletecomments函数代码示例

本文整理汇总了PHP中deletecomments函数的典型用法代码示例。如果您正苦于以下问题:PHP deletecomments函数的具体用法?PHP deletecomments怎么用?PHP deletecomments使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了deletecomments函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deletecomments

function deletecomments($id)
{
    global $config, $db;
    $id = intval($id);
    $row = $db->super_query("SELECT id, post_id, user_id, is_register, approve FROM " . PREFIX . "_comments WHERE id = '{$id}'");
    $db->query("DELETE FROM " . PREFIX . "_comments WHERE id = '{$id}'");
    $db->query("DELETE FROM " . PREFIX . "_comment_rating_log WHERE c_id = '{$id}'");
    if ($row['is_register']) {
        $db->query("UPDATE " . USERPREFIX . "_users SET comm_num=comm_num-1 WHERE user_id ='{$row['user_id']}'");
    }
    if ($row['approve']) {
        $db->query("UPDATE " . PREFIX . "_post SET comm_num=comm_num-1 WHERE id='{$row['post_id']}'");
    }
    if ($config['tree_comments']) {
        $sql_result = $db->query("SELECT id FROM " . PREFIX . "_comments WHERE parent = '{$id}'");
        while ($row = $db->get_row($sql_result)) {
            deletecomments($row['id']);
        }
    }
}
开发者ID:Gordondalos,项目名称:union,代码行数:20,代码来源:deletecomments.php

示例2: array

         $next = 0;
         $nextdeleteitem = 'feed';
     }
 }
 if ($deleteitem == 'feed') {
     C::t('home_follow_feed')->delete_by_uid($uids);
     $nextdeleteitem = 'comment';
 }
 if ($deleteitem == 'comment') {
     $comments = array();
     $query = C::t('home_comment')->fetch_all_by_uid($uids, 0, $pertask);
     foreach ($query as $comment) {
         $comments[] = $comment['cid'];
     }
     if ($comments) {
         deletecomments($comments);
     } else {
         $next = 0;
         $nextdeleteitem = 'allitem';
     }
 }
 if ($deleteitem == 'allitem') {
     require_once libfile('function/delete');
     $numdeleted = deletemember($uids);
     if ($isfounder && !empty($_GET['includeuc'])) {
         loaducenter();
         uc_user_delete($uids);
     }
     if (!empty($_GET['uidarray'])) {
         cpmsg('members_delete_succeed', '', 'succeed', array('numdeleted' => $numdeleted));
     } else {
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:31,代码来源:admincp_members.php

示例3: foreach

        foreach ($moderate as $cid => $act) {
            $moderation[$act][] = $cid;
            $moderatedata[$act][$_G['gp_idtypes'][$cid]][] = $cid;
        }
    }
    foreach ($moderatedata as $act => $typeids) {
        foreach ($typeids as $idtype => $ids) {
            $op = $act == 'ignore' ? 1 : 2;
            updatemoderate($idtype . '_cid', $ids, $op);
        }
    }
    if ($validate_cids = dimplode($moderation['validate'])) {
        DB::update('home_comment', array('status' => '0'), "cid IN ({$validate_cids})");
        $validates = DB::affected_rows();
    }
    if (!empty($moderation['delete'])) {
        require_once libfile('function/delete');
        $comments = deletecomments($moderation['delete']);
        $deletes = count($comments);
    }
    if ($ignore_cids = dimplode($moderation['ignore'])) {
        DB::update('home_comment', array('status' => '2'), "cid IN ({$ignore_cids})");
        $ignores = DB::affected_rows();
    }
    if ($_G['gp_fast']) {
        echo callback_js($_G['gp_cid']);
        exit;
    } else {
        cpmsg('moderate_comments_succeed', "action=moderate&operation=comments&page={$page}&filter={$filter}&dateline={$_G['gp_dateline']}&username={$_G['gp_username']}&keyword={$_G['gp_keyword']}&idtype={$_G['gp_idtype']}&tpp={$_G['gp_tpp']}&showcensor={$showcensor}", 'succeed', array('validates' => $validates, 'ignores' => $ignores, 'deletes' => $deletes));
    }
}
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:moderate_comment.php

示例4: showmessage

            showmessage('content_is_too_short');
        }
        $message = censor($message);
        if (censormod($message)) {
            $comment_status = 1;
        } else {
            $comment_status = 0;
        }
        DB::update('home_comment', array('message' => $message, 'status' => $comment_status), array('cid' => $comment['cid']));
        showmessage('do_success', dreferer(), array('cid' => $comment['cid']), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true));
    }
    $comment['message'] = $bbcode->html2bbcode($comment['message']);
} elseif ($_GET['op'] == 'delete') {
    if (submitcheck('deletesubmit')) {
        require_once libfile('function/delete');
        if (deletecomments(array($cid))) {
            showmessage('do_success', dreferer(), array('cid' => $cid), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true));
        } else {
            showmessage('no_privilege');
        }
    }
} elseif ($_GET['op'] == 'reply') {
    $query = DB::query("SELECT * FROM " . DB::table('home_comment') . " WHERE cid='{$cid}'");
    if (!($comment = DB::fetch($query))) {
        showmessage('comments_do_not_exist');
    }
    if ($comment['idtype'] == 'uid' && ($seccodecheck || $secqaacheck)) {
        $seccodecheck = 0;
        $secqaacheck = 0;
    }
    $config = urlencode(getsiteurl() . 'home.php?mod=misc&ac=swfupload&op=config&doodle=1');
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:spacecp_comment.php

示例5: array

	[UCenter Home] (C) 2007-2008 Comsenz Inc.
	$Id: admincp_comment.php 12986 2009-08-04 04:24:33Z xupeng $
*/

if(!defined('IN_UCHOME') || !defined('IN_ADMINCP')) {
	exit('Access Denied');
}

//权限
if(!$allowmanage = checkperm('managecomment')) {
	$_GET['uid'] = $_SGLOBAL['supe_uid'];//只能操作本人的
}

if(submitcheck('deletesubmit')) {
	include_once(S_ROOT.'./source/function_delete.php');
	if(!empty($_POST['ids']) && deletecomments($_POST['ids'])) {
		cpmessage('do_success', $_POST['mpurl']);
	} else {
		cpmessage('the_correct_choice_to_delete_comments', $_POST['mpurl']);
	}
}

$mpurl = 'admincp.php?ac=comment';

//处理搜索
$intkeys = array('cid', 'id', 'authorid', 'uid');
$strkeys = array('author', 'ip', 'idtype');
$randkeys = array(array('sstrtotime','dateline'));
$likekeys = array('title', 'message');
$results = getwheres($intkeys, $strkeys, $randkeys, $likekeys);
$wherearr = $results['wherearr'];
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:admincp_comment.php

示例6: showsetting

        showsetting('comment_search_author', 'author', $author, 'text');
        showsetting('comment_search_authorid', 'authorid', $authorid, 'text');
        showsetting('comment_search_uid', 'uid', $uid, 'text');
        showsetting('comment_search_message', 'message', $message, 'text');
        showsetting('comment_search_ip', 'ip', $ip, 'text');
        showsetting('comment_search_time', array('starttime', 'endtime'), array($starttime, $endtime), 'daterange');
        echo '<input type="hidden" name="fromumanage" value="' . $fromumanage . '">';
        showsubmit('searchsubmit');
        showtablefooter();
        showformfooter();
        showtagfooter('div');
    } else {
        $cids = authcode($cids, 'DECODE');
        $cidsadd = $cids ? explode(',', $cids) : $_GET['delete'];
        include_once libfile('function/delete');
        $deletecount = count(deletecomments($cidsadd));
        $cpmsg = cplang('comment_succeed', array('deletecount' => $deletecount));
        ?>
	<script type="text/JavaScript">alert('<?php 
        echo $cpmsg;
        ?>
');parent.$('commentforum').searchsubmit.click();</script>
	<?php 
    }
    if (submitcheck('searchsubmit', 1)) {
        $comments = $commentcount = '0';
        $sql = $error = '';
        $authorids = array();
        $author = trim($author);
        if ($id != '') {
            $id = explode(',', $id);
开发者ID:softhui,项目名称:discuz,代码行数:31,代码来源:admincp_comment.php

示例7: deleteinfo

function deleteinfo($ids)
{
    global $_SGLOBAL;
    include_once S_ROOT . './source/function_delete.php';
    $deltype = array();
    $reportuser = array();
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('report') . " WHERE rid IN (" . simplode($ids) . ")");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $value['user'] = unserialize($value['uids']);
        $reportuser[] = array_shift(array_flip($value['user']));
        $deltype[$value['idtype']][] = $value['id'];
    }
    $gid = getgroupid($_SGLOBAL['member']['experience'], $_SGLOBAL['member']['groupid']);
    //Perform the corresponding delete operations
    $i = 0;
    $_SGLOBAL['usergroup'][$gid]['managebatch'] = 1;
    foreach ($deltype as $key => $value) {
        switch ($key) {
            case 'blogid':
                $_SGLOBAL['usergroup'][$gid]['manageblog'] = 1;
                deleteblogs($value);
                break;
            case 'picid':
                $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1;
                deletepics($value);
                break;
            case 'albumid':
                $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1;
                deletealbums($value);
                break;
            case 'tid':
                $_SGLOBAL['usergroup'][$gid]['managethread'] = 1;
                deletethreads(0, $value);
                break;
            case 'tagid':
                $_SGLOBAL['usergroup'][$gid]['managemtag'] = 1;
                deletemtag($value);
                break;
            case 'sid':
                $_SGLOBAL['usergroup'][$gid]['manageshare'] = 1;
                deleteshares($value);
                break;
            case 'uid':
                $_SGLOBAL['usergroup'][$gid]['managedelspace'] = 1;
                foreach ($value as $uid) {
                    deletespace($uid);
                }
                break;
            case 'eventid':
                $_SGLOBAL['usergroup'][$gid]['manageevent'] = 1;
                deleteevents($value);
                break;
            case 'pid':
                $_SGLOBAL['usergroup'][$gid]['managepoll'] = 1;
                deletepolls($value);
                break;
            case 'comment':
                $_SGLOBAL['usergroup'][$gid]['managecomment'] = 1;
                deletecomments($value);
                break;
            case 'post':
                $_SGLOBAL['usergroup'][$gid]['managethread'] = 1;
                deleteposts(0, $value);
                break;
        }
        //The first reporter award
        getreward('report', 1, $reportuser[$i], '', 0);
        $i++;
    }
}
开发者ID:v998,项目名称:discuzx-en,代码行数:70,代码来源:admincp_report.php

示例8: switch

<?php

switch ($_GET['req']) {
    case '1':
        addcomment();
        break;
    case '2':
        fetchcomments();
        break;
    case '3':
        deletecomments();
        break;
}
function addcomment()
{
    $name = ucwords(trim(strip_tags($_GET['name'])));
    $comment = trim(strip_tags($_GET['comment']));
    $data = json_decode(file_get_contents('../files/comments.json', true));
    $i = count($data);
    $data[$i]['name'] = $name;
    $data[$i]['comment'] = $comment;
    $data[$i]['moment'] = time();
    file_put_contents('../files/comments.json', json_encode($data));
    print json_encode("Comment posted!");
}
function fetchcomments()
{
    $data = file_get_contents('../files/comments.json');
    print $data;
}
function deletecomments()
开发者ID:rapando,项目名称:noDB,代码行数:31,代码来源:comments.php


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