コード例 #1
0
ファイル: BxAlbumsTemplate.php プロジェクト: blas-dmx/trident
 function entryMediaView($iMediaId, $mixedContext = false)
 {
     $oModule = BxDolModule::getInstance($this->MODULE);
     $CNF =& $oModule->_oConfig->CNF;
     if (!($aMediaInfo = $oModule->_oDb->getMediaInfoById($iMediaId))) {
         return '';
     }
     if (!($aAlbumInfo = $oModule->_oDb->getContentInfoById($aMediaInfo['content_id']))) {
         return '';
     }
     $sUrlAlbum = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aAlbumInfo[$CNF['FIELD_ID']]);
     $sText = $this->getMediaTitle($aMediaInfo);
     $iProfileId = $aAlbumInfo[$CNF['FIELD_AUTHOR']];
     $oProfile = BxDolProfile::getInstance($iProfileId);
     if (!$oProfile) {
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     $aVars = array('title' => $sText, 'album' => _t('_bx_albums_txt_media_album_link', $sUrlAlbum, bx_process_output($aAlbumInfo[$CNF['FIELD_TITLE']]), $oProfile->getUrl(), $oProfile->getDisplayName()));
     $aNextPrev = array('next' => $this->getNextPrevMedia($aMediaInfo, true, $mixedContext), 'prev' => $this->getNextPrevMedia($aMediaInfo, false, $mixedContext));
     foreach ($aNextPrev as $k => $a) {
         $aVars['bx_if:' . $k] = array('condition' => $a, 'content' => $a);
         $aVars['bx_if:' . $k . '-na'] = array('condition' => !$a, 'content' => array());
     }
     $aVars = array_merge($aVars, $this->mediaVars($aMediaInfo, $CNF['OBJECT_IMAGES_TRANSCODER_BIG'], $CNF['OBJECT_VIDEOS_TRANSCODERS']['poster'], array('context' => $mixedContext)));
     return $this->parseHtmlByName('media-view.html', $aVars);
 }
コード例 #2
0
 public function getUserInfo($iUserId = 0)
 {
     $oProfile = BxDolProfile::getInstance($iUserId);
     if (!$oProfile) {
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     return array($oProfile->getDisplayName(), $oProfile->getUrl(), $oProfile->getThumb(), $oProfile->getUnit());
 }
コード例 #3
0
 protected function _getProfileAndContentData($iContentId)
 {
     $aContentInfo = array();
     $oProfile = false;
     $aContentInfo = $this->_oModule->_oDb->getContentInfoById($iContentId);
     if (!$aContentInfo) {
         return array(false, false);
     }
     $oProfile = BxDolProfile::getInstance($aContentInfo['profile_id']);
     if (!$oProfile) {
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     return array($oProfile, $aContentInfo);
 }
コード例 #4
0
ファイル: BxBaseRss.php プロジェクト: blas-dmx/trident
 public function getFeed($mixedId, $iUserId = 0)
 {
     $sUrl = $this->getUrl($mixedId);
     $aMarkers = array('SiteUrl' => BX_DOL_URL_ROOT);
     if ($iUserId) {
         $oProfile = BxDolProfile::getInstance($iUserId);
         if (!$oProfile) {
             $oProfile = BxDolProfileUndefined::getInstance();
         }
         $aMarkers['NickName'] = $oProfile->getDisplayName();
     }
     $sUrl = bx_replace_markers($sUrl, $aMarkers);
     header('Content-Type: text/xml; charset=utf-8');
     return bx_file_get_contents($sUrl . (defined('BX_PROFILER') && BX_PROFILER && 0 == strncmp(BX_DOL_URL_ROOT, $sUrl, strlen(BX_DOL_URL_ROOT)) ? '&bx_profiler_disable=1' : ''));
 }
コード例 #5
0
 function entryAuthor($aData, $sTemplateName = 'author.html')
 {
     $oModule = BxDolModule::getInstance($this->MODULE);
     $CNF =& $oModule->_oConfig->CNF;
     $oProfile = BxDolProfile::getInstance($aData[$CNF['FIELD_AUTHOR']]);
     if (!$oProfile) {
         bx_import('BxDolProfileUndefined');
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     if (!$oProfile) {
         return '';
     }
     $aVars = array('author_url' => $oProfile->getUrl(), 'author_thumb_url' => $oProfile->getThumb(), 'author_title' => $oProfile->getDisplayName(), 'author_desc' => $this->getAuthorDesc($aData));
     return $this->parseHtmlByName($sTemplateName, $aVars);
 }
コード例 #6
0
 /**
  * @return array of profile object and content info
  */
 protected function _getProfileAndContentData($iContentId)
 {
     $CNF =& $this->_oModule->_oConfig->CNF;
     $aContentInfo = array();
     $oProfile = false;
     $aContentInfo = $this->_oModule->_oDb->getContentInfoById($iContentId);
     if (!$aContentInfo) {
         return array(false, false);
     }
     $oProfile = BxDolProfile::getInstance($aContentInfo[$CNF['FIELD_AUTHOR']]);
     if (!$oProfile) {
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     return array($oProfile, $aContentInfo);
 }
コード例 #7
0
ファイル: BxDolCmts.php プロジェクト: blas-dmx/trident
 protected function _getAuthorObject($iAuthorId = 0)
 {
     $oProfile = BxDolProfile::getInstance($iAuthorId);
     if (!$oProfile) {
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     return $oProfile;
 }
コード例 #8
0
ファイル: BxCnvTemplate.php プロジェクト: blas-dmx/trident
 function entryMessagePreviewInGrid($r)
 {
     $oModule = BxDolModule::getInstance($this->MODULE);
     $oProfileLast = BxDolProfile::getInstance($r['last_reply_profile_id']);
     if (!$oProfileLast) {
         $oProfileLast = BxDolProfileUndefined::getInstance();
     }
     $sText = strmaxtextlen($r['text'], 100);
     $sTextCmt = strmaxtextlen($r['cmt_text'], 100);
     if (!isset($r['unread_messages'])) {
         $r['unread_messages'] = $r['comments'] - $r['read_comments'];
     }
     $aVars = array('url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']), 'text' => $sText, 'cmt_text' => $sTextCmt, 'last_reply_time_and_replier' => _t('_bx_cnv_x_date_by_x_replier', bx_time_js($r['last_reply_timestamp'], BX_FORMAT_DATE), $oProfileLast->getDisplayName()), 'bx_if:unread_messages' => array('condition' => $r['unread_messages'] > 0, 'content' => array()));
     $aVars['bx_if:unread_messages2'] = $aVars['bx_if:unread_messages'];
     return $this->parseHtmlByName('message_preview_in_grid.html', $aVars);
 }
コード例 #9
0
ファイル: BxInvModule.php プロジェクト: blas-dmx/trident
 public function getProfileObject($iProfileId = 0)
 {
     $oProfile = BxDolProfile::getInstance($iProfileId);
     if (!$oProfile) {
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     return $oProfile;
 }
コード例 #10
0
 protected function _getProfileObject($iId)
 {
     $oProfile = BxDolProfile::getInstance($iId);
     if (!$oProfile) {
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     return $oProfile;
 }
コード例 #11
0
 protected function _getProfileObject($iId)
 {
     $oProfile = BxDolProfile::getInstanceByContentAndType((int) $iId, $this->_oModule->_oConfig->getName());
     if (!$oProfile) {
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     return $oProfile;
 }
コード例 #12
0
 function entryAuthor($aData, $iProfileId = false, $sFuncAuthorDesc = 'getAuthorDesc', $sTemplateName = 'author.html')
 {
     $oModule = BxDolModule::getInstance($this->MODULE);
     $CNF =& $oModule->_oConfig->CNF;
     if (!$iProfileId) {
         $iProfileId = $aData[$CNF['FIELD_AUTHOR']];
     }
     $oProfile = BxDolProfile::getInstance($iProfileId);
     if (!$oProfile) {
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     if (!$oProfile) {
         return '';
     }
     $aVars = array('author_url' => $oProfile->getUrl(), 'author_thumb_url' => $oProfile->getThumb(), 'author_title' => $oProfile->getDisplayName(), 'author_desc' => $sFuncAuthorDesc ? $this->{$sFuncAuthorDesc}($aData) : '');
     return $this->parseHtmlByName($sTemplateName, $aVars);
 }