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; }