当前位置: 首页>>代码示例>>PHP>>正文


PHP getMemberships函数代码示例

本文整理汇总了PHP中getMemberships函数的典型用法代码示例。如果您正苦于以下问题:PHP getMemberships函数的具体用法?PHP getMemberships怎么用?PHP getMemberships使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getMemberships函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct($oMain, $iProfileId, $isRemovePhotoFieldAllowed = true, $iEntryId = 0, $iThumb = 0)
 {
     $this->_aMedia = array();
     if (BxDolRequest::serviceExists('photos', 'perform_photo_upload', 'Uploader')) {
         $this->_aMedia['images'] = array('post' => 'ready_images', 'upload_func' => 'uploadPhotos', 'tag' => BX_STORE_PHOTOS_TAG, 'cat' => BX_STORE_PHOTOS_CAT, 'thumb' => 'thumb', 'module' => 'photos', 'title_upload_post' => 'images_titles', 'title_upload' => _t('_bx_store_form_caption_file_title'), 'service_method' => 'get_photo_array');
     }
     if (BxDolRequest::serviceExists('videos', 'perform_video_upload', 'Uploader')) {
         $this->_aMedia['videos'] = array('post' => 'ready_videos', 'upload_func' => 'uploadVideos', 'tag' => BX_STORE_VIDEOS_TAG, 'cat' => BX_STORE_VIDEOS_CAT, 'thumb' => false, 'module' => 'videos', 'title_upload' => _t('_bx_store_form_caption_file_title'), 'service_method' => 'get_video_array');
     }
     $this->_oMain = $oMain;
     $this->_oDb = $oMain->_oDb;
     bx_import('BxDolCategories');
     $oCategories = new BxDolCategories();
     $oCategories->getTagObjectConfig();
     // generate templates for form custom elements
     $aCustomMediaTemplates = $this->generateCustomMediaTemplates($iProfileId, $iEntryId, $iThumb);
     // files
     $aFilesChoiceOrig = $this->_getFilesInEntry('files', 'get_file_array', 'ready_files', 'files', (int) $iProfileId, $iEntryId);
     $aFilesChoice = array();
     $sCurrencySign = getParam('pmt_default_currency_sign');
     foreach ($aFilesChoiceOrig as $k => $r) {
         if (!$r['checked']) {
             continue;
         }
         $a = $GLOBALS['oBxStoreModule']->_oDb->getFileInfo($iEntryId, $r['id']);
         $r['file_id'] = $a['id'];
         $r['title'] .= ' - ' . $sCurrencySign . ' ' . $a['price'] . ' (' . $GLOBALS['oBxStoreModule']->getGroupName($a['allow_purchase_to']) . ')';
         $r['visibility'] = $a['hidden'] ? _t('_bx_store_product_file_hidden') : _t('_bx_store_product_file_visible');
         $aFilesChoice[] = $r;
     }
     $aVarsFilesChoice = array('bx_store_base_url' => $this->_oMain->_oConfig->getBaseUri(), 'bx_if:empty' => array('condition' => empty($aFilesChoice), 'content' => array()), 'bx_repeat:files' => $aFilesChoice);
     $aInputPrivacyPurchase = $GLOBALS['oBxStoreModule']->_oPrivacyProduct->getGroupChooser($iProfileId, 'store', 'purchase');
     foreach ($aInputPrivacyPurchase['values'] as $k => $r) {
         if ($r['key'] == BX_DOL_PG_ALL) {
             unset($aInputPrivacyPurchase['values'][$k]);
             break;
         }
     }
     require_once BX_DIRECTORY_PATH_INC . 'membership_levels.inc.php';
     $aMemberships = getMemberships();
     unset($aMemberships[MEMBERSHIP_ID_NON_MEMBER]);
     // unset Non-member
     unset($aMemberships[MEMBERSHIP_ID_STANDARD]);
     // unset member
     $aMemberships = array('' => '----') + $aMemberships;
     $aMembershipsValues = array();
     foreach ($aMemberships as $k => $v) {
         $aMembershipsValues[] = array('key' => $k ? 'm' . $k : $k, 'value' => $v);
     }
     $aInputPrivacyPurchase['values'] = array_merge($aInputPrivacyPurchase['values'], $aMembershipsValues);
     /*
            if (empty($aInputPrivacyPurchase['value']) || !$aInputPrivacyPurchase['value'])
                $aInputPrivacyPurchase['value'] = BX_DOL_PG_MEMBERS;
     */
     $sInputPrivacyPurchase = str_replace('name="allow_purchase_to"', 'name="allow_purchase_to[]"', $this->genInputSelect($aInputPrivacyPurchase));
     $aVarsFilesUpload = array('file' => 'files', 'title' => 'files_titles', 'file_upload_title' => _t('_bx_store_form_caption_file_title'), 'bx_if:price' => array('condition' => true, 'content' => array('price' => 'files_prices', 'file_price_title' => _t('_bx_store_form_caption_file_price'))), 'bx_if:privacy' => array('condition' => true, 'content' => array('select' => $sInputPrivacyPurchase, 'file_permission_title' => _t('_bx_store_form_caption_file_allow_purcase_to'))));
     // privacy
     $aInputPrivacyCustom = array();
     $aInputPrivacyCustom[] = array('key' => '', 'value' => '----');
     $aInputPrivacyCustom[] = array('key' => 'c', 'value' => _t('_bx_store_privacy_customers_only'));
     $aInputPrivacyPostInForum = $GLOBALS['oBxStoreModule']->_oPrivacyProduct->getGroupChooser($iProfileId, 'store', 'post_in_forum');
     $aInputPrivacyPostInForum['values'] = array_merge($aInputPrivacyPostInForum['values'], $aInputPrivacyCustom);
     $aInputPrivacyPostInForum['db'] = array('pass' => 'Preg', 'params' => array('/^([0-9c]+)$/'));
     $aInputPrivacyViewForum = $GLOBALS['oBxStoreModule']->_oPrivacyProduct->getGroupChooser($iProfileId, 'store', 'view_forum');
     $aInputPrivacyViewForum['values'] = array_merge($aInputPrivacyViewForum['values'], $aInputPrivacyCustom);
     $aInputPrivacyViewForum['db'] = $aInputPrivacyPostInForum['db'];
     $aCustomForm = array('form_attrs' => array('name' => 'form_store', 'action' => '', 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => 'bx_store_products', 'key' => 'id', 'uri' => 'uri', 'uri_title' => 'title', 'submit_name' => 'submit_form')), 'inputs' => array('header_info' => array('type' => 'block_header', 'caption' => _t('_bx_store_form_header_info')), 'title' => array('type' => 'text', 'name' => 'title', 'caption' => _t('_bx_store_form_caption_title'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(3, 100), 'error' => _t('_bx_store_form_err_title')), 'db' => array('pass' => 'Xss')), 'desc' => array('type' => 'textarea', 'name' => 'desc', 'caption' => _t('_bx_store_form_caption_desc'), 'required' => true, 'html' => 2, 'checker' => array('func' => 'length', 'params' => array(20, 64000), 'error' => _t('_bx_store_form_err_desc')), 'db' => array('pass' => 'XssHtml')), 'tags' => array('type' => 'text', 'name' => 'tags', 'caption' => _t('_Tags'), 'info' => _t('_sys_tags_note'), 'required' => true, 'checker' => array('func' => 'avail', 'error' => _t('_bx_store_form_err_tags')), 'db' => array('pass' => 'Tags')), 'categories' => $oCategories->getGroupChooser('bx_store', (int) $iProfileId, true), 'header_images' => array('type' => 'block_header', 'caption' => _t('_bx_store_form_header_images'), 'collapsable' => true, 'collapsed' => false), 'thumb' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['images']['thumb_choice'], 'name' => 'thumb', 'caption' => _t('_bx_store_form_caption_thumb_choice'), 'info' => _t('_bx_store_form_info_thumb_choice'), 'required' => false, 'db' => array('pass' => 'Int')), 'images_choice' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['images']['choice'], 'name' => 'images_choice[]', 'caption' => _t('_bx_store_form_caption_images_choice'), 'info' => _t('_bx_store_form_info_images_choice'), 'required' => false), 'images_upload' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['images']['upload'], 'name' => 'images_upload[]', 'caption' => _t('_bx_store_form_caption_images_upload'), 'info' => _t('_bx_store_form_info_images_upload'), 'required' => false), 'header_videos' => array('type' => 'block_header', 'caption' => _t('_bx_store_form_header_videos'), 'collapsable' => true, 'collapsed' => false), 'videos_choice' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['videos']['choice'], 'name' => 'videos_choice[]', 'caption' => _t('_bx_store_form_caption_videos_choice'), 'info' => _t('_bx_store_form_info_videos_choice'), 'required' => false), 'videos_upload' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['videos']['upload'], 'name' => 'videos_upload[]', 'caption' => _t('_bx_store_form_caption_videos_upload'), 'info' => _t('_bx_store_form_info_videos_upload'), 'required' => false), 'header_files' => array('type' => 'block_header', 'caption' => _t('_bx_store_form_header_files'), 'collapsable' => true, 'collapsed' => false), 'files_choice' => array('type' => 'custom', 'content' => $aFilesChoice ? $GLOBALS['oBxStoreModule']->_oTemplate->parseHtmlByName('form_field_product_files_choice', $aVarsFilesChoice) : '', 'name' => 'files_choice[]', 'caption' => _t('_bx_store_form_caption_files_choice'), 'info' => _t('_bx_store_form_info_files_choice'), 'required' => false), 'files_upload' => array('type' => 'custom', 'content' => $GLOBALS['oBxStoreModule']->_oTemplate->parseHtmlByName('form_field_files_upload', $aVarsFilesUpload), 'name' => 'files_upload[]', 'caption' => _t('_bx_store_form_caption_files_upload'), 'info' => _t('_bx_store_form_info_files_upload'), 'required' => false), 'header_privacy' => array('type' => 'block_header', 'caption' => _t('_bx_store_form_header_privacy')), 'allow_view_product_to' => $GLOBALS['oBxStoreModule']->_oPrivacyProduct->getGroupChooser($iProfileId, 'store', 'view_product'), 'allow_post_in_forum_to' => $aInputPrivacyPostInForum, 'allow_view_forum_to' => $aInputPrivacyViewForum));
     if (!$aCustomForm['inputs']['images_choice']['content']) {
         unset($aCustomForm['inputs']['thumb']);
         unset($aCustomForm['inputs']['images_choice']);
     }
     if (!$aCustomForm['inputs']['videos_choice']['content']) {
         unset($aCustomForm['inputs']['videos_choice']);
     }
     if (!$aFilesChoice) {
         unset($aCustomForm['inputs']['files_choice']);
     }
     if (!isset($this->_aMedia['images'])) {
         unset($aCustomForm['inputs']['header_images']);
         unset($aCustomForm['inputs']['PrimPhoto']);
         unset($aCustomForm['inputs']['images_choice']);
         unset($aCustomForm['inputs']['images_upload']);
         unset($aCustomForm['inputs']['allow_upload_photos_to']);
     }
     if (!isset($this->_aMedia['videos'])) {
         unset($aCustomForm['inputs']['header_videos']);
         unset($aCustomForm['inputs']['videos_choice']);
         unset($aCustomForm['inputs']['videos_upload']);
         unset($aCustomForm['inputs']['allow_upload_videos_to']);
     }
     $aFormInputsSubmit = array('Submit' => array('type' => 'submit', 'name' => 'submit_form', 'value' => _t('_Submit')));
     $aCustomForm['inputs'] = array_merge($aCustomForm['inputs'], $aFormInputsSubmit);
     $this->processMembershipChecksForMediaUploads($aCustomForm['inputs']);
     parent::__construct($aCustomForm);
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:95,代码来源:BxStoreFormAdd.php

示例2: BxEventsFormAdd

 function BxEventsFormAdd($oMain, $iProfileId, $iEntryId = 0, $iThumb = 0)
 {
     $this->_oMain = $oMain;
     $this->_oDb = $oMain->_oDb;
     $this->_aMedia = array('images' => array('post' => 'ready_images', 'upload_func' => 'uploadPhotos', 'tag' => BX_EVENTS_PHOTOS_TAG, 'cat' => BX_EVENTS_PHOTOS_CAT, 'thumb' => 'PrimPhoto', 'module' => 'photos', 'title_upload_post' => 'images_titles', 'title_upload' => _t('_bx_events_form_caption_file_title'), 'service_method' => 'get_photo_array'), 'videos' => array('post' => 'ready_videos', 'upload_func' => 'uploadVideos', 'tag' => BX_EVENTS_VIDEOS_TAG, 'cat' => BX_EVENTS_VIDEOS_CAT, 'thumb' => false, 'module' => 'videos', 'title_upload_post' => 'videos_titles', 'title_upload' => _t('_bx_events_form_caption_file_title'), 'service_method' => 'get_video_array'), 'sounds' => array('post' => 'ready_sounds', 'upload_func' => 'uploadSounds', 'tag' => BX_EVENTS_SOUNDS_TAG, 'cat' => BX_EVENTS_SOUNDS_CAT, 'thumb' => false, 'module' => 'sounds', 'title_upload_post' => 'sounds_titles', 'title_upload' => _t('_bx_events_form_caption_file_title'), 'service_method' => 'get_music_array'), 'files' => array('post' => 'ready_files', 'upload_func' => 'uploadFiles', 'tag' => BX_EVENTS_FILES_TAG, 'cat' => BX_EVENTS_FILES_CAT, 'thumb' => false, 'module' => 'files', 'title_upload_post' => 'files_titles', 'title_upload' => _t('_bx_events_form_caption_file_title'), 'service_method' => 'get_file_array'));
     bx_import('BxDolCategories');
     $oCategories = new BxDolCategories();
     $oCategories->getTagObjectConfig();
     $oProfileFields = new BxDolProfileFields(0);
     $aCountries = $oProfileFields->convertValues4Input('#!Country');
     asort($aCountries);
     // generate templates for form custom elements
     $aCustomMediaTemplates = $this->generateCustomMediaTemplates($this->_oMain->_iProfileId, $iEntryId, $iThumb);
     // privacy
     $aInputPrivacyCustom = array();
     $aInputPrivacyCustom[] = array('key' => '', 'value' => '----');
     $aInputPrivacyCustom[] = array('key' => 'p', 'value' => _t('_bx_events_privacy_participants_only'));
     $aInputPrivacyCustomPass = array('pass' => 'Preg', 'params' => array('/^([0-9p]+)$/'));
     $aInputPrivacyCustom2 = array(array('key' => 'p', 'value' => _t('_bx_events_privacy_participants')), array('key' => 'a', 'value' => _t('_bx_events_privacy_admins_only')));
     $aInputPrivacyCustom2Pass = array('pass' => 'Preg', 'params' => array('/^([pa]+)$/'));
     $aInputPrivacyViewParticipants = $GLOBALS['oBxEventsModule']->_oPrivacy->getGroupChooser($iProfileId, 'events', 'view_participants');
     $aInputPrivacyViewParticipants['values'] = array_merge($aInputPrivacyViewParticipants['values'], $aInputPrivacyCustom);
     $aInputPrivacyComment = $GLOBALS['oBxEventsModule']->_oPrivacy->getGroupChooser($iProfileId, 'events', 'comment');
     $aInputPrivacyComment['values'] = array_merge($aInputPrivacyComment['values'], $aInputPrivacyCustom);
     $aInputPrivacyComment['db'] = $aInputPrivacyCustomPass;
     $aInputPrivacyRate = $GLOBALS['oBxEventsModule']->_oPrivacy->getGroupChooser($iProfileId, 'events', 'rate');
     $aInputPrivacyRate['values'] = array_merge($aInputPrivacyRate['values'], $aInputPrivacyCustom);
     $aInputPrivacyRate['db'] = $aInputPrivacyCustomPass;
     $aInputPrivacyForum = $GLOBALS['oBxEventsModule']->_oPrivacy->getGroupChooser($iProfileId, 'events', 'post_in_forum');
     $aInputPrivacyForum['values'] = array_merge($aInputPrivacyForum['values'], $aInputPrivacyCustom);
     $aInputPrivacyForum['db'] = $aInputPrivacyCustomPass;
     $aInputPrivacyUploadPhotos = $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'events', 'upload_photos');
     $aInputPrivacyUploadPhotos['values'] = $aInputPrivacyCustom2;
     $aInputPrivacyUploadPhotos['db'] = $aInputPrivacyCustom2Pass;
     $aInputPrivacyUploadVideos = $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'events', 'upload_videos');
     $aInputPrivacyUploadVideos['values'] = $aInputPrivacyCustom2;
     $aInputPrivacyUploadVideos['db'] = $aInputPrivacyCustom2Pass;
     $aInputPrivacyUploadSounds = $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'events', 'upload_sounds');
     $aInputPrivacyUploadSounds['values'] = $aInputPrivacyCustom2;
     $aInputPrivacyUploadSounds['db'] = $aInputPrivacyCustom2Pass;
     $aInputPrivacyUploadFiles = $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'events', 'upload_files');
     $aInputPrivacyUploadFiles['values'] = $aInputPrivacyCustom2;
     $aInputPrivacyUploadFiles['db'] = $aInputPrivacyCustom2Pass;
     $aCustomForm = array('form_attrs' => array('name' => 'form_events', 'action' => '', 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => 'bx_events_main', 'key' => 'ID', 'uri' => 'EntryUri', 'uri_title' => 'Title', 'submit_name' => 'submit_form')), 'inputs' => array('header_info' => array('type' => 'block_header', 'caption' => _t('_bx_events_form_header_info')), 'Title' => array('type' => 'text', 'name' => 'Title', 'caption' => _t('_bx_events_caption_title'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(3, 100), 'error' => _t('_bx_events_err_title')), 'db' => array('pass' => 'Xss'), 'display' => true), 'Description' => array('type' => 'textarea', 'name' => 'Description', 'caption' => _t('_bx_events_caption_desc'), 'required' => true, 'html' => 2, 'checker' => array('func' => 'length', 'params' => array(20, 64000), 'error' => _t('_bx_events_err_desc')), 'db' => array('pass' => 'XssHtml')), 'Country' => array('type' => 'select', 'name' => 'Country', 'caption' => _t('_bx_events_caption_country'), 'values' => $aCountries, 'required' => true, 'checker' => array('func' => 'preg', 'params' => array('/^[a-zA-Z]{2}$/'), 'error' => _t('_bx_events_err_country')), 'db' => array('pass' => 'Preg', 'params' => array('/([a-zA-Z]{2})/'))), 'City' => array('type' => 'text', 'name' => 'City', 'caption' => _t('_bx_events_caption_city'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(3, 50), 'error' => _t('_bx_events_err_city')), 'db' => array('pass' => 'Xss')), 'Place' => array('type' => 'text', 'name' => 'Place', 'caption' => _t('_bx_events_caption_place'), 'required' => true, 'checker' => array('func' => 'avail', 'error' => _t('_bx_events_err_place')), 'db' => array('pass' => 'Xss'), 'display' => true), 'EventStart' => array('type' => 'datetime', 'name' => 'EventStart', 'caption' => _t('_bx_events_caption_event_start'), 'required' => true, 'checker' => array('func' => 'DateTime', 'error' => _t('_bx_events_err_event_start')), 'db' => array('pass' => 'DateTime'), 'display' => 'filterDate'), 'EventEnd' => array('type' => 'datetime', 'name' => 'EventEnd', 'caption' => _t('_bx_events_caption_event_end'), 'required' => true, 'checker' => array('func' => 'DateTime', 'error' => _t('_bx_events_err_event_end')), 'db' => array('pass' => 'DateTime'), 'display' => 'filterDate'), 'Tags' => array('type' => 'text', 'name' => 'Tags', 'caption' => _t('_Tags'), 'info' => _t('_sys_tags_note'), 'required' => true, 'checker' => array('func' => 'avail', 'error' => _t('_bx_events_err_tags')), 'db' => array('pass' => 'Tags')), 'Categories' => $oCategories->getGroupChooser('bx_events', (int) $iProfileId, true), 'header_images' => array('type' => 'block_header', 'caption' => _t('_bx_events_form_header_images'), 'collapsable' => true, 'collapsed' => false), 'PrimPhoto' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['images']['thumb_choice'], 'name' => 'PrimPhoto', 'caption' => _t('_bx_events_form_caption_thumb_choice'), 'info' => _t('_bx_events_form_info_thumb_choice'), 'required' => false, 'db' => array('pass' => 'Int')), 'images_choice' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['images']['choice'], 'name' => 'images_choice[]', 'caption' => _t('_bx_events_form_caption_images_choice'), 'info' => _t('_bx_events_form_info_images_choice'), 'required' => false), 'images_upload' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['images']['upload'], 'name' => 'images_upload[]', 'caption' => _t('_bx_events_form_caption_images_upload'), 'info' => _t('_bx_events_form_info_images_upload'), 'required' => false), 'header_videos' => array('type' => 'block_header', 'caption' => _t('_bx_events_form_header_videos'), 'collapsable' => true, 'collapsed' => false), 'videos_choice' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['videos']['choice'], 'name' => 'videos_choice[]', 'caption' => _t('_bx_events_form_caption_videos_choice'), 'info' => _t('_bx_events_form_info_videos_choice'), 'required' => false), 'videos_upload' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['videos']['upload'], 'name' => 'videos_upload[]', 'caption' => _t('_bx_events_form_caption_videos_upload'), 'info' => _t('_bx_events_form_info_videos_upload'), 'required' => false), 'header_sounds' => array('type' => 'block_header', 'caption' => _t('_bx_events_form_header_sounds'), 'collapsable' => true, 'collapsed' => false), 'sounds_choice' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['sounds']['choice'], 'name' => 'sounds_choice[]', 'caption' => _t('_bx_events_form_caption_sounds_choice'), 'info' => _t('_bx_events_form_info_sounds_choice'), 'required' => false), 'sounds_upload' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['sounds']['upload'], 'name' => 'sounds_upload[]', 'caption' => _t('_bx_events_form_caption_sounds_upload'), 'info' => _t('_bx_events_form_info_sounds_upload'), 'required' => false), 'header_files' => array('type' => 'block_header', 'caption' => _t('_bx_events_form_header_files'), 'collapsable' => true, 'collapsed' => false), 'files_choice' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['files']['choice'], 'name' => 'files_choice[]', 'caption' => _t('_bx_events_form_caption_files_choice'), 'info' => _t('_bx_events_form_info_files_choice'), 'required' => false), 'files_upload' => array('type' => 'custom', 'content' => $aCustomMediaTemplates['files']['upload'], 'name' => 'files_upload[]', 'caption' => _t('_bx_events_form_caption_files_upload'), 'info' => _t('_bx_events_form_info_files_upload'), 'required' => false), 'header_privacy' => array('type' => 'block_header', 'caption' => _t('_bx_events_form_header_privacy')), 'allow_view_event_to' => $GLOBALS['oBxEventsModule']->_oPrivacy->getGroupChooser($iProfileId, 'events', 'view_event'), 'allow_view_participants_to' => $aInputPrivacyViewParticipants, 'allow_comment_to' => $aInputPrivacyComment, 'allow_rate_to' => $aInputPrivacyRate, 'allow_post_in_forum_to' => $aInputPrivacyForum, 'allow_join_to' => $GLOBALS['oBxEventsModule']->_oPrivacy->getGroupChooser($iProfileId, 'events', 'join'), 'JoinConfirmation' => array('type' => 'select', 'name' => 'JoinConfirmation', 'caption' => _t('_bx_events_form_caption_join_confirmation'), 'info' => _t('_bx_events_form_info_join_confirmation'), 'values' => array(0 => _t('_bx_events_form_join_confirmation_disabled'), 1 => _t('_bx_events_form_join_confirmation_enabled')), 'checker' => array('func' => 'int', 'error' => _t('_bx_events_form_err_join_confirmation')), 'db' => array('pass' => 'Int')), 'allow_upload_photos_to' => $aInputPrivacyUploadPhotos, 'allow_upload_videos_to' => $aInputPrivacyUploadVideos, 'allow_upload_sounds_to' => $aInputPrivacyUploadSounds, 'allow_upload_files_to' => $aInputPrivacyUploadFiles));
     if (!$aCustomForm['inputs']['images_choice']['content']) {
         unset($aCustomForm['inputs']['PrimPhoto']);
         unset($aCustomForm['inputs']['images_choice']);
     }
     if (!$aCustomForm['inputs']['videos_choice']['content']) {
         unset($aCustomForm['inputs']['videos_choice']);
     }
     if (!$aCustomForm['inputs']['sounds_choice']['content']) {
         unset($aCustomForm['inputs']['sounds_choice']);
     }
     if (!$aCustomForm['inputs']['files_choice']['content']) {
         unset($aCustomForm['inputs']['files_choice']);
     }
     $aFormInputsAdminPart = array();
     if ($GLOBALS['oBxEventsModule']->isAdmin()) {
         require_once BX_DIRECTORY_PATH_INC . 'membership_levels.inc.php';
         $aMemberships = getMemberships();
         unset($aMemberships[MEMBERSHIP_ID_NON_MEMBER]);
         // unset Non-member
         $aMemberships = array('' => _t('_bx_events_membership_filter_none')) + $aMemberships;
         $aFormInputsAdminPart = array('EventMembershipFilter' => array('type' => 'select', 'name' => 'EventMembershipFilter', 'caption' => _t('_bx_events_caption_membership_filter'), 'info' => _t('_bx_events_info_membership_filter'), 'values' => $aMemberships, 'value' => '', 'checker' => array('func' => 'preg', 'params' => array('/^[0-9a-zA-Z]*$/'), 'error' => _t('_bx_events_err_membership_filter')), 'db' => array('pass' => 'Preg', 'params' => array('/([0-9a-zA-Z]*)/'))));
     }
     $aFormInputsSubmit = array('Submit' => array('type' => 'submit', 'name' => 'submit_form', 'value' => _t('_Submit'), 'colspan' => true));
     $aCustomForm['inputs'] = array_merge($aCustomForm['inputs'], $aFormInputsAdminPart, $aFormInputsSubmit);
     $this->processMembershipChecksForMediaUploads($aCustomForm['inputs']);
     parent::BxDolFormMedia($aCustomForm);
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:71,代码来源:BxEventsFormAdd.php

示例3: getQueueMessage

function getQueueMessage()
{
    global $aPreValues;
    if ($_POST['msgs_id']) {
        $aSexValues = getFieldValues('Sex');
        foreach ($aSexValues as $sKey => $sValue) {
            $aSexValues[$sKey] = _t($sValue);
        }
        $aAgeValues = array('all' => _t('_All'), 'selectively' => _t('_Selectively'));
        $aStartAgesOptions = array();
        $aEndAgesOptions = array();
        $gl_search_start_age = (int) getParam('search_start_age');
        $gl_search_end_age = (int) getParam('search_end_age');
        for ($i = $gl_search_start_age; $i <= $gl_search_end_age; $i++) {
            $aStartAgesOptions[$i] = $i;
        }
        for ($i = $gl_search_start_age; $i <= $gl_search_end_age; $i++) {
            $aEndAgesOptions[$i] = $i;
        }
        $aCountryOptions = array('all' => _t('_All'));
        foreach ($aPreValues['Country'] as $key => $value) {
            $aCountryOptions[$key] = _t($value['LKey']);
        }
        $aMembershipOptions = array('all' => _t('_All'));
        $memberships_arr = getMemberships();
        foreach ($memberships_arr as $membershipID => $membershipName) {
            if ($membershipID == MEMBERSHIP_ID_NON_MEMBER) {
                continue;
            }
            $aMembershipOptions[$membershipID] = $membershipName;
        }
        $iRecipientMembers = (int) $GLOBALS['MySQL']->getOne("SELECT COUNT(`ID`) AS `count` FROM `Profiles` WHERE `Status`<>'Unconfirmed' AND `EmailNotify` = 1 LIMIT 1");
        $aForm = array('form_attrs' => array('name' => 'form_queue', 'class' => 'form_queue_form', 'action' => $GLOBALS['site']['url_admin'] . 'notifies.php', 'method' => 'post'), 'inputs' => array('Send1' => array('type' => 'checkbox', 'name' => 'send_to_subscribers', 'label' => _t('_adm_mmail_Send_to_subscribers'), 'value' => 'non', 'checked' => true), 'Send2' => array('type' => 'checkbox', 'name' => 'send_to_members', 'label' => _t('_adm_mmail_Send_to_members'), 'value' => 'memb', 'checked' => true, 'attrs' => array('onClick' => 'setControlsState();'), 'info' => _t('_adm_mmail_Send_to_members_info', $iRecipientMembers)), 'sex' => array('type' => 'checkbox_set', 'name' => 'sex', 'values' => $aSexValues, 'value' => array_keys($aSexValues)), 'Age' => array('type' => 'select', 'name' => 'age', 'caption' => _t('_adm_mmail_Age'), 'value' => 'all', 'values' => $aAgeValues, 'attrs' => array('onClick' => 'setAgeState();')), 'StartAge' => array('type' => 'select', 'name' => 'age_start', 'caption' => _t('_from'), 'values' => $aStartAgesOptions, 'value' => $gl_search_start_age), 'EndAge' => array('type' => 'select', 'name' => 'age_end', 'caption' => _t('_to'), 'values' => $aEndAgesOptions, 'value' => $gl_search_end_age), 'Country' => array('type' => 'select', 'name' => 'country', 'caption' => _t('_Country'), 'values' => $aCountryOptions, 'value' => 'all'), 'Membership' => array('type' => 'select', 'name' => 'membership', 'caption' => _t('_adm_mmi_membership_levels'), 'values' => $aMembershipOptions, 'value' => 'all'), 'msgs_id' => array('type' => 'hidden', 'name' => 'msgs_id', 'value' => (int) $_POST['msgs_id']), 'submit' => array('type' => 'submit', 'name' => 'queue_message', 'value' => _t('_Submit'))));
        $oForm = new BxTemplFormView($aForm);
        $sTmplResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('notifies_filter.html', array());
        return DesignBoxContent(_t('_adm_mmail_Queue_message'), $oForm->getCode() . $sTmplResult, 11);
    }
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:38,代码来源:notifies.php

示例4: PageCompMemberships

/**
 * purchase memberships
 */
function PageCompMemberships()
{
    global $site;
    global $en_credits;
    global $doll;
    global $oTemplConfig;
    $expl_win_h = 400;
    //not global
    $purchasableOnly = true;
    $purchasableMemberships = getMemberships($purchasableOnly);
    $credit2money = (double) getParam('credit2money');
    // how many credits for one money unit
    $ret = '';
    foreach ($purchasableMemberships as $ID => $name) {
        ob_start();
        ?>
<div class="membership_line">
	<form id="membership<?php 
        echo $ID;
        ?>
Form" action="<?php 
        echo $site['url'] . 'checkout.php';
        ?>
" method="post" style="margin: 2px">
	<input type="hidden" name="action" value="calculate" />
	<input type="hidden" name="checkout_action" value="membership" />
	<input type="hidden" name="allow_subscribe" value="on" />
	<input type="hidden" name="data" value="<?php 
        echo $ID;
        ?>
" />
	<table cellpadding="4" cellspacing="0" border="0" width="100%">
		<tr>
			<td align="left"><?php 
        echo htmlspecialchars($name);
        ?>
</td>
			<td align="right">
				<select class="no" name="amount" style="vertical-align: middle;">
<?php 
        $prices = getMembershipPrices($ID);
        foreach ($prices as $days => $price) {
            $optionText = $days ? $days . ' ' . _t('_days') : _t('_Lifetime');
            $optionText .= ' - ' . $doll . $price;
            if ($en_credits) {
                $optionText .= ' (' . sprintf('%.2f', $price * $credit2money) . ' ' . _t('_credits') . ')';
            }
            echo "<option value=\"{$price}\">{$optionText}</option>\n";
        }
        ?>
				</select>
			</td>
			<td align="right" width="110">
				<input type="submit" class="no" value="<?php 
        echo _t("_Check Out");
        ?>
" style="width: 100px; vertical-align: middle;" />
			</td>
			<td align="right" width="60">
				<a href="javascript:void(0);" onClick="javascript: window.open('explanation.php?explain=membership&type=<?php 
        echo $ID;
        ?>
', '', 'width=<?php 
        echo $oTemplConfig->popUpWindowWidth;
        ?>
,height=<?php 
        echo $expl_win_h;
        ?>
,menubar=no,status=no,resizable=no,scrollbars=yes,toolbar=no, location=no' );"><?php 
        echo _t("_Explanation");
        ?>
</a>
			</td>
		</tr>
	</table>
	</form>
</div>
<?php 
        $ret .= ob_get_contents();
        ob_end_clean();
    }
    $ret = "<div class=\"memberships_box\">\n{$ret}\n</div>\n";
    return DesignBoxContent(_t("_Membership NEW"), $ret, $oTemplConfig->PageCompMemberships_db_num);
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:87,代码来源:membership.php

示例5: __construct

 function __construct($aModule)
 {
     parent::__construct($aModule);
     $this->_aMemberships = getMemberships();
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:5,代码来源:BxPageACConfig.php

示例6: BxPageACConfig

 function BxPageACConfig($aModule)
 {
     parent::BxDolConfig($aModule);
     $this->_aMemberships = getMemberships();
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:5,代码来源:BxPageACConfig.php

示例7: insertInput

    function insertInput($aInput)
    {
        global $site;
        $sCode = '';
        switch ($aInput['Type']) {
            case 'text':
                $sCode = '<input type="text" class="input_text" name="' . $aInput['Name'] . '" value="' . $this->value2html($aInput['Value']) . '" />';
                break;
            case 'area':
                $sCode = '
					<textarea class="input_area" name="' . $aInput['Name'] . '">' . $this->value2html($aInput['Value']) . '</textarea>';
                break;
            case 'pass':
                $sCode = '<input type="password" class="input_pass" name="' . $aInput['Name'] . '" />';
                break;
            case 'date':
                $sCode = '<input type="text" class="input_date" name="' . $aInput['Name'] . '" value="' . $this->value2html($aInput['Value']) . '" />';
                break;
            case 'select_one':
                $this->insertSelectOne($aInput);
                break;
            case 'select_set':
                $this->insertSelectSet($aInput);
                break;
            case 'num':
                $sCode = '<input type="text" class="input_num" name="' . $aInput['Name'] . '" value="' . $this->value2html($aInput['Value']) . '" />';
                break;
            case 'range':
                $sCode = '<input type="text" class="input_range_0" name="' . $aInput['Name'] . '[0]" value="' . $this->value2html($aInput['Value'][0]) . '" />';
                $sCode .= ' - ';
                $sCode .= '<input type="text" class="input_range_1" name="' . $aInput['Name'] . '[1]" value="' . $this->value2html($aInput['Value'][1]) . '" />';
                break;
            case 'bool':
                $sCode = '
					<input type="checkbox" name="' . $aInput['Name'] . '" value="yes"' . ($aInput['Value'] ? ' checked="checked"' : '') . ' />';
                break;
            case 'system':
                switch ($aInput['Name']) {
                    case 'Couple':
                        $sCode = '<select name="Couple" class="input_select_couple" onchange="doShowHideSecondProfile( this.value, this.form )">' . '<option value="no"' . ($aInput['Value'] ? '' : ' selected="selected"') . '>' . _t('_Single') . '</option>' . '<option value="yes"' . ($aInput['Value'] ? ' selected="selected"' : '') . '>' . _t('_Couple') . '</option>' . '</select>';
                        break;
                    case 'Captcha':
                        $sCode = '<img src="' . $site['url'] . 'simg/simg.php" class="form_captcha" /><br /><br />
							<input type="text" class="input_text" maxlength="6" name="Captcha" />';
                        break;
                    case 'Status':
                        $this->insertSelectOne($aInput, false);
                        break;
                    case 'Featured':
                        $aInput['Type'] = 'bool';
                        $this->insertInput($aInput);
                        break;
                    case 'TermsOfUse':
                        $sCode = '
							
							<input type="checkbox" name="TermsOfUse" value="yes" id="TermsOfUse_agree" />
							<label for="TermsOfUse_agree">
								' . $aInput['Caption'] . '
							</label>';
                        break;
                    case 'Membership':
                        $aMemberships = getMemberships();
                        $this->insertInputMembership($aMemberships, $aInput['Value']);
                        break;
                    default:
                        $sCode = 'Unknown control type';
                }
                break;
            default:
                $sCode = 'Unknown control type';
        }
        $this->sCode .= $sCode;
    }
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:73,代码来源:BxBaseFormView.php

示例8: SDShowEditForm


//.........这里部分代码省略.........
						from&nbsp;<select class="no" name="event_age_start" id="event_age_start_id" style="vertical-align: middle;">
<?php 
    // if it's new event then show default values and show values from database otherwise
    $gl_search_start_age = (int) getParam('search_start_age');
    $gl_search_end_age = (int) getParam('search_end_age');
    $ageStartSel = $newEvent ? $gl_search_start_age : $eventArr['EventAgeLowerFilter'];
    $ageEndSel = $newEvent ? $gl_search_end_age : $eventArr['EventAgeUpperFilter'];
    for ($i = $gl_search_start_age; $i <= $gl_search_end_age; $i++) {
        $sel = $i == $ageStartSel ? 'selected="selected"' : '';
        echo "\n\t\t\t\t\t\t\t<option value=\"{$i}\" {$sel}>{$i}</option>";
    }
    ?>
									</select>
						to&nbsp;<select class="no" name="event_age_end" id="event_age_end_id" style="vertical-align: middle;">
<?php 
    for ($i = $gl_search_start_age; $i <= $gl_search_end_age; $i++) {
        $sel = $i == $ageEndSel ? 'selected="selected"' : '';
        echo "\n\t\t\t\t\t\t\t<option value=\"{$i}\" {$sel}>{$i}</option>";
    }
    ?>
						</select>
					</td>
				</tr>
				<tr>
					<td align="left" valign="top" width="120">Membership</td>
					<td align="left">
		 				<select class="no" name="event_membership[]" id="event_membership_id" size="6" multiple style="width: 150px;">
		 					<option value="all" <?php 
    echo $newEvent || strstr($eventArr['EventMembershipFilter'], '\'all\'') ? 'selected="selected"' : '';
    ?>
 >All</option>
<?php 
    // show all membership levels except non-member
    $memberships_arr = getMemberships();
    foreach ($memberships_arr as $membershipID => $membershipName) {
        if ($membershipID == MEMBERSHIP_ID_NON_MEMBER) {
            continue;
        }
        echo "\n\t\t\t\t\t\t\t<option value=\"{$membershipID}\" " . (!$newEvent && strstr($eventArr['EventMembershipFilter'], "'{$membershipID}'") ? 'selected="selected"' : '') . " >{$membershipName}</option>";
    }
    ?>
						</select>
					</td>
				</tr>
				<tr>
					<td align="left" width="120">Female ticket count <font color="red">*</font></td>
					<td align="left">
						<input type="text" class="no" name="event_count_female" id="event_count_female_id" size="6" value="<?php 
    echo $eventCountFemale;
    ?>
" />
					</td>
				</tr>
				<tr>
					<td align="left" width="120">Male ticket count <font color="red">*</font></td>
					<td align="left">
						<input type="text" class="no" name="event_count_male" id="event_count_male_id" size="6" value="<?php 
    echo $eventCountMale;
    ?>
" />
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:67,代码来源:sdating_admin.php

示例9: foreach

<?php 
    foreach ($prof['countries'] as $key => $value) {
        echo "\n\t\t\t\t\t\t\t<option value=\"{$key}\">" . _t('__' . $value) . "</option>";
    }
    ?>
						</select>
		 			</td>
		 		</tr>
		 		<tr class="table">
		 			<td align="right" valign="middle">Membership level:</td>
		 			<td width="12"></td>
		 			<td align="left" valign="middle">
		 				<select class="text" name="membership">
		 					<option value="all" selected>All</option>
<?php 
    $memberships_arr = getMemberships();
    foreach ($memberships_arr as $membershipID => $membershipName) {
        if ($membershipID == MEMBERSHIP_ID_NON_MEMBER) {
            continue;
        }
        echo "\n\t\t\t\t\t\t\t<option value=\"{$membershipID}\">{$membershipName}</option>";
    }
    ?>
						</select>
		 			</td>
		 		</tr>
		 	</table>
		</td>
	</tr>
	<tr class="table">
		<td align="center" style="padding: 5px;">
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:notifies.php

示例10: PageCompPageMainCode

/**
 * page code function
 */
function PageCompPageMainCode()
{
    global $site;
    global $dir;
    global $_page;
    global $p_arr;
    global $p_arr_new;
    global $db_vsbl;
    global $db_editbl;
    global $tab;
    global $autoApproval_ifProfile;
    global $ID;
    global $MEMBER;
    global $ADMIN;
    global $NEW_TO_ADD;
    global $Featured;
    global $pic;
    global $pics;
    global $pic_num;
    global $enable_audio_upload;
    global $enable_video_upload;
    global $sound_file_exist;
    global $video_file_exist;
    global $status_admin_ex;
    global $change_error_text;
    global $result_text;
    global $pictures_text;
    global $membership_message;
    global $max_thumb_height;
    global $max_thumb_width;
    global $enable_ray;
    global $enable_ray_pro;
    ob_start();
    if ($NEW_TO_ADD) {
        $_page['header'] = _t("_New Member");
        $_page['header_text'] = _t("_New Member Add Here");
    } else {
        $_page['header'] = process_line_output($p_arr['NickName']) . ": " . process_line_output(strmaxtextlen($p_arr['DescriptionMe'], 45));
        $_page['header_text'] = "<b>" . process_line_output($p_arr['NickName']) . "</b> - ";
        $_page['header_text'] .= _t('_' . $p_arr['Sex']);
        $_page['header_text'] .= ", " . _t("_y/o", age($p_arr['DateOfBirth'])) . " (ID: {$p_arr['ID']})";
    }
    echo '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td>';
    if ($ADMIN && $status_admin_ex) {
        echo $status_admin_ex;
    }
    if ($change_error_text) {
        echo $change_error_text . '<br />';
    }
    global $moderator;
    if ($ADMIN && !$moderator) {
        echo "<div align=right class=text2><a href=\"{$_SERVER['PHP_SELF']}\">" . _t("_Add New Profile") . "</a></div>";
    }
    if ($result_text) {
        echo '<center>' . $result_text . '</center><br />';
    }
    if ($ADMIN && !$NEW_TO_ADD && $enable_video_upload && $enable_ray && $enable_ray_pro && file_exists($dir['root'] . "ray/modules/video/admin.php")) {
        $sRayHeaderPath = $dir['root'] . "ray/inc/header.inc.php";
        $iId = (int) $p_arr['ID'];
        $aAdmin = db_arr("SELECT `Name`, `Password` FROM `Admins` LIMIT 1");
        $sNick = $aAdmin['Name'];
        $sPassword = $aAdmin['Password'];
        echo "<tr><td><div style=\"width:179px; padding-bottom:10px; margin-left:auto; margin-right:auto;\">";
        require_once $dir['root'] . "ray/modules/video/admin.php";
        echo "</div></td></tr>";
    }
    if ($ADMIN && !$NEW_TO_ADD) {
        // Print membership information and controls
        $memberships_arr = getMemberships();
        $membership_info = getMemberMembershipInfo($ID);
        ?>
    <!-- MEMBERSHIP [BEGIN] -->

	<tr><td>
		<center><?php 
        echo $membership_message;
        ?>
</center>
		<form name="MembershipForm" action="profile_edit.php?ID=<?php 
        echo $p_arr['ID'];
        ?>
" method=post>
		<input type="hidden" name="SetMembership" value="YES">
		<table width=100% cellspacing=0 cellpadding=2 class="text2" border=0>
<?php 
        echo print_rows_set_membership(1, $memberships_arr, $membership_info, 3, "table", "panel", "25%");
        ?>
		</table>
		<center>
			<input class=no type="submit" value="Set" style="width: 50px;">
		</center>
		</form>
    <hr>
    </td></tr>

    <!-- MEMBERSHIP [ END ] -->
<?php 
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:101,代码来源:profile_edit.php

示例11: getBlockCode_Membership

    function getBlockCode_Membership()
    {
        if (!isAdmin()) {
            return;
        }
        $sUnlimited = process_line_output(_t('_pfm_unlimited'));
        $this->aFormMembership = array('form_attrs' => array('id' => 'profile_edit_membership', 'name' => 'profile_edit_membership', 'action' => BX_DOL_URL_ROOT . 'pedit.php?ID=' . $this->iProfileID, 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => '', 'key' => '', 'uri' => '', 'uri_title' => '', 'submit_name' => 'save_membership')), 'inputs' => array('doSetMembership' => array('type' => 'hidden', 'name' => 'doSetMembership', 'value' => 'yes'), 'MembershipInfo' => array('type' => 'custom', 'caption' => _t('_Membership_current'), 'content' => ''), 'MembershipID' => array('type' => 'select', 'name' => 'MembershipID', 'caption' => _t('_Membership_name'), 'value' => '', 'values' => array(), 'required' => 0, 'attrs' => array('onchange' => 'checkStandard()'), 'checker' => array('func' => 'avail', 'params' => array(), 'error' => _t('_Membership_name_err_empty')), 'db' => array('pass' => 'Int')), 'MembershipDays' => array('type' => 'text', 'name' => 'MembershipDays', 'caption' => _t('_Membership_days'), 'value' => $sUnlimited, 'required' => 0, 'attrs' => array('onfocus' => "if(MembershipDays.value == '" . $sUnlimited . "') MembershipDays.value = ''", 'onblur' => "if(MembershipDays.value == '') MembershipDays.value = '" . $sUnlimited . "'"), 'info' => _t('_Membership_days_info'), 'db' => array('pass' => 'Xss')), 'MembershipImmediately' => array('type' => 'checkbox', 'name' => 'MembershipImmediately', 'caption' => _t('_Membership_starts'), 'value' => 'on', 'required' => 0, 'db' => array('pass' => 'Xss')), 'save_membership' => array('type' => 'submit', 'name' => 'save_membership', 'value' => _t('_Membership_save'))));
        $aMemberships = getMemberships();
        foreach ($aMemberships as $iId => $sName) {
            if ($iId != MEMBERSHIP_ID_NON_MEMBER) {
                $this->aFormMembership['inputs']['MembershipID']['values'][] = array('key' => $iId, 'value' => $sName);
            }
        }
        $oForm = new BxTemplFormView($this->aFormMembership);
        $oForm->initChecker();
        $sContent = "";
        if ($oForm->isSubmittedAndValid()) {
            $iMshipID = (int) $oForm->getCleanValue('MembershipID');
            $iMshipDays = (int) $oForm->getCleanValue('MembershipDays');
            //0 = unlim
            $bStartsNow = $oForm->getCleanValue('MembershipImmediately') == 'on';
            $bSave = setMembership($this->iProfileID, $iMshipID, $iMshipDays, $bStartsNow);
            $sContent .= MsgBox(_t($bSave ? '_Membership_save_msg_saved' : '_Membership_save_err_saved'), 3);
        }
        /**
         * Retrieve current membership info.
         */
        $aMembershipCurrent = getMemberMembershipInfo($this->iProfileID);
        $sMembershipCurrent = $aMembershipCurrent['Name'];
        if ($aMembershipCurrent['ID'] != MEMBERSHIP_ID_STANDARD) {
            $sMembershipCurrent .= ', ' . (!isset($aMembershipCurrent['DateExpires']) ? _t('_MEMBERSHIP_EXPIRES_NEVER') : _t('_MEMBERSHIP_EXPIRES', defineTimeInterval($aMembershipCurrent['DateExpires'])));
        }
        $oForm->aInputs['MembershipInfo']['content'] = $sMembershipCurrent;
        ob_start();
        ?>
        <script type="text/javascript">
        <!--
        function checkStandard()
        {
            var iId = parseInt($("[name='MembershipID']").val());
            if(iId == <?php 
        echo MEMBERSHIP_ID_STANDARD;
        ?>
) {
                $("[name='MembershipDays']").attr('disabled', 'disabled');
                $("[name='MembershipImmediately']").attr('disabled', 'disabled');
            } else {
                $("[name='MembershipDays']").removeAttr('disabled');
                $("[name='MembershipImmediately']").removeAttr('disabled');
            }
        }
        $(document).ready(function() {
            checkStandard();
        });
        -->
        </script>
<?php 
        $sContent .= ob_get_clean();
        return array($sContent . $oForm->getCode(), array(), array(), false);
    }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:60,代码来源:pedit.php

示例12: convertValues4Input

 function convertValues4Input($mValues, $sUseLKey = 'LKey', $sName = '', $aItem = array(), $sValue = '')
 {
     $aValues = array();
     if (db_value("SHOW TABLES LIKE '{$mValues[0]}'") && $sName && $mValues[0] != 'ml_clonetwo_fields') {
         switch ($mValues[0]) {
             case 'sys_acl_levels':
                 require_once BX_DIRECTORY_PATH_INC . 'membership_levels.inc.php';
                 $aMemberships = getMemberships();
                 unset($aMemberships[MEMBERSHIP_ID_NON_MEMBER]);
                 $aValues = array('' => _t('_ml_clonetwo_membership_filter_none')) + $aMemberships;
                 $aAllValues['values'] = $aValues;
                 return $aAllValues;
                 break;
             case 'sys_categories':
                 bx_import('BxDolCategories');
                 $oCategories = new BxDolCategories();
                 $aValues = $oCategories->getGroupChooser('ml_clonetwo', getLoggedId(), true, $sValue);
                 $aValues = $aValues['values'];
                 $aAllValues['values'] = $aValues;
                 return $aAllValues;
                 break;
             case 'sys_privacy_actions':
                 $aInputPrivacyCustom = array();
                 $aInputPrivacyCustom[] = array('key' => '', 'value' => '----');
                 $aInputPrivacyCustom[] = array('key' => 'f', 'value' => _t('_ml_clonetwo_privacy_fans_only'));
                 $sName = str_replace('allow_', '', $sName);
                 $sName = str_replace('_to', '', $sName);
                 $aPValues = $this->_oMain->_oPrivacy->getGroupChooser(getLoggedId(), $this->_aModule['uri'], $sName);
                 //print_r($aPValues['values']);
                 foreach ($aPValues['values'] as $sKey => $aPValue) {
                     $aValues[] = array('key' => $aPValue['key'], 'value' => $aPValue['value']);
                 }
                 if ($sName == 'upload_files' || $sName == 'upload_photos' || $sName == 'upload_videos' || $sName == 'upload_sounds') {
                     $aValues = array(array('key' => 'f', 'value' => _t('_ml_clonetwo_privacy_fans')), array('key' => 'a', 'value' => _t('_ml_clonetwo_privacy_admins_only')));
                 } else {
                     $aValues = array_merge($aValues, $aInputPrivacyCustom);
                 }
                 break;
             default:
                 if ($aItem['IdField'] && $aItem['CaptionField']) {
                     if ($aItem['DepParentField'] && !$aItem['DepField']) {
                         $sValue = $sValue ? $sValue : $aItem['Default'];
                         if (!$sValue) {
                             $sValue = db_value("SELECT `Default` FROM `ml_clonetwo_fields` WHERE `Name` = '{$sName}' LIMIT 1");
                         }
                         if ($sValue) {
                             $iParentId = db_value("SELECT `{$aItem['DepParentField']}` FROM `{$mValues[0]}` WHERE `{$aItem['IdField']}` = '{$sValue}' LIMIT 1");
                             if ($iParentId) {
                                 $sAddQuery = "WHERE `{$aItem['DepParentField']}` = '{$iParentId}'";
                             } else {
                                 $sAddQuery = "WHERE `{$aItem['DepParentField']}` = '{$sValue}'";
                             }
                         }
                         $aAllValues['attrs'] = array('id' => "{$sName}");
                     } elseif ($aItem['DepParentField'] && $aItem['DepField']) {
                         $sAddQuery = "WHERE `{$aItem['DepParentField']}` = '0'";
                     }
                     $sQuery = db_res("SELECT `{$aItem['IdField']}` as `key`, `{$aItem['CaptionField']}` as `value` FROM `{$mValues[0]}` {$sAddQuery}");
                     while ($aRow = mysql_fetch_array($sQuery)) {
                         $aValues[$aRow['key']] = $aRow['value'];
                     }
                     if ($aItem['DepField']) {
                         $aDepData = db_arr("SELECT `IdField`, `CaptionField`, `DepParentField` FROM `ml_clonetwo_fields` WHERE `Name` = '{$aItem['DepField']}' LIMIT 1");
                         if (empty($aDepData)) {
                             return;
                         }
                         $sAjaxUrl = BX_DOL_URL_ROOT . "modules/modloaded/clonetwo/pages.php?ajax=1&key={$aDepData['IdField']}&value={$aDepData['CaptionField']}&table={$mValues[0]}&parent={$aDepData['DepParentField']}&filter=";
                         $aAllValues['attrs'] = array('onchange' => "getHtmlData('{$aItem['DepField']}','{$sAjaxUrl}'+this.value)");
                     }
                     $aAllValues['values'] = $aValues;
                     return $aAllValues;
                 }
         }
     } elseif (is_array($mValues)) {
         foreach ($mValues as $sKey) {
             $aValues[$sKey] = _t('_FieldValues_' . $sKey);
         }
     } elseif (is_string($mValues) and !empty($mValues) and substr($mValues, 0, 2) == $this->sLinkPref) {
         $sKey = substr($mValues, 2);
         if (isset($GLOBALS['aPreValues'][$sKey])) {
             $aPValues = $GLOBALS['aPreValues'][$sKey];
             foreach ($aPValues as $sKey => $aPValue) {
                 if (!isset($aPValue[$sUseLKey])) {
                     $sUseLKey = 'LKey';
                 }
                 $aValues[$sKey] = _t($aPValue[$sUseLKey]);
             }
         }
     }
     //echoDbg($aValues);
     return $aValues;
 }
开发者ID:scriptologist,项目名称:Multi-Module-Creator-Plus,代码行数:92,代码来源:MlClonetwoPageFields.php

示例13: display_category_settings


//.........这里部分代码省略.........
                $class = 'table_odd';
            }
        }
        $i++;
        echo "<tr class=\"{$class}\"><td align=\"left\" class=\"small1\"";
        // Display item caption.
        if ('text' == $param_type) {
            echo ' valign="top"';
        }
        echo ">{$param_desc}</td><td align=\"right\" width=\"200\">";
        // Display item control.
        if ('text' == $param_type) {
            if (EMAIL_TEMPLATE_CATEGORY == $cat) {
                // Get email subject.
                $subject_name = $param_name . '_subject';
                $q_str = "SELECT `VALUE` FROM `GlParams` WHERE `Name` = '{$subject_name}'";
                $res = db_res($q_str);
                if ($row = mysql_fetch_array($res)) {
                    $subject_value = $row['VALUE'];
                } else {
                    $subject_value = '';
                }
                echo "<b>HTML version</b>&nbsp;(";
                echo "<a href=\"javascript:void(0);\" onClick=\"javascript:docOpen('" . rawurlencode($param_value) . "');\">";
                echo _t("_Preview");
                echo "</a>)<br>";
                echo 'Subject:<br />';
                echo "<input type=\"text\" class=\"no\" size=\"50\" name=\"{$param_name}_subject\" value=\"{$subject_value}\"/><br /><br />";
                echo 'Body:<br />';
                echo "<textarea cols=\"50\" rows=\"10\" class=\"no\" name=\"{$param_name}\">" . htmlspecialchars($param_value) . "</textarea>";
                $tags = '<RealName> <SiteName> <ConfCode> <ConfirmationLink> <StrID> <Email> <Password>    <YourRealName> <NickName>
                        <Domain> <ID> <TEXT> <VKissLink> <ContactInfo> <DomainName> <FromName> <Link> <NickSpamer> <IDspamer>
                        <LinkSpamer> <MatchProfileLink>    <Requester> <Profile> <site> <PrivPhotosMember> <LoginLink> <Title>
                        <Message_Text> <MessageText> <LinkSDatingEvent> <NameSDating> <PlaceSDating> <WhenStarSDating> <PersonalUID>
                        <MatchLink>';
                echo '<br><br><br><b>Text version</b><br>';
                echo 'Subject:<br />';
                echo "<input readonly type=\"text\" class=\"no\" size=\"50\" name=\"{$param_name}_subject_ro\" value=\"{$subject_value}\"/><br /><br />";
                echo 'Body:<br />';
                echo "<textarea readonly cols=\"50\" rows=\"10\" class=\"no\" name=\"{$param_name}_ro\">" . htmlspecialchars(html2txt($param_value, $tags)) . "</textarea>";
            } else {
                echo "<textarea cols=\"50\" rows=\"10\" class=\"no\" name=\"{$param_name}\">{$param_value}</textarea>";
            }
        } elseif ('digit' == $param_type) {
            echo "<input type=\"text\" class=\"no\" name=\"{$param_name}\" size=\"15\" value=\"{$param_value}\" />";
        } elseif ('checkbox' == $param_type) {
            echo "<input type=\"checkbox\" name=\"{$param_name}\" " . ('on' == $param_value ? 'checked' : '') . '>';
        } elseif ('select' == $param_type) {
            if ('chicks_for_free' == $param_name) {
                $vals = getParam('chicks_for_free', false);
                $query = "SELECT `extra` FROM `ProfilesDesc` WHERE name='Sex'";
                $result = db_arr($query);
                $result['extra'] = str_replace('\'', '', $result['extra']);
                $sex = split(',', $result['extra']);
                echo "<select name=\"{$param_name}[]\" multiple>";
                foreach ($sex as $sex_key) {
                    if (strstr($vals, '\'' . $sex_key . '\'')) {
                        $selected = 'selected';
                    } else {
                        $selected = '';
                    }
                    echo "<option value=\"{$sex_key}\" {$selected} >{$sex_key}</option>";
                }
                echo "</select>";
            } else {
                echo "&nbsp;";
            }
        } elseif ('combobox' == $param_type) {
            if ('chicks_for_free_membership' == $param_name) {
                $memberships_arr = getMemberships();
                $vals = getParam('chicks_for_free_membership', false);
                echo "<select name=\"{$param_name}\">";
                foreach ($memberships_arr as $membershipID => $membershipName) {
                    if ($membershipID == MEMBERSHIP_ID_NON_MEMBER) {
                        continue;
                    }
                    $selected = (int) $vals == $membershipID ? ' selected ' : '';
                    echo "<option value=\"{$membershipID}\" {$selected} >{$membershipName}</option>";
                }
                echo "</select>";
            } elseif ('template' == $param_name) {
                $old_val = getParam('template');
                $templ_choices = get_templates_array();
                echo "<select name=\"{$param_name}\">";
                foreach ($templ_choices as $key => $value) {
                    echo "<option value=\"{$key}\" " . ($old_val == $key ? 'selected="selected"' : '') . ">{$value}</option>\n";
                }
                echo "</select>";
            }
        } else {
            echo "<input type=\"text\" name=\"{$param_name}\" value=\"{$param_value}\" size=\"30\" />";
        }
        echo "</td></tr>";
    }
    ?>
    </table>
    </center><br />
    <?php 
    return ' ';
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:101,代码来源:global_settings.php

示例14: convertEditField2Input

 function convertEditField2Input($aItem, $aParams, $iPerson)
 {
     $bCouple = $aParams['couple'];
     $aValues = $aParams['values'];
     $aErrors = $aParams['errors'];
     $iProfileID = $aParams['profile_id'];
     $aInput = array();
     switch ($aItem['Type']) {
         case 'text':
             $aInput['type'] = 'text';
             $aInput['value'] = $aValues[$iPerson];
             break;
         case 'area':
             $aInput['type'] = 'textarea';
             $aInput['value'] = $aValues[$iPerson];
             $aInput['attrs']['counter'] = 'true';
             break;
         case 'html_area':
             $aInput['type'] = 'textarea';
             $aInput['html'] = true;
             $aInput['value'] = $aValues[$iPerson];
             $aInput['attrs']['counter'] = 'true';
             break;
         case 'date':
             $aInput['type'] = 'date';
             $aInput['value'] = $aValues[$iPerson];
             break;
         case 'datetime':
             $aInput['type'] = 'datetime';
             $aInput['value'] = $aValues[$iPerson];
             break;
         case 'num':
             $aInput['type'] = 'number';
             $aInput['value'] = $aValues[$iPerson];
             break;
         case 'range':
             $aInput['type'] = 'doublerange';
             $aInput['value'] = $aValues[$iPerson];
             break;
         case 'pass':
             $aInput['type'] = 'password';
             break;
         case 'bool':
             $aInput['type'] = 'checkbox';
             $aInput['value'] = 'yes';
             $aInput['checked'] = (bool) (int) $aValues[$iPerson];
             break;
         case 'select_one':
             switch ($aItem['Control']) {
                 case 'select':
                     $aInput['type'] = 'select';
                     break;
                 case 'radio':
                     $aInput['type'] = 'radio_set';
                     break;
                 default:
                     return false;
             }
             $aInput['values'] = $this->convertValues4Input($aItem['Values'], $aItem['UseLKey']);
             $aInput['value'] = $aValues[$iPerson];
             break;
         case 'select_set':
             switch ($aItem['Control']) {
                 case 'select':
                     $aInput['type'] = 'select_multiple';
                     break;
                 case 'checkbox':
                     $aInput['type'] = 'checkbox_set';
                     break;
                 default:
                     return false;
             }
             $aInput['values'] = $this->convertValues4Input($aItem['Values'], $aItem['UseLKey']);
             $aInput['value'] = $aValues[$iPerson];
             break;
         case 'system':
             switch ($aItem['Name']) {
                 case 'Featured':
                     $aInput = array('type' => 'checkbox', 'value' => 'yes', 'checked' => $aValues[0]);
                     break;
                 case 'Status':
                     $aInput = array('type' => 'select', 'value' => $aValues[0], 'values' => array());
                     foreach ($aItem['Values'] as $sValue) {
                         $aInput['values'][$sValue] = _t("_FieldValues_{$sValue}");
                     }
                     break;
                 case 'Membership':
                     $aMemberships = getMemberships();
                     $aMembershipInfo = getMemberMembershipInfo($iProfileID);
                     $aInput = array('type' => 'custom', 'content' => $this->getInputMembership($aMemberships, $aMembershipInfo));
                     break;
                 case 'ID':
                 case 'DateReg':
                 case 'DateLastEdit':
                 case 'DateLastLogin':
                     //non editable
                     return false;
                     break;
                 default:
                     return false;
//.........这里部分代码省略.........
开发者ID:dalinhuang,项目名称:shopexts,代码行数:101,代码来源:BxDolProfileFields.php


注:本文中的getMemberships函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。