function blockHon($aData) { $oVoting = new BxTemplVotingView('bx_sites', $aData['id']); $aResult = $this->_getUnit($aData, 'file'); $aResult['rate'] = $oVoting->getBigVoting(); $aResult['next_url'] = $_SERVER['REQUEST_URI']; return $this->parseHtmlByName('block_hon.html', $aResult); }
function getViewFile(&$aInfo) { $oVotingView = new BxTemplVotingView('bx_' . $this->_oConfig->getUri(), $aInfo['medID']); $iWidth = (int) $this->_oConfig->getGlParam('file_width'); if ($aInfo['prevItem'] > 0) { $aPrev = $this->_oDb->getFileInfo(array('fileId' => $aInfo['prevItem']), true, array('medUri', 'medTitle')); } if ($aInfo['nextItem'] > 0) { $aNext = $this->_oDb->getFileInfo(array('fileId' => $aInfo['nextItem']), true, array('medUri', 'medTitle')); } $aUnit = array('file' => $this->getFileConcept($aInfo['medID'], array('ext' => $aInfo['medExt'], 'source' => $aInfo['medSource'])), 'width_ext' => $iWidth + 2, 'width' => $iWidth, 'fileUrl' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aInfo['medUri'], 'fileTitle' => $aInfo['medTitle'], 'rate' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting(1, $aInfo['Rate']) : '', 'favInfo' => isset($aInfo['favCount']) ? $aInfo['favCount'] : '', 'viewInfo' => $aInfo['medViews'], 'albumUri' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'browse/album/' . $aInfo['albumUri'] . '/owner/' . $aInfo['NickName'], 'albumCaption' => $aInfo['albumCaption'], 'bx_if:prev' => array('condition' => $aInfo['prevItem'] > 0, 'content' => array('linkPrev' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aPrev['medUri'], 'titlePrev' => $aPrev['medTitle'], 'percent' => $aInfo['nextItem'] > 0 ? 50 : 100)), 'bx_if:next' => array('condition' => $aInfo['nextItem'] > 0, 'content' => array('linkNext' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aNext['medUri'], 'titleNext' => $aNext['medTitle'], 'percent' => $aInfo['prevItem'] > 0 ? 50 : 100))); return $this->parseHtmlByName('view_unit.html', $aUnit); }
function getMediaPage($iMediaID = 0) { global $votes_pic; $ret = ''; //$ret .= $this -> getJSCode(); if (0 < $this->iMediaCount) { $iMediaID = 0 < $iMediaID ? $iMediaID : $this->aMedia['0']['PrimPhoto']; $aCurPhoto = $this->getElementArrayByID($iMediaID); if (empty($aCurPhoto)) { $sPhotoUrl = getTemplateIcon($this->sSexPic); } else { $ret .= '<div class="mediaTitle" id="sTitleDiv">'; $ret .= stripcslashes(process_line_output($aCurPhoto['med_title'])); $ret .= '</div>'; $iPhotoID = $aCurPhoto['med_id']; $sPhotoUrl = $this->sMediaUrl . 'photo_' . $aCurPhoto['med_file']; $iPhotoRating = $this->getRating($aCurPhoto['med_rating_sum'], $aCurPhoto['med_rating_count']); } } else { $sPhotoUrl = getTemplateIcon($this->sSexPic); } $ret .= $this->getJSCode($aCurPhoto); $ret .= '<div class="photoBlock" id="photoKeeper">'; $style = ' width:' . $this->aMediaConfig['size']['photoWidth'] . 'px;' . 'height:' . $this->aMediaConfig['size']['photoHeight'] . 'px;' . 'background-image:url(' . $sPhotoUrl . ');'; $ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $style . '" class="photo" alt="" id="temPhotoID" />'; //$ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $style . '" class="photo" alt="" onload="return setImage();" id="temPhotoID" />'; $ret .= '</div>'; $sJsArray = ''; $iPhotosCount = 0; $sIconsList = $this->_getIconsList($sJsArray, $iPhotosCount); $oVotingView = new BxTemplVotingView('media', (int) $aCurPhoto['med_id']); //if( $iPhotosCount && getParam('votes_pic') == 'on' && $oVotingView->isEnabled()) if ($iPhotosCount && $votes_pic && $oVotingView->isEnabled()) { $ret .= '<div class="votingBlock">' . $oVotingView->getBigVoting() . '</div>'; } $ret .= '<div class="iconBlock">'; $ret .= $sIconsList; $ret .= '</div>'; $ret .= '<script type="text/javascript">' . $sJsArray . '</script>'; return $ret; }
function getBlockCode_RateObject() { $sMainPrefix = $this->oConfig->getMainPrefix(); $this->oMedia->oModule->_defineActions(); $aCheck = checkAction($this->iViewer, $this->oMedia->oModule->_defineActionName('view')); if ($aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) { $sCode = MsgBox(_t('_' . $sMainPrefix . '_forbidden')); } else { $aData = $this->getRateObject(); if (count($aData) > 0) { $oVotingView = new BxTemplVotingView($this->sType, $aData[0]['id']); $aUnit = array('url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'rate', 'fileBody' => $this->getRateFile($aData), 'ratePart' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting() : '', 'fileTitle' => $aData[0]['title'], 'fileUri' => $this->oMedia->getCurrentUrl('file', $aData[0]['id'], $aData[0]['uri']), 'fileWhen' => defineTimeInterval($aData[0]['date']), 'fileFrom' => getNickName($aData[0]['ownerId']), 'fileFromLink' => getProfileLink($aData[0]['ownerId'])); $sCode = $this->oMedia->oTemplate->parseHtmlByName('rate_object.html', $aUnit); checkAction($this->iViewer, $this->oMedia->oModule->_defineActionName('view'), true); } else { $sCode = MsgBox(_t('_' . $sMainPrefix . '_no_file_for_rate')); } } return array($sCode, array(), array(), false); }
function getBlockCode_RateObject() { $this->oMedia->oModule->_defineActions(); $aCheck = checkAction($this->iViewer, $this->oMedia->oModule->_defineActionName('view')); if ($aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) { $sCode = MsgBox(_t('_' . $this->sType . '_forbidden')); } else { $aData = $this->getRateObject(); if (count($aData) > 0) { $oFile =& $this->oMedia->oModule; $oFile->_oTemplate->addCss('rate_object.css'); $iInfoWidth = (int) getParam($this->sType . '_file_width'); $oVotingView = new BxTemplVotingView($this->sType, $aData[0]['id']); $aUnit = array('url' => BX_DOL_URL_ROOT . $oFile->_oConfig->getBaseUri() . 'rate', 'fileBody' => $this->oMedia->oTemplate->getFileConcept($aData[0]['id']), 'ratePart' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting() : '', 'fileTitle' => $aData[0]['title'], 'fileUri' => $this->oMedia->getCurrentUrl('file', $aData[0]['id'], $aData[0]['uri']), 'fileWhen' => defineTimeInterval($aData[0]['date']), 'fileFrom' => $aData[0]['ownerName'], 'fileFromLink' => getProfileLink($aData[0]['ownerId']), 'infoWidth' => $iInfoWidth > 0 ? $iInfoWidth + 2 : ''); $sCode = $this->oMedia->oTemplate->parseHtmlByName('rate_object.html', $aUnit); checkAction($this->iViewer, $this->oMedia->oModule->_defineActionName('view'), true); } else { $sCode = MsgBox(_t('_bx_sounds_no_file_for_rate')); } } return $sCode; }
function getRateBlock() { if ($this->iPostViewType != 3 || !$this->iViewingPostID) { return false; } bx_import('BxTemplVotingView'); $bPossibleToRate = $this->oPrivacy->check('rate', $this->iViewingPostID, $this->_iVisitorID); $oVotingView = new BxTemplVotingView($this->_oConfig->getRateSystemName(), $this->iViewingPostID); if ($oVotingView && $oVotingView->isEnabled() && $bPossibleToRate) { $sVotePostRating = $oVotingView->getBigVoting(1); } else { $sVotePostRating = $oVotingView->getBigVoting(0); } $aVars = array('content' => $sVotePostRating); return $this->_oTemplate->parseHtmlByName('default_padding.html', $aVars); }
function getBlockCode_ViewFile() { $oVotingView = new BxTemplVotingView($this->oConfig->getMainPrefix(), $this->aFileInfo['medID']); $iWidth = (int) $this->oConfig->getGlParam('file_width'); if ($this->aFileInfo['prevItem'] > 0) { $aPrev = $this->oDb->getFileInfo(array('fileId' => $this->aFileInfo['prevItem']), true, array('medUri', 'medTitle')); } if ($this->aFileInfo['nextItem'] > 0) { $aNext = $this->oDb->getFileInfo(array('fileId' => $this->aFileInfo['nextItem']), true, array('medUri', 'medTitle')); } $aUnit = array('pic' => $this->oSearch->getImgUrl($this->aFileInfo['Hash'], 'file'), 'width' => $iWidth, 'fileTitle' => $this->aFileInfo['medTitle'], 'fileDescription' => $this->aFileInfo['medDesc'], 'rate' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting(1, $this->aFileInfo['Rate']) : '', 'favInfo' => $this->oDb->getFavoritesCount($this->aFileInfo['medID']), 'viewInfo' => $this->aFileInfo['medViews'], 'albumUri' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'browse/album/' . $this->aFileInfo['albumUri'] . '/owner/' . $this->aFileInfo['NickName'], 'albumCaption' => $this->aFileInfo['albumCaption'], 'bx_if:prev' => array('condition' => $this->aFileInfo['prevItem'] > 0, 'content' => array('linkPrev' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aPrev['medUri'], 'titlePrev' => $aPrev['medTitle'], 'percent' => $this->aFileInfo['nextItem'] > 0 ? 50 : 100)), 'bx_if:next' => array('condition' => $this->aFileInfo['nextItem'] > 0, 'content' => array('linkNext' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aNext['medUri'], 'titleNext' => $aNext['medTitle'], 'percent' => $this->aFileInfo['prevItem'] > 0 ? 50 : 100))); $sCode = $this->oTemplate->parseHtmlByName('view_unit.html', $aUnit); return array($sCode, array(), array(), false); }
function getRate($iFile) { $iFile = (int) $iFile; $sCode = '<center>' . _t('_rating not enabled') . '</center>'; $oVotingView = new BxTemplVotingView($this->_oConfig->getMainPrefix(), $iFile); if ($oVotingView->isEnabled()) { $sCode = $oVotingView->getBigVoting(); } return $sCode; }
/** * Generate presentation Advertisement code with images and other * * @param $iID ID of Advertisement * @return HTML presentation of data */ function ActionPrintAdvertisement($iID) { global $site; global $aPreValues; $iAdvertisementID = (int) $iID; $sRetHtml = ''; $sSiteUrl = BX_DOL_URL_ROOT; if ($this->bAdminMode && $iAdvertisementID > 0) { $iFeaturedStatus = $this->_oDb->getFeaturedStatus($iAdvertisementID); $iNewStatus = $iFeaturedStatus == 1 ? 0 : 1; if (bx_get('do') == 'cfs') { $this->_oDb->UpdateFeatureStatus($iAdvertisementID, $iNewStatus); } } $aSqlResStr = $this->_oDb->getAdInfo($iAdvertisementID); if ($aSqlResStr) { $iOwnerID = (int) $aSqlResStr['IDProfile']; $bPossibleToView = $this->oPrivacy->check('view', $iAdvertisementID, $this->_iVisitorID); if ($this->isAllowedView($iOwnerID, true) == false || $bPossibleToView == false) { return $this->_oTemplate->displayAccessDenied(); } bx_import('BxDolViews'); new BxDolViews('ads', $iAdvertisementID); $aNameRet = getProfileInfo($aSqlResStr['IDProfile']); $sCountryName = $aSqlResStr['Country']; $sCountryPic = $sCountryName == '' ? '' : ' <img alt="' . $sCountryName . '" src="' . ($site['flags'] . strtolower($sCountryName)) . '.gif"/>'; $sCountryName = _t($aPreValues['Country'][$sCountryName]['LKey']); $sPostedByC = _t('_bx_ads_Posted_by'); $sPhoneC = _t('_Phone'); $sDetailsC = _t('_bx_ads_Details'); $sUserOtherListC = _t('_bx_ads_Users_other_listing'); $sActionsC = _t('_Actions'); $sSureC = _t('_Are_you_sure'); $sPostedBy .= '<div class="cls_res_info">'; $sPostedBy .= $sPostedByC . ': <span style="color:#333333;"><a href="' . getProfileLink($aNameRet['ID']) . '">' . $aNameRet['NickName'] . '</a></span>'; $sPostedBy .= '</div>'; if ($aNameRet['Phone'] != "") { $sPostedBy .= '<div class="cls_res_info">'; $sPostedBy .= $sPhoneC . ": <div class=\"clr3\">{$aNameRet['Phone']}</div>"; $sPostedBy .= '</div>'; } $sTimeAgo = defineTimeInterval($aSqlResStr['DateTime_UTS'], false); $aTags = array(); $aTagsLinks = array(); $aTags = preg_split("/[;,]/", $aSqlResStr['Tags']); foreach ($aTags as $sTag) { $sSubLink = $this->bUseFriendlyLinks ? "ads/tag/" : $this->sHomeUrl . "classifieds_tags.php?tag="; $sTagS = htmlspecialchars(title2uri($sTag)); $aTagsLinks[] = '<a href="' . "{$sSubLink}{$sTagS}" . '">' . $sTag . '</a>'; } $sTags .= implode(", ", $aTagsLinks); $sMemberActionForms = ''; if ($this->_iVisitorID > 0 && $this->_iVisitorID != $aNameRet['ID']) { //print Send PM button and other actions if (getParam('bx_ads_enable_paid') == 'on') { $sMemberActionForms .= <<<EOF <form action="{$this->sCurrBrowsedFile}" name="BuyNowForm" method="post"> <input type="hidden" name="BuyNow" value="BuyNow" /> <input type="hidden" name="IDAdv" value="{$iAdvertisementID}" /> <input type="hidden" name="IDSeller" value="{$aSqlResStr['IDProfile']}" /> </form> EOF; } $sMemberActionForms .= <<<EOF <form action="{$sSiteUrl}mail.php" name="post_pm" id="post_pm" method="get"> <input type="hidden" name="mode" value="compose" /> <input type="hidden" name="recipient_id" value="{$aSqlResStr['IDProfile']}" /> <input type="hidden" name="subject" value="{$aSqlResStr['Subject']}" /> </form> EOF; } $sEntryUrl = $this->genUrl($iAdvertisementID, $aSqlResStr['EntryUri'], 'entry'); $sMediaIDs = $this->_oDb->getMediaOfAd($iAdvertisementID); if ($sMediaIDs != '') { $aReadyMedia = explode(',', $sMediaIDs); $sPictureSectContent = $this->_blockPhoto($aReadyMedia, $iOwnerID); } $sPictureSect = $sPictureSectContent != '' ? DesignBoxContent(_t('_bx_ads_Ad_photos'), $sPictureSectContent, 1) : ''; $this->sTAPhotosContent = $sPictureSectContent; bx_import('BxDolSubscription'); $oSubscription = BxDolSubscription::getInstance(); $aButton = $oSubscription->getButton($this->_iVisitorID, $this->_oConfig->getUri(), '', $iAdvertisementID); $aActionKeys = array('BaseUri' => $this->_oConfig->getBaseUri(), 'visitor_id' => $this->_iVisitorID, 'owner_id' => $aNameRet['ID'], 'admin_mode' => "'" . $this->bAdminMode . "'", 'ads_id' => $iAdvertisementID, 'ads_status' => $aSqlResStr['Status'], 'ads_act_type' => $aSqlResStr['Status'] == 'active' ? 'inactive' : 'active', 'ads_featured' => (int) $aSqlResStr['Featured'], 'sure_label' => $sSureC, 'ads_entry_url' => $sEntryUrl, 'only_menu' => 0, 'sbs_ads_title' => $aButton['title'], 'sbs_ads_script' => $aButton['script'], 'TitleShare' => $this->isAllowedShare($aSqlResStr) ? _t('_Share') : ''); $sActionsTable = $GLOBALS['oFunctions']->genObjectsActions($aActionKeys, 'bx_ads', false); $sSubsAddon = $oSubscription->getData(); $sActionsSectContent = $sSubsAddon . $sMemberActionForms . $sActionsTable; $sActionsSect = $this->_iVisitorID > 0 || $this->bAdminMode ? DesignBoxContent($sActionsC, $sActionsSectContent, 1) : ''; $this->sTAActionsContent = $this->_iVisitorID > 0 || $this->bAdminMode ? $sActionsSectContent : ''; bx_import('Cmts', $this->_aModule); $this->oCmtsView = new BxAdsCmts($this->_oConfig->getCommentSystemName(), $iAdvertisementID); $sCommentsSectContent = $this->oCmtsView->getExtraCss(); $sCommentsSectContent .= $this->oCmtsView->getExtraJs(); $sCommentsSectContent .= !$this->oCmtsView->isEnabled() ? '' : $this->oCmtsView->getCommentsFirst(); $this->sTACommentsContent = $sCommentsSectContent; $sCommSect = DesignBoxContent($aCaptions['Comments'], $sCommentsSectContent, 1); $sUserOtherListing = $this->getMemberAds($aSqlResStr['IDProfile'], 2, $iAdvertisementID); $sDataTimeFormatted = getLocaleDate($aSqlResStr['DateTime_UTS']); $iViews = (int) $aSqlResStr['Views']; $sOwnerThumb = get_member_thumbnail($aSqlResStr['IDProfile'], 'none', true); $sAdsMessage = process_html_output($aSqlResStr['Message']); $sCategLink = $this->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/cat/' . $aSqlResStr['CEntryUri'] : "{$this->sCurrBrowsedFile}?bClassifiedID={$aSqlResStr['CatID']}"; $sSCategLink = $this->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/subcat/' . $aSqlResStr['SEntryUri'] : "{$this->sCurrBrowsedFile}?bSubClassifiedID={$aSqlResStr['SubID']}"; $aSubjVariables = array('author_unit' => $sOwnerThumb, 'date' => $sDataTimeFormatted, 'date_ago' => $sTimeAgo, 'cats' => $this->_oTemplate->parseHtmlByTemplateName('category', array('cat_link' => $sCategLink, 'sub_cat_link' => $sSCategLink, 'cat_name' => $aSqlResStr['Name'], 'sub_cat_name' => $aSqlResStr['NameSub'])), 'tags' => $sTags, 'fields' => ''); $sSubjectSectContent = $this->_oTemplate->parseHtmlByName('entry_view_block_info.html', $aSubjVariables); $sSubjectSect = DesignBoxContent(_t('_Info'), $sSubjectSectContent, 1); $this->sTAInfoContent = $sSubjectSectContent; $sDescriptionContent = '<div class="dbContent bx-def-bc-margin bx-def-font-large">' . $sAdsMessage . '</div>'; $sDescriptionSect = DesignBoxContent(_t('_Description'), $sDescriptionContent, 1); $this->sTADescription = $sDescriptionContent; //adding form $aForm = array('form_attrs' => array('name' => 'custom_values_form', 'action' => $oAds->sCurrBrowsedFile), 'inputs' => array('Country' => array('type' => 'value', 'name' => 'Country', 'caption' => _t('_Country'), 'value' => $sCountryName . $sCountryPic), 'City' => array('type' => 'value', 'name' => 'City', 'caption' => _t('_City'), 'value' => $aSqlResStr['City']))); if ($aSqlResStr['CustomFieldName1'] && $aSqlResStr['CustomFieldValue1']) { $aForm['inputs']['Custom1'] = array('type' => 'value', 'name' => 'Custom1', 'caption' => $aSqlResStr['CustomFieldName1'], 'value' => $aSqlResStr['Unit1'] . $aSqlResStr['CustomFieldValue1']); } if ($aSqlResStr['CustomFieldName2'] && $aSqlResStr['CustomFieldValue2']) { $aForm['inputs']['Custom2'] = array('type' => 'value', 'name' => 'Custom2', 'caption' => $aSqlResStr['CustomFieldName2'], 'value' => $aSqlResStr['Unit2'] . $aSqlResStr['CustomFieldValue2']); } $oForm = new BxTemplFormView($aForm); $sOtherInfoContent = $oForm->getCode(); $sOtherInfoSect = DesignBoxContent(_t('_bx_ads_Custom_Values'), $sOtherInfoContent, 1); $this->sTAOtherInfo = $sOtherInfoContent; $bPossibleToRate = $this->oPrivacy->check('rate', $iAdvertisementID, $this->_iVisitorID); $oVotingView = new BxTemplVotingView('ads', $iAdvertisementID); $iVote = $oVotingView && $oVotingView->isEnabled() && $bPossibleToRate ? 1 : 0; $sVotePostRating = $oVotingView->getBigVoting($iVote); $sRatingSect = DesignBoxContent(_t('_Rate'), $sVotePostRating, 1); $this->sTARateContent = '<div class="bx-def-bc-margin">' . $sVotePostRating . '</div>'; $sOtherListingContent = <<<EOF <div class="dbContent"> {$sUserOtherListing} </div> EOF; $sSPaginateActions = <<<EOF <div class="paginate bx-def-padding-left bx-def-padding-right"> <div class="view_all"> <a href="{$this->sCurrBrowsedFile}" onclick="document.forms['UsersOtherListingForm'].submit(); return false;">{$sUserOtherListC}</a> <form action="{$this->sCurrBrowsedFile}" name="UsersOtherListingForm" method="post"> <input type="hidden" name="UsersOtherListing" value="1" /> <input type="hidden" name="IDProfile" value="{$aSqlResStr['IDProfile']}" /> </form> </div> <div class="pages_section"></div> </div> EOF; $sOtherListingSect = DesignBoxContent($sUserOtherListC, $sOtherListingContent . $sSPaginateActions, 1); $this->sTAOtherListingContent = $sOtherListingContent . $sSPaginateActions; $sHomeLink = $this->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/' : "{$this->sCurrBrowsedFile}?Browse=1"; $sBrowseAllAds = _t('_bx_ads_Browse_All_Ads'); $sBreadCrumbs = <<<EOF <div class="breadcrumbs"> <a href="{$sHomeLink}">{$sBrowseAllAds}</a> / <a href="{$sCategLink}">{$aSqlResStr['Name']}</a> / <a href="{$sSCategLink}">{$aSqlResStr['NameSub']}</a> </div> EOF; $aBlocks[1] .= $sActionsSect; $aBlocks[1] .= $sSubjectSect; $aBlocks[1] .= $sRatingSect; $aBlocks[1] .= $sOtherListingSect; $aBlocks[2] .= $sPictureSect; $aBlocks[2] .= $sCommSect; $sRetHtml = <<<EOF {$sBreadCrumbs} <div> <div class="clear_both"></div> <div class="cls_info_left"> {$aBlocks['1']} </div> <div class="cls_info"> {$sDescriptionSect} {$aBlocks['2']} </div> <div class="clear_both"></div> </div> <div class="clear_both"></div> EOF; bx_import('BxDolAlerts'); $oZ = new BxDolAlerts('ads', 'view', $iAdvertisementID, $this->_iVisitorID); $oZ->alert(); $sAdCover = $this->getAdCover($aSqlResStr['Media'], 'icon'); if ($sAdCover != '' && $aSqlResStr['Media']) { $GLOBALS['oTopMenu']->setCustomSubIconUrl($sAdCover); } $GLOBALS['oTopMenu']->setCustomSubHeader(htmlspecialchars($aSqlResStr['Subject'])); $GLOBALS['oTopMenu']->setCustomBreadcrumbs(array(_t('_bx_ads_Ads') => $sHomeLink, $aSqlResStr['Subject'] => '')); $this->_oTemplate->setPageDescription(htmlspecialchars($aSqlResStr['Subject'])); $this->_oTemplate->addPageKeywords(htmlspecialchars($aSqlResStr['Tags'])); } return $sRetHtml; }
function showRateSection($iFile) { $sCode = '<center>' . _t('_Gallery video rating is not enabled') . '</center>'; $oVotingView = new BxTemplVotingView('g' . $this->sType, (int) $iFile); if ($oVotingView->isEnabled()) { $sCode = $oVotingView->getBigVoting(); } return $sCode; }
function getBlockCode_ViewFile() { $oVotingView = new BxTemplVotingView('bx_files', $this->aFileInfo['medID']); if ($this->aFileInfo['prevItem'] > 0) { $aPrev = $this->oDb->getFileInfo(array('fileId' => $this->aFileInfo['prevItem']), true, array('medUri', 'medTitle')); } if ($this->aFileInfo['nextItem'] > 0) { $aNext = $this->oDb->getFileInfo(array('fileId' => $this->aFileInfo['nextItem']), true, array('medUri', 'medTitle')); } //icon $sIcon = $this->oDb->getTypeIcon($this->aFileInfo['Type']); if (!$sIcon) { $sIcon = 'default.png'; } $aUnit = array('pic' => $this->oTemplate->getIconUrl($sIcon), 'fileTitle' => $this->aFileInfo['medTitle'], 'fileSize' => (int) $this->aFileInfo['medSize'] > 0 ? _t_format_size((int) $this->aFileInfo['medSize']) : 0, 'fileExt' => $this->aFileInfo['medExt'], 'fileDescription' => $this->aFileInfo['medDesc'], 'rate' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting(1, $this->aFileInfo['Rate']) : '', 'favInfo' => $this->oDb->getFavoritesCount($this->aFileInfo['medID']), 'viewInfo' => $this->aFileInfo['medViews'], 'albumUri' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'browse/album/' . $this->aFileInfo['albumUri'] . '/owner/' . $this->aFileInfo['NickName'], 'albumCaption' => $this->aFileInfo['albumCaption'], 'bx_if:prev' => array('condition' => $this->aFileInfo['prevItem'] > 0, 'content' => array('linkPrev' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aPrev['medUri'], 'titlePrev' => $aPrev['medTitle'], 'percent' => $this->aFileInfo['nextItem'] > 0 ? 50 : 100)), 'bx_if:next' => array('condition' => $this->aFileInfo['nextItem'] > 0, 'content' => array('linkNext' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aNext['medUri'], 'titleNext' => $aNext['medTitle'], 'percent' => $this->aFileInfo['prevItem'] > 0 ? 50 : 100))); $sCode = $this->oTemplate->parseHtmlByName('view_unit.html', $aUnit); return array($sCode, array(), array(), false); }
function getBlockCode_ViewImage() { $aFile = BxDolService::call('photos', 'get_photo_array', array($this->_aSite['photo'], 'file'), 'Search'); $sImage = $aFile['no_image'] ? '' : $aFile['file']; $sVote = ''; $sSiteUrl = $this->_aSite['url']; if (strncasecmp($sSiteUrl, 'http://', 7) != 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(); } } return $this->_oTemplate->parseHtmlByName('view_image.html', array('title' => $this->_aSite['title'], 'site_url' => $sSiteUrl, 'site_url_view' => $this->_aSite['url'], 'image' => $sImage ? $sImage : $this->_oTemplate->getIconUrl('no-photo-110.png'), 'image_fave' => $this->_oTemplate->getIconUrl('action_fave.png'), 'image_view' => $this->_oTemplate->getIconUrl('eye.png'), 'vote' => $sVote, 'view_count' => $this->_aSite['views'])); }
function PageCompPageMainCode() { global $site; global $oTemplConfig; $aPhoto = getVotingItem(); $check_res = checkAction($_COOKIE['memberID'], ACTION_ID_RATE_PHOTOS); if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) { $ret = ' <table width="100%" cellpadding="4" cellspacing="4" border="0"> <tr> <td align="center">' . $check_res[CHECK_ACTION_MESSAGE] . '</td> </tr> </table>'; return $ret; } $ret = ''; if ($_GET['prev_id']) { $ret .= showPreviousRated((int) $_GET['prev_id']); } if ($oTemplConfig->customize['rate']['showSexSelector']) { $ret .= '<div class="rate_sex_form">'; $ret .= '<form method="post" name="FormVote" action="' . $_SERVER['PHP_SELF'] . '">'; $ret .= '<span>'; $ret .= _t("_Show me"); $ret .= '</span>'; $ret .= '<span>'; $ret .= '<select name="showme" onchange="document.forms[\'FormVote\'].submit()">' . "\n"; $selected_all = $_REQUEST['showme'] == 'all' || strlen(trim($_REQUEST['showme'])) == 0 ? ' selected="selected" ' : ''; $ret .= '<option value="all"' . $selected_all . '>' . _t("_all") . '</option>'; $arr = db_arr("SELECT `extra` FROM `ProfilesDesc` WHERE `name` = 'Sex'"); $vals = preg_split("/[,\\']+/", $arr[0], -1, PREG_SPLIT_NO_EMPTY); foreach ($vals as $v) { if (strlen(trim($v)) <= 0) { continue; } $ret .= "<option value=\"{$v}\" " . ($_REQUEST['showme'] == $v ? 'selected="selected"' : '') . ">" . _t("_{$v}") . "</option>\n"; } $ret .= '</select>'; $ret .= '</span>'; $ret .= '</form>'; $ret .= '</div>'; } if (empty($aPhoto)) { $ret .= _t_action('_there_is_no_photo_that_you_can_rate'); } else { if ($oTemplConfig->customize['rate']['showProfileInfo']) { $ret .= '<div class="clear_both"></div>'; $ret .= ProfileDetails($aPhoto['med_prof_id']); $ret .= '<div class="clear_both"></div>'; } $ret .= getRatingPhoto($aPhoto); $oVotingView = new BxTemplVotingView('media', (int) $aPhoto['med_id']); if ($oVotingView->isEnabled()) { $sUrlAdd = ''; if ($_REQUEST['showme']) { $sUrlAdd .= 'showme=' . $_REQUEST['showme'] . '&'; } $ret .= "\r\n\t\t\t\t<script>\r\n\t\t\t\t\tBxDolVoting.prototype.onvote = function (fRate, iCount)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdocument.location = '{$site['url']}rate.php?{$sUrlAdd}prev_id=' + this._iObjId;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tBxDolVoting.prototype.onvotefail = function ()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdocument.location = '{$site['url']}rate.php?{$sUrlAdd}prev_id=' + this._iObjId;\r\n\t\t\t\t\t}\r\n\t\t\t\t</script>"; $ret .= '<div style="margin-left:225px">' . $oVotingView->getBigVoting() . '</div>'; } } return $ret; }
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 PageCompRate() { global $iFile; $sCode = '<center>' . _t('_Gallery video rating is not enabled') . '</center>'; $oVotingView = new BxTemplVotingView('gvideo', (int) $iFile); if ($oVotingView->isEnabled()) { $sCode = $oVotingView->getBigVoting(); } return $sCode; }
function getRateBlock() { if ($this->iPostViewType == 3 && $this->iViewingPostID > 0) { bx_import('BxTemplVotingView'); $bPossibleToRate = $this->oPrivacy->check('rate', $this->iViewingPostID, $this->_iVisitorID); $oVotingView = new BxTemplVotingView('blogposts', $this->iViewingPostID); if ($oVotingView && $oVotingView->isEnabled() && $bPossibleToRate) { $sVotePostRating = $oVotingView->getBigVoting(1); } else { $sVotePostRating = $oVotingView->getBigVoting(0); } return $sVotePostRating; } }