Ticket #20130: 20130.diff
File 20130.diff, 10.5 KB (added by , 13 years ago) |
---|
-
wp-includes/bookmark-template.php
20 20 * used by themes. 21 21 * 22 22 * The defaults for overwriting are: 23 * 'show_updated' - Default is 0 (integer). Will show the time of when the24 * bookmark was last updated.25 23 * 'show_description' - Default is 0 (integer). Whether to show the description 26 24 * of the bookmark. 27 25 * 'show_images' - Default is 1 (integer). Whether to show link image if … … 50 48 */ 51 49 function _walk_bookmarks($bookmarks, $args = '' ) { 52 50 $defaults = array( 53 'show_ updated' => 0, 'show_description' => 0,51 'show_description' => 0, 54 52 'show_images' => 1, 'show_name' => 0, 55 53 'before' => '<li>', 'after' => '</li>', 'between' => "\n", 56 54 'show_rating' => 0, 'link_before' => '', 'link_after' => '' … … 62 60 $output = ''; // Blank string to start with. 63 61 64 62 foreach ( (array) $bookmarks as $bookmark ) { 65 if ( !isset($bookmark->recently_updated) )66 $bookmark->recently_updated = false;67 63 $output .= $before; 68 if ( $show_updated && $bookmark->recently_updated )69 $output .= get_option('links_recently_updated_prepend');70 64 71 65 $the_link = '#'; 72 66 if ( !empty($bookmark->link_url) ) … … 76 70 $name = esc_attr(sanitize_bookmark_field('link_name', $bookmark->link_name, $bookmark->link_id, 'display')); 77 71 $title = $desc; 78 72 79 if ( $show_updated )80 if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) {81 $title .= ' (';82 $title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * 3600)));83 $title .= ')';84 }85 86 73 $alt = ' alt="' . $name . ( $show_description ? ' ' . $title : '' ) . '"'; 87 74 88 75 if ( '' != $title ) … … 116 103 117 104 $output .= '</a>'; 118 105 119 if ( $show_updated && $bookmark->recently_updated )120 $output .= get_option('links_recently_updated_append');121 122 106 if ( $show_description && '' != $desc ) 123 107 $output .= $between . $desc; 124 108 … … 147 131 * name. 148 132 * 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide 149 133 * links marked as 'invisible'. 150 * 'show_updated' - Default is 0 (integer). Will show the time of when the151 * bookmark was last updated.152 134 * 'echo' - Default is 1 (integer). Whether to echo (default) or return the 153 135 * formatted bookmarks. 154 136 * 'categorize' - Default is 1 (integer). Whether to show links listed by … … 202 184 'orderby' => 'name', 'order' => 'ASC', 203 185 'limit' => -1, 'category' => '', 'exclude_category' => '', 204 186 'category_name' => '', 'hide_invisible' => 1, 205 ' show_updated' => 0, 'echo' => 1,187 'echo' => 1, 206 188 'categorize' => 1, 'title_li' => __('Bookmarks'), 207 189 'title_before' => '<h2>', 'title_after' => '</h2>', 208 190 'category_orderby' => 'name', 'category_order' => 'ASC', -
wp-includes/bookmark.php
120 120 'orderby' => 'name', 'order' => 'ASC', 121 121 'limit' => -1, 'category' => '', 122 122 'category_name' => '', 'hide_invisible' => 1, 123 ' show_updated' => 0, 'include' => '',123 'include' => '', 124 124 'exclude' => '', 'search' => '' 125 125 ); 126 126 … … 203 203 $join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id"; 204 204 } 205 205 206 if ( $show_updated && get_option('links_recently_updated_time') ) {207 $recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL " . get_option('links_recently_updated_time') . " MINUTE) >= NOW(), 1,0) as recently_updated ";208 } else {209 $recently_updated_test = '';210 }211 212 $get_updated = ( $show_updated ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : '';213 214 206 $orderby = strtolower($orderby); 215 207 $length = ''; 216 208 switch ( $orderby ) { … … 247 239 if ( $hide_invisible ) 248 240 $visible = "AND link_visible = 'Y'"; 249 241 250 $query = "SELECT * $length $recently_updated_test $get_updatedFROM $wpdb->links $join WHERE 1=1 $visible $category_query";242 $query = "SELECT * $length FROM $wpdb->links $join WHERE 1=1 $visible $category_query"; 251 243 $query .= " $exclusions $inclusions $search"; 252 244 $query .= " ORDER BY $orderby $order"; 253 245 if ($limit != -1) -
wp-includes/deprecated.php
941 941 * @param bool $show_description whether to show the description if show_images=false/not defined. 942 942 * @param bool $show_rating show rating stars/chars 943 943 * @param int $limit Limit to X entries. If not specified, all entries are shown. 944 * @param int $show_updated whether to show last updated timestamp945 944 * @param bool $echo whether to echo the results, or return them instead 946 945 * @return null|string 947 946 */ 948 947 function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name', 949 $show_description = true, $show_rating = false, $limit = -1, $ show_updated = 1, $echo = true) {948 $show_description = true, $show_rating = false, $limit = -1, $deprecated = null, $echo = true) { 950 949 _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); 951 950 952 951 $order = 'ASC'; … … 958 957 if ( $category == -1 ) //get_bookmarks uses '' to signify all categories 959 958 $category = ''; 960 959 961 $results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, ' show_updated' => $show_updated, 'limit' => $limit));960 $results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'limit' => $limit)); 962 961 963 962 if ( !$results ) 964 963 return; … … 966 965 $output = ''; 967 966 968 967 foreach ( (array) $results as $row ) { 969 if ( !isset($row->recently_updated) )970 $row->recently_updated = false;971 968 $output .= $before; 972 if ( $show_updated && $row->recently_updated )973 $output .= get_option('links_recently_updated_prepend');974 969 $the_link = '#'; 975 970 if ( !empty($row->link_url) ) 976 971 $the_link = esc_url($row->link_url); … … 982 977 $name = esc_attr(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display')); 983 978 $title = $desc; 984 979 985 if ( $show_updated )986 if (substr($row->link_updated_f, 0, 2) != '00')987 $title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * 3600)) . ')';988 989 980 if ( '' != $title ) 990 981 $title = ' title="' . $title . '"'; 991 982 … … 1008 999 1009 1000 $output .= '</a>'; 1010 1001 1011 if ( $show_updated && $row->recently_updated )1012 $output .= get_option('links_recently_updated_append');1013 1014 1002 if ( $show_description && '' != $desc ) 1015 1003 $output .= $between . $desc; 1016 1004 -
wp-admin/includes/schema.php
391 391 'date_format' => __('F j, Y'), 392 392 /* translators: default time format, see http://php.net/date */ 393 393 'time_format' => __('g:i a'), 394 /* translators: links last updated date format, see http://php.net/date */395 'links_updated_date_format' => __('F j, Y g:i a'),396 'links_recently_updated_prepend' => '<em>',397 'links_recently_updated_append' => '</em>',398 'links_recently_updated_time' => 120,399 394 'comment_moderation' => 0, 400 395 'moderation_notify' => 1, 401 396 'permalink_structure' => '', … … 533 528 if ( !__get_option('home') ) update_option('home', $guessurl); 534 529 535 530 // Delete unused options 536 $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page', 'wporg_popular_tags', 'what_to_show', 'rss_language' );531 $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page', 'wporg_popular_tags', 'what_to_show', 'rss_language', 'links_updated_date_format', 'links_recently_updated_prepend', 'links_recently_updated_append', 'links_recently_updated_time' ); 537 532 foreach ( $unusedoptions as $option ) 538 533 delete_option($option); 539 534