示例#1
0
 public function photoInfo()
 {
     $albumId = $_GET['albumId'];
     //实例化Model
     $photoModel = new PhotosModel();
     $albumModel = new AlbumModel();
     $commentModel = new CommentModel();
     $userModel = new UserModel();
     $articletypeModel = new ArticleTypeModel();
     $articleTagModel = new ArticleTagModel();
     //用户个人信息
     $allUserInfo = $userModel->getAllUserInfo();
     //博主个人信息
     $blogerInfo = $this->getBlogerInfo($blogerId);
     //获取所有文章分类
     $allTypes = $articletypeModel->getCatrgoryByadminId($blogerId);
     //var_dump($allTypes);
     //获取所有文章标签
     $allTags = $articleTagModel->getArticleTag();
     //最新三条评论
     $latestComments = $commentModel->getLatestComments($blogerId, '0,3');
     //根据相册id集查询所有评论
     $comments = $commentModel->getCommentByAlbumId($ArrAlbumId);
     //相册评论数
     $photoCollectNum = $commentModel->getCommentByArrAlbumId($ArrblogerId);
     $photo['photoCollectNum'] = $photoCollectNum;
     //获取该相册的所有照片
     $photoNum = $photoModel->getPhotos($blogerId, $limit = '');
     $photo['photoNum'] = $photoNum;
     //某相册的照片数量
     $photocount = $photoModel->getPhotosCountByAlbumId($AlbumId);
     $photo['photocount'] = $photocount;
     //根据照片id查询照片信息
     $photoInfo = $photoModel->getPhotosById($value['photoId']);
     if ($count > $pagesize) {
         $page = new Page($count, $p, $pagesize);
         $str = $page->show('themeuk.php');
     }
     $this->assign('page', $str);
     $this->assign('photoNum', $photoNum);
     //某相册所有照片
     $this->assign('photoCollectNum', $photoCollectNum);
     //某相册的评论总数
     $this->assign('blogerInfo', $blogerInfo);
     //某博主信息
     $this->assign('allUserInfo', $allUserInfo);
     //某用户信息
     $this->assign('latestComments', $latestComments);
     //最新三条评论
     $this->assign('allTypes', $allTypes);
     //所有文章分类
     $this->assign('photoInfo', $photoInfo);
     //照片信息
     $this->assign("allTags", $allTags);
     //所有文章标签
     $this->assign('photocount', $photocount);
     //某相册的照片数量
     $this->assign('photo', $photo);
     //照片信息
     $this->assign('comments', $comments);
     $this->display();
 }
示例#2
0
 public function deletePhoto()
 {
     $photoId = Data::get($_POST['photoId'], Data::Int);
     $photo = new PhotosModel();
     $data = $photo->getPhotosById($photoId);
     $row = $photo->delPhotos($photoId);
     if ($row) {
         unlink($data['fileName']);
         $result['code'] = '0';
         $result['message'] = '删除成功';
     } else {
         $result['code'] = '01';
         $result['message'] = "删除失败";
     }
     echo json_encode($result);
     exit;
 }