当前位置: 首页 > 后端技术 > PHP

国际多语种婚恋交友网站的开发与制作,篇

时间:2023-03-29 22:46:34 PHP

前面介绍了会员部分的一些功能,大家也可以看看第一篇:https://blog.csdn.net/weixin_...第二篇:https://blog.csdn.net/weixin_...这是一个国际多语言交友网站开发制作的栏目:https://blog.csdn.net/weixin_...有什么问题可以随时联系我,大家,我的链接是2360248-666这是功能介绍图下面是系统设置直接上传OSS的一些功能publicfunctionmjdr(){//直接上传OSS$p=I("get.p");if(!$p)$p=0;$page=10;$list=M()->table("lx_users")->limit($p*$page,$page)->order('useridasc')->select();foreach($listas$val){if($val["avatar"]&&!strstr('http:',$val["avatar"])){$re=$this->oos_upimg('http://www.aiqing.com/'.$val["头像"]);if($re)M()->table("lx_users")->where("userid=".$val['userid'])->setField("avatar",$re);echo$val['userid']."";$p++;$nexurl=U("mjdr",array("p"=>$p));echo'';出口;}publicfunctionmjdr2(){$p=I("get.p");if(!$p)$p=0;$page=50;$list=M()->table("lx_users")->limit($p*$page,$page)->order('useridasc')->select();if(!$list)exit("none");foreach($listas$val){if($val["avatar"]&&!strstr($val["avatar"],'http:')){$uid=md5($val["userid"]-652);$filename1=$uid.".jpg";$re=$this->GrabImage2('http://www.aiqing.com/'.$val['avatar'],$filename1,'http://www.aiqing.com');if(file_exists($re)){$re2="http://www.yueai.me/".$re;M()->table("lx_users")->where("userid=".$val['userid'])->setField("avatar",$re2);}echo$val['userid']."";}$p++;$nexurl=U("mjdr2",array("p"=>$p));echo'';exit;}采集相册publicfunctionmjdr3(){//采集相册$p=I("get.p");if(!$p)$p=0;$page=10;$list=M()->table("lx_user_photo")->limit($p*$page,$page)->order('photoidasc')->select();if(!$list)exit("none");foreach($listas$val){if($val["uploadfiles"]&&!strstr($val["uploadfiles"],'http:')){$uid=md5($val["photoid"]);$filename1=$uid.".jpg";$re=$this->GrabImage3('http://www.aiqing.com/'.$val['uploadfiles'],$filename1,'http://www.aiqing.com');if(file_exists($re)){$re2="http://www.yueai.me/".$re;M()->table("lx_user_photo")->where("photoid=".$val['photoid'])->setField("uploadfiles",$re2);}echo$val['photoid']."";$p++;$nexurl=U("mjdr3",array("p"=>$p));echo'';exit;}/*带防盗链的图片$url图片地址$filename图片保存地址return返回下载的图片路径和名称,图片大小$fromurl源地址,填在源图片URL中可以破解防盗链*/functionGrabImage3($url,$filename="",$fromurl="",$filepath=""){if($url=="")returnfalse;if(!$filepath){$filepath="photo/".date("mdHi")."/";!is_dir($filepath)?mkdir($filepath):null;//生成文件夹}$randip=A("微信")->randip();$re=A("微信")->curlg($url,$fromurl,$randip);$size=file_put_contents($filepath.$filename,$re);//returnsizeif($size)return$filepath.$filename;}/*带防盗链的图片$url图片地址$filename图片保存地址return返回下载的图片路径和名称,图片大小$fromurl源地址,填在源图片URL中可以破解防盗链*/functionGrabImage2($url,$filename="",$fromurl="",$filepath=""){if($url=="")returnfalse;if(!$filepath){$filepath="Uploads/".date("ymdHi")."/";!is_dir($filepath)?mkdir($filepath):null;//生成文件夹}$randip=A("微信")->randip();$re=A("微信")->curlg($url,$fromurl,$randip);$size=file_put_contents($filepath.$filename,$re);//返回大小if($size)return$filepath.$filename;}地图插件的实现classApi2ControllerextendsSiteController{publicfunctiongetarea($lat,$lon){if(!$lon||!$lat)returnfalse;$url='http://api.map.baidu.com/geocoder/v2/?ak='.C('ak').'&callback=&location='.$lat.','.$lon.'&output=json&pois=0';//回显$url;$re=$this->curl_get_contents($url);$re=json_decode($re,true);返回$re;转储($重新);}publicfunctionbdlbsapi2($lat,$lon){$data['title']=$this->uinfo['user_nicename'];$数据[‘纬度’]=$纬度;$data['tel']=$this->uinfo['user_login'];$data['sex']=$this->uinfo['sex'];$data['经度']=$lon;$data['hash']=C('SITE_HASH_KEY');$re=$this->bdlbsapi($data);返回$re;}私有函数bdlbsapi($data,$lbsid=0){$ak=C('ak2');if($lbsid<=0){$purl='http://api.map.baidu.com/geodata/v3/poi/create';}else{$data['id']=$lbsid;$purl="http://api.map.baidu.com/geodata/v3/poi/update";}$data['ak']=$ak;$data['geotable_id']=C('LBS_DB');$data['coord_type']="1";$re=A("Weixin")->curlparr($purl,$data);$re=json_decode($re,true);if($re["status"]==0){$lbsid=$re['id'];}else{$lbsid=-1;}return$lbsid;}}?>

猜你喜欢