返回

婚恋交友网站开发搭建源码分享

发布时间:2022-11-24 20:51:14 20
# 后端# 数据库# 数据# 技术

我们的婚恋网站是用当今比较流行的网站开发技术PHP语言进行开发,数据库采用免费,小巧,易用的MySQL数据库。

下面介绍一些​​​​源码​​​

婚恋交友网站开发搭建源码分享_后端

婚恋交友网站开发搭建源码分享_网站开发_02

婚恋交友网站开发搭建源码分享_后端_03

婚恋交友网站开发搭建源码分享_网站开发_04

推荐部分

class IndexController extends SiteController {
public function index($w="")可v+wxyetu{

if(!$this->uinfo){
redirect(U("Public/index"));
exit;
}

if(C("onlywx")==1 && strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') === false){
$this->siteDisplay('jg_qzwxdk');
exit;
}
$media=$this->getMedia('推荐');
$this->assign('media', $media);
$where = " 1=1 ";
$sex = I("post.sex",'','intval');
if(!$sex){//默认
$sex = $this->uinfo['sex']==1?'2':'1';
$cookiesex =cookie('defsex');
$sex = $cookiesex?$cookiesex:$sex;
}else{
$sex = $sex;
cookie('defsex',$sex,3600);
}
if($sex>0)
$where.=" and sex=".$sex;
$where.=" and ismj=1";
$age = I("post.age",'','intval');
if($age>0){
$now = date("Y");
switch($age){
case 1:
$where.=" and age between ".($now-25)." and ".($now-18);
break;
case 2:
$where.=" and age between ".($now-35)." and ".($now-26);
break;
case 3:
$where.=" and age between ".($now-40)." and ".($now-36);
break;
case 4:
$where.=" and age between ".($now-50)." and ".($now-40);
break;
case 5:
$where.=" and age between ".($now-100)." and ".($now-50);
break;
}

图片设置

public function photo(){
if(!$this->uinfo){
redirect(U("Public/index"));
exit;
}
$media=$this->getMedia('相册');
$this->assign('media', $media);
$where = " 1=1 ";
$sex = I("post.sex",'','intval');
if(!$sex){//默认
$sex = $this->uinfo['sex']==1?'2':'1';
$cookiesex =cookie('defsex');
$sex = $cookiesex?$cookiesex:$sex;
}else{
$sex = $sex;
cookie('defsex',$sex,3600);
}

if($sex>0)
$where.=" and sex=".$sex;

$age = I("post.age",'','intval');

if($age>0){

$now = date("Y");

switch($age){

case 1:

$where.=" and age between ".($now-25)." and ".($now-18);
break;

case 2:
$where.=" and age between ".($now-35)." and ".($now-26);
break;
case 3:

$where.=" and age between ".($now-40)." and ".($now-36);
break;
case 4:

$where.=" and age between ".($now-50)." and ".($now-40);
break;
case 5:

$where.=" and age between ".($now-100)." and ".($now-50);
break;
}
}
$provinceid = I("post.provinceid",'','intval');
$cityid = I("post.cityid",'','intval');
$querypama = $this->get_areaid_toquery($provinceid,$cityid);
if($querypama['id']){
$where .= " and u.".$querypama['type'].'='.$querypama['id'];
}
$where .=' or cityid=0';
$where .=" and p.flag =1 and p.phototype=0"; //elite=1 and
$User = M("user_photo");
$count = $User->alias('p')->cache(true,300)->join("__USERS__ as u ON u.id=p.uid")->where($where) -> count();
$_GET['p']=$_POST['p'];
$Page = new \Think\Page($count, 15);
$show = $Page -> show();
$list = $User->alias('p')->cache(true,300) ->field('p.thumbfiles,u.avatar,p.photoid,p.idmd5,u.user_nicename,p.hits')->join("__USERS__ as u ON u.id=p.uid")-> where($where) -> order('p.elite,p.photoid desc') -> limit($Page -> firstRow . ',' . $Page -> listRows) -> select();
foreach($list as $key=> $val){
$list[$key]['aurl'] = U("Show/photo", array("pid" => $val[idmd5]));
}

地区部分

public function photo(){        

if(!$this->uinfo){

redirect(U("Public/index"));

exit;

}

$media=$this->getMedia('相册');

$this->assign('media', $media);

$where = " 1=1 "
$sex = I("post.sex",'','intval');

if(!$sex){//默认

$sex = $this->uinfo['sex']==1?'2':'1';

$cookiesex =cookie('defsex');

$sex = $cookiesex?$cookiesex:$sex;

}else{

$sex = $sex;

cookie('defsex',$sex,3600);

}

if($sex>0)

$where.=" and sex=".$sex
$age = I("post.age",'','intval');

if($age>0){

$now = date("Y");

switch($age){

case 1:

$where.=" and age between ".($now-25)." and ".($now-18);

break;

case 2:

$where.=" and age between ".($now-35)." and ".($now-26);

break;

case 3:

$where.=" and age between ".($now-40)." and ".($now-36);

break;

case 4:

$where.=" and age between ".($now-50)." and ".($now-40);

break;

case 5:

$where.=" and age between ".($now-100)." and ".($now-50);

break;

}

}

$provinceid = I("post.provinceid",'','intval');

$cityid = I("post.cityid",'','intval');

$querypama = $this->get_areaid_toquery($provinceid,$cityid);

if($querypama['id']){

$where .= " and u.".$querypama['type'].'='.$querypama['id'];

}

$where .=' or cityid=0';

$where .=" and p.flag =1 and p.phototype=0"; //elite=1 and

$User = M("user_photo");

$count = $User->alias('p')->cache(true,300)->join("__USERS__ as u ON u.id=p.uid")->where($where) -> count();

$_GET['p']=$_POST['p'];

$Page = new \Think\Page($count, 15);

$show = $Page -> show();

$list = $User->alias('p')->cache(true,300) ->field('p.thumbfiles,u.avatar,p.photoid,p.idmd5,u.user_nicename,p.hits')->join("__USERS__ as u ON u.id=p.uid")-> where($where) -> order('p.elite,p.photoid desc') -> limit($Page -> firstRow . ',' . $Page -> listRows) -> select();

foreach($list as $key=> $val){

$list[$key]['aurl'] = U("Show/photo", array("pid" => $val[idmd5]));

}
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(0)
按点赞数排序
用户头像
精选文章
thumb 中国研究员首次曝光美国国安局顶级后门—“方程式组织”
thumb 俄乌线上战争,网络攻击弥漫着数字硝烟
thumb 从网络安全角度了解俄罗斯入侵乌克兰的相关事件时间线