用PHP+MySQL开发的婚恋交友网站

婚恋交友网站是基于网络平台的广泛性、互通性、娱乐性、经济性、安全性等优点,作为一种新兴的网络交流方式出现在网络上。网络交友较之其它交友方式更加经济、安全、健康。

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

用PHP+MySQL开发的婚恋交友网站_第1张图片

下面分享一些代码

控制器部分

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

exit;

}

$this -> assign('nav', 'User');

if(C("onlywx")==1 && strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') === false){
$this->siteDisplay('jg_qzwxdk');

exit;

}

}

入口部分

public function index(){
$media = $this->getMedia ( '用户中心', '', '', '用户中心', 'ismenu' );

//$uinfo = $this->uinfo;

$usermod = M('Users');

$uinfo =$usermod->where(' id ='.$this->uinfo['id'])->find();

if(!$uinfo || $uinfo['user_status']==0) redirect(U('Public/dologout'));

$uinfo['age'] = date('Y',time())-$uinfo['age'];

$userCount = M('UserCount')->where('uid = '.$uinfo['id'])->find();

$userProfile =M('userProfile')->where('uid ='.$uinfo['id'])->find();

$areaList = $this->get_area();

$uinfo['province_name'] =$areaList[$uinfo['provinceid']]['areaname'];

$uinfo['city_name'] =$areaList[$uinfo['cityid']]['areaname'];

$this->setUserinfo('money',$uinfo['money']);

if($uinfo['user_nicename']){
$this->setUserinfo('user_nicename',$uinfo['user_nicename']);

}else if($uinfo['user_nicename']!=$this->uinfo['user_nicename']){
$uinfo['user_nicename']=$this->uinfo['user_nicename'];

}

$this->setUserinfo('provinceid',$uinfo['provinceid']);

$this->setUserinfo('cityid',$uinfo['cityid']);

$this->setUserinfo('avatar',$uinfo['avatar']);

$this->setUserinfo('user_rank',$uinfo['user_rank']);

$this->setUserinfo('rank_time',$uinfo['rank_time']);

$this->setUserinfo('user_status',$uinfo['user_status']);

$uinfo = $this->get_jifen_rank_name($uinfo);

if($userCount['wdsxnum']>0 || $userCount['wdgznum']>0 || $userCount['wdsysnum']>0 || $userCount['wdgiftnum']>0){
cookie('wdsxnum',1,3600);

}

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

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

if( S('qiandaotime'.$this->uinfo["id"]) == date('Ymd',time()) )

$this->assign ( 'isqd', 1 );

if($this->uinfo['last_login_time']where('id='.$this->uinfo['id'])->setField('last_login_time',time());

$this->setUserinfo('last_login_time',time());

}

if($isvip = $this->isvip($uinfo)){
$uinfo['user_rank'] = $isvip['user_rank'];

}else{
if($this->uinfo['user_rank']>0){
$usermod->where('id='.$this->uinfo['id'])->setField('user_rank',0);

$this->setUserinfo('user_rank',0);

}

$uinfo['user_rank'] = 0;

}

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

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

$this->siteDisplay ( 'user_center' );

}

我的关注/我的粉丝
用PHP+MySQL开发的婚恋交友网站_第2张图片

public function MyPhoto(){
$mod = M('UserPhoto');

$where =array('uid'=>$this->uinfo['id'],'flag'=>1,'phototype'=>0);

$cphoto = $mod->where($where)->count();

if($cphoto) $cinfo = $mod->where($where)->order('photoid desc')->getField('thumbfiles');

$where['phototype'] = 1;

$sphoto = $mod->where($where)->count();

if($sphoto) $sinfo = $mod->where($where)->order('photoid desc')->getField('thumbfiles');

$photo_config = M('UserProfile')->where('uid = '.$this->uinfo['id'])->getField('photo_config');

if($photo_config) $photo_config = unserialize($photo_config);

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

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

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

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

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

$media = $this->getMedia ( '我的相册', '', '', '我的相册', 'ismenu' );

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

$this->siteDisplay ( 'user_photo' );

}

你可能感兴趣的:(前端php)