_oDb->getMembershipsBy(array('type' => 'level_id', 'id' => $aUserLevel['ID'])); if(isset($aUserLevel['DateExpires'])) $sTxtExpiresIn = _t('_membership_txt_expires_in', floor(($aUserLevel['DateExpires'] - time())/86400)); else $sTxtExpiresIn = _t('_membership_txt_expires_never'); $this->addCss('levels.css'); return $this->parseHtmlByName('current.html', array( 'id' => $aLevelInfo['mem_id'], 'title' => $aLevelInfo['mem_name'], 'icon' => $this->_oConfig->getIconsUrl() . $aLevelInfo['mem_icon'], 'description' => str_replace("\$", "$", $aLevelInfo['mem_description']), 'expires' => $sTxtExpiresIn ) ); } function displayAvailableLevels($aValues) { $sCurrencyCode = strtolower($this->_oConfig->getCurrencyCode()); $sCurrencySign = $this->_oConfig->getCurrencySign(); $aMemberships = array(); foreach($aValues as $aValue) { $aMemberships[] = array( 'url_root' => BX_DOL_URL_ROOT, 'id' => $aValue['mem_id'], 'title' => $aValue['mem_name'], 'icon' => $this->_oConfig->getIconsUrl() . $aValue['mem_icon'], 'description' => str_replace("\$", "$", $aValue['mem_description']), 'days' => $aValue['price_days'] > 0 ? $aValue['price_days'] . ' ' . _t('_membership_txt_days') : _t('_membership_txt_expires_never') , 'price' => $aValue['price_amount'], 'currency_icon' => $this->getIconUrl($sCurrencyCode . '.png'), 'bx_if:pricy' => array( 'condition' => $aValue['price_amount'] > 0, 'content' => array( 'add_to_cart' => BxDolService::call('payment', 'get_add_to_cart_link', array(0, $this->_oConfig->getId(), $aValue['price_id'], 1, 1)) ) ), 'bx_if:free' => array( 'condition' => $aValue['price_amount'] == 0, 'content' => array( 'mem_id' => $aValue['mem_id'] ) ) ); } $this->addCss('levels.css'); return $this->parseHtmlByName('available.html', array('bx_repeat:levels' => $aMemberships)); } } ?>