private function _photo() { require_once SITE_PATH . '/apps/photo/Common/common.php'; // 热门推荐相册 $data['IsHotList'] = IsHotList(); // 照片 $order = NULL; switch ($_GET['order']) { case 'new': //最新排行 $order = 'cTime DESC'; break; default: //默认热门排行 $order = 'readCount DESC'; } $map['privacy'] = 1; //所有人公开的图片 //获取配置参数 $config = getConfig(); $data['photos'] = D('Photo', 'photo')->where($map)->order($order)->findPage(16); $data['photo_preview'] = $config['photo_preview']; $this->assign($data); $this->display('photo'); }
function _initialize() { //读取推荐列表 $IsHotList = IsHotList(); $this->assign('IsHotList', $IsHotList); }