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


PHP process_pass_data函数代码示例

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


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

示例1: PageCompPageMainCodeWithForm

function PageCompPageMainCodeWithForm()
{
    global $oTemplConfig, $site;
    $aForm = array('form_attrs' => array('id' => 'post_us_form', 'action' => BX_DOL_URL_ROOT . 'contact.php', 'method' => 'post'), 'params' => array('db' => array('submit_name' => 'do_submit')), 'inputs' => array('name' => array('type' => 'text', 'name' => 'name', 'caption' => _t('_Your name'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(1, 150), 'error' => _t('_Name is required'))), 'email' => array('type' => 'text', 'name' => 'email', 'caption' => _t('_Your email'), 'required' => true, 'checker' => array('func' => 'email', 'error' => _t('_Incorrect Email'))), 'message_subject' => array('type' => 'text', 'name' => 'subject', 'caption' => _t('_message_subject'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(5, 300), 'error' => _t('_ps_ferr_incorrect_length'))), 'message_text' => array('type' => 'textarea', 'name' => 'body', 'caption' => _t('_Message text'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(10, 5000), 'error' => _t('_ps_ferr_incorrect_length'))), 'captcha' => array('type' => 'captcha', 'caption' => _t('_Enter what you see'), 'name' => 'securityImageValue', 'required' => true, 'checker' => array('func' => 'captcha', 'error' => _t('_Incorrect Captcha'))), 'submit' => array('type' => 'submit', 'name' => 'do_submit', 'value' => _t('_Submit'))));
    $oForm = new BxTemplFormView($aForm);
    $sForm = $oForm->getCode();
    $oForm->initChecker();
    if ($oForm->isSubmittedAndValid()) {
        $sSenderName = process_pass_data($_POST['name'], BX_TAGS_STRIP);
        $sSenderEmail = process_pass_data($_POST['email'], BX_TAGS_STRIP);
        $sLetterSubject = process_pass_data($_POST['subject'], BX_TAGS_STRIP);
        $sLetterBody = process_pass_data($_POST['body'], BX_TAGS_STRIP);
        $sLetterBody = $sLetterBody . "\r\n" . '============' . "\r\n" . _t('_from') . ' ' . $sSenderName . "\r\n" . 'with email ' . $sSenderEmail;
        if (sendMail($site['email'], $sLetterSubject, $sLetterBody)) {
            $sActionKey = '_ADM_PROFILE_SEND_MSG';
        } else {
            $sActionKey = '_Email sent failed';
        }
        $sActionText = MsgBox(_t($sActionKey));
        $sForm = $sActionText . $sForm;
    } else {
        $sForm = $oForm->getCode();
    }
    return DesignBoxContent(_t('_CONTACT_H1'), $sForm, $oTemplConfig->PageCompThird_db_num);
}
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:25,代码来源:contact.php

示例2: getPreValues

function getPreValues($sKey, $aFields = array(), $iTagsFilter = BX_TAGS_NO_ACTION)
{
    $sKeyDb = process_db_input($sKey, $iTagsFilter);
    $sKey = process_pass_data($sKey);
    $sqlFields = "*";
    if (is_array($aFields) && !empty($aFields)) {
        foreach ($aFields as $sValue) {
            $sqlFields .= "`{$sValue}`, ";
        }
        $sqlFields = trim($sqlFields, ', ');
    }
    $sqlQuery = "SELECT {$sqlFields} FROM `" . BX_SYS_PRE_VALUES_TABLE . "`\n                WHERE `Key` = '{$sKeyDb}'\n                ORDER BY `Order` ASC";
    return $GLOBALS['MySQL']->getAllWithKey($sqlQuery, 'Value');
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:14,代码来源:prof.inc.php

示例3: PageCompPageMainCode

/**
 * page code function
 */
function PageCompPageMainCode()
{
    $aForm = array('form_attrs' => array('id' => 'test_email_templates', 'action' => BX_DOL_URL_ROOT . '_ml.php', 'method' => 'post'), 'params' => array('db' => array('submit_name' => 'do_submit')), 'inputs' => array('l_new' => array('type' => 'textarea', 'name' => 'l_new', 'caption' => 'New Language'), 'l_old' => array('type' => 'textarea', 'name' => 'l_old', 'caption' => 'Old Language'), 'module_lang_file' => array('type' => 'checkbox', 'name' => 'module_lang_file', 'caption' => 'Module language file', 'value' => 1, 'checked' => true), 'submit' => array('type' => 'submit', 'name' => 'do_submit', 'value' => _t('_Submit'))));
    $oForm = new BxTemplFormView($aForm);
    $oForm->initChecker();
    if ($oForm->isSubmittedAndValid()) {
        $isModuleLangFile = $_POST['module_lang_file'] ? true : false;
        $aLang71 = getLangArray(process_pass_data($_POST['l_new']), $isModuleLangFile);
        $aLang70 = getLangArray(process_pass_data($_POST['l_old']), $isModuleLangFile);
        if (is_array($aLang71) && is_array($aLang70)) {
            $s .= prepareTextarea('Added Keys', findAddedKeys($aLang71, $aLang70));
            $s .= prepareTextarea('Changed Keys', findChangedKeys($aLang71, $aLang70));
            $aDeletedKeys = findDeletedKeys($aLang71, $aLang70);
            $s .= prepareTextarea('Deleted Keys', $aDeletedKeys);
            $s .= prepareTextareaWithDeltedKeys($aDeletedKeys);
        } else {
            $s = MsgBox("Invalid arrays") . $oForm->getCode();
        }
    } else {
        $s = $oForm->getCode();
    }
    return DesignBoxContent($GLOBALS['_page']['header'], $s, 11);
}
开发者ID:blas-dmx,项目名称:trident,代码行数:26,代码来源:merge_langs.php

示例4: saveItem

 function saveItem($aData)
 {
     $this->genSaveItemHeader();
     $this->isHaveErrors = false;
     //echoDbg( $aData );
     $iItemID = (int) $aData['id'];
     $aItem = db_assoc_arr("SELECT * FROM `sys_profile_fields` WHERE `ID` = {$iItemID}");
     if (!$aItem) {
         $this->genSaveItemError(_t('_adm_fields_warning_field_not_found'));
         $this->genSaveItemFooter();
         return false;
     }
     // just a flag
     $bHaveErrors = false;
     // this array will be put into db
     $aUpdate = array();
     // check name
     if ($aItem['Type'] != 'system' and $aItem['Deletable']) {
         //we can change the name
         $sName = trim(strip_tags(process_pass_data($aData['Name'])));
         if ($sName === '') {
             $this->genSaveItemError(_t('_adm_fields_error_you_must_enter_name'), 'Name');
             $bHaveErrors = true;
         } elseif ($aItem['Type'] != 'block' and !preg_match('/^[a-z][a-z0-9_]*$/i', $sName)) {
             $this->genSaveItemError(_t('_adm_fields_error_name_latin'), 'Name');
             $bHaveErrors = true;
         } elseif ($GLOBALS['MySQL']->getOne("SELECT COUNT(*) FROM `sys_profile_fields` WHERE `Name`='" . $sName . "' AND `ID`<>'" . $iItemID . "'") || $sName != $aItem['Name'] && $GLOBALS['MySQL']->isFieldExists('Profiles', $sName)) {
             $this->genSaveItemError(_t('_adm_fields_error_name_already_exists'), 'Name');
             $bHaveErrors = true;
         } elseif ($sName == $aItem['Name']) {
             // all ok. don't change
         } else {
             $aUpdate['Name'] = $sName;
         }
         //change
     }
     $sNewName = isset($aUpdate['Name']) ? $aUpdate['Name'] : $aItem['Name'];
     $this->fieldCaption = "_FieldCaption_{$sNewName}_{$this->areaPageName}";
     // _FieldCaption_Sex_Join
     $this->fieldDesc = "_FieldDesc_{$sNewName}_{$this->areaPageName}";
     // _FieldDesc_Sex_Join
     // check Caption
     $sCaption = trim(process_pass_data($aData['Caption']));
     if ($sCaption === '') {
         $this->genSaveItemError(_t('_adm_fields_error_you_must_enter_caption'), 'Caption');
         $bHaveErrors = true;
     } elseif ($this->getLangString($this->fieldCaption) == $sCaption) {
         // all ok dont change
     } else {
         $this->updateLangString($this->fieldCaption, $sCaption);
     }
     // check Description
     $sDesc = trim(process_pass_data($aData['Desc']));
     if ($this->getLangString($this->fieldDesc) != $sDesc) {
         $this->updateLangString($this->fieldDesc, $sDesc);
     }
     // check type
     if ($aItem['Type'] != 'system' and $aItem['Type'] != 'block') {
         //we can change the type
         $sType = trim(strip_tags(process_pass_data($aData['Type'])));
         if (!isset($this->aTypes[$sType])) {
             $this->genSaveItemError(_t('_adm_fields_error_i_dont_know_this_type'), 'Type');
             $bHaveErrors = true;
         } elseif ($sType == $aItem['Type']) {
             // all ok. don't change
         } else {
             $aUpdate['Type'] = $sType;
         }
         //change
         // check the additional properties
         if (!$bHaveErrors) {
             // do not continue if have errors
             // check selectors controls
             if ($sType == 'select_one') {
                 if ($aData['Control_one'] == $aItem['Control']) {
                     //all ok
                 } elseif ($aData['Control_one'] == 'select' or $aData['Control_one'] == 'radio') {
                     $aUpdate['Control'] = $aData['Control_one'];
                 } else {
                     $this->genSaveItemError(_t('_adm_fields_error_i_dont_know_this_control_type'), 'Control_one');
                     $bHaveErrors = true;
                 }
             } elseif ($sType == 'select_set') {
                 if ($aData['Control_set'] == $aItem['Control']) {
                     //all ok
                 } elseif ($aData['Control_set'] == 'select' or $aData['Control_set'] == 'checkbox') {
                     $aUpdate['Control'] = $aData['Control_set'];
                 } else {
                     $this->genSaveItemError(_t('_adm_fields_error_i_dont_know_this_control_type'), 'Control_set');
                     $bHaveErrors = true;
                 }
             } else {
                 $aUpdate['Control'] = null;
             }
             //check Min
             $iMin = trim($aData['Min']);
             if ($iMin === '' || $sType == 'bool' || $sType == 'select_one' || $sType == 'select_set') {
                 $iMin = null;
             } else {
                 $iMin = (int) $iMin;
//.........这里部分代码省略.........
开发者ID:Arvindvi,项目名称:dolphin,代码行数:101,代码来源:BxDolPFM.php

示例5: getBlockCode_Search

 function getBlockCode_Search()
 {
     global $logged;
     $aProfile = $logged['member'] ? getProfileInfo((int) $_COOKIE['memberID']) : array();
     // default params for search form
     $sCountry = '';
     $mixedCountry = bx_get('Country');
     if ($mixedCountry && is_array($mixedCountry)) {
         $sCountry = process_pass_data($mixedCountry[0], 1);
     } elseif ($mixedCountry && is_string($mixedCountry)) {
         $sCountry = process_pass_data($mixedCountry, 1);
     }
     $sSex = '';
     $mixedSex = bx_get('Sex');
     if ($mixedSex && is_array($mixedSex)) {
         $sSex = array();
         foreach ($mixedSex as $v) {
             $sSex[] = process_pass_data($v, 1);
         }
     } elseif ($mixedSex && is_string($mixedSex)) {
         $sSex = process_pass_data($mixedSex, 1);
     }
     $aDefaultParams = array('LookingFor' => bx_get('LookingFor') ? process_pass_data(bx_get('LookingFor'), 1) : ($aProfile['Sex'] ? $aProfile['Sex'] : 'male'), 'Sex' => $sSex ? $sSex : ($aProfile['LookingFor'] ? $aProfile['LookingFor'] : 'female'), 'Country' => $sCountry ? $sCountry : ($aProfile['Country'] ? $aProfile['Country'] : getParam('default_country')), 'DateOfBirth' => bx_get('DateOfBirth') ? process_pass_data(bx_get('DateOfBirth'), 1) : getParam('search_start_age') . '-' . getParam('search_end_age'), 'Tags' => bx_get('Tags') ? process_pass_data(bx_get('Tags'), 1) : '', 'online_only' => bx_get('online_only') ? process_pass_data(bx_get('online_only'), 1) : '', 'photos_only' => bx_get('photos_only') ? process_pass_data(bx_get('photos_only'), 1) : '');
     bx_import('BxDolProfileFields');
     $oPF = new BxDolProfileFields(9);
     $a = array('default_params' => $aDefaultParams, 'form_attrs' => array('action' => $this->oConfig->getBaseUri()), 'inputs' => array(array('type' => 'hidden', 'name' => 'r', 'value' => $this->oMain->_aModule['uri'])));
     $aVars = array('content' => $oPF->getFormCode($a));
     return $this->oTemplate->parseHtmlByName('search_form_wrapper', $aVars);
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:29,代码来源:BxMapPageMain.php

示例6: PreviewMessage

function PreviewMessage()
{
    $oEmailTemplate = new BxDolEmailTemplates();
    $aMessage = $oEmailTemplate->parseTemplate('t_AdminEmail', array('MessageText' => process_pass_data($_POST['body'])));
    return DesignBoxContent(_t('_Preview'), $aMessage['body'], 11);
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:6,代码来源:notifies.php

示例7: moduleValidateConfiguration

        }
        if (!file_exists($checkout_filename)) {
            $status_text = 'Checkout file not found';
        } else {
            require_once $checkout_filename;
            $validate_res = moduleValidateConfiguration($status_text);
            if ($validate_res) {
                $status_text = 'Configuration is valid';
            }
        }
    }
} elseif ($_REQUEST['action'] == 'save_settings') {
    $res_setparam1 = setParam('currency_code', $_POST['currency_code']);
    $res_setparam3 = setParam('enable_recurring', $_POST['enable_recurring']);
    if ($res_setparam1 && $res_setparam3) {
        $currency_code = process_pass_data($_POST['currency_code']);
        $enable_recurring = $_POST['enable_recurring'] == 'on';
        $settings_status_text = 'Settings successfully saved';
    } else {
        $settings_status_text = 'Failed to save settings';
    }
}
TopCodeAdmin();
ContentBlockHead("Common settings");
if (strlen($settings_status_text)) {
    echo "\r\n<center>\r\n\t<div class=\"err\">{$settings_status_text}</div>\r\n</center>";
}
?>

<center>
<form id="settingsForm" action="<?php 
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:payment_providers.php

示例8: collectRequestString

 function collectRequestString($aGetParams, $sKeyPref = '', $sKeyPostf = '')
 {
     if (!is_array($aGetParams)) {
         return '';
     }
     $sRet = '';
     foreach ($aGetParams as $sKey => $sValue) {
         if ($sValue === '') {
             continue;
         }
         if (!is_array($sValue)) {
             $sRet .= '&' . urlencode($sKeyPref . $sKey . $sKeyPostf) . '=' . urlencode(process_pass_data($sValue));
         } else {
             $sRet .= $this->collectRequestString($sValue, "{$sKeyPref}{$sKey}{$sKeyPostf}[", "]");
             //recursive call
         }
     }
     return $sRet;
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:19,代码来源:BxBaseProfileView.php

示例9: MemberEditStory

/**
 * Cange story
 */
function MemberEditStory()
{
    global $max_l;
    global $max_h;
    global $member;
    global $ADMIN;
    $story_id = (int) $_POST['edit_id'];
    $story_text = strlen($_POST['text']) > $max_l ? "LEFT ( '" . addslashes(clear_xss(process_pass_data($_POST['text']))) . "', {$max_l} )" : "'" . addslashes(clear_xss(process_pass_data($_POST['text']))) . "'";
    $story_header = strlen($_POST['header']) > $max_h ? "LEFT ( '" . process_db_input($_POST['header']) . "', {$max_h} )" : "'" . process_db_input($_POST['header']) . "'";
    $story_sender = $ADMIN ? (int) $_POST['sender'] : $member['ID'];
    $story_active_add = $ADMIN ? '' : ", `active`=''";
    //if admin logged, don't update status. if member - set inactive
    $sQuery = "UPDATE `Stories` SET `Date` = NOW(), `Header` = {$story_header}, `Text` = {$story_text} {$story_active_add} WHERE `ID` = {$story_id} AND `Sender` = {$story_sender}";
    $res = db_res($sQuery);
    return $res;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:19,代码来源:story.php

示例10: getBlockCode_Results

 function getBlockCode_Results($iBlockID)
 {
     //collect inputs
     $aRequestParams = $this->oPF->collectSearchRequestParams();
     if (isset($_REQUEST['Tags']) and trim($_REQUEST['Tags'])) {
         $aRequestParams['Tags'] = trim(process_pass_data($_REQUEST['Tags']));
     }
     if (isset($_REQUEST['distance']) and (int) $_REQUEST['distance']) {
         $aRequestParams['distance'] = (int) $_REQUEST['distance'];
     }
     // start page generation
     $oProfile = new BxBaseProfileGenerator(getLoggedId());
     switch ($_REQUEST['show']) {
         case 'match':
             list($aDBTopMenu, $sResults) = $this->showMatchProfiles($iBlockID);
             break;
         case 'calendar':
             list($sResults, $aDBTopMenu, $sPagination, $sTopFilter) = $oProfile->GenProfilesCalendarBlock();
             break;
         default:
             $this->collectFilteredSettings();
             list($sResults, $aDBTopMenu, $sPagination, $sTopFilter) = $oProfile->GenSearchResultBlock($this->oPF->aBlocks, $aRequestParams, $this->aFilterSortSettings, 'search.php');
             break;
     }
     return array($sTopFilter . $sResults . $sPagination, $aDBTopMenu, array(), $this->getTitle());
 }
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:26,代码来源:search.php

示例11: CollectCheckoutInfo

/**
 * collect data from source
 */
function CollectCheckoutInfo($source)
{
    global $collectDataArr;
    global $collectDataInputs;
    if (!isset($source['checkout_action']) || strlen($source['data']) == 0) {
        return false;
    }
    $collectDataArr['checkout_action'] = process_pass_data($source['checkout_action']);
    $collectDataArr['amount'] = process_pass_data($source['amount']);
    $collectDataArr['data'] = process_pass_data($source['data']);
    if (isset($source['allow_subscribe'])) {
        $collectDataArr['allow_subscribe'] = process_pass_data($source['allow_subscribe']);
    }
    if (isset($source['subscribe_days'])) {
        $collectDataArr['subscribe_days'] = process_pass_data($source['subscribe_days']);
    }
    $collectDataArr['description'] = returnDescByAction($collectDataArr['checkout_action'], $collectDataArr['data'], true);
    if (strlen($collectDataArr['description']) == 0) {
        return false;
    }
    $collectDataInputs = '';
    $collectDataInputs .= "<input type=\"hidden\" name=\"checkout_action\" value=\"{$collectDataArr['checkout_action']}\" />\n";
    $collectDataInputs .= "<input type=\"hidden\" name=\"amount\" value=\"{$collectDataArr['amount']}\" />\n";
    $collectDataInputs .= "<input type=\"hidden\" name=\"data\" value=\"{$collectDataArr['data']}\" />\n";
    if (isset($source['allow_subscribe'])) {
        $collectDataInputs .= "<input type=\"hidden\" name=\"allow_subscribe\" value=\"{$collectDataArr['allow_subscribe']}\" />\n";
    }
    if (isset($source['subscribe_days'])) {
        $collectDataInputs .= "<input type=\"hidden\" name=\"subscribe_days\" value=\"{$collectDataArr['subscribe_days']}\" />\n";
    }
    return true;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:35,代码来源:checkout.php

示例12: bx_import

    {
        bx_import('BxTemplMenuQlinks2');
        $oMenu = new BxTemplMenuQlinks2();
        $sCodeBlock = $oMenu->getCode();
        return $sCodeBlock;
    }
}
//-------------------------------------------------------------------------------------------------------//
// --------------- page variables and login
$_page['name_index'] = 81;
$_page['css_name'] = array('member_panel.css', 'categories.css', 'alert.css');
$_page['extra_js'] = "<script type=\"text/javascript\">urlIconLoading = \"" . getTemplateIcon('loading.gif') . "\";\n\t\$(document).ready( function() {\n\t\t\n\t\tvar sSendUrl = '" . $site['url'] . "alerts.php';\n\t\t\n\t\t\$('input', '#alertsMenu').click(function(){\n\t\t\tvar sQuery = \$('input', '#alertsMenu').serialize();\n\t\t\t\$.post(sSendUrl, sQuery, function(data) {\n\t\t\t\t\$('#alertsView').html(data);\n\t\t\t}\n\t\t);\n\t\t\n\t} );})\n\t</script>";
$_page['header'] = _t("_My Account");
// --------------- GET/POST actions
$member['ID'] = process_pass_data(empty($_POST['ID']) ? '' : $_POST['ID']);
$member['Password'] = process_pass_data(empty($_POST['Password']) ? '' : $_POST['Password']);
$bAjxMode = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) and $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') ? true : false;
if (!(isset($_POST['ID']) && $_POST['ID'] && isset($_POST['Password']) && $_POST['Password']) && (!empty($_COOKIE['memberID']) && $_COOKIE['memberID'] && $_COOKIE['memberPassword'])) {
    if (!($logged['member'] = member_auth(0, false))) {
        login_form(_t("_LOGIN_OBSOLETE"), 0, $bAjxMode);
    }
} else {
    if (!isset($_POST['ID']) && !isset($_POST['Password'])) {
        // this is dynamic page -  send headers to not cache this page
        send_headers_page_changed();
        login_form('', 0, $bAjxMode);
    } else {
        require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php';
        $oZ = new BxDolAlerts('profile', 'before_login', 0, 0, array('login' => $member['ID'], 'password' => $member['Password'], 'ip' => getVisitorIP()));
        $oZ->alert();
        $member['ID'] = getID($member['ID']);
开发者ID:dalinhuang,项目名称:shopexts,代码行数:31,代码来源:member.php

示例13: actionBrowse

 function actionBrowse($sParamName = '', $sParamValue = '', $sParamValue1 = '', $sParamValue2 = '', $sParamValue3 = '')
 {
     $bAlbumView = false;
     if ($sParamName == 'album' && $sParamValue1 == 'owner') {
         $bAlbumView = true;
         $aAlbumInfo = $this->oAlbums->getAlbumInfo(array('fileUri' => $sParamValue, 'owner' => getID($sParamValue2)), array('ID', 'Caption', 'Owner', 'AllowAlbumView', 'Description'));
         if (empty($aAlbumInfo)) {
             $this->_oTemplate->displayPageNotFound();
             exit;
         } else {
             if ($aAlbumInfo['Owner'] == $this->_iProfileId && $sParamValue2 === getUsername($this->_iProfileId)) {
                 $this->actionAlbumsViewMy('main_objects', $sParamValue, $sParamValue1, $sParamValue2, $sParamValue3);
                 return;
             } elseif (!empty($aAlbumInfo['AllowAlbumView']) && !$this->oAlbumPrivacy->check('album_view', $aAlbumInfo['ID'], $this->_iProfileId)) {
                 $sKey = _t('_' . $this->_oConfig->getMainPrefix() . '_access_denied');
                 $sCode = DesignBoxContent($sKey, MsgBox($sKey), 1);
                 $this->aPageTmpl['header'] = $sKey;
                 $this->_oTemplate->pageCode($this->aPageTmpl, array('page_main_code' => $sCode));
                 return;
             } else {
                 $GLOBALS['oTopMenu']->setCustomSubHeader($aAlbumInfo['Caption']);
             }
         }
     }
     if ('calendar' == $sParamName) {
         $sParamValue = (int) $sParamValue;
         $sParamValue1 = (int) $sParamValue1;
         $sParamValue2 = (int) $sParamValue2;
     }
     $sClassName = $this->_oConfig->getClassPrefix() . 'Search';
     bx_import('Search', $this->_aModule);
     $oSearch = new $sClassName($sParamName, $sParamValue, $sParamValue1, $sParamValue2);
     $sRss = bx_get('rss');
     if ($sRss !== false && $sRss) {
         $oSearch->aCurrent['paginate']['perPage'] = 10;
         header('Content-Type: text/xml; charset=UTF-8');
         echo $oSearch->rss();
         exit;
     }
     $sTopPostfix = isset($oSearch->aCurrent['restriction'][$sParamName]) || $oSearch->aCurrent['sorting'] == $sParamName ? $sParamName : 'all';
     $sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_top_menu_' . $sTopPostfix);
     if (!empty($sParamValue) && isset($oSearch->aCurrent['restriction'][$sParamName])) {
         $sParamValue = $this->getBrowseParam($sParamName, $sParamValue);
         $oSearch->aCurrent['restriction'][$sParamName]['value'] = $sParamValue;
         $sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_browse_by_' . $sParamName, htmlspecialchars_adv(process_pass_data($sParamValue)));
     }
     if ($bAlbumView) {
         $oSearch->aCurrent['restriction']['allow_view']['value'] = array($aAlbumInfo['AllowAlbumView']);
         $sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_browse_by_' . $sParamName, $aAlbumInfo['Caption']);
         $this->_oTemplate->setPageDescription(substr(strip_tags($aAlbumInfo['Description']), 0, 255));
     } else {
         $oSearch->aCurrent['restriction']['not_allow_view']['value'] = array(BX_DOL_PG_HIDDEN);
     }
     if ($sParamName == 'calendar') {
         $sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_caption_browse_by_day') . ': ' . getLocaleDate(strtotime("{$sParamValue}-{$sParamValue1}-{$sParamValue2}"), BX_DOL_LOCALE_DATE_SHORT);
     }
     $oSearch->aCurrent['paginate']['perPage'] = (int) $this->_oConfig->getGlParam('number_all');
     $sCode = $oSearch->displayResultBlock();
     $sPaginate = '';
     if ($oSearch->aCurrent['paginate']['totalNum'] > 0) {
         $aAdd = array($sParamName, $sParamValue, $sParamValue1, $sParamValue2, $sParamValue3);
         foreach ($aAdd as $sValue) {
             if (strlen($sValue) > 0) {
                 $sArg .= '/' . $sValue;
             } else {
                 break;
             }
         }
         $sLink = $this->_oConfig->getBaseUri() . 'browse' . $sArg;
         $oPaginate = new BxDolPaginate(array('page_url' => $sLink . '&page={page}&per_page={per_page}', 'count' => $oSearch->aCurrent['paginate']['totalNum'], 'per_page' => $oSearch->aCurrent['paginate']['perPage'], 'page' => $oSearch->aCurrent['paginate']['page'], 'on_change_per_page' => 'return !loadDynamicBlock(1, \'' . $sLink . '&page=1&per_page=\' + this.value);'));
         $sPaginate = $oPaginate->getPaginate();
     } else {
         $sCode = MsgBox(_t('_Empty'));
     }
     $aMenu = array();
     $sCode = DesignBoxContent($sCaption, $sCode . $sPaginate, 1);
     if ($bAlbumView) {
         $sCode = $this->getAlbumPageView($aAlbumInfo, $sCode);
     }
     $this->aPageTmpl['css_name'] = array('browse.css');
     $this->aPageTmpl['header'] = $sCaption;
     $this->_oTemplate->pageCode($this->aPageTmpl, array('page_main_code' => $sCode));
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:83,代码来源:BxFilesModule.php

示例14: actionBrowse

 function actionBrowse($sParamName = '', $sParamValue = '', $sParamValue1 = '', $sParamValue2 = '', $sParamValue3 = '')
 {
     $bAlbumView = false;
     if ($sParamName == 'album' && $sParamValue1 == 'owner') {
         $bAlbumView = true;
         $aAlbumInfo = $this->oAlbums->getAlbumInfo(array('fileUri' => $sParamValue, 'owner' => getID($sParamValue2)), array('ID', 'Caption', 'Owner', 'AllowAlbumView'));
         $GLOBALS['oTopMenu']->setCustomSubHeader($aAlbumInfo['Caption']);
         $GLOBALS['oTopMenu']->setCustomBreadcrumbs(array(_t('_' . $this->_oConfig->getMainPrefix()) => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'home/', $aAlbumInfo['Caption'] => ''));
         $sAlbumPreview = '';
         if ($this->_oConfig->getGlParam('album_slideshow_on') == 'on') {
             $sAlbumPreview = $this->_oTemplate->getAlbumPreview('rss/album/' . $sParamValue . '/owner/' . $sParamValue2);
             if (strlen($sAlbumPreview) > 0) {
                 $sAlbumPreview = DesignBoxContent($aAlbumInfo['Caption'], $sAlbumPreview, 1);
             }
         }
     }
     if (!empty($aAlbumInfo) && $aAlbumInfo['Owner'] == $this->_iProfileId && $sParamValue2 === getNickName($this->_iProfileId)) {
         $this->actionAlbumsViewMy('main_objects', $sParamValue, $sParamValue1, $sParamValue2, $sParamValue3);
         return;
     }
     if ($bAlbumView && !empty($aAlbumInfo['AllowAlbumView']) && !$this->oAlbumPrivacy->check('album_view', $aAlbumInfo['ID'], $this->_iProfileId)) {
         $sKey = _t('_' . $this->_oConfig->getMainPrefix() . '_access_denied');
         $sCode = DesignBoxContent($sKey, MsgBox($sKey), 1);
         $this->aPageTmpl['header'] = $sKey;
         $this->_oTemplate->pageCode($this->aPageTmpl, array('page_main_code' => $sCode));
         return;
     }
     $sClassName = $this->_oConfig->getClassPrefix() . 'Search';
     bx_import('Search', $this->_aModule);
     $oSearch = new $sClassName($sParamName, $sParamValue, $sParamValue1, $sParamValue2);
     $sRss = bx_get('rss');
     if ($sRss !== false && $sRss) {
         $oSearch->aCurrent['paginate']['perPage'] = 10;
         echo $oSearch->rss();
         exit;
     }
     $sTopPostfix = isset($oSearch->aCurrent['restriction'][$sParamName]) || $oSearch->aCurrent['sorting'] == $sParamName ? $sParamName : 'all';
     $sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_top_menu_' . $sTopPostfix);
     if (mb_strlen($sParamValue) > 0 && isset($oSearch->aCurrent['restriction'][$sParamName])) {
         $sParamValue = $this->getBrowseParam($sParamName, $sParamValue);
         $oSearch->aCurrent['restriction'][$sParamName]['value'] = $sParamValue;
         $sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_browse_by_' . $sParamName, process_pass_data($sParamValue));
     }
     if ($bAlbumView) {
         $oSearch->aCurrent['restriction']['allow_view']['value'] = array($aAlbumInfo['AllowAlbumView']);
         $sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_browse_by_' . $sParamName, $aAlbumInfo['Caption']);
     }
     if ($sParamName == 'calendar') {
         $sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_caption_browse_by_day') . ': ' . getLocaleDate(strtotime("{$sParamValue}-{$sParamValue1}-{$sParamValue2}"), BX_DOL_LOCALE_DATE_SHORT);
     }
     $oSearch->aCurrent['paginate']['perPage'] = (int) $this->_oConfig->getGlParam('number_all');
     $sCode = $oSearch->displayResultBlock();
     if ($oSearch->aCurrent['paginate']['totalNum'] > 0) {
         $sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.sys_file_search_unit');
         $aAdd = array($sParamName, $sParamValue, $sParamValue1, $sParamValue2, $sParamValue3);
         foreach ($aAdd as $sValue) {
             if (strlen($sValue) > 0) {
                 $sArg .= '/' . rawurlencode($sValue);
             } else {
                 break;
             }
         }
         $sLink = $this->_oConfig->getBaseUri() . 'browse' . $sArg;
         $oPaginate = new BxDolPaginate(array('page_url' => $sLink . '&page={page}&per_page={per_page}', 'count' => $oSearch->aCurrent['paginate']['totalNum'], 'per_page' => $oSearch->aCurrent['paginate']['perPage'], 'page' => $oSearch->aCurrent['paginate']['page'], 'per_page_changer' => true, 'page_reloader' => true, 'on_change_per_page' => 'document.location=\'' . BX_DOL_URL_ROOT . $sLink . '&page=1&per_page=\' + this.value;'));
         $sPaginate = $oPaginate->getPaginate();
     } else {
         $sCode = MsgBox(_t('_Empty'));
     }
     $aMenu = array();
     $sCode = DesignBoxContent($sCaption, $sCode . $sPaginate, 1, $this->_oTemplate->getExtraTopMenu($aMenu, BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri()));
     $this->aPageTmpl['css_name'] = array('browse.css');
     $this->aPageTmpl['header'] = $sCaption;
     $this->_oTemplate->pageCode($this->aPageTmpl, array('page_main_code' => $sCode . $sAlbumPreview));
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:74,代码来源:BxDolFilesModule.php

示例15: moduleValidateTransaction

/**	
 * Validate if transaction real and successful
 * 
 * @param array $dataArr				- array with data to validate
 * @param string &$errorMessage			- error message when return result is not 1
 * 
 * @return int 							- validation result
 * 										  possible variants:
 * 											-1 - fraud attempt
 * 											 0 - transaction was declined
 * 											 1 - transaction was approved
 * 											 2 - inner error
 * 
 * 
 */
function moduleValidateTransaction(&$dataArr, &$errorMessage)
{
    global $providerConf;
    $maxReadSize = 8192;
    if ($providerConf['Param_process_type'] == 'Direct' || $providerConf['Param_process_type'] == 'IPN') {
        if ($dataArr['payment_status'] != 'Completed') {
            $errorMessage = 'Payment is not completed';
            return 0;
        }
        if ($providerConf['Mode'] != 'live') {
            $businessValue = $providerConf['Param_test_business'];
        } else {
            $businessValue = $providerConf['Param_business'];
        }
        if ($dataArr['business'] != $businessValue) {
            $errorMessage = 'Wrong receiver email';
            return -1;
        }
        if ($providerConf['Debug']) {
            writeDebugLog('Direct/IPN validation for transaction', $dataArr, false);
        }
        $req = 'cmd=_notify-validate';
        foreach ($dataArr as $key => $value) {
            $req .= '&' . urlencode($key) . '=' . urlencode(process_pass_data($value));
        }
        // post back to PayPal system to validate
        $header = "POST /cgi-bin/webscr HTTP/1.0\r\n";
        $header .= "Host: www.paypal.com\r\n";
        $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $header .= "Content-Length: " . strlen($req) . "\r\n";
        $header .= "Connection: close\r\n\r\n";
        // open socket
        if ($providerConf['Mode'] != 'live') {
            $connectURL = 'www.sandbox.paypal.com';
        } else {
            $connectURL = 'www.paypal.com';
        }
        if ($providerConf['Param_connection_type'] == 'SSL') {
            $fp = fsockopen("ssl://{$connectURL}", 443, $errno, $errstr, 60);
        } else {
            $fp = fsockopen("tcp://{$connectURL}", 80, $errno, $errstr, 60);
        }
        if (!$fp) {
            $errorMessage = "Can't connect to remote host for validation ({$errstr})";
            return 2;
        }
        // send data
        fputs($fp, $header . $req);
        // read the body data
        $response = fread($fp, $maxReadSize);
        $responseArr = explode("\r\n\r\n", $response);
        $responseHeader = $responseArr[0];
        $res = $responseArr[1];
        // parse the data
        $lines = explode("\n", $res);
        array_walk($lines, create_function('&$arg', "\$arg = trim(\$arg);"));
        if ($providerConf['Debug']) {
            writeDebugLog('Direct/IPN reply lines', $lines, false);
        }
        if (strcmp($lines[0], "INVALID") == 0) {
            $errorMessage = 'Transaction verification failed';
            fclose($fp);
            return -1;
        } elseif (strcmp($lines[0], "VERIFIED") != 0) {
            $errorMessage = 'No verification status received';
            fclose($fp);
            return 2;
        }
        $paymentAmount = getPaymentAmount($dataArr);
        if (!commonValidateTransaction($dataArr['item_number'], $paymentAmount, $errorMessage)) {
            return -1;
        }
        if (!customCheck($dataArr, $errorMessage)) {
            return -1;
        }
        fclose($fp);
        return 1;
    } elseif ($providerConf['Param_process_type'] == 'PDT') {
        if ($providerConf['Debug']) {
            writeDebugLog('PDT validation for transaction', $dataArr, false);
        }
        $req = 'cmd=_notify-synch';
        $req .= "&tx={$dataArr['tx']}&at={$providerConf['Param_auth_token']}";
        // post back to PayPal system to validate
        $header = "POST /cgi-bin/webscr HTTP/1.0\r\n";
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:101,代码来源:paypal.php


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