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


PHP memorize_param函数代码示例

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


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

示例1: switch

// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
 * Display payload:
 */
switch ($action) {
    case 'nil':
        // Do nothing
        break;
    case 'delete':
        if ($perm_abuse_management) {
            // Save a tab param for hidden fields of the form
            memorize_param('tab', 'string', 'abuse');
        }
        // We need to ask for confirmation:
        $edited_Message->confirm_delete(T_('Delete message?'), 'messaging_messages', $action, get_memorized('action'));
    default:
        // No specific request, list all messages:
        // Cleanup context:
        forget_param('msg_ID');
        // Display messages list:
        $action = $action == 'preview' ? $action : 'create';
        $AdminUI->disp_view('messaging/views/_message_list.view.php', array('messages_list_form_start' => '', 'messages_list_form_end' => '', 'messages_list_body_start' => '', 'messages_list_body_end' => ''));
        break;
}
$AdminUI->disp_payload_end();
// Display body bottom, debug info and close </html>:
$AdminUI->disp_global_footer();
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:messages.ctrl.php

示例2: set_filters

 /**
  * Set/Activate filterset
  *
  * This will also set back the GLOBALS !!! needed for regenerate_url().
  *
  * @param array Filters
  */
 function set_filters($filters)
 {
     if (!empty($filters)) {
         // Activate the filterset (fallback to default filter when a value is not set):
         $this->filters = array_merge($this->default_filters, $filters);
     }
     // Activate preset filters if necessary:
     $this->activate_preset_filters();
     // Page
     $this->page = param($this->page_param, 'integer', 1);
     // Country
     if (has_cross_country_restriction('users', 'list')) {
         // In case of cross country restrionction we always have to set the ctry filter
         // In this case we always have a logged in user
         global $current_User;
         if (!empty($current_User->ctry_ID) && $current_User->ctry_ID != $this->filters['country']) {
             // current country filter is not the same
             $this->filters['country'] = $current_User->ctry_ID;
             $this->refresh_query = true;
         }
     }
     // asimo> memorize is always false for now, because is not fully implemented
     if ($this->memorize) {
         // set back the GLOBALS !!! needed for regenerate_url() :
         /*
          * Selected filter preset:
          */
         memorize_param('filter_preset', 'string', $this->default_filters['filter_preset'], $this->filters['filter_preset']);
         // List of authors to restrict to
         /*
          * Restrict by membersonly
          */
         memorize_param('membersonly', 'integer', $this->default_filters['membersonly'], $this->filters['membersonly']);
         /*
          * Restrict by keywords
          */
         memorize_param('keywords', 'string', $this->default_filters['keywords'], $this->filters['keywords']);
         // Search string
         /*
          * Restrict by gender
          */
         memorize_param('gender_men', 'integer', strpos($this->default_filters['gender'], 'M') !== false, strpos($this->filters['gender'], 'M') !== false);
         memorize_param('gender_women', 'integer', strpos($this->default_filters['gender'], 'F') !== false, strpos($this->filters['gender'], 'F') !== false);
         /*
          * Restrict by status
          */
         memorize_param('status_activated', 'string', $this->default_filters['status_activated'], $this->filters['status_activated']);
         memorize_param('account_status', 'string', $this->default_filters['account_status'], $this->filters['account_status']);
         /*
          * Restrict by reported state ( was reported or not )
          */
         memorize_param('reported', 'integer', $this->default_filters['reported'], $this->filters['reported']);
         /*
          * Restrict by custom sender email settings
          */
         memorize_param('custom_sender_email', 'integer', $this->default_filters['custom_sender_email'], $this->filters['custom_sender_email']);
         memorize_param('custom_sender_name', 'integer', $this->default_filters['custom_sender_name'], $this->filters['custom_sender_name']);
         /*
          * Restrict by user group
          */
         memorize_param('group', 'string', $this->default_filters['group'], $this->filters['group']);
         /*
          * Restrict by locations
          */
         memorize_param('country', 'integer', $this->default_filters['country'], $this->filters['country']);
         // Search country
         memorize_param('region', 'integer', $this->default_filters['region'], $this->filters['region']);
         // Search region
         memorize_param('subregion', 'integer', $this->default_filters['subregion'], $this->filters['subregion']);
         // Search subregion
         memorize_param('city', 'integer', $this->default_filters['city'], $this->filters['city']);
         // Search city
         /*
          * Restrict by age group
          */
         memorize_param('age_min', 'integer', $this->default_filters['age_min'], $this->filters['age_min']);
         memorize_param('age_max', 'integer', $this->default_filters['age_max'], $this->filters['age_max']);
         /*
          * Restrict by organization
          */
         memorize_param('org', 'integer', $this->default_filters['org'], $this->filters['org']);
         /*
          * Restrict by user fields
          */
         $filters_uf_types = array();
         $filters_uf_values = array();
         $userfields = !empty($this->filters['userfields']) ? $this->filters['userfields'] : $this->default_filters['userfields'];
         foreach ($userfields as $field) {
             $filters_uf_types[] = $field['type'];
             $filters_uf_values[] = $field['value'];
         }
         memorize_param('criteria_type', 'array', $filters_uf_types, $filters_uf_types);
         memorize_param('criteria_value', 'array', $filters_uf_values, $filters_uf_values);
//.........这里部分代码省略.........
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:101,代码来源:_userlist.class.php

示例3: dirname

 *
 * b2evolution - {@link http://b2evolution.net/}
 * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
 * @copyright (c)2003-2013 by Francois Planque - {@link http://fplanque.com/}
 *
 * {@internal Note: we need at least one file in the main package}}
 *
 * @package main
 */
/**
 * First thing: Do the minimal initializations required for b2evo:
 */
require_once dirname(__FILE__) . '/conf/_config.php';
require_once $inc_path . '_main.inc.php';
if (!init_requested_blog()) {
    // No specific blog to be displayed:
    echo 'No default blog is set.';
    exit;
}
// Memorize that blog param as DEFAULT so that it doesn't get passed in regenerate_url()
memorize_param('blog', 'integer', $blog);
// A blog has been requested... Let's set a few default params:
# You could *force* a specific skin here with this setting:
# $skin = 'basic';
# This setting retricts posts to those published, thus hiding drafts.
# You should not have to change this.
$show_statuses = array();
# Additionnaly, you can set other values (see URL params in the manual)...
# $order = 'ASC'; // This for example would display the blog in chronological order...
// That's it, now let b2evolution do the rest! :)
require $inc_path . '_blog_main.inc.php';
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:index_multi.php

示例4: set_filters

 /**
  * Set/Activate filterset
  *
  * This will also set back the GLOBALS !!! needed for regenerate_url().
  *
  * @param array Filters
  * @param boolean TRUE to memorize the filter params
  * @param boolean TRUE to use filters from previous request (from array $this->filters if it was defined before)
  */
 function set_filters($filters, $memorize = true, $use_previous_filters = false)
 {
     if (!empty($filters)) {
         // Activate the filterset (fallback to default filter when a value is not set):
         if ($use_previous_filters) {
             // If $this->filters were activated before(e.g. on load from request), they can be saved here
             $this->filters = array_merge($this->default_filters, $this->filters, $filters);
         } else {
             // Don't use the filters from previous request
             $this->filters = array_merge($this->default_filters, $filters);
         }
     }
     // Activate preset filters if necessary:
     $this->activate_preset_filters();
     // Funky oldstyle params:
     $this->limit = $this->filters['comments'];
     // for compatibility with parent class
     $this->page = $this->filters['page'];
     // asimo> memorize is always false for now, because is not fully implemented
     if ($memorize) {
         // set back the GLOBALS !!! needed for regenerate_url() :
         /*
          * Selected filter preset:
          */
         memorize_param($this->param_prefix . 'filter_preset', 'string', $this->default_filters['filter_preset'], $this->filters['filter_preset']);
         // List of authors to restrict to
         /*
          * Restrict to selected authors attribute:
          */
         memorize_param($this->param_prefix . 'author_IDs', 'string', $this->default_filters['author_IDs'], $this->filters['author_IDs']);
         // List of authors ID to restrict to
         memorize_param($this->param_prefix . 'author', 'string', $this->default_filters['author'], $this->filters['author']);
         // List of authors ID to restrict to
         memorize_param($this->param_prefix . 'author_email', 'string', $this->default_filters['author_email'], $this->filters['author_email']);
         // List of authors email to restrict to
         memorize_param($this->param_prefix . 'author_url', 'string', $this->default_filters['author_url'], $this->filters['author_url']);
         // List of authors url to restrict to
         memorize_param($this->param_prefix . 'url_match', 'string', $this->default_filters['url_match'], $this->filters['url_match']);
         // List of authors url to restrict to
         memorize_param($this->param_prefix . 'include_emptyurl', 'string', $this->default_filters['include_emptyurl'], $this->filters['include_emptyurl']);
         // List of authors url to restrict to
         memorize_param($this->param_prefix . 'author_IP', 'string', $this->default_filters['author_IP'], $this->filters['author_IP']);
         // List of authors ip to restrict to
         /*
          * Restrict to selected rating:
          */
         memorize_param($this->param_prefix . 'rating_toshow', 'array', $this->default_filters['rating_toshow'], $this->filters['rating_toshow']);
         // Rating to restrict to
         memorize_param($this->param_prefix . 'rating_turn', 'string', $this->default_filters['rating_turn'], $this->filters['rating_turn']);
         // Rating to restrict to
         memorize_param($this->param_prefix . 'rating_limit', 'integer', $this->default_filters['rating_limit'], $this->filters['rating_limit']);
         // Rating to restrict to
         /*
          * Restrict by keywords
          */
         memorize_param($this->param_prefix . 's', 'string', $this->default_filters['keywords'], $this->filters['keywords']);
         // Search string
         memorize_param($this->param_prefix . 'sentence', 'string', $this->default_filters['phrase'], $this->filters['phrase']);
         // Search for sentence or for words
         memorize_param($this->param_prefix . 'exact', 'integer', $this->default_filters['exact'], $this->filters['exact']);
         // Require exact match of title or contents
         /*
          * Restrict to selected statuses:
          */
         memorize_param($this->param_prefix . 'show_statuses', 'array', $this->default_filters['statuses'], $this->filters['statuses']);
         // List of statuses to restrict to
         /*
          * Restrict to not active/expired comments:
          */
         memorize_param($this->param_prefix . 'expiry_statuses', 'array', $this->default_filters['expiry_statuses'], $this->filters['expiry_statuses']);
         // List of expiry statuses to restrict to
         /*
          * Restrict to selected comment type:
          */
         memorize_param($this->param_prefix . 'type', 'string', $this->default_filters['types'], $this->filters['types']);
         // List of comment types to restrict to
         /*
          * Restrict to current User specific permission:
          */
         memorize_param($this->param_prefix . 'user_perm', 'string', $this->default_filters['user_perm'], $this->filters['user_perm']);
         // Restrict to comments with permitted action for the current User
         /*
          * Restrict to the statuses we want to show:
          */
         // Note: oftentimes, $show_statuses will have been preset to a more restrictive set of values
         //memorize_param( $this->param_prefix.'show_statuses', 'array', $this->default_filters['visibility_array'], $this->filters['visibility_array'] );	// Array of sharings to restrict to
         /*
          * OLD STYLE orders:
          */
         memorize_param($this->param_prefix . 'order', 'string', $this->default_filters['order'], $this->filters['order']);
         // ASC or DESC
//.........这里部分代码省略.........
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:101,代码来源:_commentlist.class.php

示例5: set_filters

 /**
  * Set/Activate filterset
  *
  * This will also set back the GLOBALS !!! needed for regenerate_url().
  *
  * @param array Filters
  * @param boolean TRUE to memorize the filter params
  * @param boolean TRUE to use filters from previous request (from array $this->filters if it was defined before)
  */
 function set_filters($filters, $memorize = true, $use_previous_filters = false)
 {
     if (!empty($filters)) {
         // Activate the filterset (fallback to default filter when a value is not set):
         if ($use_previous_filters) {
             // If $this->filters were activated before(e.g. on load from request), they can be saved here
             $this->filters = array_merge($this->default_filters, $this->filters, $filters);
         } else {
             // Don't use the filters from previous request
             $this->filters = array_merge($this->default_filters, $filters);
         }
     }
     // Activate preset filters if necessary:
     $this->activate_preset_filters();
     // Funky oldstyle params:
     $this->limit = $this->filters['posts'];
     // for compatibility with parent class
     $this->page = $this->filters['page'];
     if ($memorize) {
         // set back the GLOBALS !!! needed for regenerate_url() :
         /*
          * Selected filter preset:
          */
         memorize_param($this->param_prefix . 'filter_preset', 'string', $this->default_filters['filter_preset'], $this->filters['filter_preset']);
         // List of authors to restrict to
         /*
          * Blog & Chapters/categories restrictions:
          */
         // Get chapters/categories (and compile those values right away)
         if (isset($this->filters['cat_modifier'])) {
             // Update cat param with the cat modifier only if it was set explicitly, otherwise it may overwrite the global $cat variable
             memorize_param('cat', '/^[*\\-]?([0-9]+(,[0-9]+)*)?$/', $this->default_filters['cat_modifier'], $this->filters['cat_modifier']);
             // Category modifier
         }
         memorize_param('catsel', 'array', $this->default_filters['cat_array'], $this->filters['cat_array']);
         memorize_param($this->param_prefix . 'cat_focus', 'string', $this->default_filters['cat_focus'], $this->filters['cat_focus']);
         // Categories to search on
         // TEMP until we get this straight:
         // fp> this would only be used for the categories widget and setting it here overwtrites the interesting values when a post list widget is tirggered
         // fp> if we need it here we want to use a $set_globals params to this function
         // global $cat_array, $cat_modifier;
         // $cat_array = $this->default_filters['cat_array'];
         // $cat_modifier = $this->default_filters['cat_modifier'];
         /*
          * Restrict to selected tags:
          */
         memorize_param($this->param_prefix . 'tags', 'string', $this->default_filters['tags'], $this->filters['tags']);
         /*
          * Restrict to selected authors:
          */
         // List of authors users IDs to restrict to
         memorize_param($this->param_prefix . 'author', 'string', $this->default_filters['authors'], $this->filters['authors']);
         // List of authors users logins to restrict to
         memorize_param($this->param_prefix . 'author_login', 'string', $this->default_filters['authors_login'], $this->filters['authors_login']);
         /*
          * Restrict to selected assignees:
          */
         // List of assignees users IDs to restrict to
         memorize_param($this->param_prefix . 'assgn', 'string', $this->default_filters['assignees'], $this->filters['assignees']);
         // List of assignees users logins to restrict to
         memorize_param($this->param_prefix . 'assgn_login', 'string', $this->default_filters['assignees_login'], $this->filters['assignees_login']);
         /*
          * Restrict to selected author OR assignee:
          */
         memorize_param($this->param_prefix . 'author_assignee', 'string', $this->default_filters['author_assignee'], $this->filters['author_assignee']);
         /*
          * Restrict to selected locale:
          */
         memorize_param($this->param_prefix . 'lc', 'string', $this->default_filters['lc'], $this->filters['lc']);
         // Locale to restrict to
         /*
          * Restrict to selected statuses:
          */
         memorize_param($this->param_prefix . 'status', 'string', $this->default_filters['statuses'], $this->filters['statuses']);
         // List of statuses to restrict to
         /*
          * Restrict to selected post type:
          */
         memorize_param($this->param_prefix . 'types', 'integer', $this->default_filters['types'], $this->filters['types']);
         // List of post types to restrict to
         /*
          * Restrict by keywords
          */
         memorize_param($this->param_prefix . 's', 'string', $this->default_filters['keywords'], $this->filters['keywords']);
         // Search string
         memorize_param($this->param_prefix . 'scope', 'string', $this->default_filters['keyword_scope'], $this->filters['keyword_scope']);
         // Scope of search string
         memorize_param($this->param_prefix . 'sentence', 'string', $this->default_filters['phrase'], $this->filters['phrase']);
         // Search for sentence or for words
         memorize_param($this->param_prefix . 'exact', 'integer', $this->default_filters['exact'], $this->filters['exact']);
         // Require exact match of title or contents
//.........这里部分代码省略.........
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:101,代码来源:_itemlistlight.class.php

示例6: die

    die('Please, do not access this page directly.');
}
global $blog, $admin_url, $UserSettings;
global $datestartinput, $datestart, $datestopinput, $datestop, $email;
if (param_date('datestartinput', T_('Invalid date'), false, NULL) !== NULL) {
    // We have a user provided localized date:
    memorize_param('datestart', 'string', NULL, trim(form_date($datestartinput)));
    memorize_param('datestartinput', 'string', NULL, empty($datestartinput) ? NULL : date(locale_datefmt(), strtotime($datestartinput)));
} else {
    // We may have an automated param transmission date:
    param('datestart', 'string', '', true);
}
if (param_date('datestopinput', T_('Invalid date'), false, NULL) !== NULL) {
    // We have a user provided localized date:
    memorize_param('datestop', 'string', NULL, trim(form_date($datestopinput)));
    memorize_param('datestopinput', 'string', NULL, empty($datestopinput) ? NULL : date(locale_datefmt(), strtotime($datestopinput)));
} else {
    // We may have an automated param transmission date:
    param('datestop', 'string', '', true);
}
param('email', 'string', '', true);
// Create result set:
$SQL = new SQL();
$SQL->SELECT('SQL_NO_CACHE emlog_ID, emlog_timestamp, emlog_user_ID, emlog_to, emlog_result, emlog_subject');
$SQL->FROM('T_email__log');
$count_SQL = new SQL();
$count_SQL->SELECT('SQL_NO_CACHE COUNT(emlog_ID)');
$count_SQL->FROM('T_email__log');
if (!empty($datestart)) {
    // Filter by start date
    $SQL->WHERE_and('emlog_timestamp >= ' . $DB->quote($datestart . ' 00:00:00'));
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_email_sent.view.php

示例7: param_Request

 /**
  * Get a param from Request and save it to UserSettings, or default to previously saved user setting.
  *
  * If the user setting was not set before (and there's no default given that gets returned), $default gets used.
  *
  * @todo Move this to _abstractsettings.class.php - the other Settings object can also make use of it!
  *
  * @param string Request param name
  * @param string User setting name. Make sure this is unique!
  * @param string Force value type to one of:
  * - integer
  * - float
  * - string (strips (HTML-)Tags, trims whitespace)
  * - array
  * - object
  * - null
  * - html (does nothing)
  * - '' (does nothing)
  * - '/^...$/' check regexp pattern match (string)
  * - boolean (will force type to boolean, but you can't use 'true' as a default since it has special meaning. There is no real reason to pass booleans on a URL though. Passing 0 and 1 as integers seems to be best practice).
  * Value type will be forced only if resulting value (probably from default then) is !== NULL
  * @param mixed Default value or TRUE if user input required
  * @param boolean Do we need to memorize this to regenerate the URL for this page?
  * @param boolean Override if variable already set
  * @return NULL|mixed NULL, if neither a param was given nor {@link $UserSettings} knows about it.
  */
 function param_Request($param_name, $uset_name, $type = '', $default = '', $memorize = false, $override = false)
 {
     $value = param($param_name, $type, NULL, $memorize, $override, false);
     // we pass NULL here, to see if it got set at all
     if ($value !== false) {
         // we got a value
         $this->set($uset_name, $value);
         $this->dbupdate();
     } else {
         // get the value from user settings
         $value = $this->get($uset_name);
         if (is_null($value)) {
             // it's not saved yet and there's not default defined ($_defaults)
             $value = $default;
         }
         if ($memorize) {
             // Memorize param
             memorize_param($param_name, $type, $default, $value);
         }
     }
     set_param($param_name, $value);
     return get_param($param_name);
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:49,代码来源:_usersettings.class.php

示例8: memorize_param

     $AdminUI->disp_payload_end();
     break;
 case 'view':
 case 'delete':
     // View a single post:
     // Memorize 'p' in case we reload while changing some display settings
     memorize_param('p', 'integer', NULL);
     // Begin payload block:
     $AdminUI->disp_payload_begin();
     // We use the "full" view for displaying single posts:
     $AdminUI->disp_view('items/views/_item_list_full.view.php');
     // End payload block:
     $AdminUI->disp_payload_end();
     break;
 case 'history':
     memorize_param('action', 'string', NULL);
     // Begin payload block:
     $AdminUI->disp_payload_begin();
     // view:
     $AdminUI->disp_view('items/views/_item_history.view.php');
     // End payload block:
     $AdminUI->disp_payload_end();
     break;
 case 'history_details':
     // Begin payload block:
     $AdminUI->disp_payload_begin();
     // view:
     $AdminUI->disp_view('items/views/_item_history_details.view.php');
     // End payload block:
     $AdminUI->disp_payload_end();
     break;
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:items.ctrl.php

示例9: sprintf

            if ($edited_Group->ID == $Settings->get('newusers_grp_ID')) {
                $Messages->add(T_('You can\'t delete the default group for new users!'), 'error');
                $action = 'view_group';
                break;
            }
            if (param('confirm', 'integer', 0)) {
                // confirmed, Delete from DB:
                $msg = sprintf(T_('Group &laquo;%s&raquo; deleted.'), $edited_Group->dget('name'));
                $edited_Group->dbdelete($Messages);
                unset($edited_Group);
                forget_param('grp_ID');
                $Messages->add($msg, 'success');
                $action = 'list';
            } else {
                // not confirmed, Check for restrictions:
                memorize_param('grp_ID', 'integer', true);
                if (!$edited_Group->check_delete(sprintf(T_('Cannot delete Group &laquo;%s&raquo;'), $edited_Group->dget('name')))) {
                    // There are restrictions:
                    $action = 'view_group';
                }
            }
            break;
    }
}
// We might delegate to this action from above:
if ($action == 'edit_user') {
    $Plugins->trigger_event('PluginUserSettingsEditAction', $tmp_params = array('User' => &$edited_User));
    $Session->delete('core.changepwd.request_id');
    // delete the request_id for password change request (from /htsrv/login.php)
}
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
开发者ID:LFSF,项目名称:oras,代码行数:31,代码来源:users.ctrl.php

示例10: sprintf

     // Set revision from request
     if ($phpsvnclient->getVersion() < $svn_revision) {
         // Incorrect revision number
         echo '<p class="red">' . sprintf(T_('Please select a correct revision number. The latest revision is %s.'), $phpsvnclient->getVersion()) . '</p>';
         evo_flush();
         $action = 'start';
         break;
         // Stop an upgrade from SVN
     } else {
         // Use only correct revision
         $phpsvnclient->setVersion($svn_revision);
     }
 }
 $repository_version = $phpsvnclient->getVersion();
 $upgrade_name = 'export_svn_' . $repository_version;
 memorize_param('upd_name', 'string', '', $upgrade_name);
 $upgrade_folder = $upgrade_path . $upgrade_name;
 if (file_exists($upgrade_path . $upgrade_name)) {
     // Current version already is downloaded
     echo '<p class="green">' . sprintf(T_('Revision %s has already been downloaded. Using: %s'), $repository_version, $upgrade_path . $upgrade_name);
 } else {
     // Download files
     echo '<p>' . sprintf(T_('Downloading package to &laquo;<strong>%s</strong>&raquo;...'), $upgrade_folder);
     evo_flush();
     // Export all files in temp folder for following coping
     $svn_result = $phpsvnclient->checkOut($svn_folder, $upgrade_folder, false, true);
     echo '</p>';
     if ($svn_result === false) {
         // Checkout is failed
         echo '<p style="color:red">' . sprintf(T_('Unable to download package from &laquo;%s&raquo;'), $svn_url) . '</p>';
         evo_flush();
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:upgrade.ctrl.php

示例11: hits_results_block

/**
 * Display hits results table
 */
function hits_results_block($params = array())
{
    if (!is_logged_in()) {
        // Only logged in users can access to this function
        return;
    }
    global $current_User;
    if (!$current_User->check_perm('stats', 'view')) {
        // Current user has no permission to view all stats (aggregated stats)
        return;
    }
    /**
     * View funcs
     */
    load_funcs('sessions/views/_stats_view.funcs.php');
    global $blog, $admin_url, $rsc_url;
    global $Session, $UserSettings, $DB;
    global $datestartinput, $datestart, $datestopinput, $datestop;
    global $preset_referer_type, $preset_agent_type;
    $tab = param('tab', 'string', 'summary', true);
    $tab3 = param('tab3', 'string', '', true);
    switch ($tab) {
        case 'other':
            $preset_results_title = T_('Direct browser hits');
            $preset_referer_type = 'direct';
            $preset_agent_type = 'browser';
            $preset_filter_all_url = '?ctrl=stats&amp;tab=referers&amp;blog=' . $blog;
            $hide_columns = 'referer';
            break;
        case 'referers':
            $preset_results_title = T_('Refered browser hits');
            $preset_referer_type = 'referer';
            $preset_agent_type = 'browser';
            $preset_filter_all_url = '?ctrl=stats&amp;tab=referers&amp;blog=' . $blog;
            break;
        case 'refsearches':
            if ($tab3 == 'hits') {
                $preset_results_title = T_('Search hits');
                $preset_referer_type = 'search';
                $preset_agent_type = 'browser';
                $preset_filter_all_url = '?ctrl=stats&amp;tab=refsearches&amp;tab3=hits&amp;blog=' . $blog;
            }
            break;
    }
    if (param_date('datestartinput', T_('Invalid date'), false, NULL) !== NULL) {
        // We have a user provided localized date:
        memorize_param('datestart', 'string', NULL, trim(form_date($datestartinput)));
    } else {
        // We may have an automated param transmission date:
        param('datestart', 'string', '', true);
    }
    if (param_date('datestopinput', T_('Invalid date'), false, NULL) !== NULL) {
        // We have a user provided localized date:
        memorize_param('datestop', 'string', NULL, trim(form_date($datestopinput)));
    } else {
        // We may have an automated param transmission date:
        param('datestop', 'string', '', true);
    }
    $exclude = param('exclude', 'integer', 0, true);
    $sess_ID = param('sess_ID', 'integer', NULL, true);
    $remote_IP = param('remote_IP', 'string', NULL, true);
    $referer_type = isset($preset_referer_type) ? $preset_referer_type : param('referer_type', 'string', NULL, true);
    $agent_type = isset($preset_agent_type) ? $preset_agent_type : param('agent_type', 'string', NULL, true);
    $device = param('device', 'string', NULL, true);
    $hit_type = param('hit_type', 'string', NULL, true);
    $reqURI = param('reqURI', 'string', NULL, true);
    // Create result set:
    $SQL = new SQL();
    $SQL->SELECT('SQL_NO_CACHE hit_ID, sess_ID, sess_device, hit_datetime, hit_type, hit_referer_type, hit_uri, hit_disp, hit_ctrl, hit_action, hit_blog_ID, hit_referer, hit_remote_addr,' . 'user_login, hit_agent_type, blog_shortname, dom_name, goal_name, hit_keyphrase, hit_serprank, hit_response_code');
    $SQL->FROM('T_hitlog LEFT JOIN T_basedomains ON dom_ID = hit_referer_dom_ID' . ' LEFT JOIN T_sessions ON hit_sess_ID = sess_ID' . ' LEFT JOIN T_blogs ON hit_blog_ID = blog_ID' . ' LEFT JOIN T_users ON sess_user_ID = user_ID' . ' LEFT JOIN T_track__goalhit ON hit_ID = ghit_hit_ID' . ' LEFT JOIN T_track__goal ON ghit_goal_ID = goal_ID');
    $CountSQL = new SQL();
    $CountSQL->SELECT('SQL_NO_CACHE COUNT(hit_ID)');
    $CountSQL->FROM('T_hitlog');
    $operator = $exclude ? ' <> ' : ' = ';
    if (!empty($sess_ID)) {
        // We want to filter on the session ID:
        $filter = 'hit_sess_ID' . $operator . $sess_ID;
        $SQL->WHERE($filter);
        $CountSQL->WHERE($filter);
    } elseif (!empty($remote_IP)) {
        // We want to filter on the goal name:
        $filter = 'hit_remote_addr' . $operator . $DB->quote($remote_IP);
        $SQL->WHERE($filter);
        $CountSQL->WHERE($filter);
    }
    if (!empty($referer_type)) {
        $filter = 'hit_referer_type = ' . $DB->quote($referer_type);
        $SQL->WHERE_and($filter);
        $CountSQL->WHERE_and($filter);
    }
    if (!empty($agent_type)) {
        $filter = 'hit_agent_type = ' . $DB->quote($agent_type);
        $SQL->WHERE_and($filter);
        $CountSQL->WHERE_and($filter);
    }
    if (!empty($device)) {
        if ($device == 'other') {
//.........这里部分代码省略.........
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:101,代码来源:_hitlog.funcs.php

示例12: dirname

require_once dirname(__FILE__) . '/_stats_view.funcs.php';
$user_ID = param('user_ID', 'integer', 0, true);
// Create result set:
$SQL = new SQL();
$SQL->SELECT('SQL_NO_CACHE sess_ID, user_login, TIMESTAMPDIFF( SECOND, sess_start_ts, sess_lastseen_ts ) as sess_length, sess_lastseen_ts, sess_ipaddress');
$SQL->FROM('T_sessions LEFT JOIN T_users ON sess_user_ID = user_ID');
$Count_SQL = new SQL();
$Count_SQL->SELECT('SQL_NO_CACHE COUNT(sess_ID)');
$Count_SQL->FROM('T_sessions LEFT JOIN T_users ON sess_user_ID = user_ID');
if (empty($user_ID)) {
    // display only this user sessions in user tab
    $user_ID = $edited_User->ID;
}
$SQL->WHERE('user_ID = ' . $user_ID);
$Count_SQL->WHERE('user_ID = ' . $user_ID);
memorize_param('user_tab', 'string', '', $user_tab);
// Begin payload block:
$this->disp_payload_begin();
// ------------------- PREV/NEXT USER LINKS -------------------
user_prevnext_links(array('user_tab' => 'sessions'));
// ------------- END OF PREV/NEXT USER LINKS -------------------
$Results = new Results($SQL->get(), 'sess_', 'D', $UserSettings->get('results_per_page'), $Count_SQL->get());
// echo user edit action icons
echo_user_actions($Results, $edited_User, 'edit');
echo '<span class="floatright">' . $Results->gen_global_icons() . '</span>';
$Results->global_icons = array();
// echo user tabs
echo '<div>' . get_usertab_header($edited_User, $user_tab, T_('Sessions') . get_manual_link('user-sessions-tab')) . '</div>';
$Results->title = T_('Recent sessions') . get_manual_link('user-sessions-tab');
/**
 * Callback to add filters on top of the result set
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_stats_sessions_list.view.php

示例13: param


//.........这里部分代码省略.........
                $Debuglog->add('param(-): <strong>' . $var . '</strong> as ' . $type, 'params');
                if ($GLOBALS[$var] === array() && $strict_typing === false && $use_default) {
                    // We want to consider empty values as invalid and fall back to the default value:
                    $GLOBALS[$var] = $default;
                }
                break;
            default:
                if (utf8_substr($type, 0, 1) == '/') {
                    // We want to match against a REGEXP:
                    if (!is_scalar($GLOBALS[$var])) {
                        // This happens if someone uses "foo[]=x" where "foo" is expected as string
                        debug_die('param(-): <strong>' . $var . '</strong> is not scalar!');
                    } elseif (preg_match($type, $GLOBALS[$var])) {
                        // Okay, match
                        if (isset($Debuglog)) {
                            $Debuglog->add('param(-): <strong>' . $var . '</strong> matched against ' . $type, 'params');
                        }
                    } elseif ($strict_typing == 'allow_empty' && empty($GLOBALS[$var])) {
                        // No match but we accept empty value:
                        if (isset($Debuglog)) {
                            $Debuglog->add('param(-): <strong>' . $var . '</strong> is empty: ok', 'params');
                        }
                    } elseif ($strict_typing) {
                        // We cannot accept this MISMATCH:
                        bad_request_die(sprintf(T_('Illegal value received for parameter &laquo;%s&raquo;!'), $var));
                    } else {
                        // Fall back to default:
                        $GLOBALS[$var] = $default;
                        if (isset($Debuglog)) {
                            $Debuglog->add('param(-): <strong>' . $var . '</strong> DID NOT match ' . $type . ' set to default value=' . $GLOBALS[$var], 'params');
                        }
                    }
                    // From now on, consider this as a string: (we need this when memorizing)
                    $type = 'string';
                } elseif ($GLOBALS[$var] === '') {
                    // Special handling of empty values.
                    if ($strict_typing === false && $use_default) {
                        // ADDED BY FP 2006-07-06
                        // We want to consider empty values as invalid and fall back to the default value:
                        $GLOBALS[$var] = $default;
                    } else {
                        // We memorize the empty value as NULL:
                        // fplanque> note: there might be side effects to this, but we need
                        // this to distinguish between 0 and 'no input'
                        // Note: we do this after regexps because we may or may not want to allow empty strings in regexps
                        $GLOBALS[$var] = NULL;
                        if (isset($Debuglog)) {
                            $Debuglog->add('param(-): <strong>' . $var . '</strong> set to NULL', 'params');
                        }
                    }
                } else {
                    if ($strict_typing) {
                        // We want to make sure the value is valid:
                        $regexp = '';
                        switch ($type) {
                            case 'boolean':
                                $regexp = '/^(0|1|false|true)$/i';
                                break;
                            case 'integer':
                                $regexp = '/^(\\+|-)?[0-9]+$/';
                                break;
                            case 'float':
                            case 'double':
                                $regexp = '/^(\\+|-)?[0-9]+(.[0-9]+)?$/';
                                break;
                            default:
                                // Note: other types are not tested and they are not allowed without testing.
                                debug_die('Invalid parameter type!');
                        }
                        if ($strict_typing == 'allow_empty' && empty($GLOBALS[$var])) {
                            // We have an empty value and we accept it
                            // ok..
                        } elseif (!empty($regexp)) {
                            if ($type == 'boolean' && strtolower($GLOBALS[$var]) == 'false') {
                                // 'false' string must be interpreted as boolean false value
                                $GLOBALS[$var] = false;
                            } elseif (!is_scalar($GLOBALS[$var]) || !preg_match($regexp, $GLOBALS[$var])) {
                                // Value of scalar var does not match!
                                bad_request_die(sprintf(T_('Illegal value received for parameter &laquo;%s&raquo;!'), $var));
                            }
                        }
                    }
                    // Change the variable type:
                    settype($GLOBALS[$var], $type);
                    if (isset($Debuglog)) {
                        $Debuglog->add('param(-): <strong>' . var_export($var, true) . '</strong> typed to ' . $type . ', new value=' . var_export($GLOBALS[$var], true), 'params');
                    }
                }
        }
    }
    /*
     * STEP 3: memorize the value for later url regeneration
     */
    if ($memorize) {
        // Memorize this parameter
        memorize_param($var, $type, $default);
    }
    // echo $var, '(', gettype($GLOBALS[$var]), ')=', $GLOBALS[$var], '<br />';
    return $GLOBALS[$var];
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:101,代码来源:_param.funcs.php

示例14: debug_die

/**
 * @var current action
 */
global $action;
/**
 * @var user permission, if user is only allowed to edit his profile
 */
global $user_profile_only;
global $user_tab, $user_ID;
global $current_User, $UserSettings;
if (!$current_User->check_perm('users', 'edit')) {
    // Check permission:
    debug_die(T_('You have no permission to see this tab!'));
}
memorize_param('user_tab', 'string', '', $user_tab);
memorize_param('user_ID', 'integer', 0, $user_ID);
// ------------------- PREV/NEXT USER LINKS -------------------
user_prevnext_links(array('block_start' => '<table class="prevnext_user"><tr>', 'prev_start' => '<td width="33%">', 'prev_end' => '</td>', 'prev_no_user' => '<td width="33%">&nbsp;</td>', 'back_start' => '<td width="33%" class="back_users_list">', 'back_end' => '</td>', 'next_start' => '<td width="33%" class="right">', 'next_end' => '</td>', 'next_no_user' => '<td width="33%">&nbsp;</td>', 'block_end' => '</tr></table>', 'user_tab' => 'activity'));
// ------------- END OF PREV/NEXT USER LINKS -------------------
if (!$user_profile_only) {
    // echo user edit action icons
    $Widget = new Widget();
    echo_user_actions($Widget, $edited_User, 'edit');
    echo '<span class="floatright">' . $Widget->gen_global_icons() . '</span>';
}
echo '<div>' . get_usertab_header($edited_User, $user_tab, $current_User->ID == $edited_User->ID ? T_('My Activity') : T_('User Activity')) . '</div>';
// Display IP address from where this user was created
echo '<div style="margin-top:25px;font-weight:bold;"><span>' . T_('User created from IP') . ': ' . int2ip($UserSettings->get('created_fromIPv4', $edited_User->ID)) . '</span></div>';
/**** Reports from edited user  ****/
user_reports_results_block(array('edited_User' => $edited_User));
evo_flush();
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_user_activity.view.php

示例15: param


//.........这里部分代码省略.........
                    // TODO: dh> debug_die() instead?
                    $GLOBALS[$var] = '';
                    $Debuglog->add('param(-): <strong>' . $var . '</strong> is not scalar!', 'params');
                } else {
                    $GLOBALS[$var] = trim(strip_tags($GLOBALS[$var]));
                    // Make sure the string is a single line
                    $GLOBALS[$var] = preg_replace('¤\\r|\\n¤', '', $GLOBALS[$var]);
                }
                $Debuglog->add('param(-): <strong>' . $var . '</strong> as string', 'params');
                break;
            default:
                if (substr($type, 0, 1) == '/') {
                    // We want to match against a REGEXP:
                    if (preg_match($type, $GLOBALS[$var])) {
                        // Okay, match
                        if (isset($Debuglog)) {
                            $Debuglog->add('param(-): <strong>' . $var . '</strong> matched against ' . $type, 'params');
                        }
                    } elseif ($strict_typing == 'allow_empty' && empty($GLOBALS[$var])) {
                        // No match but we accept empty value:
                        if (isset($Debuglog)) {
                            $Debuglog->add('param(-): <strong>' . $var . '</strong> is empty: ok', 'params');
                        }
                    } elseif ($strict_typing) {
                        // We cannot accept this MISMATCH:
                        bad_request_die(sprintf(T_('Illegal value received for parameter &laquo;%s&raquo;!'), $var));
                    } else {
                        // Fall back to default:
                        $GLOBALS[$var] = $default;
                        if (isset($Debuglog)) {
                            $Debuglog->add('param(-): <strong>' . $var . '</strong> DID NOT match ' . $type . ' set to default value=' . $GLOBALS[$var], 'params');
                        }
                    }
                    // From now on, consider this as a string: (we need this when memorizing)
                    $type = 'string';
                } elseif ($GLOBALS[$var] === '') {
                    // Special handling of empty values.
                    if ($strict_typing === false && $use_default) {
                        // ADDED BY FP 2006-07-06
                        // We want to consider empty values as invalid and fall back to the default value:
                        $GLOBALS[$var] = $default;
                    } else {
                        // We memorize the empty value as NULL:
                        // fplanque> note: there might be side effects to this, but we need
                        // this to distinguish between 0 and 'no input'
                        // Note: we do this after regexps because we may or may not want to allow empty strings in regexps
                        $GLOBALS[$var] = NULL;
                        if (isset($Debuglog)) {
                            $Debuglog->add('param(-): <strong>' . $var . '</strong> set to NULL', 'params');
                        }
                    }
                } elseif ($GLOBALS[$var] === array()) {
                    if ($strict_typing === false && $use_default) {
                        // ADDED BY FP 2006-09-07
                        // We want to consider empty values as invalid and fall back to the default value:
                        $GLOBALS[$var] = $default;
                    }
                } else {
                    if ($strict_typing) {
                        // We want to make sure the value is valid:
                        $regexp = '';
                        switch ($type) {
                            case 'boolean':
                                $regexp = '/^(0|1|false|true)$/i';
                                break;
                            case 'integer':
                                $regexp = '/^(\\+|-)?[0-9]+$/';
                                break;
                            case 'float':
                            case 'double':
                                $regexp = '/^(\\+|-)?[0-9]+(.[0-9]+)?$/';
                                break;
                                // Note: other types are not tested here.
                        }
                        if ($strict_typing == 'allow_empty' && empty($GLOBALS[$var])) {
                            // We have an empty value and we accept it
                            // ok..
                        } elseif (!empty($regexp) && (!is_scalar($GLOBALS[$var]) || !preg_match($regexp, $GLOBALS[$var]))) {
                            // Value does not match!
                            bad_request_die(sprintf(T_('Illegal value received for parameter &laquo;%s&raquo;!'), $var));
                        }
                    }
                    // Change the variable type:
                    settype($GLOBALS[$var], $type);
                    if (isset($Debuglog)) {
                        $Debuglog->add('param(-): <strong>' . $var . '</strong> typed to ' . $type . ', new value=' . $GLOBALS[$var], 'params');
                    }
                }
        }
    }
    /*
     * STEP 3: memorize the value for later url regeneration
     */
    if ($memorize) {
        // Memorize this parameter
        memorize_param($var, $type, $default);
    }
    // echo $var, '(', gettype($GLOBALS[$var]), ')=', $GLOBALS[$var], '<br />';
    return $GLOBALS[$var];
}
开发者ID:LFSF,项目名称:oras,代码行数:101,代码来源:_param.funcs.php


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