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

PHP get_users_of_blog函数代码示例

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

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



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

示例1: verify_new_user

function verify_new_user($var)
{
    if (!is_user_logged_in()) {
        return $var;
    }
    $errors = new WP_Error();
    $errors = $var['errors'];
    // get pricing plan level for the current blog
    $blogid = get_current_blog_id();
    $princing_plan = get_blog_option($blogid, 'product_id');
    // get pricing plan level for the current blog
    //$princing_plan = get_option('pricing_plan');
    //get number of users for this blog
    //$users = get_users_of_blog();
    //$nusers = count($users);
    $nusers = 0;
    global $blog_id;
    switch_to_blog($blog_id);
    $adminemail = get_bloginfo('admin_email');
    $admin = get_user_by_email($adminemail);
    restore_current_blog();
    $user_blogs = get_blogs_of_user($admin->ID);
    foreach ($user_blogs as $blog) {
        $bid = $blog->userblog_id;
        if ($bid == 1) {
            continue;
        }
        // does not count
        $email = get_blog_option($bid, 'admin_email');
        if ($email != $adminemail) {
            continue;
        }
        //eh apenas membro
        $u = get_users_of_blog($bid);
        $nusers = $nusers + count($u);
    }
    $pname = get_plan_name($princing_plan);
    switch ($pname) {
        case 'Cáucaso':
            if ($nusers == 30) {
                //$errors->add('pricing_plan', __('You have reached the maximum number of users. To add a new user pelase upgrade your plan.','delibera'));
                $errors->add('pricing_plan', __('Atingiu o número máximo de usuários permitido. Para adicionar mais usuários por favor actualize o seu plano.', 'delibera'));
            }
            break;
        case 'Miscenas':
            if ($nusers == 120) {
                //	$errors->add('pricing_plan', __('You have reached the maximum number of users. To add a new user pelase upgrade your plan.','delibera'));
                $errors->add('pricing_plan', __('Atingiu o número máximo de usuários permitido. Para adicionar mais usuários por favor actualize o seu plano.', 'delibera'));
            }
            break;
        case 'Creta':
            if ($nusers == 300) {
                //	$errors->add('pricing_plan', __('You have reached the maximum number of users. To add a new user pelase upgrade your plan.','delibera'));
                $errors->add('pricing_plan', __('Atingiu o número máximo de usuários permitido. Para adicionar mais usuários por favor actualize o seu plano.', 'delibera'));
            }
            break;
    }
    $var['errors'] = $errors;
    return $var;
}
开发者ID:cabelotaina,项目名称:delibera,代码行数:60,代码来源:delibera_plan_restriction.php


示例2: p2_get_at_name_map

function p2_get_at_name_map()
{
    global $wpdb;
    static $name_map = array();
    if ($name_map) {
        // since $names is static, the stuff below will only get run once per page load.
        return $name_map;
    }
    $users = get_users_of_blog();
    // get display names (can take out if you only want to handle nicenames)
    foreach ($users as $user) {
        $name_map["@{$user->user_login}"]['id'] = $user->ID;
        $users_to_array[] = $user->ID;
    }
    // get nicenames (can take out if you only want to handle display names)
    $user_ids = join(',', array_map('intval', $users_to_array));
    foreach ($wpdb->get_results("SELECT ID, display_name, user_nicename from {$wpdb->users} WHERE ID IN({$user_ids})") as $user) {
        $name_map["@{$user->display_name}"]['id'] = $user->ID;
        $name_map["@{$user->user_nicename}"]['id'] = $user->ID;
    }
    foreach ($name_map as $name => $values) {
        $username = get_userdata($values['id'])->user_login;
        $name_map[$name]['replacement'] = '<a href="' . esc_url('/mentions/' . $username) . '/">' . esc_html($name) . '</a>';
    }
    // remove any empty name just in case
    unset($name_map['@']);
    return $name_map;
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:28,代码来源:functions.php


示例3: pp_generate_sidebars

function pp_generate_sidebars()
{
    register_sidebar(array('name' => 'All - Top', 'id' => 'pp-sidebar-top', 'before_widget' => '<li id="%1$s" class="widget pp-sidebar-top %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => 'Home', 'id' => 'pp-home-sidebar', 'before_widget' => '<li id="%1$s" class="widget pp-home-sidebar %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => 'Single post page', 'id' => 'pp-single-sidebar', 'before_widget' => '<li id="%1$s" class="widget pp-single-sidebar %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => 'Project (default)', 'id' => 'pp-project-sidebar-default', 'before_widget' => '<li id="%1$s" class="widget pp-project-sidebar pp-project-sidebar-all %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
    $options = pp_get_options();
    if ($options['project_sidebars'] && ($projects = pp_get_projects())) {
        foreach ($projects as $project) {
            register_sidebar(array('name' => 'Project - ' . $project->name, 'id' => 'pp-project-sidebar-' . $project->cat_ID, 'before_widget' => '<li id="%1$s" class="widget pp-project-sidebar pp-project-sidebar-' . $project->cat_ID . ' %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
        }
    }
    register_sidebar(array('name' => 'Author (default)', 'id' => 'pp-author-sidebar-default', 'before_widget' => '<li id="%1$s" class="widget pp-author-sidebar pp-author-sidebar-all %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
    // Todo: cache the author array
    $authors = array();
    if ($options['author_sidebars'] && ($users = get_users_of_blog())) {
        foreach ($users as $user) {
            $user_object = new WP_User($user->user_id);
            if (!$user_object->has_cap('publish_posts')) {
                continue;
            }
            $authors[] = $user;
        }
    }
    foreach ($authors as $author) {
        register_sidebar(array('name' => 'Author - ' . $author->display_name, 'id' => 'pp-author-sidebar-' . $author->user_id, 'before_widget' => '<li id="%1$s" class="widget pp-author-sidebar pp-author-sidebar-' . $author->user_id . ' %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
    }
    register_sidebar(array('name' => 'All - Bottom', 'id' => 'pp-sidebar-bottom', 'before_widget' => '<li id="%1$s" class="widget pp-sidebar-bottom %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
}
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:29,代码来源:functions-sidebars.php


示例4: setUp

 function setUp()
 {
     parent::setUp();
     // keep track of users we create
     $this->_flush_roles();
     $this->orig_users = get_users_of_blog();
 }
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:7,代码来源:capabilities.php


示例5: load_users

 /**
  * Generates array of users indexed by user ID, and
  * an array of user_nicenames, indexed by user ID.
  *
  * @compat < 3.1: Use $wpdb and get_users of blog.
  */
 function load_users()
 {
     global $wpdb;
     // < 3.1
     // Cache the user information.
     if (!empty($this->users)) {
         return $this->users;
     }
     if (function_exists('get_users')) {
         // >= 3.1
         $users = get_users();
         foreach ($users as $user) {
             $this->users[$user->ID] = $user;
             $this->names[$user->ID] = $user->user_nicename;
         }
     } else {
         //  < 3.1
         $users = get_users_of_blog();
         $user_ids = '';
         foreach ($users as $user) {
             $this->users[$user->ID] = $user;
             $user_ids .= $user->ID;
         }
         foreach ($wpdb->get_results("SELECT ID, user_nicename from {$wpdb->users} WHERE ID IN({$user_ids})") as $user) {
             $this->users[$user->ID]->user_nicename = $user->user_nicename;
             $this->names[$user->ID] = $user->user_nicename;
         }
     }
     return $this->users;
 }
开发者ID:rajbot,项目名称:tikirobot_p2,代码行数:36,代码来源:mentions.php


示例6: form

    function form($instance)
    {
        $instance = wp_parse_args((array) $instance, array('title' => '', 'user_id' => 0));
        ?>
        <p>
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:');
        ?>
</label>
			<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        esc_attr_e($instance['title']);
        ?>
" />
		</p>
		<p>
			<label for="<?php 
        echo $this->get_field_id('user_id');
        ?>
"><?php 
        _e('User:');
        ?>
</label>
			<select name="<?php 
        echo $this->get_field_name('user_id');
        ?>
" id="<?php 
        echo $this->get_field_id('user_id');
        ?>
" class="widefat">
				<option value="-1"<?php 
        selected($instance['user_id'], -1);
        ?>
><?php 
        _e('Select a User');
        ?>
</option>
<?php 
        $users = get_users_of_blog();
        foreach ($users as $user) {
            echo '
				<option value="' . $user->ID . '"' . selected($instance['user_id'], $user->ID) . '>' . esc_html($user->display_name) . '</option>';
        }
        ?>
			</select>
		</p>
<?php 
    }
开发者ID:pfefferle,项目名称:wordpress-extended-profile,代码行数:56,代码来源:widget.php


示例7: get_users_of_blog_by_rol

function get_users_of_blog_by_rol($blog_id, $rol)
{
    $users = get_users_of_blog($blog_id);
    $result = array();
    foreach ($users as $user) {
        switch_to_blog($blog_id);
        $user_o = new WP_User($user->user_id);
        if ($user_o->has_cap($rol) && strcmp($user->user_nicename, "admin") != 0) {
            array_push($result, $user);
        }
        restore_current_blog();
    }
    return $result;
}
开发者ID:alx,项目名称:blogsfera,代码行数:14,代码来源:blog_info.php


示例8: format_author_value

 function format_author_value(&$value)
 {
     if (is_array($value)) {
         $users = get_users_of_blog();
         $all = true;
         foreach ($users as $user) {
             if (!in_array($user->user_id, $value)) {
                 $all = false;
                 break;
             }
         }
         if ($all) {
             $value = '';
         }
     }
 }
开发者ID:TheReaCompany,项目名称:pooplog,代码行数:16,代码来源:Tools.php


示例9: users_form

    function users_form($n)
    {
        global $wpdb, $testing;
        $users = get_users_of_blog($wpdb->blogid);
        ?>
<select name="userselect[<?php 
        echo $n;
        ?>
]">
	<option value="#NONE#"><?php 
        _e('- Select -');
        ?>
</option>
	<?php 
        foreach ($users as $user) {
            echo '<option value="' . $user->user_login . '">' . $user->user_login . '</option>';
        }
        ?>
	</select>
	<?php 
    }
开发者ID:joelglennwright,项目名称:agencypress,代码行数:21,代码来源:mt.php


示例10: q_generate_quser_pages

function q_generate_quser_pages()
{
    $errormessage = "All Users: ";
    $qusers = get_users_of_blog();
    foreach ($qusers as $quser) {
        $userpost = array('post_title' => $quser->display_name, 'post_content' => $quser->user_description, 'post_status' => 'publish', 'post_author' => $quser->ID, 'post_date' => $quser->registered, 'post_type' => 'quser');
        $postid = wp_insert_post($userpost);
        if (!$postid) {
            $errormessage .= __("error with user", 'qna-forum') . " " . $quser->ID;
        } else {
            update_user_meta($quser->ID, 'q_profilepage_id', $postid);
        }
    }
    //create default page with author -1 so that we can display a homepage or login page
    $default_post = array('post_title' => 'My Account', 'post_content' => 'Default User', 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'quser');
    $default_id = wp_insert_post($default_post);
    if (!$default_id) {
        $errormessage .= __("error creating default page", 'qna-forum');
    } else {
        update_option('q_quser_default_pageid', $default_id);
    }
    return $erromessage;
}
开发者ID:rongandat,项目名称:cyarevfoods,代码行数:23,代码来源:qusers.php


示例11: users_form

    function users_form($n, $author)
    {
        if ($this->allow_create_users()) {
            printf('<label>' . __('Create user %1$s or map to existing'), ' <input type="text" value="' . esc_attr($author) . '" name="' . 'user_create[' . intval($n) . ']' . '" maxlength="30" /></label> <br />');
        } else {
            echo __('Map to existing') . '<br />';
        }
        // keep track of $n => $author name
        echo '<input type="hidden" name="author_in[' . intval($n) . ']" value="' . esc_attr($author) . '" />';
        $users = get_users_of_blog();
        ?>
<select name="user_select[<?php 
        echo $n;
        ?>
]">
	<option value="0"><?php 
        _e('- Select -');
        ?>
</option>
	<?php 
        foreach ($users as $user) {
            echo '<option value="' . $user->user_id . '">' . $user->user_login . '</option>';
        }
        ?>
	</select>
	<?php 
    }
开发者ID:bluedanbob,项目名称:wordpress,代码行数:27,代码来源:wordpress.php


示例12: confirm_delete_users

function confirm_delete_users($users)
{
    global $current_user;
    if (!is_array($users)) {
        return false;
    }
    screen_icon();
    ?>
	<h2><?php 
    esc_html_e('Users');
    ?>
</h2>
	<p><?php 
    _e('Transfer or delete posts and links before deleting users.');
    ?>
</p>
	<form action="ms-edit.php?action=dodelete" method="post">
	<input type="hidden" name="dodelete" />
    <?php 
    wp_nonce_field('ms-users-delete');
    $site_admins = get_super_admins();
    $admin_out = "<option value='{$current_user->ID}'>{$current_user->user_login}</option>";
    foreach ($allusers = (array) $_POST['allusers'] as $key => $val) {
        if ($val != '' && $val != '0') {
            $delete_user = new WP_User($val);
            if (in_array($delete_user->user_login, $site_admins)) {
                wp_die(sprintf(__('Warning! User cannot be deleted. The user %s is a network admnistrator.'), $delete_user->user_login));
            }
            echo "<input type='hidden' name='user[]' value='{$val}'/>\n";
            $blogs = get_blogs_of_user($val, true);
            if (!empty($blogs)) {
                ?>
				<br /><fieldset><p><legend><?php 
                printf(__("What should be done with posts and links owned by <em>%s</em>?"), $delete_user->user_login);
                ?>
</legend></p>
				<?php 
                foreach ((array) $blogs as $key => $details) {
                    $blog_users = get_users_of_blog($details->userblog_id);
                    if (is_array($blog_users) && !empty($blog_users)) {
                        $user_site = "<a href='" . esc_url(get_home_url($details->userblog_id)) . "'>{$details->blogname}</a>";
                        $user_dropdown = "<select name='blog[{$val}][{$key}]'>";
                        $user_list = '';
                        foreach ($blog_users as $user) {
                            if ($user->user_id != $val && !in_array($user->user_id, $allusers)) {
                                $user_list .= "<option value='{$user->user_id}'>{$user->user_login}</option>";
                            }
                        }
                        if ('' == $user_list) {
                            $user_list = $admin_out;
                        }
                        $user_dropdown .= $user_list;
                        $user_dropdown .= "</select>\n";
                        ?>
						<ul style="list-style:none;">
							<li><?php 
                        printf(__('Site: %s'), $user_site);
                        ?>
</li>
							<li><label><input type="radio" id="delete_option0" name="delete[<?php 
                        echo $details->userblog_id . '][' . $delete_user->ID;
                        ?>
]" value="delete" checked="checked" />
							<?php 
                        _e('Delete all posts and links.');
                        ?>
</label></li>
							<li><label><input type="radio" id="delete_option1" name="delete[<?php 
                        echo $details->userblog_id . '][' . $delete_user->ID;
                        ?>
]" value="reassign" />
							<?php 
                        echo __('Attribute all posts and links to:') . '</label>' . $user_dropdown;
                        ?>
</li>
						</ul>
						<?php 
                    }
                }
                echo "</fieldset>";
            }
        }
    }
    ?>
	<p class="submit"><input type="submit" class="button-secondary delete" value="<?php 
    esc_attr_e('Confirm Deletion');
    ?>
" /></p>
	</form>
    <?php 
    return true;
}
开发者ID:owaismeo,项目名称:wordpress-10,代码行数:92,代码来源:ms.php


示例13: getBlogUsernames

 /**
  * Returns all blog usernames (in form [user_login => display_name (user_login)] )
  *
  * @return array $usernames
  **/
 function getBlogUsernames()
 {
     $return = array();
     $users = get_users_of_blog();
     foreach ($users as $user) {
         if ($user->display_name == $user->user_login) {
             $return[$user->user_login] = "{$user->display_name}";
         } else {
             $return[$user->user_login] = "{$user->display_name} ({$user->user_login})";
         }
     }
     return $return;
 }
开发者ID:elizabethcb,项目名称:Daily-Globe,代码行数:18,代码来源:wpomatic-class-copy-thing.php


示例14: xtec_delblogs_page

function xtec_delblogs_page()
{
    if (isset($_POST['inactivity_days'])) {
        $inactivity_days = $_POST['inactivity_days'];
    } else {
        $inactivity_days = get_site_option('xtec_maintenance_inactivity_days', 90);
    }
    if (isset($_POST['posts_pages'])) {
        $posts_pages = $_POST['posts_pages'];
    } else {
        $posts_pages = get_site_option('xtec_maintenance_posts_pages', 2);
    }
    if (get_site_option('xtec_maintenance_never_upload_file', 1) == 1) {
        $never_upload_file = true;
    } else {
        $never_upload_file = false;
    }
    if (isset($_POST['never_upload_file'])) {
        $never_upload_file = true;
    } else {
        if (isset($_POST['submit']) || isset($_POST['set_as_default']) || isset($_POST['touch'])) {
            $never_upload_file = false;
        }
    }
    ?>
	
	<div class="wrap">
	
	<h2>Eliminació de blocs</h2>
	
	<?php 
    global $wpdb;
    if (isset($_POST['delete'])) {
        if (!isset($_POST['idblogs'])) {
            ?>
<div class="error below-h2"><p>No has seleccionat cap bloc.</p></div><?php 
        } else {
            $idblogs = $_POST['idblogs'];
            foreach ($idblogs as $idblog) {
                $blogname = get_blog_option($idblog, 'blogname');
                $path = $wpdb->get_var("SELECT `path` FROM `{$wpdb->blogs}` WHERE `blog_id`='{$idblog}'");
                $del_date = date("Y-m-d H:i:s");
                $sql = "INSERT INTO `wp_delblocs` SET `site_id` = '{$idblog}', `site_path` = '" . $path . "', `blogname` = '" . $blogname . "', `del_date` = '{$del_date}', `status` = '2';";
                $wpdb->get_results($sql);
                $users = get_users_of_blog($idblog);
                foreach ($users as $user) {
                    $sql = "INSERT INTO `wp_delblocs_users` SET `blog_id` = '{$idblog}', `user_id` = '" . $user->user_id . "', `user_login` = '" . $user->user_login . "', `display_name` = '" . $user->display_name . "', `user_email` = '" . $user->user_email . "', `meta_value` = '" . $user->meta_value . "';";
                    $wpdb->get_results($sql);
                }
                // drops data of the blog when deleted
                wpmu_delete_blog($idblog, true);
                echo "El bloc {$blogname} amb ID {$idblog} s'ha eliminat correctament.<br />";
            }
        }
        echo "<p><a href=\"?page=xtec-delblogs\">Torna al formulari d'eliminació de blocs</a></p>";
    } else {
        if (isset($_POST['touch'])) {
            if (!isset($_POST['idblogs'])) {
                ?>
<div class="error below-h2"><p>No has seleccionat cap bloc.</p></div><?php 
            } else {
                $idblogs = $_POST['idblogs'];
                foreach ($idblogs as $idblog) {
                    $blogname = get_blog_option($idblog, 'blogname');
                    $wpdb->update($wpdb->blogs, array('last_updated' => current_time('mysql', true)), array('blog_id' => $idblog));
                    refresh_blog_details($wpdb->blogid);
                    echo "La data de la darrera actualització del bloc <strong>{$blogname}</strong> amb ID <strong>{$idblog}</strong> ha estat actualitzada a la data actual.<br>";
                }
            }
            echo "<p><a href=\"?page=xtec-delblogs\">Torna al formulari d'eliminació de blocs</a></p>";
        } else {
            if (isset($_POST['set_as_default'])) {
                update_site_option('xtec_maintenance_inactivity_days', $_POST['inactivity_days']);
                update_site_option('xtec_maintenance_posts_pages', $_POST['posts_pages']);
                $value = isset($_POST['never_upload_file']) ? 1 : 0;
                update_site_option('xtec_maintenance_never_upload_file', $value);
            }
            ?>
		
		<form action="?page=xtec-delblogs" method="post">
			<table class="form-table">
				<tbody>
					<tr valign="top">
						<th scope="row">
							<label for="inactivity_days">Dies d'inactivitat</label>
						</th>
						<td>
							<input id="inactivity_days" class="small-text" type="text" value="<?php 
            echo $inactivity_days;
            ?>
" name="inactivity_days"/>
						</td>
					</tr>
					<tr valign="top">
						<th scope="row">
							<label for="posts_pages">Articles i pàgines</label>
						</th>
						<td>
							<input id="posts_pages" class="small-text" type="text" value="<?php 
            echo $posts_pages;
//.........这里部分代码省略.........
开发者ID:ignacioabejaro,项目名称:xtecblocs,代码行数:101,代码来源:xtec-maintenance.php


示例15: trailingslashit

         } else {
             $domain = $current_site->domain;
             $path = trailingslashit($current_site->path . $dashboard_blog);
         }
         $wpdb->hide_errors();
         $dashboard_blog_id = wpmu_create_blog($domain, $path, __('My Dashboard'), $current_user->id, array('public' => 0), $current_site->id);
         $wpdb->show_errors();
     } else {
         $dashboard_blog_id = $blog_details->blog_id;
     }
 }
 if (is_wp_error($dashboard_blog_id)) {
     wp_die(__('Problem creating dashboard blog: ') . $dashboard_blog_id->get_error_message());
 }
 if ($_POST['dashboard_blog_orig'] != $_POST['dashboard_blog']) {
     $users = get_users_of_blog(get_site_option('dashboard_blog'));
     $move_users = array();
     foreach ((array) $users as $user) {
         if (array_pop(array_keys(unserialize($user->meta_value))) == 'subscriber') {
             $move_users[] = $user->user_id;
         }
     }
     if (false == empty($move_users)) {
         foreach ((array) $move_users as $user_id) {
             remove_user_from_blog($user_id, get_site_option('dashboard_blog'));
             add_user_to_blog($dashboard_blog_id, $user_id, get_site_option('default_user_role', 'subscriber'));
             update_user_meta($user_id, 'primary_blog', $dashboard_blog_id);
         }
     }
 }
 update_site_option('dashboard_blog', $dashboard_blog_id);
开发者ID:beaucollins,项目名称:wp,代码行数:31,代码来源:ms-edit.php


示例16: tweetimport_display_account_add_edit_form

function tweetimport_display_account_add_edit_form($mode="add", $account_details=NULL)
{
  echo '<h3>' . ($mode=='add'?'Add':'Update') . ' Twitter Feed</h3>';
  echo '<div class="form-wrap">';
  echo '<form name="twitter-account-form" id="twitter-account-form" method="post">';
  echo '<input type="hidden" name="tweetimport_action" value="' . ($mode=="add"?'add':'update') .'">';

  echo '<fieldset class="tweetimport">';
  echo '<legend class="tweetimport">Feed Info</legend>';
  if ($mode == 'add')
  {
    echo '<div class="form-field form-required">';
    echo '<label for="account_type">Twitter Feed Type</label>';
    echo '<select name="account_type" id="account_type">';
    if (!isset ($account_details['account_type'])) $account_details['account_type'] = 0;
    echo '<option value="0" ' . ($account_details['account_type']==0?'selected="selected"':'') . '>User Public Timeline</option>';
    echo '<option value="1" ' . ($account_details['account_type']==1?'selected="selected"':'') . '>Favorites</option>';
    echo '<option value="2" ' . ($account_details['account_type']==2?'selected="selected"':'') . '>List</option>';
    echo '</select>';
    echo '<p>Define the feed source type and identifiers. For a normal user feed, please select User Public Timeline. Favorites allows importing the tweets favorited by a user. A List feed will import the tweets that appear on a list as shown on the list page.</p>';
    echo '</div>';

    echo '<div class="form-field form-required">';
    echo '<label for="account_name">Twitter Feed User Name or List</label>';
    echo '<input name="account_name" id="account_name" type="text" value="' . $account_details['twitter_name'] . '" size="40" aria-required="true" />';
    echo '<p>For a User Public Timeline or a Favorites feed, please enter the twitter user name only. For a List feed, please input the user/list-name as it appears on the list page on twitter.</p>';
    echo '</div>';
  }
  else
  {
    echo '<div class="form-field form-required">';
    echo 'Updating Account information for<br />Twitter Feed Type: <strong>';
    if ($account_details['account_type'] == 0) echo 'User Public Timeline';
    elseif ($account_details['account_type'] == 1) echo 'Favorites';
    elseif ($account_details['account_type'] == 2) echo 'List';
    echo '</strong><br />Twitter Feed User Name or List: <strong>' . $account_details['twitter_name'] . '</strong>';
    echo '<p>Twitter feed information cannot be changed after creation. If for any reason you would like to change the feed user name or list, please deactivate or delete the account and create a new one. Please note that deleting an account does not delete the posts created through this account.</p>';
    echo '</div>';
  }

  echo '</fieldset>';
 
  echo '<br /><br />';
  echo '<fieldset class="tweetimport">';
  echo '<legend class="tweetimport">Import Options</legend>';

  echo '<div class="form-field form-required">';
  echo '<label for="tweet_author">Assign Author for tweets</label>';
  echo '<select name="tweet_author" id="tweet_author" >';

  $blog_authors = get_users_of_blog();
  foreach ($blog_authors as $blog_author)
  {
    $blog_author_info = get_userdata($blog_author->user_id);
    if (!isset ($account_details['author'])) $account_details['author'] = 1;
    if ($blog_author->user_id == $account_details['author']) {$selected = 'selected="selected"';} else {$selected = '';}
    echo '<option value="' . $blog_author->user_id . '" ' . $selected . '>' . $blog_author_info->user_login . '</option>';
  }
  echo '</select>';
  echo '<p>Assign an author to your imported tweets.</p>';
  echo '</div>';

  echo '<div class="form-field form-required">';
  echo '<label for="tweet_category">Category for imported tweets</label>';
  echo '<select name="tweet_category" id="tweet_category" >';

  $categories = get_categories ('hide_empty=0');
  foreach ($categories as $category)
  {
    !empty($category->term_id) ? $cat_id = $category->term_id : $cat_id = $category->cat_ID;
    !empty($category->name) ? $cat_name = $category->name : $cat_name = $category->cat_name;
    if (!isset ($account_details['category'])) $account_details['category'] = 1;
    if ($cat_id == $account_details['category']) {$selected = 'selected="selected"';} else {$selected = '';}
    echo '<option value="' . $cat_id . '" ' . $selected . '>' . $cat_name . '</option>';
  }
  echo '</select>';
  echo '<p>Import this account tweets to the selected category.</p>';
  echo '</div>';

  echo '<div class="form-field">';
  echo '<label for="account_tags">Tag Tweets</label>';
  echo '<input name="account_tags" id="account_tags" type="text" value="'. $account_details['add_tag'] .'" size="40" />';
  echo '<p>You can add multiple tags. Make sure to separate tags with a comma (,)</p>';
  echo '</div>';

  echo '<div class="form-field form-required">';
  echo '<label for="names_clickable">Make Twitter names clickable</label>';
  echo '<select name="names_clickable" id="names_clickable">';
  if (!isset ($account_details['names_clickable'])) $account_details['names_clickable'] = 0;
  echo '<option value="0" ' . ($account_details['names_clickable']!=1?'selected="selected"':'') . '>No</option>';
  echo '<option value="1" ' . ($account_details['names_clickable']==1?'selected="selected"':'') . '>Yes</option>';
  echo '</select>';
  echo '<p>Would you like Tweet Import to try identify Twitter user names in tweets and make them clickable leading to their Twitter pages?</p>';
  echo '</div>';

  echo '<div class="form-field form-required">';
  echo '<label for="account_hashtags">#hashtags</label>';
  echo '<select name="account_hashtags" id="account_hashtags">';
  if (!isset ($account_details['hash_tag'])) $account_details['hash_tag'] = 0;
  echo '<option value="0" ' . ($account_details['hash_tag']!=1?'selected="selected"':'') . '>No</option>';
//.........这里部分代码省略.........
开发者ID:robotconscience,项目名称:Robotconscience.com,代码行数:101,代码来源:tweet-import.php


示例17: wp_specialchars

        ?>
<h2><?php 
        echo wp_specialchars($title);
        if (isset($_GET['s']) && $_GET['s']) {
            printf('<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', wp_specialchars(get_search_query()));
        }
        ?>
</h2>

<div class="filter">
<form id="list-filter" action="" method="get">
<ul class="subsubsub">
<?php 
        $role_links = array();
        $avail_roles = array();
        $users_of_blog = get_users_of_blog();
        $total_users = count($users_of_blog);
        foreach ((array) $users_of_blog as $b_user) {
            $b_roles = unserialize($b_user->meta_value);
            foreach ((array) $b_roles as $b_role => $val) {
                if (!isset($avail_roles[$b_role])) {
                    $avail_roles[$b_role] = 0;
                }
                $avail_roles[$b_role]++;
            }
        }
        unset($users_of_blog);
        $current_role = false;
        $class = empty($role) ? ' class="current"' : '';
        $role_links[] = "<li><a href='users.php'{$class}>" . sprintf(__ngettext('All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users), number_format_i18n($total_users)) . '</a>';
        foreach ($wp_roles->get_names() as $this_role => $name) {
开发者ID:blowery,项目名称:wordpress,代码行数:31,代码来源:users.php


示例18: populate_network

/**
 * populate network settings
 *
 * @since 3.0.0
 *
 * @param int $network_id id of network to populate
 * @return bool|WP_Error True on success, or WP_Error on warning (with the install otherwise successful,
 * 	so the error code must be checked) or failure.
 */
function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $subdomain_install = false ) {
	global $wpdb, $current_site, $wp_db_version, $wp_rewrite;

	$errors = new WP_Error();
	if ( '' == $domain )
		$errors->add( 'empty_domain', __( 'You must provide a domain name.' ) );
	if ( '' == $site_name )
		$errors->add( 'empty_sitename', __( 'You must provide a name for your network of sites.' ) );

	// check for network collision
	if ( $network_id == $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE id = %d", $network_id ) ) )
		$errors->add( 'siteid_exists', __( 'The network already exists.' ) );

	$site_user = get_user_by_email( $email );
	if ( ! is_email( $email ) )
		$errors->add( 'invalid_email', __( 'You must provide a valid e-mail address.' ) );

	if ( $errors->get_error_code() )
		return $errors;

	// set up site tables
	$template = get_option( 'template' );
	$stylesheet = get_option( 'stylesheet' );
	$allowed_themes = array( $stylesheet => true );
	if ( $template != $stylesheet )
		$allowed_themes[ $template ] = true;
	if ( WP_DEFAULT_THEME != $stylesheet && WP_DEFAULT_THEME != $template )
		$allowed_themes[ WP_DEFAULT_THEME ] = true;

	if ( 1 == $network_id ) {
		$wpdb->insert( $wpdb->site, array( 'domain' => $domain, 'path' => $path ) );
		$network_id = $wpdb->insert_id;
	} else {
		$wpdb->insert( $wpdb->site, array( 'domain' => $domain, 'path' => $path, 'id' => $network_id ) );
	}

	if ( !is_multisite() ) {
		$site_admins = array( $site_user->user_login );
		$users = get_users_of_blog();
		if ( $users ) {
			foreach ( $users as $user ) {
				if ( is_super_admin( $user->ID ) && !in_array( $user->user_login, $site_admins ) )
					$site_admins[] = $user->user_login;
			}
		}
	} else {
		$site_admins = get_site_option( 'site_admins' );
	}

	$welcome_email = __( '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
Login Here: BLOG_URLwp-login.php

We hope you enjoy your new site.
Thanks!

--The Team @ SITE_NAME' );

	$sitemeta = array(
		'site_name' => $site_name,
		'admin_email' => $site_user->user_email,
		'admin_user_id' => $site_user->ID,
		'registration' => 'none',
		'upload_filetypes' => 'jpg jpeg png gif mp3 mov avi wmv midi mid pdf',
		'blog_upload_space' => 10,
		'fileupload_maxk' => 1500,
		'site_admins' => $site_admins,
		'allowedthemes' => $allowed_themes,
		'illegal_names' => array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator', 'files' ),
		'wpmu_upgrade_site' => $wp_db_version,
		'welcome_email' => $welcome_email,
		'first_post' => __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' ),
		// @todo - network admins should have a method of editing the network siteurl (used for cookie hash)
		'siteurl' => get_option( 'siteurl' ) . '/',
		'add_new_users' => '0',
		'upload_space_check_disabled' => '0',
		'subdomain_install' => intval( $subdomain_install ),
		'global_terms_enabled' => global_terms_enabled() ? '1' : '0'
	);
	if ( !intval( $subdomain_install ) )
		$sitemeta['illegal_names'][] = 'blog';

	$insert = '';
	foreach ( $sitemeta as $meta_key => $meta_value ) {
		$meta_key = $wpdb->escape( $meta_key );
//.........这里部分代码省略.........
开发者ID:realfluid,项目名称:umbaugh,代码行数:101,代码来源:schema.php


示例19: mysql2date

								<td valign="top">
								<?php 
                            if ($blog['registered'] == '0000-00-00 00:00:00') {
                                echo '&#x2014;';
    

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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