function getBlockCode_featured() { bx_import('SearchUnit', $this->oModule->_aModule); $oTmpAdsSearch = new BxAdsSearchUnit(); $oTmpAdsSearch->sSelectedUnit = 'ad_of_day'; $oTmpAdsSearch->aCurrent['paginate']['forcePage'] = 1; $oTmpAdsSearch->aCurrent['paginate']['perPage'] = 1; $oTmpAdsSearch->aCurrent['restriction']['featuredStatus']['value'] = 1; $sTopAdOfAllDayValue = $oTmpAdsSearch->displayResultBlock(); return $oTmpAdsSearch->aCurrent['paginate']['totalNum'] > 0 ? $sTopAdOfAllDayValue : ''; }
function getUnit($iId, $sUnitTemplate = false) { bx_import('SearchUnit', $this->_aModule); $oTmpAdsSearch = new BxAdsSearchUnit(); if ($sUnitTemplate) { $oTmpAdsSearch->sSelectedUnit = $sUnitTemplate; } $oTmpAdsSearch->aCurrent['paginate']['forcePage'] = 1; $oTmpAdsSearch->aCurrent['paginate']['perPage'] = 1; $oTmpAdsSearch->aCurrent['restriction']['id']['value'] = (int) $iId; $s = $oTmpAdsSearch->displayResultBlock(false); return $oTmpAdsSearch->aCurrent['paginate']['totalNum'] > 0 ? $s : ''; }
/** * Ads block for profile page (as PHP function). List of latest ads of member. * * @param $_iProfileID - member id * * @return html of last ads units */ function serviceAdsProfilePage($_iProfileID) { $GLOBALS['oTopMenu']->setCurrentProfileID($_iProfileID); require_once $this->_oConfig->getClassPath() . 'BxAdsSearchUnit.php'; $oTmpAdsSearch = new BxAdsSearchUnit(); $oTmpAdsSearch->aCurrent['paginate']['perPage'] = 10; $oTmpAdsSearch->aCurrent['sorting'] = 'last'; $oTmpAdsSearch->aCurrent['restriction']['owner']['value'] = $_iProfileID; $sMemberAds = $oTmpAdsSearch->displayResultBlock(); if ($oTmpAdsSearch->aCurrent['paginate']['totalNum']) { //$sMemberAds = $GLOBALS['oFunctions']->centerContent($sMemberAds, '.ads_Unit'); return <<<EOF <div class="clear_both"></div> <div class="dbContent"> \t{$sMemberAds} \t<div class="clear_both"></div> </div> EOF; } }