summaryrefslogtreecommitdiffstats
path: root/wp-includes/bookmark-template.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-21 18:37:58 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-21 18:37:58 +0000
commit89fe0ff804e7c6497ebacc8b341ac89974f6f255 (patch)
tree3fce310b29c685008fdbb75c5ab531bc3a6ae12a /wp-includes/bookmark-template.php
parenta139071806ba941346a109fbefb2d5f22bae1cc4 (diff)
downloadwordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.gz
wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.xz
wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.zip
WP Merge to rev 5499, this is a big one! Test it before you put it live!
Test only, not for production use yet git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@972 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/bookmark-template.php')
-rw-r--r--wp-includes/bookmark-template.php87
1 files changed, 46 insertions, 41 deletions
diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php
index e7a8480..2a06cf2 100644
--- a/wp-includes/bookmark-template.php
+++ b/wp-includes/bookmark-template.php
@@ -9,28 +9,23 @@
**/
function wp_get_links($args = '') {
global $wpdb;
-
- if ( empty($args) )
- return;
-
- if ( false === strpos($args, '=') ) {
+
+ if ( strpos( $args, '=' ) === false ) {
$cat_id = $args;
- $args = add_query_arg('category', $cat_id, $args);
+ $args = add_query_arg( 'category', $cat_id, $args );
}
-
- parse_str($args);
-
- if ( !isset($category) ) $category = -1;
- if ( !isset($before) ) $before = '';
- if ( !isset($after) ) $after = '<br />';
- if ( !isset($between) ) $between = ' ';
- if ( !isset($show_images) ) $show_images = true;
- if ( !isset($orderby) ) $orderby = 'name';
- if ( !isset($show_description) ) $show_description = true;
- if ( !isset($show_rating) ) $show_rating = false;
- if ( !isset($limit) ) $limit = -1;
- if ( !isset($show_updated) ) $show_updated = 1;
- if ( !isset($echo) ) $echo = true;
+
+ $defaults = array(
+ 'category' => -1, 'before' => '',
+ 'after' => '<br />', 'between' => ' ',
+ 'show_images' => true, 'orderby' => 'name',
+ 'show_description' => true, 'show_rating' => false,
+ 'limit' => -1, 'show_updated' => true,
+ 'echo' => true
+ );
+
+ $r = wp_parse_args( $args, $defaults );
+ extract( $r );
return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo);
} // end wp_get_links
@@ -136,6 +131,10 @@ function get_links($category = -1,
if ( $show_description && '' != $desc )
$output .= $between . $desc;
+
+ if ($show_rating) {
+ $output .= $between . get_linkrating($row);
+ }
$output .= "$after\n";
} // end while
@@ -241,15 +240,14 @@ 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' => 1, 'before' => '<li>',
- 'after' => '</li>', 'between' => "\n");
- $r = array_merge($defaults, $r);
- extract($r);
+ $defaults = array(
+ 'show_updated' => 0, 'show_description' => 0,
+ 'show_images' => 1, 'before' => '<li>',
+ 'after' => '</li>', 'between' => "\n"
+ );
+
+ $r = wp_parse_args( $args, $defaults );
+ extract( $r );
foreach ( (array) $bookmarks as $bookmark ) {
if ( !isset($bookmark->recently_updated) )
@@ -304,6 +302,11 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
if ( $show_description && '' != $desc )
$output .= $between . $desc;
+
+ if ($show_rating) {
+ $output .= $between . get_linkrating($bookmark);
+ }
+
$output .= "$after\n";
} // end while
@@ -311,18 +314,20 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
}
function wp_list_bookmarks($args = '') {
- if ( is_array($args) )
- $r = &$args;
- else
- parse_str($args, $r);
-
- $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '',
- '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', 'class' => 'linkcat',
- 'category_before' => '<li id="%id" class="%class">', 'category_after' => '</li>');
- $r = array_merge($defaults, $r);
- extract($r);
+ $defaults = array(
+ 'orderby' => 'name', 'order' => 'ASC',
+ 'limit' => -1, 'category' => '',
+ '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',
+ 'class' => 'linkcat', 'category_before' => '<li id="%id" class="%class">',
+ 'category_after' => '</li>'
+ );
+
+ $r = wp_parse_args( $args, $defaults );
+ extract( $r );
$output = '';