public function _empty($action) { $resource = strtolower(CONTROLLER_NAME); $this->assign('type', $resource); if (in_array($resource, array('text', 'picture', 'music', 'video'))) { if (in_array($action, array('new', 'edit'))) { if ('edit' == $action) { $id = intval(I('id')); if ($post = M('post')->find($id)) { $this->assign('post', $post); } else { $this->error('错误的记录'); } } $this->display('Post/' . $resource); } else { $this->error('错误的请求'); } } else { switch (strtolower(CONTROLLER_NAME)) { case 'post': echo 'post'; die; $Index = new IndexController(); $Index->detail(ACTION_NAME); break; case 'search': $Index = new IndexController(); $Index->search(); break; case 'feed': $type = I('get.type'); $this->feed($type); break; case 'mine': if (!is_login()) { $this->error('尚未登录,请登录后再访问', "User/login"); } $Index = new IndexController(); $Index->mine(); break; default: $Index = new IndexController(); if (is_numeric(CONTROLLER_NAME) && is_numeric(ACTION_NAME)) { $Index->archive(CONTROLLER_NAME, ACTION_NAME); } else { $this->error('错误的请求'); } break; } } }
case 'logout': $index->logout(); break; case 'manage': if ($_SESSION['user_type'] == 1) { $index->showManagement(); } break; case 'register': $index->showRegister('show'); break; case 'checkr': $index->register(); break; case 'search': $index->search('autor'); break; case 'searchb': $index->search('book'); break; case 'submit': $index->submitComment(); break; case 'showbook': $index->showBook(); break; case 'profile': $index->showProfile(); break; case 'update': $index->updateManager();