Don't hide blog when option is blank!

git-svn-id: http://svn.automattic.com/wordpress/trunk@3885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2006-06-17 23:38:45 +00:00
parent 1f07084f77
commit b9d8d2e9fd
4 changed files with 43 additions and 42 deletions

View File

@ -1,36 +1,36 @@
<?php
require_once('./admin.php');
$title = __('Privacy Options');
$parent_file = 'options-general.php';
include('./admin-header.php');
?>
<div class="wrap">
<h2><?php _e('Privacy Options') ?></h2>
<form method="post" action="options.php">
<?php wp_nonce_field('update-options') ?>
<table class="optiontable">
<tr valign="top">
<th scope="row"><?php _e('Blog visibility:') ?> </th>
<td>
<input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> />
<label for="blog-public">I would like my blog to be visible to anyone who visits, including search engines and archivers</label>
<br />
<input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> />
<label for="blog-norobots">I would like to block search engines, but allow normal folks</label>
<?php do_action('blog_privacy_selector'); ?>
</td>
</tr>
</table>
<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="blog_public" />
</p>
</form>
</div>
<?php include('./admin-footer.php') ?>
<?php
require_once('./admin.php');
$title = __('Privacy Options');
$parent_file = 'options-general.php';
include('./admin-header.php');
?>
<div class="wrap">
<h2><?php _e('Privacy Options') ?></h2>
<form method="post" action="options.php">
<?php wp_nonce_field('update-options') ?>
<table class="optiontable">
<tr valign="top">
<th scope="row"><?php _e('Blog visibility:') ?> </th>
<td>
<input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> />
<label for="blog-public">I would like my blog to be visible to anyone who visits, including search engines and archivers</label>
<br />
<input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> />
<label for="blog-norobots">I would like to block search engines, but allow normal folks</label>
<?php do_action('blog_privacy_selector'); ?>
</td>
</tr>
</table>
<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="blog_public" />
</p>
</form>
</div>
<?php include('./admin-footer.php') ?>

View File

@ -229,7 +229,7 @@ function populate_options() {
add_option('secret', md5(uniqid(microtime())));
// 2.1
add_option('blog_public', 1);
add_option('blog_public', '1');
add_option('default_link_category', 2);
add_option('show_on_front', 'posts');

View File

@ -975,7 +975,7 @@ function get_num_queries() {
}
function privacy_ping_filter( $sites ) {
if ( get_option('blog_public') )
if ( '0' != get_option('blog_public') )
return $sites;
else
return '';
@ -1026,7 +1026,8 @@ function do_feed_atom() {
}
function do_robots() {
if ( '1' != get_option('blog_public') ) {
do_action('do_robots');
if ( '0' == get_option('blog_public') ) {
echo "User-agent: *\n";
echo "Disallow: /\n";
} else {

View File

@ -694,13 +694,13 @@ function wp_footer() {
}
function rsd_link() {
echo '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="' . get_bloginfo('wpurl') . "/xmlrpc.php?rsd\" />\n";
echo ' <link rel="EditURI" type="application/rsd+xml" title="RSD" href="' . get_bloginfo('wpurl') . "/xmlrpc.php?rsd\" />\n";
}
function noindex() {
// If the blog is not public, tell robots to go away.
if ( ! get_option('blog_public') )
echo '<meta name="robots" content="noindex,nofollow" />' . "\n";
if ( '0' == get_option('blog_public') )
echo "<meta name='robots' content='noindex,nofollow' />\n";
}
/**