function guest_agree_delete($sid, $pid, $touid, $tid) { $pid = intval($pid); $sid = addslashes($sid); $r = db_exec("DELETE FROM `bbs_guest_agree` WHERE sid='{$sid}' AND pid='{$pid}'"); if ($r !== FALSE) { user_update($touid, array('agrees-' => 1)); post_update($pid, array('agrees-' => 1)); $tid and thread_update($tid, array('agrees-' => 1)); // 改变用户组 user_update_group($touid); return TRUE; // 0 } else { return FALSE; } }
function myagree_delete($uid, $pid, $isfirst) { $agree = myagree_read($pid, $uid); if (empty($agree)) { return 0; } $fromuid = $agree['uid']; $touid = $agree['touid']; $tid = $agree['tid']; $r = db_exec("DELETE FROM `bbs_myagree` WHERE uid='{$uid}' AND pid='{$pid}' LIMIT 1"); db_exec("DELETE FROM `bbs_post_agree` WHERE pid='{$pid}' AND uid='{$uid}' LIMIT 1"); if ($r !== FALSE) { user_update($fromuid, array('myagrees-' => 1)); user_update($touid, array('agrees-' => 1)); post_update($pid, array('agrees-' => 1)); $isfirst and thread_update($tid, array('agrees-' => 1)); // 改变用户组 user_update_group($touid); return $r; // 0 } else { return FALSE; } }