コード例 #1
0
 function actionGetCurrentImage($iPicId)
 {
     $iPicId = (int) $iPicId;
     if ($iPicId > 0) {
         require_once 'BxPhotosSearch.php';
         $oMedia = new BxPhotosSearch();
         $aInfo = $oMedia->serviceGetPhotoArray($iPicId, 'file');
         $aInfo['ownerUrl'] = getProfileLink($aInfo['owner']);
         $aInfo['ownerName'] = getNickName($aInfo['owner']);
         $aInfo['date'] = defineTimeInterval($aInfo['date']);
         $oMedia->getRatePart();
         $aInfo['rate'] = $oMedia->oRate->getJustVotingElement(0, 0, $aInfo['rate']);
         $aLinkAddon = $oMedia->getLinkAddByPrams();
         $oPaginate = new BxDolPaginate(array('count' => (int) $_GET['total'], 'per_page' => 1, 'page' => (int) $_GET['page'], 'info' => false, 'per_page_changer' => false, 'page_reloader' => false, 'on_change_page' => 'getCurrentImage({page})'));
         $aInfo['paginate'] = $oPaginate->getPaginate();
         header('Content-Type:text/javascript');
         $oJSON = new Services_JSON();
         echo $oJSON->encode($aInfo);
     }
 }
コード例 #2
0
 function serviceGetBlockFavorited($iBlockId)
 {
     if ($this->_iProfileId == 0) {
         return;
     }
     bx_import('Search', $this->_aModule);
     $oMedia = new BxPhotosSearch();
     $oMedia->clearFilters(array('activeStatus', 'allow_view', 'album_status', 'albumType', 'ownerStatus'), array('albumsObjects', 'albums'));
     if (isset($oMedia->aAddPartsConfig['favorite']) && !empty($oMedia->aAddPartsConfig['favorite'])) {
         $oMedia->aCurrent['join']['favorite'] = $oMedia->aAddPartsConfig['favorite'];
         $oMedia->aCurrent['restriction']['fav'] = array('value' => $iUserId, 'field' => $oMedia->aAddPartsConfig['favorite']['userField'], 'operator' => '=', 'table' => $oMedia->aAddPartsConfig['favorite']['table']);
     }
     $oMedia->aCurrent['paginate']['perPage'] = (int) $this->oConfig->getGlParam('number_top');
     $sCode = $oMedia->displayResultBlock();
     if ($oMedia->aCurrent['paginate']['totalNum'] > 0) {
         $oMedia->aConstants['linksTempl']['favorited'] = 'browse/favorited';
         $sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.sys_file_search_unit');
         $aTopMenu = array();
         $aBottomMenu = $oMedia->getBottomMenu('favorited', 0, '');
         return array($sCode, $aTopMenu, $aBottomMenu, false);
     }
 }