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); }
public function getUserInfo($iUserId = 0) { $oProfile = BxDolProfile::getInstance($iUserId); if (!$oProfile) { $oProfile = BxDolProfileUndefined::getInstance(); } return array($oProfile->getDisplayName(), $oProfile->getUrl(), $oProfile->getThumb(), $oProfile->getUnit()); }
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); }
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' : '')); }
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); }
/** * @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); }
protected function _getAuthorObject($iAuthorId = 0) { $oProfile = BxDolProfile::getInstance($iAuthorId); if (!$oProfile) { $oProfile = BxDolProfileUndefined::getInstance(); } return $oProfile; }
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); }
public function getProfileObject($iProfileId = 0) { $oProfile = BxDolProfile::getInstance($iProfileId); if (!$oProfile) { $oProfile = BxDolProfileUndefined::getInstance(); } return $oProfile; }
protected function _getProfileObject($iId) { $oProfile = BxDolProfile::getInstance($iId); if (!$oProfile) { $oProfile = BxDolProfileUndefined::getInstance(); } return $oProfile; }
protected function _getProfileObject($iId) { $oProfile = BxDolProfile::getInstanceByContentAndType((int) $iId, $this->_oModule->_oConfig->getName()); if (!$oProfile) { $oProfile = BxDolProfileUndefined::getInstance(); } return $oProfile; }
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); }