本文整理汇总了PHP中QueueManager::pushLoadUserQqavatar方法的典型用法代码示例。如果您正苦于以下问题:PHP QueueManager::pushLoadUserQqavatar方法的具体用法?PHP QueueManager::pushLoadUserQqavatar怎么用?PHP QueueManager::pushLoadUserQqavatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueueManager
的用法示例。
在下文中一共展示了QueueManager::pushLoadUserQqavatar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initQqLoginUser
public function initQqLoginUser($qc, $accessToken, $openId, $nickName)
{
if (empty($qc) || empty($accessToken) || empty($openId) || empty($nickName)) {
return false;
}
$NicknameMd5Obj = new NicknameMd5();
if ($NicknameMd5Obj->checkNameIsExist($nickName)) {
$this->setError(ErrorConf::nickNameIsExist());
return false;
}
$qqUserInfo = $this->getQqInfo($qc);
if (empty($qqUserInfo)) {
return false;
}
$gender = $qqUserInfo['gender'];
$province = $qqUserInfo['province'];
$city = $qqUserInfo['city'];
$year = $qqUserInfo['year'];
$qqavatar = $qqUserInfo['qqAvatar'];
$birthday = '';
if (!empty($year)) {
$birthday = $year . "-01-01";
}
$addtime = date('Y-m-d H:i:s');
$db = DbConnecter::connectMysql('share_passport');
$qquserpasword = md5('QL' . time());
$sql = "insert into passport (username,password,addtime) values (?,?,?)";
$st = $db->prepare($sql);
$st->execute(array('QL', $qquserpasword, $addtime));
$uid = $db->lastInsertId() + 0;
if ($uid == 0) {
return false;
}
$sql = "insert into qqrelation (open_id,uid,access_token,addtime) values (?,?,?,?)";
$st = $db->prepare($sql);
$st->execute(array($openId, $uid, $accessToken, $addtime));
$NicknameMd5Obj->addOne($nickName, $uid);
$avatartime = 0;
if ($qqavatar != "") {
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $qqavatar); //
// curl_setopt($ch, CURLOPT_TIMEOUT, 10); //
// curl_setopt($ch, CURLOPT_USERAGENT, "Baiduspider+(+ http://www.baidu.com/search/spider.htm)");
// curl_setopt($ch, CURLOPT_REFERER, $qqavatar);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $content = curl_exec($ch);
// curl_close($ch);
// $avatarfile = "/alidata/tmpavatarfile/{$uid}";
// file_put_contents( $avatarfile, $content);
// if(is_file($avatarfile))
// {
// $obj = new alioss_sdk();
// //$obj->set_debug_mode(FALSE);
// $bucket = 'tutuavatar';
// $responseObj = $obj->upload_file_by_file($bucket,$uid,$avatarfile);
// if ($responseObj->status==200){
// $avatartime = time();
// }
// }
QueueManager::pushLoadUserQqavatar($uid, $qqavatar);
}
$UserObj = new User();
$UserObj->initQQLoginUser($uid, $nickName, $avatartime, $gender, $birthday, $province, $city, $addtime);
$this->setSsoCookie(array('uid' => $uid, 'pasword' => $qquserpasword), array('nickname' => $nickName));
$return = array('uid' => $uid, 'nickname' => $nickName, 'avatartime' => time());
QueueManager::pushAfterRegQueue($uid);
QueueManager::pushUserInfoToSearch($uid);
return $return;
}