コード例 #1
0
ファイル: friendinvite.php プロジェクト: jechiy/PHPWind
                if ($value['uid'] && array_key_exists($value['uid'], $userList)) {
                    unset($userList[$value['uid']]);
                }
            }
        }
        $emailCount = is_array($emailList) ? count($emailList) : 0;
        $friendCount = count($friendList);
        $notFriendCount = count($userList);
    }
    require_once PrintEot('ajax_friendinvite');
    ajax_footer();
} elseif ($step == 'addfriend') {
    S::gp(array('value'), 'GP');
    empty($value) && Showmsg("非法操作");
    L::loadClass('friend', 'friend', false);
    $friendServer = new PW_Friend();
    $value = explode(',', $value);
    $check = $friendServer->getFriendCheck($value);
    $friend = array();
    foreach ($value as $key => $id) {
        if ($id != $winduid) {
            if (getstatus($check[$id], 3, 3) == 0) {
                $friend[] = array($winduid, $id, 0, $timestamp, '');
                $friend[] = array($id, $winduid, 0, $timestamp, '');
            } elseif (getstatus($check[$id], 3, 3) == 1) {
                $friend[] = array($id, $winduid, 1, $timestamp, '');
            }
        }
    }
    $friend && $friendServer->addFriends($friend);
    exit;
コード例 #2
0
ファイル: ms_ajax.php プロジェクト: jechiy/PHPWind
<?php

!defined('P_W') && exit('Forbidden');
S::gp(array('action'));
define('FRIEND_SEPARATER', '#%');
!in_array($action, array('friend', 'mark', 'del', 'postReply', 'overlook', 'post', 'agree', 'markgroup', 'shield', 'unshield', 'open', 'close', 'replay')) && ajaxExport("非法操作请返回");
if (in_array($action, array('friend', 'agree', 'overlook'))) {
    L::loadClass('friend', 'friend', false);
    $friendObj = new PW_Friend(FRIEND_SEPARATER);
}
if (!$winduid) {
    ajaxExport(array('bool' => $bool, 'message' => '你还没有登录'));
}
if ('friend' == $action) {
    /*
    S::gp(array('gname'));
    if ($gname == '-2') {
    	 $friend = $friendObj->getFriends($winduid);
    	 $group	 = $friendObj->getFriendColonys($winduid);
    	 $json	 = array('friend'=>$friend,'group'=>$group);
    	 ajaxExport($json);
    } elseif ($gname == '0') {
    	 ajaxExport($friendObj->getFriendsByColony($winduid, 0));
    } elseif ($gname) {
    	 ajaxExport($friendObj->getFriendsByColony($winduid, $gname, 'name'));
    } else {
    	$friends = array();
    	$attentionService = L::loadClass('attention','friend');
    	$attentionList = $attentionService->getUidsInFollowList($winduid);
    	if(S::isArray($attentionList)) {
    		$userService = L::loadClass('userservice','user');