function getInstance($uid, $aid, $num) { $saveAttach = null; L::loadClass('photo', 'colony', false); $photoService = new PW_Photo($uid, 0, 1, 0); $albumInfo = $photoService->getAlbumInfo($aid); $photonums = $albumInfo['photonum']; $GLOBALS += L::config(null, 'o_config'); if ($albumInfo && (!$GLOBALS['o_maxphotonum'] || $albumInfo['photonum'] + $num <= $GLOBALS['o_maxphotonum'])) { L::loadClass('photoupload', 'upload', false); $saveAttach = new saveAttach(new PhotoUpload($aid)); } return $saveAttach; }
Showmsg("user_not_exists"); } if (!is_array($result)) { Showmsg($result); } $url .= "&uid=" . $result['ownerid']; ObHeader($url); } /* require_once(R_P . 'u/lib/space.class.php'); $newSpace = new PwSpace($uid ? $uid : $winduid); $space =& $newSpace->getInfo(); empty($space) && Showmsg('user_not_exists'); */ L::loadClass('photo', 'colony', false); $photoService = new PW_Photo($uid, $ifriend, $page, $perpage); $isGM = $photoService->isPermission(); $isown = $photoService->isSelf(); if ($isSpace) { $USCR = 'space_photos'; // S::gp('uid'); $newSpace = new PwSpace($uid ? $uid : $winduid); $photoRight = $newSpace->viewRight('photos'); require_once S::escapePath($appEntryBasePath . 'action/view.php'); } else { !$winduid && Showmsg('not_login'); if ($isown) { $a_key = $a == 'friend' ? 'index' : 'own'; $a_key = $ifriend ? 'index' : $a_key; require_once S::escapePath($appEntryBasePath . 'action/my.php'); } else {
function _getTextWithPhoto($photoId, $content) { global $winduid; $content = preg_replace('/(\\[(upload=\\d+)\\])/Ui', '[\\2]', $content); if (!$photoId) { return $content; } L::loadClass('photo', 'colony', false); $albumService = new PW_Photo($winduid, 0, 0, 0); $photoInfo = $albumService->getPhotoInfo($photoId); if (!$photoInfo) { return $content; } $albumInfo = $albumService->getAlbumInfo($photoInfo['aid']); if ($albumInfo['ownerid'] == $winduid) { $content = "[upload={$photoId}]" . $content; } return $content; }
<?php !defined('P_W') && exit('Forbidden'); S::gp(array('job')); $photoEditor = $db_phopen && $winduid; if (!$photoEditor && $job) { Showmsg('undefined_action'); } //* include_once pwCache::getPath(D_P . 'data/bbscache/o_config.php'); pwCache::getData(D_P . 'data/bbscache/o_config.php'); require_once R_P . 'u/require/core.php'; L::loadClass('photo', 'colony', false); $photoService = new PW_Photo($winduid, 0, 1, 0); $photoService->setPerpage($photoService->getAlbumNumByUid()); if ($job == 'listphotos') { /* ajax 请求获取相片列表 */ define('AJAX', 1); S::GP(array('aid')); $ajaxPhotos = array(); $result = $photoService->getPhotoListByAid($aid, false, false); list(, $photos) = $result; //$albumInfo,$photos if (S::isArray($photos)) { foreach ($photos as $photo) { $lastpos = strrpos($photo['path'], '/'); $ajaxPhotos[] = array('pid' => $photo['pid'], 'thumbpath' => $photo['path'], 'ifthumb' => $photo['ifthumb'], 'path' => $photo['path'], 'pintro' => $photo['pintro']); } $ajaxPhotos = pwJsonEncode($ajaxPhotos); echo "success\t{$ajaxPhotos}"; } else { Showmsg('data_error');