关于前端:用PHPMySQL开发的婚恋交友网站

36次阅读

共计 3311 个字符,预计需要花费 9 分钟才能阅读完成。

婚恋交友网站是基于网络平台的广泛性、互通性、娱乐性、经济性、安全性等长处,作为一种新兴的网络交换形式呈现在网络上。网络交友较之其它交友形式更加经济、平安、衰弱。

咱们的网站是用当今比拟风行的网站开发技术 PHP 语言进行开发,数据库采纳收费,玲珑,易用的 MySQL 数据库。

上面分享一些代码

控制器局部

<?php

namespace Home\Controller;

use Home\Controller\SiteController;

/**

* http://lxphp.com

*/

class UserController extends SiteController {public function __construct() {parent::__construct ();

if(!$this->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']<time()-86400){$usermod->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');

}

我的关注 / 我的粉丝

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');

}

正文完
 0