diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-19 12:54:22 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-19 12:54:22 +0000 |
commit | 2774f2069ed2f9d3e7249bf21e88078ed41f127a (patch) | |
tree | 96a734c8066ba36c140469b1d7e7a194233ae77d /wp-inst | |
parent | 2a8eb7cb35db6adc0e7770222dc30be3d495df21 (diff) | |
download | wordpress-mu-2774f2069ed2f9d3e7249bf21e88078ed41f127a.tar.gz wordpress-mu-2774f2069ed2f9d3e7249bf21e88078ed41f127a.tar.xz wordpress-mu-2774f2069ed2f9d3e7249bf21e88078ed41f127a.zip |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@571 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst')
-rw-r--r-- | wp-inst/wp-admin/upgrade-schema.php | 2 | ||||
-rw-r--r-- | wp-inst/wp-content/themes/default/sidebar.php | 8 | ||||
-rw-r--r-- | wp-inst/wp-includes/bookmark-template.php | 103 | ||||
-rw-r--r-- | wp-inst/wp-includes/category-template.php | 10 | ||||
-rw-r--r-- | wp-inst/wp-includes/deprecated.php | 1 | ||||
-rw-r--r-- | wp-inst/wp-includes/functions.php | 4 | ||||
-rw-r--r-- | wp-inst/wp-includes/general-template.php | 7 | ||||
-rw-r--r-- | wp-inst/wp-includes/version.php | 2 |
8 files changed, 116 insertions, 21 deletions
diff --git a/wp-inst/wp-admin/upgrade-schema.php b/wp-inst/wp-admin/upgrade-schema.php index cdb9bf2..702fe4c 100644 --- a/wp-inst/wp-admin/upgrade-schema.php +++ b/wp-inst/wp-admin/upgrade-schema.php @@ -306,7 +306,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'); diff --git a/wp-inst/wp-content/themes/default/sidebar.php b/wp-inst/wp-content/themes/default/sidebar.php index 46d8ddd..7ed8c11 100644 --- a/wp-inst/wp-content/themes/default/sidebar.php +++ b/wp-inst/wp-content/themes/default/sidebar.php @@ -46,14 +46,10 @@ </ul> </li> - <li><h2>Categories</h2> - <ul> - <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?> - </ul> - </li> + <?php wp_list_categories('sort_column=name&optioncount=1&hierarchical=0&title_li=<h2>Categories</h2>'); ?> <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?> - <?php get_links_list(); ?> + <?php wp_list_bookmarks(); ?> <li><h2>Meta</h2> <ul> diff --git a/wp-inst/wp-includes/bookmark-template.php b/wp-inst/wp-includes/bookmark-template.php index cf2508d..c1414c4 100644 --- a/wp-inst/wp-includes/bookmark-template.php +++ b/wp-inst/wp-includes/bookmark-template.php @@ -259,15 +259,90 @@ function get_links_list($order = 'name', $hide_if_empty = 'obsolete') { } } +function _walk_bookmarks($bookmarks, $args = '' ) { + if ( is_array($args) ) + $r = &$args; + else + parse_str($args, $r); + + $defaults = array('show_updated' => 0, 'show_description' => 0, 'show_images' => 0, 'before' => '<li>', + 'after' => '</li>', 'between' => "\n"); + $r = array_merge($defaults, $r); + extract($r); + + foreach ( (array) $bookmarks as $bookmark ) { + if (!isset($bookmark->recently_updated)) $bookmark->recently_updated = false; + $output .= $before; + if ($show_updated && $bookmark->recently_updated) { + $output .= get_settings('links_recently_updated_prepend'); + } + + $the_link = '#'; + if (!empty($bookmark->link_url)) + $the_link = wp_specialchars($bookmark->link_url); + + $rel = $bookmark->link_rel; + if ($rel != '') { + $rel = ' rel="' . $rel . '"'; + } + + $desc = wp_specialchars($bookmark->link_description, ENT_QUOTES); + $name = wp_specialchars($bookmark->link_name, ENT_QUOTES); + $title = $desc; + + if ($show_updated) { + if (substr($bookmark->link_updated_f, 0, 2) != '00') { + $title .= ' (Last updated ' . date(get_settings('links_updated_date_format'), $bookmark->link_updated_f + (get_settings('gmt_offset') * 3600)) . ')'; + } + } + + if ('' != $title) { + $title = ' title="' . $title . '"'; + } + + $alt = ' alt="' . $name . '"'; + + $target = $bookmark->link_target; + if ('' != $target) { + $target = ' target="' . $target . '"'; + } + + $output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>'; + + if (($bookmark->link_image != null) && $show_images) { + if (strstr($bookmark->link_image, 'http')) + $output .= "<img src=\"$bookmark->link_image\" $alt $title />"; + else // If it's a relative path + $output .= "<img src=\"" . get_settings('siteurl') . "$bookmark->link_image\" $alt $title />"; + } else { + $output .= $name; + } + + $output .= '</a>'; + + if ($show_updated && $bookmark->recently_updated) { + $output .= get_settings('links_recently_updated_append'); + } + + if ($show_description && ($desc != '')) { + $output .= $between . $desc; + } + $output .= "$after\n"; + } // end while + + return $output; +} + function wp_list_bookmarks($args = '') { if ( is_array($args) ) $r = &$args; else parse_str($args, $r); - $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => 0, 'category' => 0, - 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'echo' =>1, - 'categorize' => 1, 'title_li' => __('Bookmarks')); + $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => 0, + 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'echo' => 1, + 'categorize' => 1, 'title_li' => __('Bookmarks'), 'title_before' => '<h2>', 'title_after' => '</h2>', + 'category_orderby' => 'name', 'category_order' => 'ASC'); $r = array_merge($defaults, $r); extract($r); @@ -278,6 +353,26 @@ function wp_list_bookmarks($args = '') { // with the category name as the title li. If not $categorize, use title_li. // When using each category's name as a title li, use before and after args for specifying // any markup. We don't want to hardcode h2. + + $output = ''; + + if ( $categorize ) { + $cats = get_categories("type=link&orderby=$category_orderby&order=$category_order&hierarchical=0"); + foreach ( (array) $cats as $cat ) { + $bookmarks = get_bookmarks($r); + if ( empty($bookmarks) ) + continue; + $output .= "<li id=\"linkcat-$cat->cat_ID\">$title_before$cat->cat_name$title_after\n\t<ul>\n"; + $r['category'] = $cat->cat_ID; + $output .= _walk_bookmarks($bookmarks, $r); + $output .= "\n\t</ul>\n</li>\n"; + } + } + + if ($echo) + echo $output; + + return $output; } -?>
\ No newline at end of file +?> diff --git a/wp-inst/wp-includes/category-template.php b/wp-inst/wp-includes/category-template.php index 3df9b73..0ca0e62 100644 --- a/wp-inst/wp-includes/category-template.php +++ b/wp-inst/wp-includes/category-template.php @@ -212,11 +212,11 @@ function wp_list_categories($args = '') { else parse_str($args, $r); - $defaults = array('show_option_all' => '', 'orderby' => 'ID', - 'order' => 'asc', 'style' => 'list', 'show_last_update' => 0, + $defaults = array('show_option_all' => '', 'orderby' => 'name', + 'order' => 'ASC', 'show_last_update' => 0, 'style' => 'list', 'show_count' => 0, 'hide_empty' => 1, 'use_desc_for_title' => 1, 'child_of' => 0, 'feed' => '', 'feed_image' => '', 'exclude' => '', - 'hierarchical' => true, 'title_li' => ''); + 'hierarchical' => true, 'title_li' => __('Categories')); $r = array_merge($defaults, $r); $r['include_last_update_time'] = $r['show_date']; extract($r); @@ -224,7 +224,7 @@ function wp_list_categories($args = '') { $categories = get_categories($r); $output = ''; - if ( $title_li && $list ) + if ( $title_li && 'list' == $style ) $output = '<li class="categories">' . $r['title_li'] . '<ul>'; if ( empty($categories) ) { @@ -243,7 +243,7 @@ function wp_list_categories($args = '') { $output .= walk_category_tree($categories, $depth, $r); } - if ( $title_li && $list ) + if ( $title_li && 'list' == $style ) $output .= '</ul></li>'; echo apply_filters('list_cats', $output); diff --git a/wp-inst/wp-includes/deprecated.php b/wp-inst/wp-includes/deprecated.php index 39fca84..0794b59 100644 --- a/wp-inst/wp-includes/deprecated.php +++ b/wp-inst/wp-includes/deprecated.php @@ -430,6 +430,7 @@ function wp_list_cats($args = '') { $r['show_count'] = $r['optioncount'];
if ( !empty($r['list']) )
$r['style'] = 'break';
+ $r['title_li'] = '';
return wp_list_categories($r);
}
diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php index 8a465e8..e673b1c 100644 --- a/wp-inst/wp-includes/functions.php +++ b/wp-inst/wp-includes/functions.php @@ -1048,7 +1048,9 @@ function do_feed_atom() { } function do_robots() { - if ( '1' != get_option('blog_public') ) { + global $current_blog; + do_action('do_robots'); + if ( '0' == $current_blog->public ) { echo "User-agent: *\n"; echo "Disallow: /\n"; } else { diff --git a/wp-inst/wp-includes/general-template.php b/wp-inst/wp-includes/general-template.php index 31111f9..643aa06 100644 --- a/wp-inst/wp-includes/general-template.php +++ b/wp-inst/wp-includes/general-template.php @@ -694,13 +694,14 @@ 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() { + global $current_blog; // 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' == $current_blog->public ) + echo "<meta name='robots' content='noindex,nofollow' />\n"; } /** diff --git a/wp-inst/wp-includes/version.php b/wp-inst/wp-includes/version.php index 9e9a82d..49fffa5 100644 --- a/wp-inst/wp-includes/version.php +++ b/wp-inst/wp-includes/version.php @@ -1,6 +1,6 @@ <?php -// This just holds the version number, in a separate file so we can bump it without cluttering the SVN +// This holds the version number in a separate file so we can bump it without cluttering the SVN $wp_version = 'wordpress-mu-1.0'; // Let's just avoid confusion $wp_db_version = 3845; |