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

PHP get_blogaddress_by_id函数代码示例

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

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



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

示例1: login

/**
 * Change redirect upon login to user's My Catalog page
 *
 * @param string $redirect_to
 * @param string $request_redirect_to
 * @param \WP_User $user
 *
 * @return string
 */
function login($redirect_to, $request_redirect_to, $user)
{
    if (false === is_a($user, 'WP_User')) {
        // Unknown user, bail with default
        return $redirect_to;
    }
    if (is_super_admin($user->ID)) {
        // This is an admin, don't mess
        return $redirect_to;
    }
    $blogs = get_blogs_of_user($user->ID);
    if (array_key_exists(get_current_blog_id(), $blogs)) {
        // Yes, user has access to this blog
        return $redirect_to;
    }
    if ($user->primary_blog) {
        // Force redirect the user to their blog or, if they have more than one, to their catalog, bypass wp_safe_redirect()
        if (count($blogs) > 1) {
            $redirect = get_blogaddress_by_id($user->primary_blog) . 'wp-admin/index.php?page=pb_catalog';
        } else {
            $redirect = get_blogaddress_by_id($user->primary_blog) . 'wp-admin/';
        }
        location($redirect);
    }
    // User has no primary_blog? Make them sign-up for one
    return network_site_url('/wp-signup.php');
}
开发者ID:Emaratilicious,项目名称:oddibooks,代码行数:36,代码来源:pb-redirect.php


示例2: add_columns

 /**
  * Add colums to blog view
  *
  * @since	0.1
  * @param	$column_name  string
  * @param	$blog_id	  integer
  * @uses	switch_to_blog, mlp_get_available_languages_titles, _e, network_admin_url
  * 			mlp_get_language_flag, restore_current_blog, apply_filters
  * @return	$column_name  string
  */
 public function add_columns($column_name, $blog_id)
 {
     //render column value
     if ('mlp_interlinked' === $column_name) {
         switch_to_blog($blog_id);
         $interlinked = mlp_get_available_languages_titles();
         if (count($interlinked) < 2 || !is_array($interlinked)) {
             _e('nothing', 'multilingualpress');
             return;
         }
         $linked_blogs = array();
         echo '<div class="mlp_interlinked_blogs">';
         foreach ($interlinked as $interlinked_blog_id => $interlinked_blog_title) {
             if ($interlinked_blog_id == $blog_id) {
                 continue;
             }
             $linked_blogs[] = sprintf('<a href="%1$s">%2$s</a>', get_blogaddress_by_id($interlinked_blog_id), esc_html($interlinked_blog_title));
         }
         empty($linked_blogs) || (print join(' | ', $linked_blogs));
         echo '</div>';
         restore_current_blog();
     }
     $column_name = apply_filters('mlp_add_custom_columns', $column_name, $blog_id);
     return $column_name;
 }
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:35,代码来源:class-Mlp_Custom_Columns.php


示例3: get_blogaddress_by_id

 /**
  * Gets the URL for the blog with the given ID.
  *
  * This gets the URL for the requested blog when in multisite mode, or
  * for the root blog when running a standard installation.
  *
  * @param  int    $blog_id the ID of a blog
  * @return string          the URL for the blog
  *
  * @since 0.4
  */
 public static function get_blogaddress_by_id($blog_id)
 {
     if (function_exists('get_blogaddress_by_id')) {
         return get_blogaddress_by_id($blog_id);
     } else {
         return home_url();
     }
 }
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:19,代码来源:NXTClass.php


示例4: bw_display_blog

/**
 * Display information about a blog in a particular format
 *
 * 
 */
function bw_display_blog($id, $atts, $content)
{
    $bloginfo = bw_get_bloginfo($id);
    if ($bloginfo) {
        if (is_numeric($id)) {
            $url = get_blogaddress_by_id($id);
        } else {
            $url = get_blogaddress_by_name($id);
        }
        $blog = $bloginfo->blog_id;
        switch_to_blog($blog);
        if ($content) {
            e(bw_do_shortcode($content));
        } else {
            alink(null, $url, $bloginfo->blogname);
        }
        restore_current_blog();
    }
}
开发者ID:bobbingwide,项目名称:oik-ms,代码行数:24,代码来源:oik-blogs.php


示例5: printf

            } else {
                printf(__('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url());
            }
            echo '</p>';
        } else {
            ?>
				<h2><?php 
            _e('An error occurred during the activation');
            ?>
</h2>
				<?php 
            echo '<p>' . $result->get_error_message() . '</p>';
        }
    } else {
        extract($result);
        $url = get_blogaddress_by_id((int) $blog_id);
        $user = get_userdata((int) $user_id);
        ?>
			<h2><?php 
        _e('Your account is now active!');
        ?>
</h2>

			<div id="signup-welcome">
				<p><span class="h3"><?php 
        _e('Username:');
        ?>
</span> <?php 
        echo $user->user_login;
        ?>
</p>
开发者ID:openify,项目名称:wordpress-composer,代码行数:31,代码来源:wp-activate.php


示例6: wpmu_welcome_notification

/**
 * Notify a user that her blog activation has been successful.
 *
 * Filter 'wpmu_welcome_notification' to disable or bypass.
 *
 * Filter 'update_welcome_email' and 'update_welcome_subject' to
 * modify the content and subject line of the notification email.
 *
 * @since MU
 *
 * @param int $blog_id
 * @param int $user_id
 * @param string $password
 * @param string $title The new blog's title
 * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization.
 * @return bool
 */
function wpmu_welcome_notification($blog_id, $user_id, $password, $title, $meta = '')
{
    global $current_site;
    if (!apply_filters('wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta)) {
        return false;
    }
    $welcome_email = stripslashes(get_site_option('welcome_email'));
    if ($welcome_email == false) {
        $welcome_email = stripslashes(__('Dear User,

Your new SITE_NAME site has been successfully set up at:
BLOG_URL

You can log in to the administrator account with the following information:
Username: USERNAME
Password: PASSWORD
Log in here: BLOG_URLwp-login.php

We hope you enjoy your new site. Thanks!

--The Team @ SITE_NAME'));
    }
    $url = get_blogaddress_by_id($blog_id);
    $user = new WP_User($user_id);
    $welcome_email = str_replace('SITE_NAME', $current_site->site_name, $welcome_email);
    $welcome_email = str_replace('BLOG_TITLE', $title, $welcome_email);
    $welcome_email = str_replace('BLOG_URL', $url, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = apply_filters('update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = get_site_option('site_name') == '' ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_site->site_name)) {
        $current_site->site_name = 'WordPress';
    }
    $subject = apply_filters('update_welcome_subject', sprintf(__('New %1$s Site: %2$s'), $current_site->site_name, stripslashes($title)));
    wp_mail($user->user_email, $subject, $message, $message_headers);
    return true;
}
开发者ID:nhemsley,项目名称:wordpress,代码行数:61,代码来源:ms-functions.php


示例7: subsites_list

 /**
  * Get array of subsite simple urls keyed by their ID.
  *
  * @return array
  */
 public function subsites_list()
 {
     $subsites = array();
     if (!is_multisite()) {
         return $subsites;
     }
     $sites = wp_get_sites(array('limit' => 0));
     if (!empty($sites)) {
         foreach ($sites as $subsite) {
             $subsites[$subsite['blog_id']] = $this->simple_site_url(get_blogaddress_by_id($subsite['blog_id']));
         }
     }
     return $subsites;
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:19,代码来源:wpmdb-base.php


示例8: wpmu_welcome_notification

/**
 * Notify a user that their blog activation has been successful.
 *
 * Filter 'wpmu_welcome_notification' to disable or bypass.
 *
 * Filter 'update_welcome_email' and 'update_welcome_subject' to
 * modify the content and subject line of the notification email.
 *
 * @since MU
 *
 * @param int    $blog_id
 * @param int    $user_id
 * @param string $password
 * @param string $title    The new blog's title
 * @param array  $meta     Optional. Not used in the default function, but is passed along to hooks for customization.
 * @return bool
 */
function wpmu_welcome_notification($blog_id, $user_id, $password, $title, $meta = array())
{
    $current_site = get_current_site();
    /**
     * Filter whether to bypass the welcome email after site activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU
     *
     * @param int|bool $blog_id  Blog ID.
     * @param int      $user_id  User ID.
     * @param string   $password User password.
     * @param string   $title    Site title.
     * @param array    $meta     Signup meta data.
     */
    if (!apply_filters('wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_email');
    if ($welcome_email == false) {
        /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */
        $welcome_email = __('Howdy USERNAME,

Your new SITE_NAME site has been successfully set up at:
BLOG_URL

You can log in to the administrator account with the following information:

Username: USERNAME
Password: PASSWORD
Log in here: BLOG_URLwp-login.php

We hope you enjoy your new site. Thanks!

--The Team @ SITE_NAME');
    }
    $url = get_blogaddress_by_id($blog_id);
    $user = get_userdata($user_id);
    $welcome_email = str_replace('SITE_NAME', $current_site->site_name, $welcome_email);
    $welcome_email = str_replace('BLOG_TITLE', $title, $welcome_email);
    $welcome_email = str_replace('BLOG_URL', $url, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    /**
     * Filter the content of the welcome email after site activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU
     *
     * @param string $welcome_email Message body of the email.
     * @param int    $blog_id       Blog ID.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param string $title         Site title.
     * @param array  $meta          Signup meta data.
     */
    $welcome_email = apply_filters('update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = get_site_option('site_name') == '' ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_site->site_name)) {
        $current_site->site_name = 'WordPress';
    }
    /**
     * Filter the subject of the welcome email after site activation.
     *
     * @since MU
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_subject', sprintf(__('New %1$s Site: %2$s'), $current_site->site_name, wp_unslash($title)));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    return true;
}
开发者ID:Jitsufreak,项目名称:PJ,代码行数:97,代码来源:ms-functions.php


示例9: update_option

            }
            break;
    }
    update_option('allowedthemes', $allowed_themes);
    restore_current_blog();
    wp_safe_redirect(add_query_arg(array('id' => $id, $action => $n), $referer));
    exit;
}
if (isset($_GET['action']) && 'update-site' == $_GET['action']) {
    wp_safe_redirect($referer);
    exit;
}
add_thickbox();
add_screen_option('per_page', array('label' => _x('Themes', 'themes per page (screen options)')));
$site_url_no_http = preg_replace('#^http(s)?://#', '', get_blogaddress_by_id($id));
$title_site_url_linked = sprintf(__('Edit Site: <a href="%1$s">%2$s</a>'), get_blogaddress_by_id($id), $site_url_no_http);
$title = sprintf(__('Edit Site: %s'), $site_url_no_http);
$parent_file = 'sites.php';
$submenu_file = 'sites.php';
require ABSPATH . 'wp-admin/admin-header.php';
?>

<div class="wrap">
<?php 
screen_icon('ms-admin');
?>
<h2 id="edit-site"><?php 
echo $title_site_url_linked;
?>
</h2>
<h3 class="nav-tab-wrapper">
开发者ID:centaurustech,项目名称:base-system,代码行数:31,代码来源:site-themes.php


示例10: printf

                printf(__('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url('wp-login.php', 'login'), $signup->user_login, $signup->user_email, wp_lostpassword_url());
            } else {
                printf(__('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url());
            }
            echo '</p>';
        } else {
            ?>
				<h2><?php 
            _e('An error occurred during the activation');
            ?>
</h2>
				<?php 
            echo '<p>' . $result->get_error_message() . '</p>';
        }
    } else {
        $url = isset($result['blog_id']) ? get_blogaddress_by_id((int) $result['blog_id']) : '';
        $user = get_userdata((int) $result['user_id']);
        ?>
			<h2><?php 
        _e('Your account is now active!');
        ?>
</h2>

			<div id="signup-welcome">
				<p><span class="h3"><?php 
        _e('Username:');
        ?>
</span> <?php 
        echo $user->user_login;
        ?>
</p>
开发者ID:nihrain,项目名称:accelerate,代码行数:31,代码来源:wp-activate.php


示例11: rpr_preprocess_signup_form


//.........这里部分代码省略.........
                    } else {
                        _e('Site registration has been disabled.');
                        ?>
						</div>
						</div>
						<?php 
                        do_action('after_signup_form');
                        get_footer();
                        exit;
                    }
                    break;
                default:
                    return;
            }
            /* begin wp-activate page */
            $key = (string) $_REQUEST['key'];
            // wpmu_create_user, wpmu_welcome_user_notification, add_new_user_to_blog, do wpmu_activate_user action
            $result = wpmu_activate_signup($key);
            if (is_wp_error($result)) {
                if ('already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code()) {
                    $signup = $result->get_error_data();
                    ?>
					<h2><?php 
                    _e('Your account is now active!');
                    ?>
</h2>
					<?php 
                    echo '<p class="lead-in">';
                    if ($signup->domain . $signup->path == '') {
                        printf(__('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url('wp-login.php', 'login'), $signup->user_login, $signup->user_email, wp_lostpassword_url());
                    } else {
                        printf(__('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url());
                    }
                    echo '</p>';
                } else {
                    ?>
					<h2><?php 
                    _e('An error occurred during the activation');
                    ?>
</h2>
					<?php 
                    echo '<p>' . $result->get_error_message() . '</p>';
                }
            } else {
                //TODO: Why not reference $result->blog_id?
                extract($result);
                if (isset($blog_id)) {
                    $url = get_blogaddress_by_id((int) $blog_id);
                }
                $user = get_userdata((int) $user_id);
                ?>
				<h2><?php 
                _e('Your account is now active!');
                ?>
</h2>
				<div id="signup-welcome">
					<p><span class="h3"><?php 
                _e('Username:');
                ?>
</span> <?php 
                echo $user->user_login;
                ?>
</p>
					<p><span class="h3"><?php 
                _e('Password:');
                ?>
</span> <?php 
                echo $password;
                ?>
</p>
				</div>
				<?php 
                if (isset($blog_id) && $url != network_home_url('', 'http')) {
                    ?>
					<p class="view"><?php 
                    printf(__('Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Log in</a>'), $url, $url . 'wp-login.php');
                    ?>
</p>
				<?php 
                } else {
                    ?>
					<p class="view"><?php 
                    printf(__('Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.'), network_site_url('wp-login.php', 'login'), network_home_url());
                    ?>
</p>
				<?php 
                }
            }
            ?>
			</div>
			<script type="text/javascript">
				var key_input = document.getElementById('key');
				key_input && key_input.focus();
			</script>
			<?php 
            get_footer();
            ?>
			<?php 
            exit;
        }
开发者ID:bvassmer,项目名称:Register-Plus-Redux,代码行数:101,代码来源:rpr-signup.php


示例12: tml_display_activate

        /**
         * Outputs the activation page
         *
         * @since 6.1
         * @access public
         *
         * @param object $template Theme_My_Login_Template object
         */
        public function tml_display_activate(&$template)
        {
            global $blog_id;
            echo '<div class="login" id="theme-my-login' . esc_attr($template->get_option('instance')) . '">';
            if (empty($_GET['key']) && empty($_POST['key'])) {
                ?>

			<h2><?php 
                _e('Activation Key Required', 'theme-my-login');
                ?>
</h2>
			<form name="activateform" id="activateform" method="post" action="<?php 
                $template->the_action_url('activate');
                ?>
">
				<p>
					<label for="key<?php 
                $template->the_instance();
                ?>
"><?php 
                _e('Activation Key:', 'theme-my-login');
                ?>
</label>
					<br /><input type="text" name="key<?php 
                $template->the_instance();
                ?>
" id="key" value="" size="50" />
				</p>
				<p class="submit">
					<input id="submit<?php 
                $template->the_instance();
                ?>
" type="submit" name="Submit" class="submit" value="<?php 
                esc_attr_e('Activate', 'theme-my-login');
                ?>
" />
				</p>
			</form>

		<?php 
            } else {
                $key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key'];
                $result = wpmu_activate_signup($key);
                if (is_wp_error($result)) {
                    if ('already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code()) {
                        $signup = $result->get_error_data();
                        ?>
					<h2><?php 
                        _e('Your account is now active!', 'theme-my-login');
                        ?>
</h2>
					<?php 
                        echo '<p class="lead-in">';
                        if ($signup->domain . $signup->path == '') {
                            printf(__('Your account has been activated. You may now <a href="%1$s">login</a> to the site using your chosen username of &#8220;%2$s&#8221;.  Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.', 'theme-my-login'), network_site_url('wp-login.php', 'login'), $signup->user_login, $signup->user_email, network_site_url('wp-login.php?action=lostpassword', 'login'));
                        } else {
                            printf(__('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;.  Please check your email inbox at %4$s for your password and login instructions.  If you do not receive an email, please check your junk or spam folder.  If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.', 'theme-my-login'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, network_site_url('wp-login.php?action=lostpassword'));
                        }
                        echo '</p>';
                    } else {
                        ?>
					<h2><?php 
                        _e('An error occurred during the activation', 'theme-my-login');
                        ?>
</h2>
					<?php 
                        echo '<p>' . $result->get_error_message() . '</p>';
                    }
                } else {
                    extract($result);
                    $url = get_blogaddress_by_id((int) $blog_id);
                    $user = new WP_User((int) $user_id);
                    ?>
				<h2><?php 
                    _e('Your account is now active!', 'theme-my-login');
                    ?>
</h2>

				<div id="signup-welcome">
					<p><span class="h3"><?php 
                    _e('Username:', 'theme-my-login');
                    ?>
</span> <?php 
                    echo $user->user_login;
                    ?>
</p>
					<p><span class="h3"><?php 
                    _e('Password:', 'theme-my-login');
                    ?>
</span> <?php 
                    echo $password;
                    ?>
//.........这里部分代码省略.........
开发者ID:tkxhoa,项目名称:movie,代码行数:101,代码来源:class-theme-my-login-ms-signup.php


示例13: test_get_blogaddress_by_id_with_invalid_id

 /**
  * Tests returning the appropriate response for a invalid id given.
  */
 function test_get_blogaddress_by_id_with_invalid_id()
 {
     $blogaddress = get_blogaddress_by_id(42);
     $this->assertEquals('', $blogaddress);
 }
开发者ID:plis197715,项目名称:wordpress-develop,代码行数:8,代码来源:site.php


示例14: edit_site_Network_Admin_GForms_TMP

    /**
     * Display Edit Site Section of Settings Page
     */
    function edit_site_Network_Admin_GForms_TMP()
    {
        $unauthorized = false;
        if (!is_multisite()) {
            $unauthorized = __('Multisite support is not enabled.');
        }
        if (!current_user_can('manage_sites')) {
            $unauthorized = __('You do not have sufficient permissions to edit this site.');
        }
        $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
        if (!$id) {
            $unauthorized = __('Invalid site ID.');
        }
        $details = get_blog_details($id);
        if (!can_edit_network($details->site_id)) {
            $unauthorized = __('You do not have permission to access this page.');
        }
        if ($unauthorized) {
            echo "<p>{$unauthorized}</p>\n";
            return;
        }
        $site_url_no_http = preg_replace('#^http(s)?://#', '', get_blogaddress_by_id($id));
        $title_site_url_linked = sprintf(__('API Enabled: <a href="%1$s">%2$s</a>'), get_blogaddress_by_id($id), $site_url_no_http);
        $gforms_tmp_admin_client_id = \get_blog_option($id, 'gforms_tmp_admin_client_id', false);
        $gforms_tmp_admin_client_name = \get_blog_option($id, 'gforms_tmp_admin_client_name', false);
        $gforms_tmp_active = \get_blog_option($id, 'gforms_tmp_active', false);
        $gforms_tmp_last_update = \get_blog_option($id, 'gforms_tmp_last_update', false);
        $date = 'Y/m/d g:i:s a';
        $is_main_site = \is_main_site($id);
        if (isset($_GET['update'])) {
            $messages = array();
            if ('updated' == $_GET['update']) {
                $messages[1] = __('Site updated.');
            } else {
                $messages[0] = __('Site could not be updated.');
            }
        }
        if (!empty($messages)) {
            foreach ($messages as $status => $msg) {
                echo '<div id="message" class="' . ($status ? 'updated' : 'error') . '"><p>' . $msg . '</p></div>';
            }
        }
        ?>

<div class="wrap">

	<div id="icon-options-general" class="icon32">
		<br>
	</div>

	<h2 id="edit-site"><?php 
        echo $title_site_url_linked;
        ?>
</h2>

	<br />

	<form method="post"
		action="<?php 
        echo network_admin_url('admin.php?page=' . $this::slug . '&action=edit');
        ?>
">

                <?php 
        wp_nonce_field('gforms-tmp-edit-site');
        ?>

                <input type="hidden" name="id"
			value="<?php 
        echo esc_attr($id);
        ?>
" /> <input type="hidden"
			name="action" value="site_update_network_admin_gforms_tmp" />

		<table class="form-table">

			<tr class="form-field form-required">

				<th scope="row"><?php 
        _e('Domain');
        ?>
</th>

                        <?php 
        $protocol = is_ssl() ? 'https://' : 'http://';
        if ($is_main_site) {
            ?>

                            <td><code><?php 
            echo $protocol;
            echo esc_attr($details->domain);
            ?>
</code></td>

                        <?php 
        } else {
            ?>
//.........这里部分代码省略.........
开发者ID:arstropica,项目名称:gforms_tmp,代码行数:101,代码来源:class.network_admin_gforms_tmp.php


示例15: author_gravatar_tag

function author_gravatar_tag($authorID, $tags = '', $width = '')
{
    global $gravatar_width, $profile_picture_options;
    if ($authorID != 0) {
        $path = author_image_path($authorID, false, 'absolute');
        $width = $width != '' ? $width : $gravatar_width;
        //$height = author_image_dimensions($path, 'height') * ($gravatar_width / author_image_dimensions($path, 'width'));// not needed
        $tag = '<img src="' . author_image_path($authorID, false, 'url') . '" width=' . $width . ' ' . $tags . ' hspace=10 />';
        if ($profile_picture_options['link_profile'] == 'yes') {
            $primary_blog = get_usermeta($authorID, 'primary_blog');
            if ($primary_blog != '') {
                $url = get_blogaddress_by_id($primary_blog);
            } else {
                $url = get_blogaddress_by_id(1);
            }
            $tag = '<a href="' . $url . '?author=' . $authorID . '">' . $tag . '</a>';
        }
        return $tag;
    } else {
        return false;
    }
}
开发者ID:alx,项目名称:blogsfera,代码行数:22,代码来源:profile-picture.php


示例16: xpress_primary_blog_link

function xpress_primary_blog_link() {
	global $xoops_config;
	global $current_user;
	global $blog_id;
	$ret = array();

	if (xpress_is_multiblog() && is_user_logged_in()){
		$blog_list = get_blog_list();
		$root_path = get_blog_status(1,'path');
		$primary_blog_id = @$current_user->primary_blog;
		if(empty($primary_blog_id)) return $ret;
		$primary_path = get_blog_status($primary_blog_id,'path');
		$script = str_replace($root_path, "", $primary_path);
		if ($primary_blog_id !== $blog_id){
			$ret['url'] = get_blogaddress_by_id($primary_blog_id);
			$ret['menu_url'] = $script;
			$ret['title'] = __('Your Primary Blog','xpressme');
			$ret['link'] = '<a href="' . $ret['url'] . '">' . $ret['title'] . '</a>';
		}
	}
	return $ret;
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:22,代码来源:custom_functions.php


示例17: switch_to_blog

</code></td>
			<?php 
} else {
    switch_to_blog($id);
    ?>
			<th scope="row"><label for="path"><?php 
    _e('Path');
    ?>
</label></th>
			<td>
				<input name="blog[path]" type="text" id="path" value="<?php 
    echo esc_attr($details->path);
    ?>
" /><br />
				<input type="checkbox" name="update_home_url" id="update_home_url" value="update" <?php 
    if (get_option('siteurl') == untrailingslashit(get_blogaddress_by_id($id)) || get_option('home') == untrailingslashit(get_blogaddress_by_id($id))) {
        echo 'checked="checked"';
    }
    ?>
 /> <label for="update_home_url"><?php 
    _e('Update <code>siteurl</code> and <code>home</code> as well.');
    ?>
</label>
			</td>
			<?php 
    restore_current_blog();
}
?>
		</tr>
		<tr class="form-field">
			<th scope="row"><label for="blog_registered"><?php 
开发者ID:kuryerov,项目名称:portfolio,代码行数:31,代码来源:site-info.php


示例18: subsites_list

 /**
  * Get array of subsite simple urls keyed by their ID.
  *
  * @return array
  */
 public function subsites_list()
 {
     $subsites = array();
     if (!is_multisite()) {
         return $subsites;
     }
     if (version_compare($GLOBALS['wp_version'], '4.6', '>=')) {
         $sites = get_sites(array('limit' => 0));
     } else {
         $sites = wp_get_sites(array('limit' => 0));
     }
     if (!empty($sites)) {
         foreach ((array) $sites as $subsite) {
             $subsite = (array) $subsite;
             $subsites[$subsite['blog_id']] = $this->simple_site_url(get_blogaddress_by_id($subsite['blog_id']));
         }
     }
     return $subsites;
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:24,代码来源:wpmdb-base.php


示例19: add_network

/**
 * Add a new network
 *
 * @since 1.3
 *
 * @param string $domain Domain name for new network - for VHOST=no, this
 *                        should be FQDN, otherwise domain only
 * @param string $path Path to root of network hierarchy - should be '/' unless
 *                      WP is cohabiting with another product on a domain
 * @param string $site_name Name of the root blog to be created on the new
 *                           network
 * @param integer $clone_network ID of network whose networkmeta values are
 *                                to be copied - default NULL
 * @param array $options_to_clone Override default network meta options to copy
 *                                 when cloning - default NULL
 * @return integer ID of newly created network
 */
function add_network($domain, $path, $site_name = false, $clone_network = false, $options_to_clone = false)
{
    global $wpdb, $sites;
    // Set a default site name if one isn't set
    if (false == $site_name) {
        $site_name = __('New Network Root', 'wp-multi-network');
    }
    // If no options, fallback on defaults
    if (empty($options_to_clone)) {
        $options_to_clone = array_keys(network_options_to_copy());
    }
    // Check for existing network
    $sql = "SELECT * FROM {$wpdb->site} WHERE domain = %s AND path = %s LIMIT 1";
    $query = $wpdb->prepare($sql, $domain, $path);
    $network = $wpdb->get_row($query);
    if (!empty($network)) {
        return new WP_Error('network_exists', __('Network already exists.', 'wp-multi-network'));
    }
    // Insert new network
    $wpdb->insert($wpdb->site, array('domain' => $domain, 'path' => $path));
    $new_network_id = $wpdb->insert_id;
    // Update global network list
    $sites = $wpdb->get_results("SELECT * FROM {$wpdb->site}");
    // If network was created, create a blog for it too
    if (!empty($new_network_id)) {
        if (!defined('WP_INSTALLING')) {
            define('WP_INSTALLING', true);
        }
        // there's an ongoing error with wpmu_create_blog that throws a warning if meta is not defined:
        // http://core.trac.wordpress.org/ticket/20793
        // temporary fix -- set from current blog's value
        // Looks like a fix is in for 3.7
        $new_blog_id = wpmu_create_blog($domain, $path, $site_name, get_current_user_id(), array('public' => get_option('blog_public', false)), (int) $new_network_id);
        // Bail if blog could not be created
        if (is_a($new_blog_id, 'WP_Error')) {
            return $new_blog_id;
        }
        /**
         * Fix upload_path for main sites on secondary networks
         * This applies only to new installs (WP 3.5+)
         */
        // Switch to main network (if it exists)
        if (defined('SITE_ID_CURRENT_SITE') && network_exists(SITE_ID_CURRENT_SITE)) {
            switch_to_network(SITE_ID_CURRENT_SITE);
            $use_files_rewriting = get_site_option('ms_files_rewriting');
            restore_current_network();
        } else {
            $use_files_rewriting = get_site_option('ms_files_rewriting');
        }
        global $wp_version;
        // Create the upload_path and upload_url_path values
        if (!$use_files_rewriting && version_compare($wp_version, '3.7', '<')) {
            // WP_CONTENT_URL is locked to the current site and can't be overridden,
            //  so we have to replace the hostname the hard way
            $current_siteurl = get_option('siteurl');
            $new_siteurl = untrailingslashit(get_blogaddress_by_id($new_blog_id));
            $upload_url = str_replace($current_siteurl, $new_siteurl, WP_CONTENT_URL);
            $upload_url = $upload_url . '/uploads';
            $upload_dir = WP_CONTENT_DIR;
            if (0 === strpos($upload_dir, ABSPATH)) {
                $upload_dir = substr($upload_dir, strlen(ABSPATH));
            }
            $upload_dir .= '/uploads';
            if (defined('MULTISITE')) {
                $ms_dir = '/sites/' . $new_blog_id;
            } else {
                $ms_dir = '/' . $new_blog_id;
            }
            $upload_dir .= $ms_dir;
            $upload_url .= $ms_dir;
            update_blog_option($new_blog_id, 'upload_path', $upload_dir);
            update_blog_option($new_blog_id, 'upload_url_path', $upload_url);
        }
    }
    // Clone the network meta from an existing network
    if (!empty($clone_network) && network_exists($clone_network)) {
        $options_cache = array();
        $clone_network = (int) $clone_network;
        switch_to_network($clone_network);
        foreach ($options_to_clone as $option) {
            $options_cache[$option] = get_site_option($option);
        }
        restore_current_network();
//.........这里部分代码省略.........
开发者ID:tlandn,项目名称:akvo-sites-zz-template,代码行数:101,代码来源:functions-wp-ms-networks.php


示例20: add_site

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_blogaddress_by_name函数代码示例发布时间:2022-05-15
下一篇:
PHP get_blog_status函数代码示例发布时间: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