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;
 }
Example #2
0
 function _getTextWithPhoto($photoId, $content)
 {
     global $winduid;
     $content = preg_replace('/(\\[(upload=\\d+)\\])/Ui', '&#91;\\2&#93;', $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;
 }