function get_album_cover($albumId, $albumInfo = '') { //获取相册详细信息 if (empty($albumInfo) || $albumId != $albumInfo['id']) { $albumInfo = D('Album')->find($albumId); } //照片封面 if (intval($albumInfo['photoCount']) > 0 && !empty($albumInfo['coverImagePath'])) { $cover = SITE_URL . '/thumb.php?w=120&h=100&url=' . get_photo_url($albumInfo['coverImagePath']); } elseif (intval($albumInfo['photoCount']) == 0) { $covr = APP_PUBLIC_URL . '/images/photo_zwzp.gif'; } else { $cover = APP_PUBLIC_URL . '/images/photo_bg.gif'; } //根据隐私情况,判断相册封面 if ($albumInfo['privacy'] == 4) { //密码可见 $cover = APP_PUBLIC_URL . '/images/photo_mima.gif'; } elseif ($albumInfo['privacy'] == 3) { //主人可见 $cover = APP_PUBLIC_URL . '/images/photo_zrkj.gif'; } elseif ($albumInfo['privacy'] == 2) { //显示相册只有他的好友可见 $cover = APP_PUBLIC_URL . '/images/photo_hykj.gif'; } return $cover; }
function get_album_cover($albumId, $albumInfo = '') { //获取相册详细信息 if (empty($albumInfo) || $albumId != $albumInfo['id']) { $albumInfo = D('Album')->find($albumId); } //照片封面 if (!empty($albumInfo['coverImagePath'])) { $cover = SITE_URL . '/thumb.php?w=120&h=100&url=' . get_photo_url($albumInfo['coverImagePath']); } else { $cover = APP_PUBLIC_URL . '/images/photo_zwzp.gif'; } return $cover; }
function doaddShare() { $info = h($_REQUEST['info']); $aimId = intval($_REQUEST['aimId']); $fids = $_REQUEST['fids']; if ($_REQUEST['type'] == 'album') { $type['typeId'] = 6; $type['typeName'] = '相册'; $type['alias'] = 'album'; $field = 'userId,name,info'; $data = D('Album')->where("id='{$aimId}'")->field($field)->find(); //$data['name'] = h($_REQUEST['name']); $data['username'] = getUserName($data['userId']); $data['cover'] = get_album_cover($aimId); } else { $type['typeId'] = 7; $type['typeName'] = '相片'; $type['alias'] = 'photo'; $field = 'albumId,userId,name,info,savepath'; $data = D('Photo')->where("id='{$aimId}'")->field($field)->find(); //$data['name'] = h($_REQUEST['name']); $data['username'] = getUserName($data['userId']); $data['albumName'] = D('Album')->where("id=" . $data['albumId'])->getField('name'); $data['photo'] = get_photo_url($data['savepath']); //dump($data);exit; } $result = $this->api->share_addShare($type, $aimId, $data, $info, 0, $fids); echo $result; }
function doaddShare() { $type['typeId'] = 8; $type['typeName'] = '群组'; $type['alias'] = 'group'; $info = h($_REQUEST['info']); $aimId = intval($_REQUEST['aimId']); $field = 'uid,name,logo,cid0,membercount'; $data = D('group')->where("id='{$aimId}'")->field($field)->find(); $data['logo'] = get_photo_url($data['logo']); $data['catagory'] = D('Category')->where("id=" . $data['cid0'])->getField('title'); //$data['name'] = h($_REQUEST['name']); $fids = $_REQUEST['fids']; $result = $this->api->share_addShare($type, $aimId, $data, $info, 0, $fids); echo $result; }