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


PHP QueueManager::pushLoadUserQqavatar方法代码示例

本文整理汇总了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;
 }
开发者ID:huqq1987,项目名称:clone-lemon,代码行数:69,代码来源:Sso.class.php


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