function getVideoAlbums($sUser, $sPwd, $sNick) { $iIdProfile = BxDolXMLRPCUtil::getIdByNickname($sNick); if (!$iIdProfile || !($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) { return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct")); } // create user's default album if there is no one if ($sUser == $sNick) { $sCaption = str_replace('{nickname}', $sUser, getParam('bx_videos_profile_album_name')); bx_import('BxDolAlbums'); $oAlbum = new BxDolAlbums('bx_videos'); $aData = array('caption' => $sCaption, 'location' => _t('_bx_videos_undefined'), 'owner' => $iId, 'AllowAlbumView' => BX_DOL_PG_ALL); $oAlbum->addAlbum($aData); } return BxDolXMLRPCMedia::_getMediaAlbums('video', $iIdProfile, $iId, true); }
function serviceProfilePhotoBlock($aParams) { $this->aCurrent['sorting'] = 'album_order'; $sCaption = str_replace('{nickname}', getNickName($aParams['PID']), $this->oModule->_oConfig->getGlParam('profile_album_name')); $sUri = uriFilter($sCaption); $oAlbum = new BxDolAlbums('bx_photos'); $aAlbumInfo = $oAlbum->getAlbumInfo(array('fileUri' => $sUri, 'owner' => $aParams['PID']), array('ID')); if (empty($aAlbumInfo) && $this->oModule->_iProfileId == (int) $aParams['PID']) { $aData = array('caption' => $sCaption, 'location' => _t('_' . $this->oModule->_oConfig->getMainPrefix() . '_undefined'), 'owner' => $this->oModule->_iProfileId, 'AllowAlbumView' => BX_DOL_PG_ALL); $aAlbumInfo['ID'] = $oAlbum->addAlbum($aData, false); } if ($this->oModule->oAlbumPrivacy->check('album_view', $aAlbumInfo['ID'], $this->oModule->_iProfileId)) { $this->aCurrent['restriction']['album'] = array('value' => $sUri, 'field' => 'Uri', 'operator' => '=', 'paramName' => 'albumUri', 'table' => 'sys_albums'); return $this->getPhotoBlock($aParams); } }
function getProfilePhotoBlock($aParams) { $sCaption = str_replace('{nickname}', getUsername($aParams['PID']), $this->oModule->_oConfig->getGlParam('profile_album_name')); $sUri = uriFilter($sCaption); $oAlbum = new BxDolAlbums('bx_photos'); $aAlbumInfo = $oAlbum->getAlbumInfo(array('fileUri' => $sUri, 'owner' => $aParams['PID']), array('ID')); if (empty($aAlbumInfo) && $this->oModule->_iProfileId == (int) $aParams['PID']) { $aData = array('caption' => $sCaption, 'owner' => $this->oModule->_iProfileId, 'AllowAlbumView' => $this->oModule->oAlbumPrivacy->_oDb->getDefaultValueModule('photos', 'album_view')); $aAlbumInfo['ID'] = $oAlbum->addAlbum($aData, false); } if (!$this->oModule->oAlbumPrivacy->check('album_view', $aAlbumInfo['ID'], $this->oModule->_iProfileId)) { return ''; } $this->aCurrent['sorting'] = 'album_order'; $this->aCurrent['restriction']['album'] = array('value' => $sUri, 'field' => 'Uri', 'operator' => '=', 'paramName' => 'albumUri', 'table' => 'sys_albums'); return $this->getPhotoBlock($aParams); }