コード例 #1
0
function cimy_switch_to_blog($meta = array())
{
    global $cimy_uef_plugins_dir;
    if (is_multisite() && $cimy_uef_plugins_dir == "plugins") {
        if (isset($meta["blog_id"])) {
            $mu_blog_id = intval($meta["blog_id"]);
        } else {
            if (isset($_GET["blog_id"])) {
                $mu_blog_id = intval($_GET["blog_id"]);
            } else {
                if (isset($_POST["blog_id"])) {
                    $mu_blog_id = intval($_POST["blog_id"]);
                } else {
                    $mu_blog_id = 1;
                }
            }
        }
        if (cimy_uef_mu_blog_exists($mu_blog_id)) {
            if (switch_to_blog($mu_blog_id)) {
                cimy_uef_set_tables();
            } else {
                $mu_blog_id = 1;
            }
        } else {
            $mu_blog_id = 1;
        }
    }
}
コード例 #2
0
    if (is_multisite()) {
        $cimy_uef_plugins_dir = __FILE__;
        if (!stristr($cimy_uef_plugins_dir, "mu-plugins") === false) {
            $prefix = $wpdb->base_prefix;
            $cimy_uef_plugins_dir = "mu-plugins";
        } else {
            $cimy_uef_plugins_dir = "plugins";
        }
    }
    $old_wpdb_data_table = $prefix . "cimy_data";
    $old_wpdb_fields_table = $prefix . "cimy_fields";
    $wpdb_data_table = $prefix . "cimy_uef_data";
    $wpdb_fields_table = $prefix . "cimy_uef_fields";
    $wpdb_wp_fields_table = $prefix . "cimy_uef_wp_fields";
}
cimy_uef_set_tables();
$cimy_uef_options = "cimy_uef_options";
$cimy_uef_options_descr = "Cimy User Extra Fields options are stored here and modified only by admin";
/*
RULES (stored into an associative array and serialized):
- 'min_length':			[int]		=> specify min length
[only for text, textarea, textarea-rich, password, picture, picture-url, avatar, file]
- 'exact_length':		[int]		=> specify exact length
[only for text, textarea, textarea-rich, password, picture, picture-url, avatar, file]
- 'max_length':			[int]		=> specify max length
[only for text, textarea, textarea-rich, password, picture, picture-url, avatar, file]
- 'email':			[true | false]	=> check or not for email syntax
[only for text, textarea, textarea-rich, password]
- 'can_be_empty':		[true | false]	=> field can or cannot be empty
[only for text, textarea, textarea-rich, password, picture, picture-url, dropdown, dropdown-multi, avatar, file]
- 'edit':
コード例 #3
0
ファイル: cimy_uef_functions.php プロジェクト: johangas/moped
function cimy_uef_blog_switched($new_blog_id, $prev_blog_id)
{
    cimy_uef_set_tables();
}