Changeset 6748
- Timestamp:
- 02/07/2008 06:07:12 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/schema.php
r6736 r6748 236 236 add_option('tag_base'); 237 237 238 // 2.5 239 add_option('show_avatars', '1'); 240 add_option('avatar_rating', 'G'); 241 238 242 // Delete unused options 239 243 $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'); -
trunk/wp-admin/options-reading.php
r6475 r6748 76 76 </table> 77 77 </fieldset> 78 79 <fieldset class="options"> 80 <legend><?php _e('Avatars') ?></legend> 81 <table class="niceblue"> 82 <tr valign="top"> 83 <th width="33%" scope="row"><?php _e('Show Avatars?') ?></th> 84 <td> 85 <select name="show_avatars" id="show_avatars"> 86 <?php 87 $yesorno = array(0 => __("Don't show Avatars"), 1 => __('Show Avatars')); 88 foreach ( $yesorno as $key => $value) { 89 $selected = (get_option('show_avatars') == $key) ? 'selected="selected"' : ''; 90 echo "\n\t<option value='$key' $selected>$value</option>"; 91 } 92 ?> 93 </select> 94 </td> 95 </tr> 96 <tr valign="top"> 97 <th width="33%" scope="row"><?php _e('Show Avatars with Rating:') ?></th> 98 <td> 99 <select name="avatar_rating" id="avatar_rating"> 100 <?php 101 $ratings = array( 'G' => _c('G|rating'), 'PG' => _c('PG|Rating'), 'R' => _c('R|Rating'), 'X' => _c('X|Rating')); 102 foreach ($ratings as $key => $rating) : 103 $selected = (get_option('avatar_rating') == $key) ? 'selected="selected"' : ''; 104 echo "\n\t<option value='$key' $selected>$rating</option>"; 105 endforeach; 106 ?> 107 </select> 108 </td> 109 </tr> 110 </table> 111 </fieldset> 112 78 113 <table class="niceblue"> 79 114 <tr valign="top"> … … 89 124 <p class="submit"> 90 125 <input type="hidden" name="action" value="update" /> 91 <input type="hidden" name="page_options" value="posts_per_page,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression,show_on_front,page_on_front,page_for_posts " />126 <input type="hidden" name="page_options" value="posts_per_page,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression,show_on_front,page_on_front,page_for_posts,show_avatars,avatar_rating" /> 92 127 <input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /> 93 128 </p> -
trunk/wp-includes/pluggable.php
r6739 r6748 1163 1163 endif; 1164 1164 1165 if ( !function_exists( 'get_avatar' ) ) : 1166 /** 1167 * get_avatar() - Get avatar for a user 1168 * 1169 * Retrieve the avatar for a user provided a user ID or email address 1170 * 1171 * @since 2.5 1172 * @param int|string $id_or_email A user ID or email address 1173 * @param int $size Size of the avatar image 1174 * @param string $default URL to a default image to use if no avatar is available 1175 * @return string <img> tag for the user's avatar 1176 */ 1177 function get_avatar( $id_or_email, $size = '96', $default = '' ) { 1178 if ( ! get_option('show_avatars') ) 1179 return false; 1180 1181 if ( is_numeric($id_or_email) ) { 1182 $id = (int) $id_or_email; 1183 $user = get_userdata($id); 1184 if ( !$user) 1185 $email = ''; 1186 else 1187 $email = $user->user_email; 1188 } else { 1189 $email = $id_or_email; 1190 } 1191 1192 $default_sizes = array(16, 32, 48, 96, 128); 1193 if ( empty($default) ) { 1194 if ( in_array($size, $default_sizes) ) 1195 $default = trailingslashit(get_bloginfo('wpurl')) . "wp-includes/images/avatar/unknown-$size.jpg"; 1196 else 1197 $default = trailingslashit(get_bloginfo('wpurl')) . "wp-includes/images/avatar/unknown-96.jpg"; 1198 } 1199 1200 if ( !empty($email) ) { 1201 $default = urlencode( $default ); 1202 1203 $out = 'http://www.gravatar.com/avatar.php?gravatar_id='; 1204 $out .= md5( $email ); 1205 $out .= "&size={$size}"; 1206 $out .= "&default={$default}"; 1207 1208 $rating = get_option('avatar_rating'); 1209 if ( !empty( $rating ) ) 1210 $out .= "&rating={$rating}"; 1211 1212 $avatar = "<img alt='' src='{$out}' class='avatar avatar-{$size}' height='{$size}' width='{$size}' />"; 1213 } else { 1214 $avatar = "<img alt='' src='{$default}' />"; 1215 } 1216 1217 return apply_filters('get_avatar', $avatar, $id_or_email, $size, $default); 1218 } 1219 endif; 1220 1165 1221 if ( !function_exists('wp_setcookie') ) : 1166 1222 /** -
trunk/wp-includes/version.php
r6736 r6748 17 17 * @global int $wp_db_version 18 18 */ 19 $wp_db_version = 67 36;19 $wp_db_version = 6748; 20 20 21 21 ?>
Note: See TracChangeset
for help on using the changeset viewer.