Changeset 436
- Timestamp:
- 10/24/2008 04:00:42 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 18 edited
-
bp-activity/bp-activity-templatetags.php (modified) (5 diffs)
-
bp-activity/bp-activity-widgets.php (modified) (1 diff)
-
bp-core.php (modified) (3 diffs)
-
bp-core/bp-core-ajax.php (modified) (1 diff)
-
bp-core/bp-core-avatars.php (modified) (2 diffs)
-
bp-core/bp-core-catchuri.php (modified) (1 diff)
-
bp-core/bp-core-classes.php (modified) (4 diffs)
-
bp-core/bp-core-cssjs.php (modified) (1 diff)
-
bp-core/bp-core-widgets.php (modified) (1 diff)
-
bp-core/css/directory-members.css (modified) (3 diffs)
-
bp-core/directories/bp-core-directory-members.php (modified) (4 diffs)
-
bp-core/images/add_friend_button.gif (added)
-
bp-core/images/remove_friend_button.gif (added)
-
bp-core/images/requested_friend_button.gif (added)
-
bp-core/js/directory-members.js (modified) (1 diff)
-
bp-core/js/general.js (modified) (2 diffs)
-
bp-friends/bp-friends-ajax.php (modified) (2 diffs)
-
bp-friends/bp-friends-templatetags.php (modified) (2 diffs)
-
bp-groups/bp-groups-templatetags.php (modified) (2 diffs)
-
bp-wire/bp-wire-templatetags.php (modified) (1 diff)
-
bp-xprofile/bp-xprofile-signup.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-templatetags.php
r391 r436 85 85 } 86 86 87 function bp_activity_get_list( $user_id, $title, $ limit = false ) {88 global $bp_activity_user_id, $bp_activity_limit, $bp_activity_title ;87 function bp_activity_get_list( $user_id, $title, $no_activity, $limit = false ) { 88 global $bp_activity_user_id, $bp_activity_limit, $bp_activity_title, $bp_activity_no_activity; 89 89 90 90 $bp_activity_user_id = $user_id; 91 91 $bp_activity_limit = $limit; 92 92 $bp_activity_title = $title; 93 $bp_activity_no_activity = $no_activity; 93 94 94 95 load_template( TEMPLATEPATH . '/activity/activity-list.php' ); … … 122 123 } 123 124 125 function bp_activities_no_activity() { 126 global $bp_activity_no_activity; 127 echo $bp_activity_no_activity; 128 } 129 124 130 function bp_activity_content() { 125 131 global $activities_template; … … 133 139 } 134 140 135 function bp_activity_content_filter( $content, $date_recorded, $full_name, $insert_time = true, $ is_home= true ) {141 function bp_activity_content_filter( $content, $date_recorded, $full_name, $insert_time = true, $filter_words = true, $filter_you = true ) { 136 142 if ( !$content ) 137 143 return false; … … 146 152 if ( $insert_time ) 147 153 $content[0] = bp_activity_insert_time_since( $content[0], $date_recorded ); 154 155 /* Switch 'their/your' depending on whether the user is logged in or not and viewing their profile */ 156 if ( $filter_words ) { 157 $content[0] = str_replace( __('their', 'buddypress'), __('your', 'buddypress'), $content[0] ); 158 } 148 159 149 /* Switch 'their/your' and 'Name/You' depending on whether the user is logged in or not and viewing their profile */ 150 if ( $is_home ) { 151 $content[0] = str_replace( __('their', 'buddypress'), __('your', 'buddypress'), $content[0] ); 152 $content[0] = str_replace( $full_name, __('You', 'buddypress'), $content[0] ); 160 /* Remove the 'You' and replace if with the persons name */ 161 if ( $filter_you ) { 162 $content[0] = str_replace( $full_name, __('You', 'buddypress'), $content[0] ); 153 163 } 154 164 … … 169 179 170 180 181 171 182 ?> -
trunk/bp-activity/bp-activity-widgets.php
r391 r436 35 35 <?php foreach( $activity as $item ) : ?> 36 36 <li class="<?php echo $item['component_name'] ?>"> 37 <?php echo bp_activity_content_filter( $item['content'], $item['date_recorded'], false );?>37 <?php echo bp_activity_content_filter( $item['content'], $item['date_recorded'], '', true, false, true );?> 38 38 </li> 39 39 <?php endforeach; ?> -
trunk/bp-core.php
r431 r436 3 3 /* Define the current version number for checking if DB tables are up to date. */ 4 4 define( 'BP_CORE_VERSION', '0.2.6.1' ); 5 6 /* Define the slug for member pages and the members directory (e.g. domain.com/[members] ) */ 7 define( 'MEMBERS_SLUG', 'members' ); 8 9 /* These components are accessed via the root, and not under a blog name or home base. 10 e.g Groups is accessed via: http://domain.com/groups/group-name NOT http://domain.com.andy/groups/group-name */ 11 define( 'BP_CORE_ROOT_COMPONENTS', MEMBERS_SLUG . ',groups' ); 5 12 6 13 /* Load the language file */ 7 14 if ( file_exists(ABSPATH . 'wp-content/mu-plugins/bp-languages/buddypress-' . get_locale() . '.mo') ) 8 15 load_textdomain( 'buddypress', ABSPATH . 'wp-content/mu-plugins/bp-languages/buddypress-' . get_locale() . '.mo' ); 9 10 /* These components are accessed via the root, and not under a blog name or home base.11 e.g Groups is accessed via: http://domain.com/groups/group-name NOT http://domain.com.andy/groups/group-name */12 define( 'BP_CORE_ROOT_COMPONENTS', 'groups,members' );13 16 14 17 /* Functions to handle pretty URLs and breaking them down into usable variables */ … … 180 183 $ud = get_userdata($user_id); 181 184 182 return $bp['root_domain'] . '/ members/' . $ud->user_login . '/';185 return $bp['root_domain'] . '/' . MEMBERS_SLUG . '/' . $ud->user_login . '/'; 183 186 } 184 187 … … 414 417 $ud = get_userdata($uid); 415 418 416 return $bp['root_domain'] . '/ members/' . $ud->user_login . '/';419 return $bp['root_domain'] . '/' . MEMBERS_SLUG . '/' . $ud->user_login . '/'; 417 420 } 418 421 -
trunk/bp-core/bp-core-ajax.php
r432 r436 69 69 foreach ( (array) $users as $user ) { 70 70 ?> 71 <?php $user_obj = new BP_Core_User( $user->user_id, true ); ?> 71 72 <li> 72 73 <div class="item-avatar"> 73 <?php echo bp_core_get_avatar( $user->user_id, 1 )?>74 <?php echo $user_obj->avatar_thumb ?> 74 75 </div> 75 76 76 77 <div class="item"> 77 <div class="item-title"><?php echo bp_core_get_userlink( $user->user_id ) ?></div> 78 <div class="item-meta"> 79 <span class="activity"> 80 <?php echo bp_core_get_last_activity( get_usermeta( $user->user_id, 'last_activity' ), __('active '), __(' ago') ); ?> 81 </span> 78 <div class="item-title"><?php echo $user_obj->user_link ?></div> 79 <div class="item-meta"><span class="activity"><?php echo $user_obj->last_active ?></span></div> 80 </div> 81 82 <div class="action"> 83 <?php bp_add_friend_button( $user_obj->id ) ?> 84 <div class="meta"> 85 <?php if ( $user_obj->total_friends ) echo $user_obj->total_friends ?><?php if ( $user_obj->total_blogs ) echo ', ' . $user_obj->total_blogs ?><?php if ( $user_obj->total_groups ) echo ', ' . $user_obj->total_groups ?> 82 86 </div> 83 87 </div> 88 89 <div class="clear"></div> 84 90 </li> 85 91 <?php -
trunk/bp-core/bp-core-avatars.php
r432 r436 195 195 196 196 function bp_core_check_avatar_upload($file) { 197 if ( !isset($file['file']) || $file['file']['size'] == 0)197 if ( $file['error'] ) 198 198 return false; 199 199 … … 446 446 447 447 function bp_core_ap_die( $msg ) { 448 global $bp; 448 449 echo '<p><strong>' . $msg . '</strong></p>'; 449 echo '<p><a href="' . $bp['loggedin_domain']. '/' . $bp['profile']['slug'] . '/change-avatar">' . __('Try Again', 'buddypress') . '</a></p>';450 echo '<p><a href="' . site_url() . '/' . $bp['profile']['slug'] . '/change-avatar">' . __('Try Again', 'buddypress') . '</a></p>'; 450 451 echo '</div>'; 451 452 exit; -
trunk/bp-core/bp-core-catchuri.php
r431 r436 72 72 $bp_uri = array_merge( array(), $bp_uri ); 73 73 74 if ( $bp_uri[0] == 'members'&& $bp_uri[1] != '' ) {74 if ( $bp_uri[0] == MEMBERS_SLUG && $bp_uri[1] != '' ) { 75 75 $is_member_page = true; 76 76 $is_root_component = true; -
trunk/bp-core/bp-core-classes.php
r430 r436 80 80 81 81 function populate_extras() { 82 global $bp; 83 82 84 $this->total_friends = BP_Friends_Friendship::total_friend_count( $this->id ); 83 85 … … 87 89 else 88 90 $this->total_friends .= ' ' . __( 'friends', 'buddypress' ); 91 92 $this->total_friends = '<a href="' . $this->user_url . $bp['friends']['slug'] . '" title="' . sprintf( __( "%s's friend list", 'buddypress' ), $this->fullname ) . '">' . $this->total_friends . '</a>'; 89 93 } 90 94 … … 94 98 else 95 99 $this->total_blogs .= ' ' . __( 'blogs', 'buddypress' ); 100 101 $this->total_blogs = '<a href="' . $this->user_url . $bp['blogs']['slug'] . '" title="' . sprintf( __( "%s's blog list", 'buddypress' ), $this->fullname ) . '">' . $this->total_blogs . '</a>'; 96 102 } 97 103 … … 104 110 else 105 111 $this->total_groups .= ' ' . __( 'groups', 'buddypress' ); 112 113 $this->total_groups = '<a href="' . $this->user_url . $bp['groups']['slug'] . '" title="' . sprintf( __( "%s's group list", 'buddypress' ), $this->fullname ) . '">' . $this->total_groups . '</a>'; 106 114 } 107 115 } -
trunk/bp-core/bp-core-cssjs.php
r394 r436 43 43 wp_enqueue_style( 'bp-admin-bar', site_url() . '/wp-content/mu-plugins/bp-core/css/admin-bar.css' ); 44 44 } 45 46 /* If you want custom css styles, include a custom-styles.css file in /bp-core/css/custom-styles.css */ 47 if ( file_exists(ABSPATH . MUPLUGINDIR . '/bp-core/css/custom-styles.css') ) 48 wp_enqueue_style( 'bp-core-custom-styles', site_url() . MUPLUGINDIR . '/bp-core/css/custom-styles.css' ); 49 45 50 wp_print_styles(); 46 51 } -
trunk/bp-core/bp-core-widgets.php
r394 r436 101 101 <div class="item-options" id="members-list-options"> 102 102 <img id="ajax-loader-members" src="<?php echo $bp['core']['image_base'] ?>/ajax-loader.gif" height="7" alt="Loading" style="display: none;" /> 103 <a href="<?php echo site_url() . '/ members'?>" id="newest-members" class="selected"><?php _e("Newest", 'buddypress') ?></a> |104 <a href="<?php echo site_url() . '/ members'?>" id="recently-active-members"><?php _e("Active", 'buddypress') ?></a> |105 <a href="<?php echo site_url() . '/ members'?>" id="popular-members"><?php _e("Popular", 'buddypress') ?></a>103 <a href="<?php echo site_url() . '/' . MEMBERS_SLUG ?>" id="newest-members" class="selected"><?php _e("Newest", 'buddypress') ?></a> | 104 <a href="<?php echo site_url() . '/' . MEMBERS_SLUG ?>" id="recently-active-members"><?php _e("Active", 'buddypress') ?></a> | 105 <a href="<?php echo site_url() . '/' . MEMBERS_SLUG ?>" id="popular-members"><?php _e("Popular", 'buddypress') ?></a> 106 106 </div> 107 107 <ul id="members-list" class="item-list"> -
trunk/bp-core/css/directory-members.css
r394 r436 6 6 ul#letter-list li { 7 7 float: left; 8 margin: 0 14px 14px 0;8 margin: 0 4px 3px 0; 9 9 } 10 10 ul#letter-list li a { 11 11 display: block; 12 12 background: #eee; 13 padding: 5px; 14 width: 22px; 13 width: 20px; 15 14 text-align: center; 16 15 text-decoration: none; … … 24 23 color: #f7740a; 25 24 } 25 26 ul#members-list li { 27 position: relative; 28 } 26 29 27 30 ul#members-list li .item-avatar, .avatar-block img.avatar { … … 51 54 margin: -15px 0 5px 0; 52 55 } 56 57 ul#members-list li div.action { 58 position: absolute; 59 top: 20%; 60 right: 1em; 61 text-align: right; 62 } 63 div.action div.friendship-button { 64 margin-bottom: 5px; 65 } 66 67 div.action div.meta { 68 font-size: 0.9em; 69 } 70 71 ul#members-list li a.add, ul#members-list li a.remove, ul#members-list li div.pending { 72 background: url(../images/add_friend_button.gif) top left no-repeat; 73 text-indent: -999em; 74 display: block; 75 overflow: hidden; 76 width: 102px; 77 text-align: left; 78 } 79 80 ul#members-list li a.remove { 81 background: url(../images/remove_friend_button.gif) top left no-repeat; 82 width: 121px; 83 } 84 85 ul#members-list li div.pending { 86 background: url(../images/requested_friend_button.gif) top left no-repeat; 87 width: 136px; 88 } 89 90 91 92 -
trunk/bp-core/directories/bp-core-directory-members.php
r431 r436 3 3 global $bp, $current_blog; 4 4 5 if ( $bp['current_component'] == 'members'&& $bp['current_action'] == '' ) {5 if ( $bp['current_component'] == MEMBERS_SLUG && $bp['current_action'] == '' ) { 6 6 add_action( 'bp_template_content', 'bp_core_directory_members_content' ); 7 7 add_action( 'bp_template_sidebar', 'bp_core_directory_members_sidebar' ); … … 79 79 <div class="action"> 80 80 <?php bp_add_friend_button( $user_obj->id ) ?> 81 < ?php if ( $user_obj->total_friends ) echo $user_obj->total_friends ?>82 <?php if ( $user_obj->total_blogs ) echo $user_obj->total_blogs ?>83 < ?php if ( $user_obj->total_groups ) echo $user_obj->total_groups ?>81 <div class="meta"> 82 <?php if ( $user_obj->total_friends ) echo $user_obj->total_friends ?><?php if ( $user_obj->total_blogs ) echo ', ' . $user_obj->total_blogs ?><?php if ( $user_obj->total_groups ) echo ', ' . $user_obj->total_groups ?> 83 </div> 84 84 </div> 85 85 … … 90 90 <?php endif; ?> 91 91 </div> 92 <?php wp_nonce_field('directory_members' ) ?>92 <?php wp_nonce_field('directory_members', '_wpnonce-member-filter' ) ?> 93 93 </form> 94 95 96 94 <?php 97 95 } … … 102 100 <div class="widget"> 103 101 <h2 class="widgettitle"><?php _e('Search Members') ?></h2> 104 <form action="<?php echo site_url() . '/ members/search/' ?>" method="post" id="search-members-form">102 <form action="<?php echo site_url() . '/' . MEMBERS_SLUG . '/search/' ?>" method="post" id="search-members-form"> 105 103 <label><input type="text" name="members_search" id="members_search" value="" /></label> 106 104 <input type="submit" id="members_search_submit" name="members_search_submit" value="Search" /> -
trunk/bp-core/js/directory-members.js
r394 r436 13 13 action: 'directory_members', 14 14 'cookie': encodeURIComponent(document.cookie), 15 '_wpnonce': jQuery("input#_wpnonce ").val(),15 '_wpnonce': jQuery("input#_wpnonce-member-filter").val(), 16 16 'letter': letter[1], 17 17 }, -
trunk/bp-core/js/general.js
r309 r436 2 2 jQuery("div.friendship-button a").livequery('click', 3 3 function(e) { 4 jQuery(this).toggle();5 jQuery(this).before('<span id="working">Working...</span>');6 7 4 var fid = jQuery(this).attr('id'); 8 5 fid = fid.split('-'); … … 21 18 22 19 var action = thelink.attr('rel'); 23 20 var parentdiv = thelink.parent(); 21 24 22 if ( action == 'add' ) { 25 jQuery("#working").html(response); 26 } else { 27 jQuery("#working").toggle(); 28 thelink.html(response); 29 thelink.attr('rel', 'add'); 30 thelink.removeClass('remove'); 31 thelink.toggle(); 23 jQuery(parentdiv).fadeOut(200, 24 function() { 25 parentdiv.removeClass('add_friend'); 26 parentdiv.addClass('pending'); 27 parentdiv.fadeIn(200).html(response); 28 } 29 ); 30 31 } else if ( action == 'remove' ) { 32 jQuery(parentdiv).fadeOut(200, 33 function() { 34 parentdiv.removeClass('remove_friend'); 35 parentdiv.addClass('add'); 36 parentdiv.fadeIn(200).html(response); 37 } 38 ); 32 39 } 33 34 40 }); 35 41 return false; -
trunk/bp-friends/bp-friends-ajax.php
r431 r436 112 112 113 113 if ( BP_Friends_Friendship::check_is_friend( $bp['loggedin_userid'], $_POST['fid'] ) == 'is_friend' ) { 114 if ( !friends_remove_friend( $bp['loggedin_userid'], $ bp['current_userid'] ) ) {114 if ( !friends_remove_friend( $bp['loggedin_userid'], $_POST['fid'] ) ) { 115 115 echo __("Friendship could not be canceled.", 'buddypress'); 116 116 } else { 117 friends_update_friend_totals( $bp['loggedin_userid'], $ bp['current_userid'], 'remove' );118 echo __('Add Friend', 'buddypress');117 friends_update_friend_totals( $bp['loggedin_userid'], $_POST['fid'], 'remove' ); 118 echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . $bp['loggedin_domain'] . $bp['friends']['slug'] . '/add-friend/' . $_POST['fid'] . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; 119 119 } 120 120 } else if ( BP_Friends_Friendship::check_is_friend( $bp['loggedin_userid'], $_POST['fid'] ) == 'not_friends' ) { … … 122 122 echo __("Friendship could not be requested.", 'buddypress'); 123 123 } else { 124 echo __('Friendship Requested', 'buddypress'); 124 echo 'Friendship Requested'; 125 //echo '<a id="friend-' . $_POST['fid'] . '" class="remove" rel="remove" title="' . __( 'Remove Friend', 'buddypress' ) . '" href="' . $bp['loggedin_domain'] . $bp['friends']['slug'] . '/remove-friend/' . $_POST['fid'] . '">' . __( 'Remove Friend', 'buddypress' ) . '</a>'; 125 126 } 126 127 } else { -
trunk/bp-friends/bp-friends-templatetags.php
r396 r436 324 324 $friend_status = BP_Friends_Friendship::check_is_friend( $bp['loggedin_userid'], $potential_friend_id ); 325 325 326 echo '<div class="friendship-button " id="friendship-button-' . $potential_friend_id . '">';326 echo '<div class="friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">'; 327 327 if ( $friend_status == 'pending' ) { 328 328 _e('Friendship Requested', 'buddypress'); … … 330 330 echo '<a href="' . $bp['loggedin_domain'] . $bp['friends']['slug'] . '/remove-friend/' . $potential_friend_id . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>'; 331 331 } else { 332 echo '<a href="' . $bp['loggedin_domain'] . $bp['friends']['slug'] . '/add-friend/' . $potential_friend_id . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" >' . __('Add Friend', 'buddypress') . '</a>';332 echo '<a href="' . $bp['loggedin_domain'] . $bp['friends']['slug'] . '/add-friend/' . $potential_friend_id . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>'; 333 333 } 334 334 echo '</div>'; -
trunk/bp-groups/bp-groups-templatetags.php
r396 r436 255 255 function bp_group_all_members_permalink() { 256 256 global $groups_template, $bp; 257 echo bp_group_permalink( false, true ) . '/ members';257 echo bp_group_permalink( false, true ) . '/' . MEMBERS_SLUG ; 258 258 } 259 259 … … 600 600 <?php } else { ?> 601 601 <div id="message" class="info"> 602 <p><?php bp_word_or_name( __( "You haven't oined any groups yet.", 'buddypress' ), __( "%s hasn't joined any groups yet.", 'buddypress' ) ) ?></p>602 <p><?php bp_word_or_name( __( "You haven't joined any groups yet.", 'buddypress' ), __( "%s hasn't joined any groups yet.", 'buddypress' ) ) ?></p> 603 603 </div> 604 604 <?php } ?> -
trunk/bp-wire/bp-wire-templatetags.php
r431 r436 213 213 214 214 if ( $bp['current_component'] == 'wire' || $bp['current_component'] == 'profile' ) { 215 echo site_url() . '/'. $bp['wire']['slug'] . '/post/';215 echo $bp['current_domain'] . $bp['wire']['slug'] . '/post/'; 216 216 } else { 217 echo site_url() . '/'. $bp[$bp['current_component']]['slug'] . '/' . $uri . '/wire/post/';217 echo $bp['current_domain'] . $bp[$bp['current_component']]['slug'] . '/' . $uri . '/wire/post/'; 218 218 } 219 219 } -
trunk/bp-xprofile/bp-xprofile-signup.php
r432 r436 152 152 2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(CORE_MAX_FILE_SIZE), 153 153 3 => __("The uploaded file was only partially uploaded", 'buddypress'), 154 4 => __("No file was uploaded", 'buddypress'),155 154 6 => __("Missing a temporary folder", 'buddypress') 156 155 ); 157 156 158 if ( !$checked_upload = bp_core_check_avatar_upload($_FILES) ) { 159 $avatar_error = true; 160 $avatar_error_msg = $uploadErrors[$_FILES['file']['error']]; 161 } 162 163 if ( $checked_upload && !$checked_size = bp_core_check_avatar_size($_FILES) ) { 164 $avatar_error = true; 165 $avatar_size = size_format(CORE_MAX_FILE_SIZE); 166 $avatar_error_msg = sprintf( __('The file you uploaded is too big. Please upload a file under %s', 'buddypress'), $avatar_size); 167 } 168 169 if ( $checked_upload && $checked_size && !$checked_type = bp_core_check_avatar_type($_FILES) ) { 170 $avatar_error = true; 171 $avatar_error_msg = __('Please upload only JPG, GIF or PNG photos.', 'buddypress'); 172 } 173 174 // "Handle" upload into temporary location 175 if ( $checked_upload && $checked_size && $checked_type && !$original = bp_core_handle_avatar_upload($_FILES) ) { 176 $avatar_error = true; 177 $avatar_error_msg = __('Upload Failed! Your photo dimensions are likely too big.', 'buddypress'); 178 } 179 180 if ( $checked_upload && $checked_size && $checked_type && $original && !$checked_dims = bp_core_check_avatar_dimensions($original) ) { 181 $avatar_error = true; 182 $avatar_error_msg = sprintf( __('The image you upload must have dimensions of %d x %d pixels or larger.', 'buddypress'), CORE_AVATAR_V2_W, CORE_AVATAR_V2_W ); 183 } 184 185 if ( $checked_upload && $checked_size && $checked_type && $original && $checked_dims && !$canvas = bp_core_resize_avatar($original) ) 186 $canvas = $original; 187 157 if ( $_FILES['file']['error'] !== 4 ) { 158 if ( !$checked_upload = bp_core_check_avatar_upload($_FILES) ) { 159 $avatar_error = true; 160 $avatar_error_msg = $uploadErrors[$_FILES['file']['error']]; 161 } 162 163 if ( $checked_upload && !$checked_size = bp_core_check_avatar_size($_FILES) ) { 164 $avatar_error = true; 165 $avatar_size = size_format(CORE_MAX_FILE_SIZE); 166 $avatar_error_msg = sprintf( __('The file you uploaded is too big. Please upload a file under %s', 'buddypress'), $avatar_size); 167 } 168 169 if ( $checked_upload && $checked_size && !$checked_type = bp_core_check_avatar_type($_FILES) ) { 170 $avatar_error = true; 171 $avatar_error_msg = __('Please upload only JPG, GIF or PNG photos.', 'buddypress'); 172 } 173 174 // "Handle" upload into temporary location 175 if ( $checked_upload && $checked_size && $checked_type && !$original = bp_core_handle_avatar_upload($_FILES) ) { 176 $avatar_error = true; 177 $avatar_error_msg = __('Upload Failed! Your photo dimensions are likely too big.', 'buddypress'); 178 } 179 180 if ( $checked_upload && $checked_size && $checked_type && $original && !$checked_dims = bp_core_check_avatar_dimensions($original) ) { 181 $avatar_error = true; 182 $avatar_error_msg = sprintf( __('The image you upload must have dimensions of %d x %d pixels or larger.', 'buddypress'), CORE_AVATAR_V2_W, CORE_AVATAR_V2_W ); 183 } 184 185 if ( $checked_upload && $checked_size && $checked_type && $original && $checked_dims && !$canvas = bp_core_resize_avatar($original) ) 186 $canvas = $original; 187 } 188 188 189 if ( !$has_errors && !$avatar_error ) { 189 190 $public = (int) $_POST['blog_public'];
Note: See TracChangeset
for help on using the changeset viewer.