Esempio n. 1
0
 function getBlockCode_SocialSharing()
 {
     $sUrl = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $this->aDataEntry[$this->_oDb->_sFieldUri];
     $sTitle = $this->aDataEntry[$this->_oDb->_sFieldTitle];
     $aCustomParams = false;
     if ($this->aDataEntry[$this->_oDb->_sFieldThumb]) {
         $a = array('ID' => $this->aDataEntry[$this->_oDb->_sFieldAuthorId], 'Avatar' => $this->aDataEntry[$this->_oDb->_sFieldThumb]);
         $aImage = BxDolService::call('photos', 'get_image', array($a, 'browse'), 'Search');
         $sImgUrl = $aImage['no_image'] ? '' : $aImage['file'];
         if ($sImgUrl) {
             $aCustomParams = array('img_url' => $sImgUrl, 'img_url_encoded' => rawurlencode($sImgUrl));
         }
     }
     bx_import('BxTemplSocialSharing');
     $sCode = BxTemplSocialSharing::getInstance()->getCode($sUrl, $sTitle, $aCustomParams);
     return array($sCode, array(), array(), false);
 }
Esempio n. 2
0
 function getBlockCode_SocialSharing()
 {
     $aAd = $this->oAds->_oDb->getAdInfo($this->iAdId);
     if (!$aAd) {
         return false;
     }
     $sUrl = $this->oAds->genUrl($this->iAdId, $aAd['EntryUri'], 'entry');
     $sTitle = $aAd['title'];
     $sImgUrl = false;
     $aCustomParams = false;
     if ($aAd['Media'] && ($sImgUrl = $this->oAds->getAdCover($aAd['Media'], 'big_thumb', false))) {
         $aCustomParams = array('img_url' => $sImgUrl, 'img_url_encoded' => rawurlencode($sImgUrl));
     }
     bx_import('BxTemplSocialSharing');
     $sCode = BxTemplSocialSharing::getInstance()->getCode($sUrl, $sTitle, $aCustomParams);
     return array($sCode, array(), array(), false);
 }
Esempio n. 3
0
 function getPostSocialSharingBlock()
 {
     if (!$this->isAllowedShare($this->aViewingPostInfo)) {
         return '';
     }
     $sUrl = $this->genUrl($this->aViewingPostInfo['PostID'], $this->aViewingPostInfo['PostUri']);
     $sTitle = $this->aViewingPostInfo['PostCaption'];
     $sImgUrl = false;
     $aCustomParams = false;
     if ($this->aViewingPostInfo['PostPhoto']) {
         $sImgUrl = BX_BLOGS_IMAGES_URL . 'orig_' . $this->aViewingPostInfo['PostPhoto'];
         $aCustomParams = array('img_url' => $sImgUrl, 'img_url_encoded' => rawurlencode($sImgUrl));
     }
     bx_import('BxTemplSocialSharing');
     $sCode = BxTemplSocialSharing::getInstance()->getCode($sUrl, $sTitle, $aCustomParams);
     return array($sCode, array(), array(), false);
 }
Esempio n. 4
0
 function getBlockCode_SocialSharing()
 {
     if (!$this->oModule->isAllowedShare($this->aFileInfo)) {
         return '';
     }
     $sUrl = BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $this->aFileInfo['medUri'];
     $sTitle = $this->aFileInfo['medTitle'];
     $sImgUrl = $this->oSearch->getImgUrl($this->aFileInfo['Hash'], 'file');
     bx_import('BxTemplSocialSharing');
     $sCode = BxTemplSocialSharing::getInstance()->getCode($sUrl, $sTitle, array('img_url' => $sImgUrl, 'img_url_encoded' => rawurlencode($sImgUrl)));
     return array($sCode, array(), array(), false);
 }
Esempio n. 5
0
 function getBlockCode_SocialSharing()
 {
     if (!$this->oModule->isAllowedShare($this->aFileInfo)) {
         return '';
     }
     $sUrl = BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $this->aFileInfo['medUri'];
     $sTitle = $this->aFileInfo['medTitle'];
     bx_import('BxTemplSocialSharing');
     $sCode = BxTemplSocialSharing::getInstance()->getCode($sUrl, $sTitle);
     return array($sCode, array(), array(), false);
 }
Esempio n. 6
0
 function getBlockSocialSharing($sUri)
 {
     $aEntry = $this->_oDb->getEntries(array('sample_type' => 'uri', 'uri' => $sUri));
     if (!$aEntry || $aEntry['status'] != BX_TD_STATUS_ACTIVE) {
         return '';
     }
     $sUrl = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aEntry['uri'];
     $sTitle = $aEntry['caption'];
     bx_import('BxTemplSocialSharing');
     $s = BxTemplSocialSharing::getInstance()->getCode($sUrl, $sTitle);
     return array($s, array(), array(), false);
 }
Esempio n. 7
0
 function getBlockCode_SocialSharing()
 {
     if (!$this->oModule->isAllowedShare($this->aPollInfo)) {
         return '';
     }
     $sUrl = BX_DOL_URL_ROOT . $this->oModule->_oConfig->getBaseUri() . '&action=show_poll_info&id=' . $this->aPollInfo['id_poll'];
     $sTitle = $this->aPollInfo['poll_question'];
     bx_import('BxTemplSocialSharing');
     $sCode = BxTemplSocialSharing::getInstance()->getCode($sUrl, $sTitle);
     return array($sCode, array(), array(), false);
 }
Esempio n. 8
0
 protected function _entitySocialSharing($iId, $iIdForTimeline, $iIdThumb, $sTitle, $sObjectStorage, $sObjectTranscoder, $sObjectVote, $sUriViewEntry)
 {
     $sUrl = BxDolPermalinks::getInstance()->permalink('page.php?i=' . $sUriViewEntry . '&id=' . $iId);
     $aCustomParams = false;
     if ($iIdThumb) {
         if ($sObjectTranscoder) {
             $o = BxDolTranscoder::getObjectInstance($sObjectTranscoder);
         } else {
             $o = BxDolStorage::getObjectInstance($sObjectStorage);
         }
         if ($sImgUrl = $o->getFileUrlById($iIdThumb)) {
             $aCustomParams = array('img_url' => $sImgUrl, 'img_url_encoded' => rawurlencode($sImgUrl));
         }
     }
     //TODO: Rebuild using menus engine when it will be ready for such elements like Vote, Share, etc.
     $sVotes = '';
     $oVotes = BxDolVote::getObjectInstance($sObjectVote, $iId);
     if ($oVotes) {
         $sVotes = $oVotes->getElementBlock(array('show_do_vote_as_button' => true));
     }
     $sShare = '';
     if (BxDolRequest::serviceExists('bx_timeline', 'get_share_element_block')) {
         $sShare = BxDolService::call('bx_timeline', 'get_share_element_block', array(bx_get_logged_profile_id(), $this->_aModule['name'], 'added', $iIdForTimeline, array('show_do_share_as_button' => true)));
     }
     $sSocial = BxTemplSocialSharing::getInstance()->getCode($iId, $this->_aModule['name'], BX_DOL_URL_ROOT . $sUrl, $sTitle, $aCustomParams);
     return $this->_oTemplate->parseHtmlByName('entry-share.html', array('vote' => $sVotes, 'share' => $sShare, 'social' => $sSocial));
     //TODO: Rebuild using menus engine when it will be ready for such elements like Vote, Share, etc.
 }
 /**
  * Entry social sharing block
  */
 public function serviceEntitySocialSharing($iContentId = 0)
 {
     if (!$iContentId) {
         $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
     }
     if (!$iContentId) {
         return false;
     }
     $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
     if (!$aContentInfo) {
         return false;
     }
     $CNF =& $this->_oConfig->CNF;
     bx_import('BxDolPermalinks');
     $sUrl = BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
     $aCustomParams = false;
     if ($aContentInfo[$CNF['FIELD_THUMB']]) {
         bx_import('BxDolStorage');
         $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
         if ($oStorage && ($sImgUrl = $oStorage->getFileUrlById($aContentInfo[$CNF['FIELD_THUMB']]))) {
             $aCustomParams = array('img_url' => $sImgUrl, 'img_url_encoded' => rawurlencode($sImgUrl));
         }
     }
     //TODO: Rebuild using menus engine when it will be ready for such elements like Vote, Share, etc.
     $sVotes = '';
     bx_import('BxDolVote');
     $oVotes = BxDolVote::getObjectInstance($CNF['OBJECT_VOTES'], $aContentInfo[$CNF['FIELD_ID']]);
     if ($oVotes) {
         $sVotes = $oVotes->getElementBlock(array('show_do_vote_as_button' => true));
     }
     $sShare = '';
     if (BxDolRequest::serviceExists('bx_timeline', 'get_share_element_block')) {
         $sShare = BxDolService::call('bx_timeline', 'get_share_element_block', array(bx_get_logged_profile_id(), $this->_aModule['name'], 'added', $aContentInfo[$CNF['FIELD_ID']], array('show_do_share_as_button' => true)));
     }
     bx_import('BxTemplSocialSharing');
     $sSocial = BxTemplSocialSharing::getInstance()->getCode($iContentId, $this->_aModule['name'], BX_DOL_URL_ROOT . $sUrl, $aContentInfo[$CNF['FIELD_TITLE']], $aCustomParams);
     return $this->_oTemplate->parseHtmlByName('entry-share.html', array('vote' => $sVotes, 'share' => $sShare, 'social' => $sSocial));
     //TODO: Rebuild using menus engine when it will be ready for such elements like Vote, Share, etc.
 }