• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP set_user_setting函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: save_settings

function save_settings()
{
    validate_request_vars();
    if (sizeof($_REQUEST)) {
        foreach ($_REQUEST as $var => $value) {
            switch ($var) {
                case 'timespan':
                    set_user_setting('cycle_timespan', get_request_var('timespan'));
                    break;
                case 'refresh':
                    set_user_setting('cycle_delay', get_request_var('refresh'));
                    break;
                case 'graphs':
                    set_user_setting('cycle_graphs', get_request_var('graphs'));
                    break;
                case 'cols':
                    set_user_setting('cycle_columns', get_request_var('cols'));
                    break;
                case 'height':
                    set_user_setting('cycle_height', get_request_var('height'));
                    break;
                case 'width':
                    set_user_setting('cycle_width', get_request_var('width'));
                    break;
                case 'legend':
                    set_user_setting('cycle_legend', get_request_var('legend'));
                    break;
                case 'filter':
                    set_user_setting('cycle_filter', get_request_var('filter'));
                    break;
            }
        }
    }
    validate_request_vars(true);
}
开发者ID:Cacti,项目名称:plugin_cycle,代码行数:35,代码来源:functions.php


示例2: independent_publisher_setup

 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which runs
  * before the init hook. The init hook is too late for some features, such as indicating
  * support post thumbnails.
  *
  * @since Independent Publisher 1.0
  */
 function independent_publisher_setup()
 {
     /**
      * Custom template tags for this theme.
      */
     require get_stylesheet_directory() . '/inc/template-tags.php';
     /**
      * Customizer additions.
      */
     require get_stylesheet_directory() . '/inc/customizer.php';
     /**
      * Make theme available for translation
      * Translations can be filed in the /languages/ directory
      */
     load_theme_textdomain('independent-publisher', get_stylesheet_directory() . '/languages');
     /**
      * Add default posts and comments RSS feed links to head
      */
     add_theme_support('automatic-feed-links');
     /**
      * Enable Custom Backgrounds
      */
     add_theme_support('custom-background', apply_filters('independent_publisher_custom_background_args', array('default-color' => 'ffffff', 'default-image' => '')));
     // Enable support for HTML5 markup.
     add_theme_support('html5', array('comment-list', 'search-form', 'comment-form', 'gallery'));
     /**
      * Enable Post Thumbnails
      */
     add_theme_support('post-thumbnails');
     /*
      * Add custom thumbnail size for use with featured images
      */
     add_image_size('independent_publisher_post_thumbnail', 700, 700);
     /**
      * Enable editor style
      */
     add_editor_style();
     /**
      * Set max width of full screen visual editor to match content width
      */
     set_user_setting('dfw_width', 700);
     /**
      * Set default value for Show Post Word Count theme option
      */
     add_option('independent_publisher_general_options', array('show_post_word_count' => true));
     /**
      * This theme uses wp_nav_menu() in two locations.
      */
     register_nav_menus(array('primary' => __('Primary Menu', 'independent-publisher'), 'single' => __('Single Posts Menu', 'independent-publisher'), 'social' => __('Social', 'independent-publisher')));
     /**
      * Add support for the Aside Post Formats
      */
     add_theme_support('post-formats', array('aside', 'link', 'gallery', 'status', 'quote', 'chat', 'image', 'video', 'audio'));
 }
开发者ID:caueira,项目名称:independent-publisher,代码行数:63,代码来源:functions.php


示例3: prepare_items

 /**
  *
  * @global string $usersearch
  * @global string $role
  * @global wpdb   $wpdb
  * @global string $mode
  */
 public function prepare_items()
 {
     global $usersearch, $role, $wpdb, $mode;
     $usersearch = isset($_REQUEST['s']) ? wp_unslash(trim($_REQUEST['s'])) : '';
     $users_per_page = $this->get_items_per_page('users_network_per_page');
     $role = isset($_REQUEST['role']) ? $_REQUEST['role'] : '';
     $paged = $this->get_pagenum();
     $args = array('number' => $users_per_page, 'offset' => ($paged - 1) * $users_per_page, 'search' => $usersearch, 'blog_id' => 0, 'fields' => 'all_with_meta');
     if (wp_is_large_network('users')) {
         $args['search'] = ltrim($args['search'], '*');
     } else {
         if ('' !== $args['search']) {
             $args['search'] = trim($args['search'], '*');
             $args['search'] = '*' . $args['search'] . '*';
         }
     }
     if ($role === 'super') {
         $logins = implode("', '", get_super_admins());
         $args['include'] = $wpdb->get_col("SELECT ID FROM {$wpdb->users} WHERE user_login IN ('{$logins}')");
     }
     /*
      * If the network is large and a search is not being performed,
      * show only the latest users with no paging in order to avoid
      * expensive count queries.
      */
     if (!$usersearch && wp_is_large_network('users')) {
         if (!isset($_REQUEST['orderby'])) {
             $_GET['orderby'] = $_REQUEST['orderby'] = 'id';
         }
         if (!isset($_REQUEST['order'])) {
             $_GET['order'] = $_REQUEST['order'] = 'DESC';
         }
         $args['count_total'] = false;
     }
     if (isset($_REQUEST['orderby'])) {
         $args['orderby'] = $_REQUEST['orderby'];
     }
     if (isset($_REQUEST['order'])) {
         $args['order'] = $_REQUEST['order'];
     }
     if (!empty($_REQUEST['mode'])) {
         $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
         set_user_setting('network_users_list_mode', $mode);
     } else {
         $mode = get_user_setting('network_users_list_mode', 'list');
     }
     /** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */
     $args = apply_filters('users_list_table_query_args', $args);
     // Query the user IDs for this page
     $wp_user_search = new WP_User_Query($args);
     $this->items = $wp_user_search->get_results();
     $this->set_pagination_args(array('total_items' => $wp_user_search->get_total(), 'per_page' => $users_per_page));
 }
开发者ID:idies,项目名称:escience-2016-wp,代码行数:60,代码来源:class-wp-ms-users-list-table.php


示例4: __construct

 /**
  * クラスの初期化
  *
  * @since    1.0.0
  * @param      object $blocks ブロックのインスタンス
  */
 public function __construct($blocks)
 {
     BCE_Utilis::set_option();
     // 自動最大高さ機能をオフ
     set_user_setting('editor_expand', 'off');
     $this->plugin_name = BCE_Utilis::get_plugin_name();
     $this->version = BCE_Utilis::get_version();
     $this->blocks = $blocks;
     add_filter('the_editor', array($this, 'the_editor'), 10, 1);
     add_action('wp_footer', array($this, 'output_locales'));
     add_action('admin_footer', array($this, 'output_locales'));
 }
开发者ID:1shiharat,项目名称:block-content-editor,代码行数:18,代码来源:class-bce-setup.php


示例5: get_user_setting

function get_user_setting($key, $should_set = true)
{
    global $default_user_settings, $mobile_detect;
    if (array_key_exists($key, $_COOKIE)) {
        return $_COOKIE[$key];
    } else {
        switch ($key) {
            case 'use_dialogs':
                $default_value = is_mobile_browser() ? 'no' : 'yes';
                break;
            default:
                $default_value = $default_user_settings[$key];
                break;
        }
        if ($should_set) {
            set_user_setting($key, $default_value);
        }
        return $default_value;
    }
}
开发者ID:nylen,项目名称:rtgui,代码行数:20,代码来源:functions.php


示例6: userUpdateLogin

/**
 * Updates the login time in the database of the given user
 * The login time is used to automatically logout users who have been
 * inactive for the defined session time
 * @param string $username	the username to update the login info for
 */
function userUpdateLogin($user_id)
{
    set_user_setting($user_id, 'sessiontime', time());
}
开发者ID:bitweaver,项目名称:phpgedview,代码行数:10,代码来源:authentication.php


示例7: do_xmlrpc

                 $response = do_xmlrpc(xmlrpc_encode_request($cmd, $params));
                 if (!response || @xmlrpc_is_fault($response)) {
                     $errors[] = "Failed to add torrent \"{$d_name}\" to rTorrent:\n\n" . print_r($response, true);
                 }
             }
         }
     }
     if (count($errors)) {
         array_unshift($errors, "One or more errors occurred:\n");
         $script = 'alert(' . json_encode($errors) . '.join("\\n"))';
     } else {
         if (is_array($r_tags)) {
             set_error_handler('handleError');
             try {
                 set_torrent_tags($r_add_torrent, $r_tags, array());
                 set_user_setting('new_torrent_tags', implode('|', $r_tags));
             } catch (Exception $e) {
                 restore_error_handler();
                 die('Error setting tags: ' . $e->getMessage());
             }
             restore_error_handler();
         }
         $script = 'closeWindow();';
     }
     print "<script type=\"text/javascript\">{$script}</script>\n";
     break;
 case 'delete_files':
     if (is_array($_SESSION['to_add_data'])) {
         foreach ($_SESSION['to_add_data'] as $data) {
             @unlink("{$tmp_add_dir}/" . $data['filename']);
         }
开发者ID:nylen,项目名称:rtgui,代码行数:31,代码来源:add-torrents.php


示例8: ajax_toggle_advanced_items

 /**
  * ajax_toggle_advanced_items function.
  * 
  * @access public
  * @return void
  */
 public function ajax_toggle_advanced_items()
 {
     $nonce = $_POST['beansidebars_advanced_noonce'];
     $status = $_POST['new_status'];
     //Add nonce security to the request
     if (!wp_verify_nonce($nonce, 'beansidebars_advanced_noonce')) {
         die;
     }
     $response = set_user_setting('beansidebarsshowadvanced', $status);
     echo $response;
     die;
     // WordPress may print out a spurious zero without this can be particularly bad if using JSON
 }
开发者ID:kaitlynhova,项目名称:kaitlynhova-wp-adventures,代码行数:19,代码来源:bean-admin-class.beanconditions.php


示例9: dirname

 * Widgets administration panel.
 *
 * @package WordPress
 * @subpackage Administration
 */
/** WordPress Administration Bootstrap */
require_once dirname(__FILE__) . '/admin.php';
/** WordPress Administration Widgets API */
require_once ABSPATH . 'wp-admin/includes/widgets.php';
if (!current_user_can('edit_theme_options')) {
    wp_die(__('Cheatin&#8217; uh?'), 403);
}
$widgets_access = get_user_setting('widgets_access');
if (isset($_GET['widgets-access'])) {
    $widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
    set_user_setting('widgets_access', $widgets_access);
}
function wp_widgets_access_body_class($classes)
{
    return "{$classes} widgets_access ";
}
if ('on' == $widgets_access) {
    add_filter('admin_body_class', 'wp_widgets_access_body_class');
} else {
    wp_enqueue_script('admin-widgets');
    if (wp_is_mobile()) {
        wp_enqueue_script('jquery-touch-punch');
    }
}
/**
 * Fires early before the Widgets administration screen loads,
开发者ID:luskyj89,项目名称:mt-wordpress,代码行数:31,代码来源:widgets.php


示例10: prepare_items

 /**
  *
  * @global string $s
  * @global string $mode
  * @global wpdb   $wpdb
  */
 public function prepare_items()
 {
     global $s, $mode, $wpdb;
     $current_site = get_current_site();
     if (!empty($_REQUEST['mode'])) {
         $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
         set_user_setting('sites_list_mode', $mode);
     } else {
         $mode = get_user_setting('sites_list_mode', 'list');
     }
     $per_page = $this->get_items_per_page('sites_network_per_page');
     $pagenum = $this->get_pagenum();
     $s = isset($_REQUEST['s']) ? wp_unslash(trim($_REQUEST['s'])) : '';
     $wild = '';
     if (false !== strpos($s, '*')) {
         $wild = '%';
         $s = trim($s, '*');
     }
     /*
      * If the network is large and a search is not being performed, show only
      * the latest sites with no paging in order to avoid expensive count queries.
      */
     if (!$s && wp_is_large_network()) {
         if (!isset($_REQUEST['orderby'])) {
             $_GET['orderby'] = $_REQUEST['orderby'] = '';
         }
         if (!isset($_REQUEST['order'])) {
             $_GET['order'] = $_REQUEST['order'] = 'DESC';
         }
     }
     $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
     if (empty($s)) {
         // Nothing to do.
     } elseif (preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/', $s) || preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.?$/', $s) || preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.?$/', $s) || preg_match('/^[0-9]{1,3}\\.$/', $s)) {
         // IPv4 address
         $sql = $wpdb->prepare("SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE %s", $wpdb->esc_like($s) . $wild);
         $reg_blog_ids = $wpdb->get_col($sql);
         if (!$reg_blog_ids) {
             $reg_blog_ids = array(0);
         }
         $query = "SELECT *\n\t\t\t\tFROM {$wpdb->blogs}\n\t\t\t\tWHERE site_id = '{$wpdb->siteid}'\n\t\t\t\tAND {$wpdb->blogs}.blog_id IN (" . implode(', ', $reg_blog_ids) . ")";
     } else {
         if (is_numeric($s) && empty($wild)) {
             $query .= $wpdb->prepare(" AND ( {$wpdb->blogs}.blog_id = %s )", $s);
         } elseif (is_subdomain_install()) {
             $blog_s = str_replace('.' . $current_site->domain, '', $s);
             $blog_s = $wpdb->esc_like($blog_s) . $wild . $wpdb->esc_like('.' . $current_site->domain);
             $query .= $wpdb->prepare(" AND ( {$wpdb->blogs}.domain LIKE %s ) ", $blog_s);
         } else {
             if ($s != trim('/', $current_site->path)) {
                 $blog_s = $wpdb->esc_like($current_site->path . $s) . $wild . $wpdb->esc_like('/');
             } else {
                 $blog_s = $wpdb->esc_like($s);
             }
             $query .= $wpdb->prepare(" AND  ( {$wpdb->blogs}.path LIKE %s )", $blog_s);
         }
     }
     $order_by = isset($_REQUEST['orderby']) ? $_REQUEST['orderby'] : '';
     if ($order_by === 'registered') {
         $query .= ' ORDER BY registered ';
     } elseif ($order_by === 'lastupdated') {
         $query .= ' ORDER BY last_updated ';
     } elseif ($order_by === 'blogname') {
         if (is_subdomain_install()) {
             $query .= ' ORDER BY domain ';
         } else {
             $query .= ' ORDER BY path ';
         }
     } elseif ($order_by === 'blog_id') {
         $query .= ' ORDER BY blog_id ';
     } else {
         $order_by = null;
     }
     if (isset($order_by)) {
         $order = isset($_REQUEST['order']) && 'DESC' === strtoupper($_REQUEST['order']) ? "DESC" : "ASC";
         $query .= $order;
     }
     // Don't do an unbounded count on large networks
     if (!wp_is_large_network()) {
         $total = $wpdb->get_var(str_replace('SELECT *', 'SELECT COUNT( blog_id )', $query));
     }
     $query .= " LIMIT " . intval(($pagenum - 1) * $per_page) . ", " . intval($per_page);
     $this->items = $wpdb->get_results($query, ARRAY_A);
     if (wp_is_large_network()) {
         $total = count($this->items);
     }
     $this->set_pagination_args(array('total_items' => $total, 'per_page' => $per_page));
 }
开发者ID:idies,项目名称:escience-2016-wp,代码行数:94,代码来源:class-wp-ms-sites-list-table.php


示例11: hide_forever

 /**
  * Hide the WooTransmitter notification forever, if desired.
  * @since  1.0.0
  * @return void
  */
 public function hide_forever()
 {
     if (is_user_logged_in() && isset($_GET['wootransmitter-hide']) && $_GET['wootransmitter-hide'] == 'yes' && isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'wootransmitter-hide')) {
         set_user_setting('wootransmitterbridgehide', '1');
         $redirect = remove_query_arg(array('wootransmitter-hide', '_wpnonce'), $this->current_url());
         wp_safe_redirect($redirect);
         exit;
     }
 }
开发者ID:TyRichards,项目名称:river_of_life,代码行数:14,代码来源:transmitter-installer.class.php


示例12: accept_changes

/**
* Accpet changed gedcom record into database
*
* This function gets an updated record from the gedcom file and replaces it in the database
* @author John Finlay
* @param string $cid The change id of the record to accept
*/
function accept_changes($cid)
{
    global $pgv_changes, $GEDCOM, $TBLPREFIX, $FILE, $GEDCOMS;
    global $INDEX_DIRECTORY, $SYNC_GEDCOM_FILE, $fcontents, $manual_save;
    if (isset($pgv_changes[$cid])) {
        $changes = $pgv_changes[$cid];
        $change = $changes[count($changes) - 1];
        if ($GEDCOM != $change["gedcom"]) {
            $GEDCOM = $change["gedcom"];
        }
        $FILE = $GEDCOM;
        $gid = $change["gid"];
        $gedrec = $change["undo"];
        if (empty($gedrec)) {
            $gedrec = find_gedcom_record($gid);
        }
        update_record($gedrec, $change["type"] == "delete");
        //-- write the changes back to the gedcom file
        if ($SYNC_GEDCOM_FILE) {
            // TODO: We merge CONC lines on import, so need to add them back on export
            if (!isset($manual_save) || $manual_save == false) {
                //-- only allow one thread to accept changes at a time
                //				$mutex = new Mutex("accept_changes");
                //				$mutex->Wait();
            }
            if (empty($fcontents)) {
                read_gedcom_file();
            }
            if ($change["type"] == "delete") {
                $pos1 = find_newline_string($fcontents, "0 @{$gid}@");
                if ($pos1 !== false) {
                    $pos2 = find_newline_string($fcontents, "0", $pos1 + 5);
                    if ($pos2 === false) {
                        $fcontents = substr($fcontents, 0, $pos1) . '0 TRLR' . PGV_EOL;
                        AddToLog("Corruption found in GEDCOM {$GEDCOM} Attempted to correct");
                    } else {
                        $fcontents = substr($fcontents, 0, $pos1) . substr($fcontents, $pos2);
                    }
                } else {
                    AddToLog("Corruption found in GEDCOM {$GEDCOM} Attempted to correct.  Deleted gedcom record {$gid} was not found in the gedcom file.");
                }
            } elseif ($change["type"] == "append") {
                $pos1 = find_newline_string($fcontents, "0 TRLR");
                $fcontents = substr($fcontents, 0, $pos1) . reformat_record_export($gedrec) . '0 TRLR' . PGV_EOL;
            } elseif ($change["type"] == "replace") {
                $pos1 = find_newline_string($fcontents, "0 @{$gid}@");
                if ($pos1 !== false) {
                    $pos2 = find_newline_string($fcontents, "0", $pos1 + 5);
                    if ($pos2 === false) {
                        $fcontents = substr($fcontents, 0, $pos1) . '0 TRLR' . PGV_EOL;
                        AddToLog("Corruption found in GEDCOM {$GEDCOM} Attempted to correct");
                    } else {
                        $fcontents = substr($fcontents, 0, $pos1) . reformat_record_export($gedrec) . substr($fcontents, $pos2);
                    }
                } else {
                    //-- attempted to replace a record that doesn't exist
                    AddToLog("Corruption found in GEDCOM {$GEDCOM} Attempted to correct.  Replaced gedcom record {$gid} was not found in the gedcom file.");
                    $pos1 = find_newline_string($fcontents, "0 TRLR");
                    $fcontents = substr($fcontents, 0, $pos1) . reformat_record_export($gedrec) . '0 TRLR' . PGV_EOL;
                    AddToLog("Gedcom record {$gid} was appended back to the GEDCOM file.");
                }
            }
            if (!isset($manual_save) || $manual_save == false) {
                write_file();
                //				$mutex->Release();
            }
        }
        if ($change["type"] != "delete") {
            //-- synchronize the gedcom record with any user account
            $username = get_user_from_gedcom_xref($GEDCOM, $gid);
            if ($username && get_user_setting($username, 'sync_gedcom') == 'Y') {
                $firstname = get_gedcom_value("GIVN", 2, $gedrec);
                $lastname = get_gedcom_value("SURN", 2, $gedrec);
                if (empty($lastname)) {
                    $fullname = get_gedcom_value("NAME", 1, $gedrec, "", false);
                    $ct = preg_match("~(.*)/(.*)/~", $fullname, $match);
                    if ($ct > 0) {
                        $firstname = $match[1];
                        $lastname = $match[2];
                    } else {
                        $firstname = $fullname;
                    }
                }
                //-- SEE [ 1753047 ] Email/sync with account
                $email = get_gedcom_value("EMAIL", 1, $gedrec);
                if (empty($email)) {
                    $email = get_gedcom_value("_EMAIL", 1, $gedrec);
                }
                if (!empty($email)) {
                    set_user_setting($username, 'email', $email);
                }
                set_user_setting($username, 'firstname', $firstname);
                set_user_setting($username, 'lastname', $lastname);
//.........这里部分代码省略.........
开发者ID:bitweaver,项目名称:phpgedview,代码行数:101,代码来源:functions_import.php


示例13: set_user_gedcom_setting

function set_user_gedcom_setting($user_id, $ged_id, $parameter, $value)
{
    $ged_name = get_gedcom_from_id($ged_id);
    $tmp = get_user_setting($user_id, $parameter);
    if (is_string($tmp)) {
        $tmp_array = unserialize($tmp);
        if (!is_array($tmp_array)) {
            $tmp_array = array();
        }
    } else {
        $tmp_array = array();
    }
    if (empty($value)) {
        // delete the value
        unset($tmp_array[$ged_name]);
    } else {
        // update the value
        $tmp_array[$ged_name] = $value;
    }
    set_user_setting($user_id, $parameter, serialize($tmp_array));
    global $PGV_USERS_cache;
    if (isset($PGV_USERS_cache[$user_id])) {
        unset($PGV_USERS_cache[$user_id]);
    }
}
开发者ID:bitweaver,项目名称:phpgedview,代码行数:25,代码来源:functions_db.php


示例14: rtgui_session_start

//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with rtGui.  If not, see <http://www.gnu.org/licenses/>.
require_once 'config.php';
require_once 'functions.php';
rtgui_session_start();
extract($_REQUEST, EXTR_PREFIX_ALL, 'r');
if ($r_operation == 'save_settings') {
    set_user_setting('refresh_interval', $r_set_refresh);
    rtorrent_xmlrpc('set_upload_rate', array($r_set_max_up));
    rtorrent_xmlrpc('set_download_rate', array($r_set_max_down));
    set_user_setting('theme', $r_set_theme);
    set_user_setting('use_dialogs', $r_set_use_dialogs ? 'yes' : 'no');
    set_user_setting('show_hidden', $r_set_show_hidden ? 'yes' : 'no');
}
$download_cap = rtorrent_xmlrpc('get_download_rate');
$upload_cap = rtorrent_xmlrpc('get_upload_rate');
if (isset($r_submit)) {
    if ($r_dialog) {
        echo <<<JS
<script type="text/javascript">
window.top.reloadUserSettings();
window.top.hideDialog(true);
</script>
JS;
    } else {
        header('Location: .');
    }
    die;
开发者ID:nylen,项目名称:rtgui,代码行数:31,代码来源:settings.php


示例15: wp_die

<?php

global $current_screen;
/** WordPress Administration fields API */
//require_once(ABSPATH . 'wp-admin/includes/fields.php');
//require( SCF_DIR . '/inc/functions.widget.php');
if (!current_user_can('edit_theme_options')) {
    wp_die(__('Cheatin&#8217; uh?'));
}
wp_admin_css('widgets', true);
$fields_access = get_user_setting('widgets_access');
if (isset($_GET['fields-access'])) {
    $fields_access = 'on' == $_GET['fields-access'] ? 'on' : 'off';
    set_user_setting('widgets_access', $fields_access);
}
if ('on' == $fields_access) {
    add_filter('admin_body_class', create_function('', '{return " widgets_access ";}'));
} else {
    wp_enqueue_script('admin-widgets');
}
do_action('sidebar_admin_setup');
$title = __('Page Fields', 'custom_fields');
$parent_file = 'themes.php';
$help = '
	<p>' . __('fields are independent sections of content that can be placed into any fieldized area provided by your theme (commonly called sidebars). To populate your sidebars/field areas with individual fields, drag and drop the title bars into the desired area. By default, only the first field area is expanded. To populate additional field areas, click on their title bars to expand them.') . '</p>
	<p>' . __('Available fields section contains all the fields you can choose from. Once you drag a field into a sidebar, it will open to allow you to configure its settings. When you are happy with the field settings, click the Save button and the field will go live on your site. If you click Delete, it will remove the field.') . '</p>
	<p>' . __('If you want to remove the field but save its setting for possible future use, just drag it into the Inactive fields area. You can add them back anytime from there. This is especially helpful when you switch to a theme with less or different field areas.') . '</p>
	<p>' . __('fields may be used multiple times. You can give each field a title, to display on your site, but it&#8217;s not required.') . '</p>
	<p>' . __('Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.') . '</p>
';
$help .= '<p><strong>' . __('For more information:') . '</strong></p>';
开发者ID:emaxees,项目名称:elpandecadadia,代码行数:31,代码来源:admin.tpl.php


示例16: VALUES

 $controller->setPageTitle(WT_I18N::translate('User verification'));
 $controller->pageHeader();
 echo '<div id="login-register-page">';
 echo '<h2>' . WT_I18N::translate('User verification') . '</h2>';
 echo '<div id="user-verify">';
 echo WT_I18N::translate('The data for the user <b>%s</b> was checked.', $user_name);
 if ($user) {
     if ($user->checkPassword($user_password) && $user->getSetting('reg_hashcode') == $user_hashcode) {
         WT_Mail::send($WT_TREE, $webmaster->getEmail(), $webmaster->getRealName(), $WEBTREES_EMAIL, $WEBTREES_EMAIL, $mail1_subject, $mail1_body);
         $mail1_method = $webmaster->getSetting('CONTACT_METHOD');
         if ($mail1_method != 'messaging3' && $mail1_method != 'mailto' && $mail1_method != 'none') {
             WT_DB::prepare("INSERT INTO `##message` (sender, ip_address, user_id, subject, body) VALUES (? ,? ,? ,? ,?)")->execute(array($user_name, $WT_REQUEST->getClientIp(), $webmaster->getUserId(), $mail1_subject, WT_Filter::unescapeHtml($mail1_body)));
         }
         $user->setSetting('verified', 1)->setSetting('reg_timestamp', date("U"))->setSetting('reg_hashcode', null);
         if (!$REQUIRE_ADMIN_AUTH_REGISTRATION) {
             set_user_setting($user_id, 'verified_by_admin', 1);
         }
         Log::addAuthenticationLog('User ' . $user_name . ' verified their email address');
         echo '<br><br>' . WT_I18N::translate('You have confirmed your request to become a registered user.') . '<br><br>';
         if ($REQUIRE_ADMIN_AUTH_REGISTRATION && !$user->getSetting('verified_by_admin')) {
             echo WT_I18N::translate('The administrator has been informed.  As soon as he gives you permission to login, you can login with your user name and password.');
         } else {
             echo WT_I18N::translate('You can now login with your user name and password.');
         }
         echo '<br><br>';
     } else {
         Log::addAuthenticationLog('User ' . $user_name . ' failed to verify their email address');
         echo '<br><br>';
         echo '<span class="warning">';
         echo WT_I18N::translate('Data was not correct, please try again');
         echo '</span><br><br>';
开发者ID:sadr110,项目名称:webtrees,代码行数:31,代码来源:login.php


示例17: import

 /**
  * Import users etc. from index files
  *
  */
 function import()
 {
     global $INDEX_DIRECTORY, $TBLPREFIX, $pgv_lang, $GEDCOMS, $GEDCOM, $gBitDb;
     if (file_exists($INDEX_DIRECTORY . "authenticate.php") == false) {
         $this->impSuccess = false;
         return;
     } else {
         require $INDEX_DIRECTORY . "authenticate.php";
         $countold = count($users);
         $gBitDb->query("DELETE FROM {$TBLPREFIX}users");
         foreach ($users as $username => $user) {
             if ($user["editaccount"] == "1") {
                 $user["editaccount"] = "Y";
             } else {
                 $user["editaccount"] = "N";
             }
             //-- make sure fields are set for v4.0 DB
             if (!isset($user["firstname"])) {
                 if (isset($user["fullname"])) {
                     $parts = explode(' ', trim($user["fullname"]));
                     $user["lastname"] = array_pop($parts);
                     $user["firstname"] = implode(" ", $parts);
                 } else {
                     $user["firstname"] = '';
                     $user["lastname"] = '';
                 }
             }
             if (!isset($user["comment"])) {
                 $user["comment"] = '';
             }
             if (!isset($user["comment_exp"])) {
                 $user["comment_exp"] = '';
             }
             if (!isset($user["sync_gedcom"])) {
                 $user["sync_gedcom"] = 'N';
             }
             if (!isset($user["relationship_privacy"])) {
                 $user["relationship_privacy"] = 'N';
             }
             if (!isset($user["max_relation_path"])) {
                 $user["max_relation_path"] = '2';
             }
             if (!isset($user["auto_accept"])) {
                 $user["auto_accept"] = 'N';
             }
             if ($user_id = create_user($user['username'], $user['password'])) {
                 set_user_setting($user_id, 'firstname', $user["firstname"]);
                 set_user_setting($user_id, 'lastname', $user["lastname"]);
                 set_user_setting($user_id, 'email', $user["email"]);
                 set_user_setting($user_id, 'theme', $user["theme"]);
                 set_user_setting($user_id, 'language', $user["language"]);
                 set_user_setting($user_id, 'contactmethod', $user["contactmethod"]);
                 set_user_setting($user_id, 'defaulttab', $user["defaulttab"]);
                 set_user_setting($user_id, 'comment', $user["comment"]);
                 set_user_setting($user_id, 'comment_exp', $user["comment_exp"]);
                 set_user_setting($user_id, 'pwrequested', $user["pwrequested"]);
                 set_user_setting($user_id, 'reg_timestamp', $user["reg_timestamp"]);
                 set_user_setting($user_id, 'reg_hashcode', $user["reg_hashcode"]);
                 set_user_setting($user_id, 'loggedin', $user["loggedin"]);
                 set_user_setting($user_id, 'sessiontime', $user["sessiontime"]);
                 set_user_setting($user_id, 'max_relation_path', $user["max_relation_path"]);
                 set_user_setting($user_id, 'sync_gedcom', $user["sync_gedcom"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'relationship_privacy', $user["relationship_privacy"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'auto_accept', $user["auto_accept"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'canadmin', $user["canadmin"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'visibleonline', $user["visibleonline"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'editaccount', $user["editaccount"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'verified', $user["verified"] ? 'yes' : 'no');
                 set_user_setting($user_id, 'verified_by_admin', $user["verified_by_admin"] ? 'yes' : 'no');
                 foreach (array('gedcomid', 'rootid', 'canedit') as $var) {
                     if ($user[$var]) {
                         foreach (unserialize(stripslashes($user[$var])) as $gedcom => $id) {
                             set_user_gedcom_setting($user_id, $gedcom, $var, $id);
                         }
                     }
                 }
                 AddToLog("added user -> {$user['username']} <-");
             }
         }
         if ($countold == get_user_count()) {
             $this->impSuccess = true;
         } else {
             $this->impSuccess = false;
         }
     }
     if (file_exists($INDEX_DIRECTORY . "messages.dat") == false) {
         $this->msgSuccess = false;
     } else {
         $gBitDb->query("DELETE FROM {$TBLPREFIX}messages");
         $messages = array();
         $fp = fopen($INDEX_DIRECTORY . "messages.dat", "rb");
         $mstring = fread($fp, filesize($INDEX_DIRECTORY . "messages.dat"));
         fclose($fp);
         $messages = unserialize($mstring);
         foreach ($messages as $newid => $message) {
             $gBitDb->query("INSERT INTO {$TBLPREFIX}messages (m_id, m_from, m_to, m_subject, m_body, m_created) VALUES (?, ? ,? ,? ,? ,?)", array($newid, $message["from"], $message["to"], $message["subject"], $message["body"], $message["created"]));
//.........这里部分代码省略.........
开发者ID:bitweaver,项目名称:phpgedview,代码行数:101,代码来源:usermigrate_ctrl.php


示例18: prepare_items

 /**
  * Prepares the list of sites for display.
  *
  * @since 3.1.0
  * @since 4.6.0 Converted to use get_sites()
  *
  * @global string $s
  * @global string $mode
  * @global wpdb   $wpdb
  */
 public function prepare_items()
 {
     global $s, $mode, $wpdb;
     if (!empty($_REQUEST['mode'])) {
         $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
         set_user_setting('sites_list_mode', $mode);
     } else {
         $mode = get_user_setting('sites_list_mode', 'list');
     }
     $per_page = $this->get_items_per_page('sites_network_per_page');
     $pagenum = $this->get_pagenum();
     $s = isset($_REQUEST['s']) ? wp_unslash(trim($_REQUEST['s'])) : '';
     $wild = '';
     if (false !== strpos($s, '*')) {
         $wild = '*';
         $s = trim($s, '*');
     }
     /*
      * If the network is large and a search is not being performed, show only
      * the latest sites with no paging in order to avoid expensive count queries.
      */
     if (!$s && wp_is_large_network()) {
         if (!isset($_REQUEST['orderby'])) {
             $_GET['orderby'] = $_REQUEST['orderby'] = '';
         }
         if (!isset($_REQUEST['order'])) {
             $_GET['order'] = $_REQUEST['order'] = 'DESC';
         }
     }
     $args = array('number' => intval($per_page), 'offset' => intval(($pagenum - 1) * $per_page), 'network_id' => get_current_network_id());
     if (empty($s)) {
         // Nothing to do.
     } elseif (preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/', $s) || preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.?$/', $s) || preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.?$/', $s) || preg_match('/^[0-9]{1,3}\\.$/', $s)) {
         // IPv4 address
         $sql = $wpdb->prepare("SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE %s", $wpdb->esc_like($s) . (!empty($wild) ? '%' : ''));
         $reg_blog_ids = $wpdb->get_col($sql);
         if ($reg_blog_ids) {
             $args['site__in'] = $reg_blog_ids;
         }
     } elseif (is_numeric($s) && empty($wild)) {
         $args['ID'] = $s;
     } else {
         $args['search'] = $s;
         if (!is_subdomain_install()) {
             $args['search_columns'] = array('path');
         }
     }
     $order_by = isset($_REQUEST['orderby']) ? $_REQUEST['orderby'] : '';
     if ('registered' === $order_by) {
         // registered is a valid field name.
     } elseif ('lastupdated' === $order_by) {
         $order_by = 'last_updated';
     } elseif ('blogname' === $order_by) {
         if (is_subdomain_install()) {
             $order_by = 'domain';
         } else {
             $order_by = 'path';
         }
     } elseif ('blog_id' === $order_by) {
         $order_by = 'id';
     } elseif (!$order_by) {
         $order_by = false;
     }
     $args['orderby'] = $order_by;
     if ($order_by) {
         $args['order'] = isset($_REQUEST['order']) && 'DESC' === strtoupper($_REQUEST['order']) ? "DESC" : "ASC";
     }
     if (wp_is_large_network()) {
         $args['no_found_rows'] = true;
     } else {
         $args['no_found_rows'] = false;
     }
     /**
      * Filters the arguments for the site query in the sites list table.
      *
      * @since 4.6.0
      *
      * @param array $args An array of get_sites() arguments.
      */
     $args = apply_filters('ms_sites_list_table_query_args', $args);
     $_sites = get_sites($args);
     if (is_array($_sites)) {
         update_site_cache($_sites);
         $this->items = array_slice($_sites, 0, $per_page);
     }
     $total_sites = get_sites(array_merge($args, array('count' => true, 'offset' => 0, 'number' => 0)));
     $this->set_pagination_args(array('total_items' => $total_sites, 'per_page' => $per_page));
 }
开发者ID:pjsong,项目名称:WordPress,代码行数:98,代码来源:class-wp-ms-sites-list-table.php


示例19: save_settings

function save_settings()
{
    global $current_tab;
    syslog_request_validation($current_tab);
    if (sizeof($_REQUEST)) {
        foreach ($_REQUEST as $var => $value) {
            switch ($var) {
                case 'rows':
                    set_user_setting('syslog_rows', get_request_var(' 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP set_user_status函数代码示例发布时间:2022-05-15
下一篇:
PHP set_user_preferences函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap