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


PHP privacy_update函数代码示例

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


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

示例1: privacy_update

        privacy_update();
        showmessage('do_success', $_POST['refer']);
    }
} elseif ($op == 'groupignore') {
    $groups = getfriendgroup();
    $group = intval($_GET['group']);
    if (!isset($groups[$group])) {
        showmessage('change_friend_groupname_error');
    }
    if (submitcheck('groupignoresubmit')) {
        if (isset($space['privacy']['filter_gid'][$group])) {
            unset($space['privacy']['filter_gid'][$group]);
        } else {
            $space['privacy']['filter_gid'][$group] = $group;
        }
        privacy_update();
        friend_cache($_SGLOBAL['supe_uid']);
        //缓存更新
        showmessage('do_success', $_POST['refer'], 0);
    }
} elseif ($op == 'blacklist') {
    if ($_GET['subop'] == 'delete') {
        $_GET['uid'] = intval($_GET['uid']);
        $_SGLOBAL['db']->query("DELETE FROM " . tname('blacklist') . " WHERE uid='{$space['uid']}' AND buid='{$_GET['uid']}'");
        showmessage('do_success', "space.php?do=friend&view=blacklist&start={$_GET['start']}", 0);
    }
    if (submitcheck('blacklistsubmit')) {
        $_POST['username'] = trim($_POST['username']);
        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('space') . " WHERE username='{$_POST['username']}'");
        if (!($tospace = $_SGLOBAL['db']->fetch_array($query))) {
            showmessage('space_does_not_exist');
开发者ID:NaturalWill,项目名称:UCQA,代码行数:31,代码来源:cp_friend.php

示例2: _adminUser


//.........这里部分代码省略.........
         $maxfriendnum = checkperm('maxfriendnum');
         if ($maxfriendnum && $space['friends'] >= $maxfriendnum + $space['addfriend']) {
             if ($_G['magic']['friendnum']) {
                 $list = $this->makeErrorInfo($res, 'enough_of_the_number_of_friends_with_magic');
                 $this->_exitWithHtmlAlert($list['errcode']);
             } else {
                 $list = $this->makeErrorInfo($res, 'enough_of_the_number_of_friends');
                 $this->_exitWithHtmlAlert($list['errcode']);
             }
         }
         if ($act == 'add') {
             if (!checkperm('allowfriend')) {
                 $list = $this->makeErrorInfo($res, 'no_privilege_addfriend');
                 $this->_exitWithHtmlAlert($list['errcode']);
             }
             if (C::t('home_friend_request')->count_by_uid_fuid($uid, $_G['uid'])) {
                 $list = $this->makeErrorInfo($res, 'waiting_for_the_other_test');
                 $this->_exitWithHtmlAlert($list['errcode']);
             }
         }
     }
     require_once libfile('function/friend');
     require_once libfile('function/spacecp');
     if (!empty($_POST)) {
         switch ($act) {
             case 'add':
                 $note = $_GET['note'];
                 if (!friend_request_check($uid)) {
                     $_POST['gid'] = $gid;
                     $_POST['note'] = censor(htmlspecialchars(cutstr($note, strtolower(CHARSET) == 'utf-8' ? 30 : 20, '')));
                     friend_add($uid, $_POST['gid'], $_POST['note']);
                     $note = array('uid' => $_G['uid'], 'url' => 'home.php?mod=spacecp&ac=friend&op=add&uid=' . $_G['uid'] . '&from=notice', 'from_id' => $_G['uid'], 'from_idtype' => 'friendrequest', 'note' => !empty($_POST['note']) ? lang('spacecp', 'friend_request_note', array('note' => $_POST['note'])) : '');
                     notification_add($uid, 'friend', 'friend_request', $note);
                     // ios push
                     UserUtils::pushIOSMessage($uid, 'friend', $_G['username'] . WebUtils::t(' 请求加您为好友') . $note['note']);
                     require_once libfile('function/mail');
                     $values = array('username' => $tospace['username'], 'url' => getsiteurl() . 'home.php?mod=spacecp&ac=friend&op=request');
                     sendmail_touser($uid, lang('spacecp', 'friend_subject', $values), '', 'friend_add');
                     $list = $this->makeErrorInfo($res, 'request_has_been_sent');
                     $this->_exitWithHtmlAlert($list['errcode']);
                 }
                 $this->_exitWithHtmlAlert($res['errcode']);
             case 'add2':
                 global $_G;
                 require_once libfile('function/home');
                 $_POST['gid'] = intval($gid);
                 friend_add($uid, $uid);
                 if (ckprivacy('friend', 'feed')) {
                     require_once libfile('function/feed');
                     feed_add('friend', 'feed_friend_title', array('touser' => "<a href=\"home.php?mod=space&uid={$tospace['uid']}\">{$tospace['username']}</a>"));
                 }
                 notification_add($uid, 'friend', 'friend_add');
                 // showmessage('friends_add', dreferer(), array('username' => $tospace['username'], 'uid'=>$uid, 'from' => $_GET['from']), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true));
                 $list = $this->makeErrorInfo($res, 'friends_add', array('{username}' => $tospace['username']));
                 $this->_exitWithHtmlAlert($list['errcode']);
                 break;
             case 'ignore':
                 global $_G;
                 require_once libfile('function/friend');
                 friend_delete($uid);
                 $params['noError'] = 1;
                 $list = $this->makeErrorInfo($res, 'do_success', $params);
                 $this->_exitWithHtmlAlert($list['errcode']);
                 break;
             case 'shield':
                 global $_G, $space;
                 // $type = empty($_GET['type'])?'':preg_replace("/[^0-9a-zA-Z\_\-\.]/", '', $_GET['type']);
                 // if(submitcheck('ignoresubmit')) {
                 $authorid = empty($_POST['authorid']) ? 0 : intval($_POST['authorid']);
                 $type = 'friend';
                 if ($type) {
                     $type_uid = $type . '|' . $authorid;
                     if (empty($space['privacy']['filter_note']) || !is_array($space['privacy']['filter_note'])) {
                         $space['privacy']['filter_note'] = array();
                     }
                     $space['privacy']['filter_note'][$type_uid] = $type_uid;
                     privacy_update();
                 }
                 $this->_exitWithHtmlAlert('do_success');
                 // showmessage('do_success', dreferer(), array(), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true));
                 // }
                 $formid = random(8);
                 break;
             default:
                 $errorMsg = '错误的动作参数';
                 break;
         }
     } else {
         if ($act == 'add') {
             require_once libfile('function/friend');
             $groups = $this->_getFriendGroupList();
             $tospace = getuserbyuid($uid);
         } elseif ($act == 'add2') {
             require_once libfile('function/friend');
             $groups = $this->_getFriendGroupList();
             $tospace = $this->_getFriendUserByUid($uid);
         }
     }
     $this->getController()->renderPartial('userAdmin', array('formUrl' => WebUtils::createUrl_oldVersion('user/useradminview', array('uid' => $uid, 'act' => $act, 'type' => $type)), 'errorMsg' => $errorMsg, 'action' => $act, '_G' => $_G, 'groups' => $groups, 'tospace' => $tospace));
 }
开发者ID:caidongyun,项目名称:CS,代码行数:101,代码来源:UserAdminViewAction.php


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