后面介绍了会员局部的一些性能实现,大家也能够看看一下
第一篇:https://www.gaodaima.com/weixin_…
第二篇:https://www.gaodaima.com/weixin_…
这个是国内多语言婚恋交友网站开发制作的专栏:
https://www.gaodaima.com/weixin_…
如果有什么疑难能够,找我,各位,我的扣是2360248-666
这个是性能介绍图
上面是一些零碎设置的性能实现
间接上传到OSS
public function mjdr(){//间接上传到OSS
$p = I("get.p"); if(!$p) $p=0; $page = 10; $list = M()->table("lx_users")->limit($p*$page,$page)->order('userid asc')->select(); foreach($list as $val){ if($val["avatar"] && !strstr('http:',$val["avatar"])){ $re = $this->oos_upimg('http://www.aiqing.com/'.$val["avatar"]); if($re) M()->table("lx_users")->where("userid=".$val['userid'])->setField("avatar",$re); echo $val['userid']."<img src='".$re."' width='100'>"; } } $p++; $nexurl = U("mjdr",array("p"=>$p)); echo '<script>window.location.href="'.$nexurl.'";</script>'; exit;
}
public function mjdr2(){
$p = I("get.p"); if(!$p) $p=0; $page = 50; $list = M()->table("lx_users")->limit($p*$page,$page)->order('userid asc')->select(); if(!$list) exit("none"); foreach($list as $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']."<img src='".$re."' width='100'>"; } } $p++; $nexurl = U("mjdr2",array("p"=>$p)); echo '<script>window.location.href="'.$nexurl.'";</script>'; exit;
}
采集相册
public function mjdr3(){//采集相册
$p = I("get.p"); if(!$p) $p=0; $page = 10; $list = M()->table("lx_user_photo")->limit($p*$page,$page)->order('photoid asc')->select(); if(!$list) exit("none"); foreach($list as $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']."<img src='".$re."' width='100'>"; } } $p++; $nexurl = U("mjdr3",array("p"=>$p)); echo '<script>window.location.href="'.$nexurl.'";</script>'; exit;
}
/*
- 有防盗链的图片
- $url 图片地址
- $filename 图片保留地址
- return 返回下载的图片门路和名称,图片大小
- $fromurl 起源URL,填写起源图片网址可破解防盗链
*/
function GrabImage3($url,$filename=””,$fromurl=””,$filepath=””) {
if($url==””) return false;
if(!$filepath){
$filepath="photo/".date("mdHi")."/";
!is_dir($filepath)? mkdir($filepath):null;//生成文件夹
}
$randip = A(“Weixin”)->randip();
$re = A(“Weixin”)->curlg($url,$fromurl,$randip);
$size = file_put_contents($filepath.$filename,$re);//返回大小
if($size)
return $filepath.$filename;
}
/*
- 有防盗链的图片
- $url 图片地址
- $filename 图片保留地址
- return 返回下载的图片门路和名称,图片大小
- $fromurl 起源URL,填写起源图片网址可破解防盗链
*/
function GrabImage2($url,$filename=””,$fromurl=””,$filepath=””) {
if($url==””) return false;
if(!$filepath){
$filepath="Uploads/".date("ymdHi")."/";
!is_dir($filepath)? mkdir($filepath):null;//生成文件夹
}
$randip = A(“Weixin”)->randip();
$re = A(“Weixin”)->curlg($url,$fromurl,$randip);
$size = file_put_contents($filepath.$filename,$re);//返回大小
if($size)
return $filepath.$filename;
}
地图插件的实现
class Api2Controller extends SiteController {
public function getarea($lat,$lon){ if(!$lon || !$lat) return false; $url = 'http://api.map.baidu.com/geocoder/v2/?ak='.C('ak').'&callback=&location='.$lat.','.$lon.'&output=json&pois=0'; //echo $url; $re = $this->curl_get_contents($url); $re = json_decode($re,true); return $re; dump($re); } public function bdlbsapi2($lat,$lon){ $data['title']=$this->uinfo['user_nicename']; $data['latitude']=$lat; $data['tel']=$this->uinfo['user_login']; $data['sex']=$this->uinfo['sex']; $data['longitude']=$lon; $data['hash']=C('SITE_HASH_KEY'); $re = $this->bdlbsapi($data); return $re; } private function 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;
}
}
?>