function getBlockCode_ViewImage() { $sSiteUrl = $this->_aSite['url']; $aFile = BxDolService::call('photos', 'get_photo_array', array($this->_aSite['photo'], 'file'), 'Search'); $sImage = $aFile['no_image'] ? '' : $aFile['file']; // BEGIN STW INTEGRATION if (getParam('bx_sites_account_type') != 'No Automated Screenshots') { if ($sImage == '') { $aSTWOptions = array(); bx_sites_import('STW'); $sThumbHTML = getThumbnailHTML($sSiteUrl, $aSTWOptions, false, false); } } // END STW INTEGRATION $sVote = ''; if (strncasecmp($sSiteUrl, 'http://', 7) !== 0 && strncasecmp($sSiteUrl, 'https://', 8) !== 0) { $sSiteUrl = 'http://' . $sSiteUrl; } if ($this->_oConfig->isVotesAllowed() && $this->_oSites->oPrivacy->check('rate', $this->_aSite['id'], $this->_oSites->iOwnerId)) { bx_import('BxTemplVotingView'); $oVotingView = new BxTemplVotingView('bx_sites', $this->_aSite['id']); if ($oVotingView->isEnabled()) { $sVote = $oVotingView->getBigVoting(); } } $sContent = $this->_oTemplate->parseHtmlByName('view_image.html', array('title' => $this->_aSite['title'], 'site_url' => $sSiteUrl, 'site_url_view' => $this->_aSite['url'], 'bx_if:is_image' => array('condition' => $sThumbHTML == false, 'content' => array('image' => $sImage ? $sImage : $this->_oTemplate->getImageUrl('no-image-thumb.png'))), 'bx_if:is_thumbhtml' => array('condition' => $sThumbHTML != '', 'content' => array('thumbhtml' => $sThumbHTML)), 'vote' => $sVote, 'view_count' => $this->_aSite['views'])); return array($sContent, array(), array(), false); }
function getBlockCode_ViewAll() { bx_sites_import('SearchResult'); $oSearchResult = new BxSitesSearchResult('home'); if ($s = $oSearchResult->displayResultBlock(true, true)) { return array($s, array(_t('RSS') => array('href' => $this->_oConfig->getBaseUri() . 'browse/all?rss=1', 'target' => '_blank', 'icon' => 'rss')), array(), true); } else { return MsgBox(_t('_Empty')); } }
function getBlockCode_Owner() { bx_sites_import('SearchResult'); $oSearchResult = new BxSitesSearchResult('user', process_db_input($this->_aProfile['NickName'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION)); if ($s = $oSearchResult->displayResultBlock(true)) { return $s; } else { return MsgBox(_t('_Empty')); } }
function getBlockCode_ViewRate() { bx_sites_import('SearchResult'); $oSearchResult = new BxSitesSearchResult('hon_rate'); $oSearchResult->sUnitName = 'hon'; $oSearchResult->sUnitTemplate = 'block_hon'; if ($s = $oSearchResult->displayResultBlock()) { return $s; } else { return MsgBox(_t('_Empty')); } }
function _manageSites($sMode, $sValue, $aButtons) { bx_sites_import('SearchResult'); $oSearchResult = new BxSitesSearchResult($sMode, $sValue); $oSearchResult->sUnitTemplate = 'unit_admin'; $sActionsPanel = ''; $sFormName = 'manageSitesForm'; if ($sContent = $oSearchResult->displayResultBlock(true)) { $sActionsPanel = $oSearchResult->showAdminActionsPanel($sFormName, $aButtons); } else { $sContent = MsgBox(_t('_Empty')); } $aVars = array('form_name' => $sFormName, 'content' => $sContent, 'actions_panel' => $sActionsPanel); return $this->_oTemplate->parseHtmlByName('manage.html', $aVars); }
function _getUnit($aData, $sThumbSize = 'browse') { if (null == $this->_oMain) { $this->_oMain = BxDolModule::getInstance('BxSitesModule'); } $sUrl = strncasecmp($aData['url'], 'http://', 7) !== 0 && strncasecmp($aData['url'], 'https://', 8) !== 0 ? 'http://' . $aData['url'] : $aData['url']; $aFile = BxDolService::call('photos', 'get_photo_array', array($aData['photo'], $sThumbSize), 'Search'); $sImage = $aFile['no_image'] ? '' : $aFile['file']; // BEGIN STW INTEGRATION if (getParam('bx_sites_account_type') != 'No Automated Screenshots') { if ($sImage == '') { $aSTWOptions = array(); bx_sites_import('STW'); $sThumbHTML = getThumbnailHTML($sUrl, $aSTWOptions); } } // END STW INTEGRATION $sSiteLink = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aData['entryUri']; $aResult = array('id' => $aData['id'], 'url' => $sUrl, 'url_title' => $this->_getDomain($sUrl), 'title' => $aData['title'], 'site_url' => $sSiteLink, 'description' => $this->_oMain->_formatSnippetText($aData), 'bx_if:is_image' => array('condition' => $sThumbHTML == false, 'content' => array('site_link' => $sSiteLink, 'image' => $sImage ? $sImage : $this->getImageUrl('no-image-thumb.png'))), 'bx_if:is_thumbhtml' => array('condition' => $sThumbHTML != '', 'content' => array('site_link' => $sSiteLink, 'thumbhtml' => $sThumbHTML)), 'comments' => $aData['commentsCount'] . ' ' . _t('_bx_sites_unit_comments'), 'date' => defineTimeInterval($aData['date']), 'owner_str' => _t('_bx_sites_unit_from') . ' ', 'cats_str' => _t('_Categories') . ':', 'cats' => $this->parseCategories($aData['categories']), 'tags_str' => _t('_Tags') . ':', 'tags' => $this->parseTags($aData['tags'])); $this->_checkOwner($aData, $aResult); return $aResult; }