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_ActionList() { $sCode = null; $sMainPrefix = $this->oConfig->getMainPrefix(); bx_import('BxDolSubscription'); $oSubscription = BxDolSubscription::getInstance(); $aButton = $oSubscription->getButton($this->iProfileId, $sMainPrefix, '', (int) $this->aFileInfo['medID']); $sCode .= $oSubscription->getData(); $aReplacement = array('favorited' => $this->aFileInfo['favorited'] == false ? '' : 'favorited', 'featured' => (int) $this->aFileInfo['Featured'], 'featuredCpt' => '', 'approvedCpt' => '', 'approvedAct' => '', 'moduleUrl' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri(), 'fileUri' => $this->aFileInfo['medUri'], 'iViewer' => $this->iProfileId, 'ID' => (int) $this->aFileInfo['medID'], 'Owner' => (int) $this->aFileInfo['medProfId'], 'OwnerName' => $this->aFileInfo['NickName'], 'AlbumUri' => $this->aFileInfo['albumUri'], 'sbs_' . $sMainPrefix . '_title' => $aButton['title'], 'sbs_' . $sMainPrefix . '_script' => $aButton['script'], 'shareCpt' => $this->oModule->isAllowedShare($this->aFileInfo) ? _t('_Share') : '', 'downloadCpt' => $this->oModule->isAllowedDownload($this->aFileInfo) ? _t('_Download') : ''); if (isAdmin($this->iProfileId)) { $sMsg = $aReplacement['featured'] > 0 ? 'un' : ''; $aReplacement['featuredCpt'] = _t('_' . $sMainPrefix . '_action_' . $sMsg . 'feature'); } if ($this->oModule->isAllowedApprove($this->aFileInfo)) { $sMsg = ''; $iAppr = 1; if ($this->aFileInfo['Approved'] == 'approved') { $sMsg = 'de'; $iAppr = 0; } $aReplacement['approvedCpt'] = _t('_' . $sMainPrefix . '_admin_' . $sMsg . 'activate'); $aReplacement['approvedAct'] = $iAppr; } $aReplacement['repostCpt'] = $aReplacement['repostScript'] = ''; if (BxDolRequest::serviceExists('wall', 'get_repost_js_click')) { $sCode .= BxDolService::call('wall', 'get_repost_js_script'); $aReplacement['repostCpt'] = _t('_Repost'); $aReplacement['repostScript'] = BxDolService::call('wall', 'get_repost_js_click', array($this->iProfileId, $sMainPrefix, 'add', (int) $this->aFileInfo['medID'])); } $sActionsList = $GLOBALS['oFunctions']->genObjectsActions($aReplacement, $sMainPrefix); if (is_null($sActionsList)) { return ''; } return $sCode . $sActionsList; }
function uploadImage($sUser, $sPwd, $sAlbum, $binImageData, $iDataLength, $sTitle, $sTags, $sDesc) { if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) { return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct")); } if (!BxDolXMLRPCMedia::_isMembershipEnabledFor($iIdProfileViewer, 'BX_PHOTOS_ADD', true)) { return new xmlrpcval("fail access"); } // write tmp file $sTmpFilename = BX_DIRECTORY_PATH_ROOT . "tmp/" . time() . '_' . $iId; $f = fopen($sTmpFilename, "wb"); if (!$f) { return new xmlrpcval("fail fopen"); } if (!fwrite($f, $binImageData, (int) $iDataLength)) { fclose($f); return new xmlrpcval("fail write"); } fclose($f); // upload $aFileInfo = array(); $aFileInfo['medTitle'] = $sTitle; $aFileInfo['medDesc'] = $sDesc; $aFileInfo['medTags'] = $sTags; $aFileInfo['Categories'] = array($sAlbum); $aFileInfo['album'] = $sAlbum; if (BxDolService::call('photos', 'perform_photo_upload', array($sTmpFilename, $aFileInfo, 0, $iId), 'Uploader')) { return new xmlrpcval("ok"); } else { return new xmlrpcval("fail upload"); } }
public function response($oAlert) { if ('bx_albums_files' == $oAlert->sUnit && 'file_deleted' == $oAlert->sAction) { BxDolService::call($this->MODULE, 'delete_file_associations', array($oAlert->iObject)); } parent::response($oAlert); }
public function response($oAlert) { if ('profile' != $oAlert->sUnit || 'delete' != $oAlert->sAction || !isset($oAlert->aExtras['delete_with_content']) || !$oAlert->aExtras['delete_with_content']) { return; } BxDolService::call($this->MODULE, 'delete_entities_by_author', array($oAlert->iObject)); }
function service($aToken) { if (!isAdmin($aToken['user_id'])) { $this->errorOutput(403, 'access_denied', 'Only admin can access service endpoint'); return false; } bx_login($aToken['user_id'], false, false); $sUri = bx_get('uri'); $sMethod = bx_get('method'); if (!($aParams = bx_get('params'))) { $aParams = array(); } elseif (is_string($aParams) && preg_match('/^a:[\\d+]:\\{/', $aParams)) { $aParams = @unserialize($aParams); } if (!is_array($aParams)) { $aParams = array($aParams); } if (!($sClass = bx_get('class'))) { $sClass = 'Module'; } if (!BxDolRequest::serviceExists($sUri, $sMethod, $sClass)) { $this->errorOutput(404, 'not_found', 'Service was not found'); return false; } $mixedRet = BxDolService::call($sUri, $sMethod, $aParams, $sClass); $this->output(array('uri' => $sUri, 'method' => $sMethod, 'data' => $mixedRet)); }
/** * Get menu code. * @return string */ public function getCode() { $aMenuItemSelected = $this->_getSelectedMenuItem(); if (isset($aMenuItemSelected['set_name']) && 'sys_site' == $aMenuItemSelected['set_name'] && 'home' == $aMenuItemSelected['name']) { return ''; } $this->_addJsCss(); $oMenuSubmenu = BxDolMenu::getObjectInstance($this->_sObjectSubmenu); $aVars = array('object' => $this->_sObject, 'id' => 'bx-menu-submenu-menu', 'title' => $aMenuItemSelected['title'], 'link' => BxDolPermalinks::getInstance()->permalink($aMenuItemSelected['link']), 'popup' => $oMenuSubmenu ? BxTemplFunctions::getInstance()->transBox('bx-menu-submenu-menu', '<div class="bx-def-padding">' . $oMenuSubmenu->getCode() . '</div>', true) : '', 'bx_if:menu' => array('condition' => $oMenuSubmenu, 'content' => array()), 'bx_if:image' => array('condition' => false !== strpos($aMenuItemSelected['icon'], '.'), 'content' => array('icon_url' => $aMenuItemSelected['icon'])), 'bx_if:icon' => array('condition' => false === strpos($aMenuItemSelected['icon'], '.'), 'content' => array('icon' => $aMenuItemSelected['icon'])), 'bx_repeat:menus' => array()); $aMenus = $this->getSubmenuParams($aMenuItemSelected); foreach ($aMenus as $aMenu) { $sPopupContent = ''; if (isset($aMenu['object']) && ($oMenu = BxDolMenu::getObjectInstance($aMenu['object']))) { $sPopupContent = $oMenu->getCode(); } elseif (isset($aMenu['service']) && is_array($aMenu['service'])) { $sPopupContent = BxDolService::call($aMenu['service']['module'], $aMenu['service']['method'], isset($aMenu['service']['params']) ? $aMenu['service']['params'] : array(), isset($aMenu['service']['class']) ? $aMenu['service']['class'] : 'Module'); } if (!$sPopupContent) { continue; } $aVars['bx_repeat:menus'][] = array('id' => $aMenu['id'], 'icon' => $aMenu['icon'], 'popup' => BxTemplFunctions::getInstance()->transBox($aMenu['id'], '<div class="bx-def-padding">' . $sPopupContent . '</div>', true)); } if (!$aVars['bx_repeat:menus'] && (!$oMenuSubmenu || !$aMenuItemSelected)) { return ''; } $sMenu = $this->_oTemplate->parseHtmlByName($this->_aObject['template'], $aVars); return $this->_oTemplate->parseHtmlByName('menu_main_submenu_wrapper.html', array('menu' => $sMenu)); }
protected function getWidgets($sPage, $aWidgets) { $oTemplate = BxDolStudioTemplate::getInstance(); $aParseVars = array('url_root' => BX_DOL_URL_ROOT, 'url_studio' => BX_DOL_URL_STUDIO, 'url_studio_icons' => BX_DOL_URL_STUDIO_BASE . 'images/icons/'); $aTmplVars = array(); foreach ($aWidgets as $aWidget) { $aTmplVarsActions = array(); if (!$this->isEnabled($aWidget) && !empty($aWidget['cnt_actions'])) { $aService = unserialize($aWidget['cnt_actions']); $aActions = BxDolService::call($aService['module'], $aService['method'], array_merge(array($aWidget), $aService['params']), $aService['class']); foreach ($aActions as $aAction) { $sActionIcon = $aAction['icon']; $bActionIcon = strpos($sActionIcon, '.') === false; if (!$bActionIcon) { $sActionIcon = $oTemplate->getIconUrl($sActionIcon); } $sCaption = _t($aAction['caption']); $aTmplVarsActions[] = array('caption' => $sCaption, 'url' => !empty($aAction['url']) ? $oTemplate->parseHtmlByContent($aAction['url'], $aParseVars, array('{', '}')) : 'javascript:void(0)', 'bx_if:show_click' => array('condition' => !empty($aAction['click']), 'content' => array('content' => 'javascript:' . $aAction['click'])), 'bx_if:action_icon' => array('condition' => $bActionIcon, 'content' => array('icon' => $sActionIcon, 'caption' => $sCaption)), 'bx_if:action_image' => array('condition' => !$bActionIcon, 'content' => array('icon_url' => $sActionIcon, 'caption' => $sCaption))); } } $sIcon = $this->getIcon($aWidget); $bIcon = strpos($sIcon, '.') === false; $sNotices = !empty($this->aWidgetsNotices[$aWidget['id']]) ? $this->aWidgetsNotices[$aWidget['id']] : ''; $aTmplVars[] = array('id' => $aWidget['id'], 'url' => !empty($aWidget['url']) ? $oTemplate->parseHtmlByContent($aWidget['url'], $aParseVars, array('{', '}')) : 'javascript:void(0)', 'bx_if:show_click_icon' => array('condition' => !empty($aWidget['click']), 'content' => array('content' => 'javascript:' . $aWidget['click'])), 'bx_if:show_click_link' => array('condition' => !empty($aWidget['click']), 'content' => array('content' => 'javascript:' . $aWidget['click'])), 'bx_if:show_notice' => array('condition' => !empty($sNotices), 'content' => array('content' => $sNotices)), 'bx_if:show_actions' => array('condition' => !empty($aTmplVarsActions), 'content' => array('bx_repeat:actions' => $aTmplVarsActions)), 'bx_if:icon' => array('condition' => $bIcon, 'content' => array('icon' => $sIcon)), 'bx_if:image' => array('condition' => !$bIcon, 'content' => array('icon_url' => $sIcon)), 'caption' => _t($aWidget['caption']), 'widget_disabled_class' => !$this->isEnabled($aWidget) ? 'bx-std-widget-icon-disabled' : '', 'widget_bookmarked_class' => (int) $aWidget['bookmark'] == 1 ? 'bx-std-widget-icon-bookmarked' : '', 'widget_styles' => isset($_COOKIE['bx_studio_bookmark']) && (int) $_COOKIE['bx_studio_bookmark'] == 1 && (int) $aWidget['bookmark'] != 1 ? 'display:none;' : ''); } return $oTemplate->parseHtmlByName('widgets.html', array('bx_repeat:widgets' => $aTmplVars)); }
public function response($oAlert) { if ($this->MODULE == $oAlert->sUnit && 'commentPost' == $oAlert->sAction) { BxDolService::call($this->MODULE, 'trigger_comment_post', array($oAlert->iObject, $oAlert->aExtras['comment_author_id'], $oAlert->aExtras['comment_id'])); } parent::response($oAlert); }
function uploadImage($sUser, $sPwd, $sAlbum, $binImageData, $iDataLength, $sTitle, $sTags, $sDesc) { if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) { return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct")); } if (!BxDolXMLRPCMedia::_isMembershipEnabledFor($iIdProfileViewer, 'BX_PHOTOS_ADD', true)) { return new xmlrpcval("fail access"); } // write tmp file $sTmpFilename = BX_DIRECTORY_PATH_ROOT . "tmp/" . time() . '_' . $iId; $f = fopen($sTmpFilename, "wb"); if (!$f) { return new xmlrpcval("fail fopen"); } if (!fwrite($f, $binImageData, (int) $iDataLength)) { fclose($f); return new xmlrpcval("fail write"); } fclose($f); // upload $aFileInfo = array(); $aFileInfo['medTitle'] = process_db_input($sTitle, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION); $aFileInfo['medDesc'] = process_db_input($sDesc, BX_TAGS_VALIDATE, BX_SLASHES_NO_ACTION); $aFileInfo['medTags'] = process_db_input($sTags, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION); $aFileInfo['Categories'] = array(process_db_input($sAlbum, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION)); $aFileInfo['album'] = process_db_input($sAlbum, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION); $isUpdateThumb = (int) db_value("SELECT `Avatar` FROM `Profiles` WHERE `ID` = '{$iId}' LIMIT 1") ? false : true; if (BxDolService::call('photos', 'perform_photo_upload', array($sTmpFilename, $aFileInfo, $isUpdateThumb), 'Uploader')) { return new xmlrpcval("ok"); } else { return new xmlrpcval("fail upload"); } }
function blockFiles(&$aData) { $iEntryId = $aData['id']; $aReadyMedia = array(); if ($iEntryId) { $aReadyMedia = $GLOBALS['oBxStoreModule']->_oDb->getFiles($iEntryId, true); } if (!$aReadyMedia) { return ''; } $aVars = array('bx_repeat:files' => array()); $sCurrencySign = getParam('pmt_default_currency_sign'); foreach ($aReadyMedia as $r) { $iMediaId = $r['media_id']; $a = BxDolService::call('files', 'get_file_array', array($iMediaId), 'Search'); if (!$a['date']) { continue; } bx_import('BxTemplFormView'); $oForm = new BxTemplFormView(array()); $aInputBtnDownload = array('type' => 'submit', 'name' => 'bx_store_download', 'value' => _t('_bx_store_download'), 'attrs' => array('onclick' => "window.open ('" . BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . "download/{$r['id']}','_self');")); $aVars['bx_repeat:files'][] = array('id' => $iMediaId, 'title' => $a['title'], 'icon' => $a['file'], 'price' => $sCurrencySign . ' ' . $r['price'], 'for_group' => sprintf(_t('_bx_store_for_group'), $GLOBALS['oBxStoreModule']->getGroupName($r['allow_purchase_to'])), 'date' => defineTimeInterval($a['date']), 'bx_if:purchase' => array('condition' => $GLOBALS['oBxStoreModule']->isAllowedPurchase($r), 'content' => array('btn_purchase' => BxDolService::call('payment', 'get_add_to_cart_link', array($r['author_id'], $this->_oConfig->getId(), $r['id'], 1)))), 'bx_if:download' => array('condition' => $GLOBALS['oBxStoreModule']->isAllowedDownload($r), 'content' => array('btn_download' => $oForm->genInputButton($aInputBtnDownload)))); } if (!$aVars['bx_repeat:files']) { return ''; } return $this->parseHtmlByName('block_files', $aVars); }
function uninstall($aParams) { if (BxDolRequest::serviceExists('wall', 'update_handlers')) { BxDolService::call('wall', 'update_handlers', array($this->_aConfig['home_uri'], false)); } return parent::uninstall($aParams); }
/** * Overwtire the method of parent class. * * @param BxDolAlerts $oAlert an instance of alert. */ function response($oAlert) { $sKey = $oAlert->sUnit . '_' . $oAlert->sAction; $iCommentId = 0; switch ($oAlert->sAction) { case 'delete': case 'delete_poll': case 'delete_post': $this->_oModule->_oDb->deleteActivityByObject($oAlert->sUnit, $oAlert->iObject); return; case 'commentPost': if (!isset($oAlert->aExtras['comment_id']) || (int) $oAlert->aExtras['comment_id'] == 0) { return; } $iCommentId = (int) $oAlert->aExtras['comment_id']; break; case 'commentRemoved': if (!isset($oAlert->aExtras['comment_id']) || (int) $oAlert->aExtras['comment_id'] == 0) { return; } $this->_oModule->_oDb->deleteActivityByObject($oAlert->sUnit, $oAlert->iObject, (int) $oAlert->aExtras['comment_id']); return; } // call defined method; if (!is_array($this->aInternalHandlers) || !array_key_exists($sKey, $this->aInternalHandlers)) { return; } if (!BxDolRequest::serviceExists($this->aInternalHandlers[$sKey]['module_uri'], $this->aInternalHandlers[$sKey]['module_method'])) { return; } // define functions parameters; $aParams = array('action' => $oAlert->sAction, 'object_id' => $oAlert->iObject, 'sender_id' => $oAlert->iSender, 'extra_params' => $oAlert->aExtras); $aResult = BxDolService::call($this->aInternalHandlers[$sKey]['module_uri'], $this->aInternalHandlers[$sKey]['module_method'], $aParams); if (empty($aResult)) { return; } // create new event; // define recipent id; $iRecipientId = isset($aResult['recipient_id']) ? $aResult['recipient_id'] : $oAlert->iObject; if (isset($aResult['spy_type']) && $aResult['spy_type'] == 'content_activity' && $iRecipientId == $oAlert->iSender) { $iRecipientId = 0; } $iEventId = 0; if ($oAlert->iSender || !$oAlert->iSender && $this->_oModule->_oConfig->bTrackGuestsActivites) { $iEventId = $this->_oModule->_oDb->createActivity($oAlert->sUnit, $oAlert->sAction, $oAlert->iObject, $iCommentId, $oAlert->iSender, $iRecipientId, $aResult); } if (!$iEventId) { return; } // try to define all profile's friends; $aFriends = getMyFriendsEx($oAlert->iSender); if (empty($aFriends) || !is_array($aFriends)) { return; } // attach event to friends; foreach ($aFriends as $iFriendId => $aItems) { $this->_oModule->_oDb->attachFriendEvent($iEventId, $oAlert->iSender, $iFriendId); } }
function install($aParams) { $aResult = parent::install($aParams); if ($aResult['result']) { BxDolService::call('wmap', 'part_install', array('profiles', array('part' => 'profiles', 'title' => '_Profiles', 'title_singular' => '_Profile', 'icon' => 'map_marker_profiles.png', 'icon_site' => 'user', 'join_table' => 'Profiles', 'join_where' => "AND `p`.`Status` = 'Active'", 'join_field_id' => 'ID', 'join_field_country' => 'Country', 'join_field_city' => 'City', 'join_field_state' => '', 'join_field_zip' => 'zip', 'join_field_address' => '', 'join_field_title' => 'NickName', 'join_field_uri' => 'ID', 'join_field_author' => 'ID', 'join_field_privacy' => 'allow_view_to', 'permalink' => 'profile.php?ID='))); } return $aResult; }
function response($oTag) { if (!($iProfileId = (int) $oTag->iObject)) { return; } bx_import('BxDolService'); BxDolService::call('avatar', 'delete_profile_avatars', array($iProfileId)); }
function install($aParams) { $aResult = parent::install($aParams); if ($aResult['result']) { BxDolService::call($this->_aConfig['home_uri'], 'update_dependent_modules'); } return $aResult; }
public function response($oAlert) { if ('system' != $oAlert->sUnit || 'before_send_mail' != $oAlert->sAction || 'on' != getParam('bx_smtp_on')) { return; } $a = $oAlert->aExtras; $a['override_result'] = BxDolService::call('bx_smtp', 'send', array($a['email'], $a['subject'], $a['body'], $a['header'], $a['params'], $a['html'], $a['recipient'])); }
function uninstall($aParams) { if (BxDolRequest::serviceExists('spy', 'update_handlers')) { BxDolService::call('spy', 'update_handlers', array($this->_aConfig['home_uri'], false)); } $this->updateEmailTemplatesExceptions(); return parent::uninstall($aParams); }
function install($aParams) { $aResult = parent::install($aParams); if ($aResult['result']) { BxDolService::call($this->_aConfig['home_uri'], 'update_handlers'); } $this->addHtmlFields(array('POST.content', 'REQUEST.content')); return $aResult; }
protected function _processHandlers($sAction) { $aModules = $this->oDb->getModules(); foreach ($aModules as $aModule) { $aConfig = self::getModuleConfig($aModule); if (!empty($aConfig['relations']) && is_array($aConfig['relations']) && in_array($this->_aConfig['name'], $aConfig['relations'])) { BxDolService::call($this->_aConfig['name'], $sAction, array($aModule['uri'])); } } }
public function response($oAlert) { if ($this->MODULE == $oAlert->sUnit) { switch ($oAlert->sAction) { case 'commentPost': BxDolService::call($this->MODULE, 'trigger_comment_post', array($oAlert->iObject, $oAlert->aExtras['comment_author_id'], $oAlert->aExtras['comment_id'])); break; } } }
function PageCompPageMainCode() { if (!$GLOBALS['MySQL']->getOne("SELECT COUNT(*) FROM `bx_spy_handlers` WHERE `alert_unit` = 'bx_wall' AND `alert_action` = 'post' AND `module_uri` = 'wall' AND `module_class` = 'Module' AND `module_method` = 'get_spy_post'")) { BxDolService::call('spy', 'update_handlers', array('wall', true)); $s = 'Wall handlers for Spy were updated'; } else { $s = 'Wall handlers are already updated'; } return DesignBoxContent($GLOBALS['_page']['header'], $s, $GLOBALS['oTemplConfig']->PageCompThird_db_num); }
function getPageMainCode() { $oTemplate = BxDolTemplate::getInstance(); $bEnabled = getParam('sys_site_cover_enabled'); if (!$bEnabled) { $oTemplate->displayPageNotFound(); } $oTemplate->addJs(array('skrollr/skrollr.min.js')); return $oTemplate->parseHtmlByContent(getParam('sys_site_cover_code'), array('join_link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account'), 'login_form' => BxDolService::call('system', 'login_form', array(), 'TemplServiceLogin'))); }
function uninstall($aParams) { if (BxDolRequest::serviceExists('payment', 'update_dependent_modules')) { BxDolService::call('payment', 'update_dependent_modules', array($this->_aConfig['home_uri'], false)); } if (BxDolRequest::serviceExists('payflow', 'update_dependent_modules')) { BxDolService::call('payflow', 'update_dependent_modules', array($this->_aConfig['home_uri'], false)); } return parent::uninstall($aParams); }
function removeVideo5($sUser, $sPwd, $iFileId) { if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) { return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct")); } if (BxDolService::call('videos', 'remove_object', array((int) $iFileId))) { return new xmlrpcval("ok"); } return new xmlrpcval("fail"); }
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'), 'add_to_cart' => BxDolService::call('payment', 'get_add_to_cart_link', array(0, $this->_oConfig->getId(), $aValue['price_id'], 1, 1))); } $this->addCss('levels.css'); return $this->parseHtmlByName('available.html', array('bx_repeat:levels' => $aMemberships)); }
function install($aParams) { $aResult = parent::install($aParams); if ($aResult['result'] && getParam($this->_sParamDefaultPayment) == '') { setParam($this->_sParamDefaultPayment, $this->_aConfig['home_uri']); } if ($aResult['result']) { BxDolService::call($this->_aConfig['home_uri'], 'update_dependent_modules'); } return $aResult; }
function getSavedBoardInfo($sId, $iBoardId) { global $aXmlTemplates; $aBoard = BxDolService::call('photos', 'get_photo_array', array($iBoardId, 'original'), 'Search'); if (count($aBoard) == 0 || $sId != $aBoard["owner"]) { $sResult = parseXml($aXmlTemplates["result"], "msgSavedError", FAILED_VAL); } else { $sResult = parseXml($aXmlTemplates["result"], $iBoardId, SUCCESS_VAL); $sResult .= parseXml($aXmlTemplates["savedBoard"], $aBoard["file"], $aBoard["title"]); } return $sResult; }
protected function _getTemplateVars() { $aVars = parent::_getTemplateVars(); $aVars['bx_repeat:menu_items'] = array(true); $aVars['profile_display_name'] = BxDolProfile::getInstance()->getDisplayName(); $aVars['url_switch_profile'] = BxDolPermalinks::getInstance()->permalink('page.php?i=account-profile-switcher'); $aVars['menu_account'] = BxDolMenu::getObjectInstance('sys_account')->getCode(); $aVars['menu_notifications'] = BxDolMenu::getObjectInstance('sys_account_notifications')->getCode(); $a = BxDolService::call('system', 'account_profile_switcher', array(), 'TemplServiceProfiles'); $aVars['profile_switcher'] = $a['content']; return $aVars; }
/** * Get member avatar from profile photos */ public function get($aData) { switch ($this->_sObject) { case 'bx_photos_thumb': $sThumb = BxDolService::call('photos', 'profile_photo', array($aData['ID'], 'thumb'), 'Search'); return $sThumb ? $sThumb : $GLOBALS['oFunctions']->getSexPic($aData['Sex'], 'medium'); case 'bx_photos_icon': $sIcon = BxDolService::call('photos', 'profile_photo', array($aData['ID'], 'icon'), 'Search'); return $sIcon ? $sIcon : $GLOBALS['oFunctions']->getSexPic($aData['Sex'], 'small'); } return parent::get($aData); }