Changeset 373
- Timestamp:
- 10/07/2008 07:16:51 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 25 edited
-
bp-activity.php (modified) (2 diffs)
-
bp-blogs.php (modified) (6 diffs)
-
bp-blogs/bp-blogs-classes.php (modified) (2 diffs)
-
bp-blogs/bp-blogs-cssjs.php (modified) (1 diff)
-
bp-core.php (modified) (9 diffs)
-
bp-core/bp-core-adminbar.php (modified) (2 diffs)
-
bp-core/bp-core-avatars.php (modified) (5 diffs)
-
bp-core/bp-core-classes.php (modified) (2 diffs)
-
bp-core/bp-core-cssjs.php (modified) (3 diffs)
-
bp-friends.php (modified) (4 diffs)
-
bp-friends/bp-friends-ajax.php (modified) (1 diff)
-
bp-friends/bp-friends-classes.php (modified) (2 diffs)
-
bp-friends/bp-friends-cssjs.php (modified) (1 diff)
-
bp-groups.php (modified) (7 diffs)
-
bp-groups/bp-groups-classes.php (modified) (3 diffs)
-
bp-groups/bp-groups-cssjs.php (modified) (1 diff)
-
bp-groups/bp-groups-templatetags.php (modified) (1 diff)
-
bp-messages.php (modified) (2 diffs)
-
bp-messages/bp-messages-cssjs.php (modified) (3 diffs)
-
bp-wire.php (modified) (2 diffs)
-
bp-xprofile.php (modified) (2 diffs)
-
bp-xprofile/bp-xprofile-cssjs.php (modified) (4 diffs)
-
bp-xprofile/bp-xprofile-signup.php (modified) (2 diffs)
-
buddypress-theme/home/comments-popup.php (modified) (1 diff)
-
buddypress-theme/home/comments.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r356 r373 3 3 4 4 define ( 'BP_ACTIVITY_IS_INSTALLED', 1 ); 5 define ( 'BP_ACTIVITY_VERSION', '0.1. 7' );5 define ( 'BP_ACTIVITY_VERSION', '0.1.8' ); 6 6 7 7 /* Use english formatted times - e.g. 6 hours / 8 hours / 1 day / 15 minutes */ … … 90 90 'table_name_loggedin_user_friends_cached' => $wpdb->base_prefix . $bp['loggedin_homebase_id'] . '_friends_activity_cached', 91 91 92 'image_base' => get_option('siteurl') . '/wp-content/mu-plugins/bp-activity/images',92 'image_base' => site_url() . '/wp-content/mu-plugins/bp-activity/images', 93 93 'slug' => 'activity' 94 94 ); -
trunk/bp-blogs.php
r371 r373 3 3 4 4 define ( 'BP_BLOGS_IS_INSTALLED', 1 ); 5 define ( 'BP_BLOGS_VERSION', '0.1. 1' );5 define ( 'BP_BLOGS_VERSION', '0.1.2' ); 6 6 7 7 /* These will be moved into admin configurable settings */ … … 10 10 11 11 include_once( 'bp-blogs/bp-blogs-classes.php' ); 12 include_once( 'bp-blogs/bp-blogs-cssjs.php' ); 13 include_once( 'bp-blogs/bp-blogs-templatetags.php' ); 14 include_once( 'bp-blogs/bp-blogs-widgets.php' ); 12 15 //include_once( 'bp-blogs/bp-blogs-ajax.php' ); 13 include_once( 'bp-blogs/bp-blogs-cssjs.php' ); 14 /*include_once( 'bp-blogs/bp-blogs-admin.php' );*/ 15 include_once( 'bp-blogs/bp-blogs-templatetags.php' ); 16 16 //include_once( 'bp-blogs/bp-blogs-admin.php' ); 17 17 18 18 /************************************************************************** … … 105 105 'table_name_blog_comments' => $wpdb->base_prefix . 'bp_user_blogs_comments', 106 106 'format_activity_function' => 'bp_blogs_format_activity', 107 'image_base' => get_option('siteurl') . '/wp-content/mu-plugins/bp-groups/images',107 'image_base' => site_url() . '/wp-content/mu-plugins/bp-groups/images', 108 108 'slug' => 'blogs' 109 109 ); … … 455 455 456 456 function bp_blogs_register_existing_content( $blog_id ) { 457 global $ wpdb, $bp;457 global $bp, $current_blog; 458 458 459 459 if ( !$bp ) { … … 470 470 bp_blogs_record_blog( (int)$blog->userblog_id, (int)$user_id ); 471 471 472 $wpdb->set_blog_id( $blog->userblog_id );472 switch_to_blog( $blog->userblog_id ); 473 473 $posts_for_blog = bp_core_get_all_posts_for_user( $user_id ); 474 474 … … 479 479 } 480 480 } 481 482 switch_to_blog( $current_blog->blog_id ); 481 483 } 482 484 add_action( 'bp_homebase_signup_completed', 'bp_blogs_register_existing_content', 10 ); 483 485 486 function bp_blogs_get_latest_posts( $blog_id = null, $limit = 5 ) { 487 global $bp; 488 489 if ( !is_numeric( $limit ) ) 490 $limit = 5; 491 492 return BP_Blogs_Post::get_latest_posts( $blog_id, $limit ); 493 } 494 484 495 485 496 ?> -
trunk/bp-blogs/bp-blogs-classes.php
r371 r373 84 84 $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM " . $bp['blogs']['table_name'] . " WHERE user_id = %d", $user_id) ); 85 85 $total_blog_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(blog_id) FROM " . $bp['blogs']['table_name'] . " WHERE user_id = %d", $user_id) ); 86 86 87 87 for ( $i = 0; $i < count($blog_ids); $i++ ) { 88 88 $blogs[] = array( … … 183 183 } 184 184 185 function get_latest_posts( $blog_id = null, $limit = 5 ) { 186 global $wpdb, $bp; 187 188 if ( $blog_id ) 189 $blog_sql = $wpdb->prepare( " WHERE blog_id = %d", $blog_id ); 190 191 $post_ids = $wpdb->get_results( $wpdb->prepare( "SELECT post_id, blog_id FROM " . $bp['blogs']['table_name_blog_posts'] . "$blog_sql ORDER BY date_created DESC LIMIT $limit" ) ); 192 193 for ( $i = 0; $i < count($post_ids); $i++ ) { 194 $posts[$i] = BP_Blogs_Post::fetch_post_content($post_ids[$i]); 195 } 196 197 return $posts; 198 } 199 185 200 function get_posts_for_user( $user_id = null ) { 186 201 global $bp, $wpdb; -
trunk/bp-blogs/bp-blogs-cssjs.php
r359 r373 6 6 if ( $wpdb->blogid == $bp['current_homebase_id'] ) { 7 7 if ( strpos( $_GET['page'], 'bp-blogs' ) !== false ) { 8 wp_enqueue_style('bp-blogs-admin-css', get_option('siteurl') . '/wp-content/mu-plugins/bp-blogs/admin-tabs/admin.css');8 wp_enqueue_style('bp-blogs-admin-css', site_url() . '/wp-content/mu-plugins/bp-blogs/admin-tabs/admin.css'); 9 9 } 10 10 } -
trunk/bp-core.php
r371 r373 1 1 <?php 2 3 /* Define the protocol to be used, change to https:// if on secure server. */4 define( 'PROTOCOL', 'http://' );5 6 2 /* Define the current version number for checking if DB tables are up to date. */ 7 define( 'BP_CORE_VERSION', '0.2. 4' );3 define( 'BP_CORE_VERSION', '0.2.5' ); 8 4 9 5 /* Require all needed files */ 10 require_once( ABSPATH . 'wp-content/mu-plugins/bp-core/bp-core-catchuri.php' ); 11 require_once( ABSPATH . 'wp-content/mu-plugins/bp-core/bp-core-classes.php' ); 12 require_once( ABSPATH . 'wp-content/mu-plugins/bp-core/bp-core-cssjs.php' ); 13 require_once( ABSPATH . 'wp-content/mu-plugins/bp-core/bp-core-avatars.php' ); 14 require_once( ABSPATH . 'wp-content/mu-plugins/bp-core/bp-core-templatetags.php' ); 15 require_once( ABSPATH . 'wp-content/mu-plugins/bp-core/bp-core-adminbar.php' ); 16 require_once( ABSPATH . 'wp-content/mu-plugins/bp-core/admin-mods/bp-core-remove-blogtabs.php' ); 17 require_once( ABSPATH . 'wp-content/mu-plugins/bp-core/admin-mods/bp-core-admin-styles.php' ); 18 require_once( ABSPATH . 'wp-content/mu-plugins/bp-core/homebase-creation/bp-core-homebase-functions.php' ); 6 require_once( 'bp-core/bp-core-catchuri.php' ); 7 require_once( 'bp-core/bp-core-classes.php' ); 8 require_once( 'bp-core/bp-core-cssjs.php' ); 9 require_once( 'bp-core/bp-core-avatars.php' ); 10 require_once( 'bp-core/bp-core-templatetags.php' ); 11 require_once( 'bp-core/bp-core-adminbar.php' ); 12 require_once( 'bp-core/bp-core-widgets.php' ); 13 require_once( 'bp-core/bp-core-ajax.php' ); 14 require_once( 'bp-core/admin-mods/bp-core-remove-blogtabs.php' ); 15 require_once( 'bp-core/admin-mods/bp-core-admin-styles.php' ); 16 require_once( 'bp-core/homebase-creation/bp-core-homebase-functions.php' ); 17 19 18 20 19 /** … … 102 101 $bp['is_item_admin'] = bp_is_home(); 103 102 103 $bp['core'] = array( 104 'image_base' => site_url() . '/wp-content/mu-plugins/bp-core/images', 105 ); 106 107 104 108 if ( !$bp['current_component'] ) 105 109 $bp['current_component'] = $bp['default_component']; … … 194 198 global $current_blog; 195 199 196 if ( VHOST == 'yes' ) { 197 $current_domain = PROTOCOL . $current_blog->domain . '/'; 198 } else { 199 $current_domain = get_bloginfo('wpurl') . '/'; 200 } 201 202 return $current_domain; 200 return get_blog_option( $current_blog->blog_id, 'siteurl' ) . '/'; 203 201 } 204 202 … … 273 271 * @return false if no, or true if yes. 274 272 */ 275 function bp_core_user_has_home( ) {273 function bp_core_user_has_home( $user_id = false ) { 276 274 global $bp; 277 275 278 if ( $bp['loggedin_homebase_id'] == '' ) 279 return false; 280 281 return true; 276 if ( !$user_id ) { 277 if ( $bp['loggedin_homebase_id'] == '' ) 278 return false; 279 280 return $bp['loggedin_homebase_id']; 281 } else { 282 return get_usermeta( $user_id, 'home_base' ); 283 } 282 284 } 283 285 … … 964 966 // array of time period chunks 965 967 $chunks = array( 966 array( 60 * 60 * 24 * 365 , 'year' ), 967 array( 60 * 60 * 24 * 30 , 'month' ), 968 array( 60 * 60 * 24 * 7, 'week' ), 969 array( 60 * 60 * 24 , 'day' ), 970 array( 60 * 60 , 'hour' ), 971 array( 60 , 'minute' ), 968 array( 60 * 60 * 24 * 365 , __('year') ), 969 array( 60 * 60 * 24 * 30 , __('month') ), 970 array( 60 * 60 * 24 * 7, __('week') ), 971 array( 60 * 60 * 24 , __('day') ), 972 array( 60 * 60 , __('hour') ), 973 array( 60 , __('minute') ), 974 array( 1, __('second') ) 972 975 ); 973 976 … … 1003 1006 $seconds2 = $chunks[$i + 1][0]; 1004 1007 $name2 = $chunks[$i + 1][1]; 1008 1009 if ( $name2 == __('second') ) return $output; 1005 1010 1006 1011 if ( ( $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 ) ) != 0 ) { … … 1018 1023 * Record user activity to the database. Many functions use a "last active" feature to 1019 1024 * show the length of time since the user was last active. 1020 * This function will update that time as a usermeta setting for the user .1025 * This function will update that time as a usermeta setting for the user every 5 minutes. 1021 1026 * 1022 1027 * @package BuddyPress Core … … 1025 1030 */ 1026 1031 function bp_core_record_activity() { 1027 global $userdata; 1028 1029 // Updated last site activity for this user. 1030 update_usermeta( $userdata->ID, 'last_activity', time() ); 1031 } 1032 add_action( 'login_head', 'bp_core_record_activity' ); 1032 global $bp; 1033 1034 if ( !is_user_logged_in() ) 1035 return false; 1036 1037 if ( time() >= strtotime('+5 minutes', get_usermeta( $bp['loggedin_userid'], 'last_activity') ) || get_usermeta( $bp['loggedin_userid'], 'last_activity') == '' ) { 1038 // Updated last site activity for this user. 1039 update_usermeta( $bp['loggedin_userid'], 'last_activity', time() ); 1040 } 1041 } 1042 add_action( 'wp_head', 'bp_core_record_activity' ); 1043 1044 1045 /** 1046 * bp_core_get_last_activity() 1047 * 1048 * Formats last activity based on time since date given. 1049 * 1050 * @package BuddyPress Core 1051 * @param last_activity_date The date of last activity. 1052 * @param $before The text to prepend to the activity time since figure. 1053 * @param $after The text to append to the activity time since figure. 1054 * @uses bp_core_time_since() This function will return an English representation of the time elapsed. 1055 */ 1056 function bp_core_get_last_activity( $last_activity_date, $before, $after ) { 1057 if ( !$last_activity_date || $last_activity_date == '' ) { 1058 $last_active = __('not recently active'); 1059 } else { 1060 $last_active = $before; 1061 1062 if ( strstr( $last_activity_date, '-' ) ) { 1063 $last_active .= bp_core_time_since( strtotime( $last_activity_date ) ); 1064 } else { 1065 $last_active .= bp_core_time_since( $last_activity_date ); 1066 } 1067 1068 $last_active .= $after; 1069 } 1070 1071 return $last_active; 1072 } 1033 1073 1034 1074 /** … … 1130 1170 return $new_nav; 1131 1171 } 1172 1173 function bp_core_remove_data( $user_id ) { 1174 /* When the user is deleted, we must automatically delete their home base blog */ 1175 if ( $home_base_id = bp_core_user_has_home($user_id) ) 1176 wpmu_delete_blog( $home_base_id, true ); 1177 1178 /* Remove usermeta */ 1179 delete_usermeta( $user_id, 'home_base' ); 1180 delete_usermeta( $user_id, 'last_activity' ); 1181 } 1182 add_action( 'wpmu_delete_user', 'bp_core_remove_data', 1 ); 1183 add_action( 'delete_user', 'bp_core_remove_data', 1 ); 1184 1132 1185 ?> -
trunk/bp-core/bp-core-adminbar.php
r309 r373 6 6 if ( is_user_logged_in() && bp_core_user_has_home() ) { 7 7 echo '<div id="wp-admin-bar">'; 8 echo '<a href="' . get_blog_option( 1, 'siteurl' ) . '"><img id="admin-bar-logo" src="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-core/images/admin_bar_logo.gif" alt="BuddyPress" /></a>';8 echo '<a href="' . get_blog_option( 1, 'siteurl' ) . '"><img id="admin-bar-logo" src="' . site_url() . '/wp-content/mu-plugins/bp-core/images/admin_bar_logo.gif" alt="BuddyPress" /></a>'; 9 9 echo '<ul class="main-nav">'; 10 10 … … 32 32 echo '</li>'; 33 33 } 34 echo '<li><a id="logout" href="' . get_option('siteurl') . '/wp-login.php?action=logout">' . __('Log Out') . '</a></li>';34 echo '<li><a id="logout" href="' . site_url() . '/wp-login.php?action=logout">' . __('Log Out') . '</a></li>'; 35 35 echo '</ul>'; 36 36 echo '</li>'; -
trunk/bp-core/bp-core-avatars.php
r372 r373 15 15 define( 'CORE_AVATAR_V2_H', 150 ); 16 16 define( 'CORE_MAX_FILE_SIZE', get_site_option('fileupload_maxk') * 1024 ); 17 define( 'CORE_DEFAULT_AVATAR', get_option('siteurl') . '/wp-content/mu-plugins/bp-xprofile/images/none.gif' );18 define( 'CORE_DEFAULT_AVATAR_THUMB', get_option('siteurl') . '/wp-content/mu-plugins/bp-xprofile/images/none-thumbnail.gif' );17 define( 'CORE_DEFAULT_AVATAR', site_url() . '/wp-content/mu-plugins/bp-xprofile/images/none.gif' ); 18 define( 'CORE_DEFAULT_AVATAR_THUMB', site_url() . '/wp-content/mu-plugins/bp-xprofile/images/none-thumbnail.gif' ); 19 19 20 20 function bp_core_get_avatar( $user, $version = 1, $no_tag = false, $width = null, $height = null ) { … … 91 91 <?php 92 92 if ( !$action ) 93 $action = get_option('siteurl') . '/wp-admin/admin.php?page=bp-xprofile.php';93 $action = site_url() . '/wp-admin/admin.php?page=bp-xprofile.php'; 94 94 95 95 if ( !$delete_action ) 96 $delete_action = get_option('siteurl') . '/wp-admin/admin.php?page=bp-xprofile.php&slick_avatars_action=delete';96 $delete_action = site_url() . '/wp-admin/admin.php?page=bp-xprofile.php&slick_avatars_action=delete'; 97 97 98 98 bp_core_render_avatar_upload_form($action); … … 242 242 243 243 function bp_core_resize_avatar($file, $size = CORE_CROPPING_CANVAS_MAX) { 244 $canvas = wp_create_thumbnail( $file, $size );245 246 if ( bp_core_thumb_error($canvas))244 $canvas = wp_create_thumbnail( $file, $size ); 245 246 if ( $canvas->errors ) 247 247 return false; 248 248 … … 302 302 echo '</div>'; 303 303 304 echo '<div id="avatar_v2" >';304 echo '<div id="avatar_v2" style="display: none">'; 305 305 echo '<h3>' . __('Alternate Avatar') . '</h3>'; 306 306 echo '<p>' . __('Please select the area of your photo you would like to use for an alternate version') . '(' . CORE_AVATAR_V2_W . 'px x ' . CORE_AVATAR_V2_H . 'px).</p>'; … … 471 471 } 472 472 473 function bp_core_add_cropper_js() {474 echo '<script type="text/javascript" src="' . get_option('home') . '/wp-includes/js/prototype.js"></script>';475 echo '<script type="text/javascript" src="' . get_option('home') . '/wp-includes/js/scriptaculous/scriptaculous.js"></script>';476 echo '<script type="text/javascript" src="' . get_option('home') . '/wp-includes/js/scriptaculous/dragdrop.js"></script>';477 echo '<script type="text/javascript" src="' . get_option('home') . '/wp-includes/js/crop/cropper.js"></script>';478 473 ?> 479 <style type="text/css">480 #avatar_v2 { display: none; }481 .crop-img { float: left; margin: 0 20px 15px 0; }482 </style>483 484 <script type="text/javascript">485 function cropAndContinue() {486 jQuery('#avatar_v1').slideUp();487 jQuery('#avatar_v2').slideDown('normal', function(){488 v2Cropper();489 });490 }491 492 function v1Cropper() {493 v1Crop = new Cropper.ImgWithPreview(494 'crop-v1-img',495 {496 ratioDim: { x: <?php echo round(CORE_AVATAR_V1_W / CORE_AVATAR_V1_H, 5); ?>, y: 1 },497 minWidth: <?php echo CORE_AVATAR_V1_W; ?>,498 minHeight: <?php echo CORE_AVATAR_V1_H; ?>,499 prevWidth: <?php echo CORE_AVATAR_V1_W; ?>,500 prevHeight: <?php echo CORE_AVATAR_V1_H; ?>,501 onEndCrop: onEndCropv1,502 previewWrap: 'crop-preview-v1'503 }504 );505 }506 507 function onEndCropv1(coords, dimensions) {508 jQuery('#v1_x1').val(coords.x1);509 jQuery('#v1_y1').val(coords.y1);510 jQuery('#v1_x2').val(coords.x2);511 jQuery('#v1_y2').val(coords.y2);512 jQuery('#v1_w').val(dimensions.width);513 jQuery('#v1_h').val(dimensions.height);514 }515 516 <?php if (CORE_AVATAR_V2_W !== false && CORE_AVATAR_V2_H !== false) { ?>517 function v2Cropper() {518 v1Crop = new Cropper.ImgWithPreview(519 'crop-v2-img',520 {521 ratioDim: { x: <?php echo round(CORE_AVATAR_V2_W / CORE_AVATAR_V2_H, 5); ?>, y: 1 },522 minWidth: <?php echo CORE_AVATAR_V2_W; ?>,523 minHeight: <?php echo CORE_AVATAR_V2_H; ?>,524 prevWidth: <?php echo CORE_AVATAR_V2_W; ?>,525 prevHeight: <?php echo CORE_AVATAR_V2_H; ?>,526 onEndCrop: onEndCropv2,527 previewWrap: 'crop-preview-v2'528 }529 );530 }531 <?php } ?>532 533 function onEndCropv2(coords, dimensions) {534 jQuery('#v2_x1').val(coords.x1);535 jQuery('#v2_y1').val(coords.y1);536 jQuery('#v2_x2').val(coords.x2);537 jQuery('#v2_y2').val(coords.y2);538 jQuery('#v2_w').val(dimensions.width);539 jQuery('#v2_h').val(dimensions.height);540 }541 </script>542 <?php543 }544 545 ?> -
trunk/bp-core/bp-core-classes.php
r309 r373 61 61 $this->fullname = bp_core_get_userlink( $this->id, true ); 62 62 $this->email = bp_core_get_user_email( $this->id ); 63 $this->last_active = bp_core_get_last_activity( get_usermeta( $this->id, 'last_activity' ), __('active '), __(' ago') ); 63 64 64 $last_activity = get_usermeta( $this->id, 'last_activity' ); 65 66 if ( !$last_activity || $last_activity == '' ) { 67 $this->last_active = __('not recently active'); 68 } else { 69 $this->last_active = __('active '); 70 71 if ( strstr( $last_activity, '-' ) ) { 72 $this->last_active .= bp_core_time_since( strtotime( get_usermeta( $this->id, 'last_activity' ) ) ); 73 } else { 74 $this->last_active .= bp_core_time_since( get_usermeta( $this->id, 'last_activity' ) ); 75 } 76 77 $this->last_active .= __(' ago'); 78 } 79 80 if ( BP_XPROFILE_IS_INSTALLED ) { 65 if ( function_exists('xprofile_install') ) { 81 66 $this->avatar = bp_core_get_avatar( $this->id, 2 ); 82 67 $this->avatar_thumb = bp_core_get_avatar( $this->id, 1 ); … … 86 71 } 87 72 88 if ( BP_STATUSES_IS_INSTALLED) {73 if ( function_exists('bp_statuses_install') ) { 89 74 $this->status = null; // TODO: Fetch status updates. 90 75 $this->status_last_updated = null; 91 76 } 92 77 } 78 79 /* Static Functions */ 80 81 function get_newest_users( $limit = 5 ) { 82 global $wpdb; 83 84 if ( !$limit ) 85 $limit = 5; 86 87 return $wpdb->get_results( $wpdb->prepare( "SELECT ID as user_id, user_registered FROM {$wpdb->base_prefix}users WHERE spam = 0 AND deleted = 0 AND user_status = 0 ORDER BY user_registered DESC LIMIT %d", $limit ) ); 88 } 89 90 function get_active_users( $limit = 5 ) { 91 global $wpdb; 92 93 if ( !$limit ) 94 $limit = 5; 95 96 return $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$wpdb->base_prefix}usermeta um WHERE meta_key = 'last_activity' ORDER BY meta_value ASC LIMIT %d", $limit ) ); 97 } 98 99 function get_popular_users( $limit = 5 ) { 100 global $wpdb; 101 102 if ( !function_exists('friends_install') ) 103 return false; 104 105 if ( !$limit ) 106 $limit = 5; 107 108 return $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$wpdb->base_prefix}usermeta um WHERE meta_key = 'total_friend_count' ORDER BY meta_value DESC LIMIT %d", $limit ) ); 109 110 } 111 93 112 } 94 113 -
trunk/bp-core/bp-core-cssjs.php
r309 r373 10 10 */ 11 11 function bp_core_add_js() { 12 echo '<script type="text/javascript">var ajaxurl = "' . get_option('siteurl') . '/wp-admin/admin-ajax.php";</script>'; 13 echo "<script type='text/javascript' src='" . get_option('siteurl') . "/wp-includes/js/jquery/jquery.js?ver=1.2.3'></script>"; 14 echo " 15 <script type='text/javascript' src='" . get_option('siteurl') . "/wp-content/mu-plugins/bp-core/js/jquery/jquery.livequery.pack.js'></script>"; 12 wp_enqueue_script( 'jquery' ); 13 wp_enqueue_script( 'jquery-livequery-pack', site_url() . "/wp-content/mu-plugins/bp-core/js/jquery/jquery.livequery.pack.js", 'jquery' ); 14 wp_enqueue_script( 'bp-general-js', site_url() . '/wp-content/mu-plugins/bp-core/js/general.js' ); 15 } 16 add_action( 'template_redirect', 'bp_core_add_js' ); 16 17 17 echo '<script src="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-core/js/general.js" type="text/javascript"></script>'; 18 /** 19 * bp_core_add_ajax_js() 20 * 21 * Add the reference to ajaxurl used by all ajax functionality in BuddyPress. 22 * 23 * @package BuddyPress Core 24 * @uses get_option() Selects a site setting from the DB. 25 */ 26 function bp_core_add_ajax_js() { 27 echo '<script type="text/javascript">var ajaxurl = "' . site_url() . '/wp-admin/admin-ajax.php";</script>'; 18 28 } 19 add_action( 'wp_head', 'bp_core_add_ js' );29 add_action( 'wp_head', 'bp_core_add_ajax_js' ); 20 30 21 31 /** … … 28 38 */ 29 39 function bp_core_add_css() { 30 if ( bp_core_user_has_home() && is_user_logged_in() ) 31 echo '<link rel="stylesheet" href="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-core/css/admin-bar.css" type="text/css" />'; 40 if ( is_user_logged_in() ) { 41 wp_enqueue_style( 'bp-admin-bar', site_url() . '/wp-content/mu-plugins/bp-core/css/admin-bar.css' ); 42 wp_print_styles(); 43 } 32 44 } 33 45 add_action( 'wp_head', 'bp_core_add_css' ); 34 46 47 48 /** 49 * bp_core_add_admin_js() 50 * 51 * Add the JS needed for all components in the admin area. 52 * 53 * @package BuddyPress Core 54 * @uses get_option() Selects a site setting from the DB. 55 */ 35 56 function bp_core_add_admin_js() { 36 57 if ( strpos( $_GET['page'], 'bp-core' ) !== false ) { 37 wp_enqueue_script( 'bp-account-admin-js', get_option('siteurl') . '/wp-content/mu-plugins/bp-core/js/account-admin.js' );58 wp_enqueue_script( 'bp-account-admin-js', site_url() . '/wp-content/mu-plugins/bp-core/js/account-admin.js' ); 38 59 } 39 } 40 add_action( 'admin_menu', 'bp_core_add_admin_js' ); 41 42 function bp_core_enqueue_admin_js() { 60 43 61 if ( strpos( $_GET['page'], 'bp-core/admin-mods' ) !== false ) { 44 62 wp_enqueue_script('password-strength-meter'); … … 46 64 47 65 if ( strpos( $_GET['page'], 'bp-core/homebase-creation' ) !== false ) { 66 wp_enqueue_script('prototype'); 67 wp_enqueue_script('scriptaculous-root'); 68 wp_enqueue_script('cropper'); 48 69 add_action( 'admin_head', 'bp_core_add_cropper_js' ); 49 70 } 50 71 } 51 add_action( 'admin_menu', 'bp_core_ enqueue_admin_js' );72 add_action( 'admin_menu', 'bp_core_add_admin_js' ); 52 73 53 function bp_core_enqueue_admin_css() { 74 75 /** 76 * bp_core_add_admin_css() 77 * 78 * Add the CSS needed for all components in the admin area. 79 * 80 * @package BuddyPress Core 81 * @uses get_option() Selects a site setting from the DB. 82 */ 83 function bp_core_add_admin_css() { 54 84 if ( strpos( $_GET['page'], 'bp-core/homebase-creation' ) !== false ) { 55 wp_enqueue_style( 'bp-core-home-base-css', get_option('siteurl') . '/wp-content/mu-plugins/bp-core/css/home-base.css' );85 wp_enqueue_style( 'bp-core-home-base-css', site_url() . '/wp-content/mu-plugins/bp-core/css/home-base.css' ); 56 86 } 57 87 } 58 add_action( 'admin_menu', 'bp_core_enqueue_admin_css' ); 88 add_action( 'admin_menu', 'bp_core_add_admin_css' ); 89 90 91 /** 92 * bp_core_add_cropper_js() 93 * 94 * Adds the JS needed for general avatar cropping. 95 * 96 * @package BuddyPress Core 97 */ 98 function bp_core_add_cropper_js() { 99 ?> 100 <script type="text/javascript"> 101 function cropAndContinue() { 102 jQuery('#avatar_v1').slideUp(); 103 jQuery('#avatar_v2').slideDown('normal', function(){ 104 v2Cropper(); 105 }); 106 } 107 108 function v1Cropper() { 109 v1Crop = new Cropper.ImgWithPreview( 110 'crop-v1-img', 111 { 112 ratioDim: { x: <?php echo round(CORE_AVATAR_V1_W / CORE_AVATAR_V1_H, 5); ?>, y: 1 }, 113 minWidth: <?php echo CORE_AVATAR_V1_W; ?>, 114 minHeight: <?php echo CORE_AVATAR_V1_H; ?>, 115 prevWidth: <?php echo CORE_AVATAR_V1_W; ?>, 116 prevHeight: <?php echo CORE_AVATAR_V1_H; ?>, 117 onEndCrop: onEndCropv1, 118 previewWrap: 'crop-preview-v1' 119 } 120 ); 121 } 122 123 function onEndCropv1(coords, dimensions) { 124 jQuery('#v1_x1').val(coords.x1); 125 jQuery('#v1_y1').val(coords.y1); 126 jQuery('#v1_x2').val(coords.x2); 127 jQuery('#v1_y2').val(coords.y2); 128 jQuery('#v1_w').val(dimensions.width); 129 jQuery('#v1_h').val(dimensions.height); 130 } 131 132 <?php if (CORE_AVATAR_V2_W !== false && CORE_AVATAR_V2_H !== false) { ?> 133 function v2Cropper() { 134 v1Crop = new Cropper.ImgWithPreview( 135 'crop-v2-img', 136 { 137 ratioDim: { x: <?php echo round(CORE_AVATAR_V2_W / CORE_AVATAR_V2_H, 5); ?>, y: 1 }, 138 minWidth: <?php echo CORE_AVATAR_V2_W; ?>, 139 minHeight: <?php echo CORE_AVATAR_V2_H; ?>, 140 prevWidth: <?php echo CORE_AVATAR_V2_W; ?>, 141 prevHeight: <?php echo CORE_AVATAR_V2_H; ?>, 142 onEndCrop: onEndCropv2, 143 previewWrap: 'crop-preview-v2' 144 } 145 ); 146 } 147 <?php } ?> 148 149 function onEndCropv2(coords, dimensions) { 150 jQuery('#v2_x1').val(coords.x1); 151 jQuery('#v2_y1').val(coords.y1); 152 jQuery('#v2_x2').val(coords.x2); 153 jQuery('#v2_y2').val(coords.y2); 154 jQuery('#v2_w').val(dimensions.width); 155 jQuery('#v2_h').val(dimensions.height); 156 } 157 </script> 158 <?php 159 } -
trunk/bp-friends.php
r359 r373 3 3 4 4 define ( 'BP_FRIENDS_IS_INSTALLED', 1 ); 5 define ( 'BP_FRIENDS_VERSION', '0.1. 3' );5 define ( 'BP_FRIENDS_VERSION', '0.1.4' ); 6 6 7 7 include_once( 'bp-friends/bp-friends-classes.php' ); 8 8 include_once( 'bp-friends/bp-friends-ajax.php' ); 9 9 include_once( 'bp-friends/bp-friends-cssjs.php' ); 10 include_once( 'bp-friends/bp-friends-templatetags.php' ); 11 include_once( 'bp-friends/bp-friends-widgets.php' ); 10 12 /*include_once( 'bp-messages/bp-friends-admin.php' );*/ 11 include_once( 'bp-friends/bp-friends-templatetags.php' );12 13 13 14 14 … … 53 53 $bp['friends'] = array( 54 54 'table_name' => $wpdb->base_prefix . 'bp_friends', 55 'image_base' => get_option('siteurl') . '/wp-content/mu-plugins/bp-friends/images',55 'image_base' => site_url() . '/wp-content/mu-plugins/bp-friends/images', 56 56 'format_activity_function' => 'friends_format_activity', 57 57 'slug' => 'friends' … … 373 373 374 374 if ( BP_Friends_Friendship::accept( $friendship_id ) ) { 375 friends_update_friend_totals( $friendship->initiator_user_id, $friendship->friend_user_id ); 376 375 377 do_action( 'bp_friends_friendship_accepted', array( 'item_id' => $friendship_id, 'component_name' => 'friends', 'component_action' => 'friendship_accepted', 'is_private' => 0, 'dual_record' => true, 'secondary_user_homebase_id' => $secondary_user_homebase_id ) ); 376 378 return true; … … 389 391 } 390 392 393 function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) { 394 if ( $status == 'add' ) { 395 update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) + 1 ); 396 update_usermeta( $friend_user_id, 'total_friend_count', (int)get_usermeta( $friend_user_id, 'total_friend_count' ) + 1 ); 397 } else { 398 update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) - 1 ); 399 update_usermeta( $friend_user_id, 'total_friend_count', (int)get_usermeta( $friend_user_id, 'total_friend_count' ) - 1 ); 400 } 401 } 402 403 function friends_remove_data( $user_id ) { 404 BP_Friends_Friendship::delete_all_for_user($user_id); 405 406 /* Remove usermeta */ 407 delete_usermeta( $user_id, 'total_friend_count' ); 408 } 409 add_action( 'wpmu_delete_user', 'bp_core_remove_data', 1 ); 410 add_action( 'delete_user', 'bp_core_remove_data', 1 ); 411 391 412 392 413 ?> -
trunk/bp-friends/bp-friends-ajax.php
r348 r373 136 136 echo "-1[[SPLIT]]" . __("Friendship could not be canceled."); 137 137 } else { 138 friends_update_friend_totals( $bp['loggedin_userid'], $bp['current_userid'], 'remove' ); 138 139 echo __('Add Friend'); 139 140 } -
trunk/bp-friends/bp-friends-classes.php
r359 r373 114 114 if ( !$user_id ) 115 115 $user_id = $bp['current_userid']; 116 117 $sql = $wpdb->prepare( "SELECT count(id) FROM " . $bp['friends']['table_name'] . " WHERE (initiator_user_id = %d OR friend_user_id = %d) AND is_confirmed = 1", $user_id, $user_id ); 118 119 if ( !$friend_count = $wpdb->get_var( $sql ) ) 120 return 0; 121 122 if ( !$friend_count ) 123 return 0; 124 116 117 if ( !$friend_count = get_usermeta( $user_id, 'total_friend_count') ) { 118 update_usermeta( $user_id, 'total_friend_count', 0 ); 119 120 $sql = $wpdb->prepare( "SELECT count(id) FROM " . $bp['friends']['table_name'] . " WHERE (initiator_user_id = %d OR friend_user_id = %d) AND is_confirmed = 1", $user_id, $user_id ); 121 122 if ( !$friend_count = $wpdb->get_var( $sql ) ) 123 return 0; 124 125 if ( !$friend_count ) 126 return 0; 127 128 update_usermeta( $user_id, 'total_friend_count', $friend_count ); 129 } 130 125 131 return $friend_count; 126 132 } … … 275 281 return $wpdb->get_row( $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM " . $bp['friends']['table_name'] . " WHERE id = %d", $friendship_id ) ); 276 282 } 283 284 function delete_all_for_user( $user_id ) { 285 global $wpdb, $bp; 286 287 return $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp['friends']['table_name'] . " WHERE friend_user_id = %d OR initiator_user_id = %d", $user_id, $user_id ) ); 288 } 277 289 } 278 290 -
trunk/bp-friends/bp-friends-cssjs.php
r309 r373 8 8 function friends_add_js() { 9 9 global $bp; 10 11 if ( !isset($_GET['page']) )12 $_GET['page'] = null;13 10 14 if ( $bp['current_component'] == $bp['friends']['slug'] ) { 15 echo ' 16 <script src="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-friends/js/general.js" type="text/javascript"></script>'; 17 } 11 if ( $bp['current_component'] == $bp['friends']['slug'] ) 12 wp_enqueue_script( 'bp-friends-js', site_url() . '/wp-content/mu-plugins/bp-friends/js/general.js' ); 18 13 } 19 add_action( ' wp_head', 'friends_add_js' );14 add_action( 'template_redirect', 'friends_add_js' ); 20 15 21 16 ?> -
trunk/bp-groups.php
r359 r373 3 3 4 4 define ( 'BP_GROUPS_IS_INSTALLED', 1 ); 5 define ( 'BP_GROUPS_VERSION', '0.1. 5' );5 define ( 'BP_GROUPS_VERSION', '0.1.6' ); 6 6 7 7 include_once( 'bp-groups/bp-groups-classes.php' ); 8 8 include_once( 'bp-groups/bp-groups-ajax.php' ); 9 9 include_once( 'bp-groups/bp-groups-cssjs.php' ); 10 include_once( 'bp-groups/bp-groups-templatetags.php' ); 11 include_once( 'bp-groups/bp-groups-widgets.php' ); 10 12 /*include_once( 'bp-messages/bp-groups-admin.php' );*/ 11 include_once( 'bp-groups/bp-groups-templatetags.php' );12 13 13 14 14 /************************************************************************** … … 92 92 'table_name' => $wpdb->base_prefix . 'bp_groups', 93 93 'table_name_members' => $wpdb->base_prefix . 'bp_groups_members', 94 'image_base' => get_option('siteurl') . '/wp-content/mu-plugins/bp-groups/images',94 'image_base' => site_url() . '/wp-content/mu-plugins/bp-groups/images', 95 95 'format_activity_function' => 'groups_format_activity', 96 96 'slug' => 'groups' … … 552 552 $avatar_error = false; 553 553 554 if ( bp_core_check_avatar_upload($file) ) { 555 if ( !bp_core_check_avatar_upload($file) ) { 556 $avatar_error = true; 557 $avatar_error_msg = __('Your group avatar upload failed, please try again.'); 558 } 559 560 if ( !bp_core_check_avatar_size($file) ) { 561 $avatar_error = true; 562 $avatar_size = size_format(1024 * CORE_MAX_FILE_SIZE); 563 $avatar_error_msg = sprintf( __('The file you uploaded is too big. Please upload a file under %d'), $avatar_size); 564 } 565 566 if ( !bp_core_check_avatar_type($file) ) { 567 $avatar_error = true; 568 $avatar_error_msg = __('Please upload only JPG, GIF or PNG photos.'); 569 } 570 571 // "Handle" upload into temporary location 572 if ( !$original = bp_core_handle_avatar_upload($file) ) { 573 $avatar_error = true; 574 $avatar_error_msg = __('Upload Failed! Your photo dimensions are likely too big.'); 575 } 576 577 if ( !bp_core_check_avatar_dimensions($original) ) { 578 $avatar_error = true; 579 $avatar_error_msg = sprintf( __('The image you upload must have dimensions of %d x %d pixels or larger.'), CORE_CROPPING_CANVAS_MAX, CORE_CROPPING_CANVAS_MAX ); 580 } 581 582 if ( !$canvas = bp_core_resize_avatar($original) ) { 583 $avatar_error = true; 584 $avatar_error_msg = __('Could not create thumbnail, try another photo.'); 585 } 586 587 if ( $avatar_error ) { ?> 588 <div id="message" class="error"> 589 <p><?php echo $avatar_error_msg ?></p> 590 </div> 591 <?php 592 bp_core_render_avatar_upload_form( '', true ); 593 } else { 594 bp_core_render_avatar_cropper( $original, $canvas, null, null, false, $bp['loggedin_domain'] ); 595 } 554 // Set friendly error feedback. 555 $uploadErrors = array( 556 0 => __("There is no error, the file uploaded with success"), 557 1 => __("The uploaded file exceeds the upload_max_filesize directive in php.ini"), 558 2 => __("The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"), 559 3 => __("The uploaded file was only partially uploaded"), 560 4 => __("No file was uploaded"), 561 6 => __("Missing a temporary folder") 562 ); 563 564 if ( !bp_core_check_avatar_upload($file) ) { 565 $avatar_error = true; 566 $avatar_error_msg = __('Your group avatar upload failed, please try again. Error was: ' . $uploadErrors[$file['file']['error']] ); 567 } 568 569 else if ( !bp_core_check_avatar_size($file) ) { 570 $avatar_error = true; 571 $avatar_size = size_format(1024 * CORE_MAX_FILE_SIZE); 572 $avatar_error_msg = __('The file you uploaded is too big. Please upload a file under') . size_format(1024 * CORE_MAX_FILE_SIZE); 573 } 574 575 else if ( !bp_core_check_avatar_type($file) ) { 576 $avatar_error = true; 577 $avatar_error_msg = __('Please upload only JPG, GIF or PNG photos.'); 578 } 579 580 // "Handle" upload into temporary location 581 else if ( !$original = bp_core_handle_avatar_upload($file) ) { 582 $avatar_error = true; 583 $avatar_error_msg = __('Upload Failed! Your photo dimensions are likely too big.'); 584 } 585 586 else if ( !bp_core_check_avatar_dimensions($original) ) { 587 $avatar_error = true; 588 $avatar_error_msg = sprintf( __('The image you upload must have dimensions of %d x %d pixels or larger.'), CORE_CROPPING_CANVAS_MAX, CORE_CROPPING_CANVAS_MAX ); 589 } 590 591 if ( !$canvas = bp_core_resize_avatar($original) ) 592 $canvas = $original; 593 594 if ( $avatar_error ) { ?> 595 <div id="message" class="error"> 596 <p><?php echo $avatar_error_msg ?></p> 597 </div> 598 <?php 599 bp_core_render_avatar_upload_form( '', true ); 600 } else { 601 bp_core_render_avatar_cropper( $original, $canvas, null, null, false, $bp['loggedin_domain'] ); 596 602 } 597 603 } … … 623 629 624 630 function groups_manage_group( $step, $group_id ) { 625 global $bp ;631 global $bp, $create_group_step; 626 632 627 633 if ( is_numeric( $step ) && ( $step == '1' || $step == '2' || $step == '3' || $step == '4' ) ) { 628 // If this is the group avatar step, load in the JS.629 if ( $create_group_step == '3' )630 add_action( 'wp_head', 'bp_core_add_cropper_js' );631 632 634 $group = new BP_Groups_Group( $group_id ); 633 635 634 636 switch ( $step ) { 635 637 case '1': 636 if ( isset($_POST['group-name']) && isset($_POST['group-desc'])) {638 if ( $_POST['group-name'] != '' && $_POST['group-desc'] != '' && $_POST['group-news'] != '' ) { 637 639 $group->creator_id = $bp['loggedin_userid']; 638 640 $group->name = stripslashes($_POST['group-name']); … … 667 669 return $group->id; 668 670 } 671 672 return false; 669 673 break; 670 674 … … 703 707 704 708 case '3': 709 705 710 // Image already cropped and uploaded, lets store a reference in the DB. 706 711 if ( !wp_verify_nonce($_POST['nonce'], 'slick_avatars') || !$result = bp_core_avatar_cropstore( $_POST['orig'], $_POST['canvas'], $_POST['v1_x1'], $_POST['v1_y1'], $_POST['v1_w'], $_POST['v1_h'], $_POST['v2_x1'], $_POST['v2_y1'], $_POST['v2_w'], $_POST['v2_h'], false, 'groupavatar', $group_id ) ) … … 869 874 } 870 875 876 function groups_remove_data( $user_id ) { 877 BP_Groups_Member::delete_all_for_user($user_id); 878 } 879 add_action( 'wpmu_delete_user', 'bp_core_remove_data', 1 ); 880 add_action( 'delete_user', 'bp_core_remove_data', 1 ); 881 871 882 872 883 ?> -
trunk/bp-groups/bp-groups-classes.php
r351 r373 215 215 /* Static Functions */ 216 216 217 function delete( $group_id ) { 218 global $wpdb, $bp; 219 220 if ( $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp['groups']['table_name'] . " WHERE id = %d", $group_id ) ) ) 221 return false; 222 223 return true; 224 } 225 217 226 function group_exists( $slug ) { 218 227 global $wpdb, $bp; … … 298 307 } 299 308 300 function delete( $group_id) {301 global $wpdb, $bp; 302 303 if ( $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp['groups']['table_name'] . " WHERE id = %d", $group_id ) ))304 return false;305 306 return true;307 } 309 function get_newest( $limit = 5 ) { 310 global $wpdb, $bp; 311 312 if ( !$limit ) 313 $limit = 5; 314 315 return $wpdb->get_results( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name'] . " ORDER BY date_created DESC LIMIT %d", $limit ) ); 316 } 308 317 } 309 318 … … 442 451 return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND is_confirmed = 1 ORDER BY rand() LIMIT $total_groups", $user_id ) ); 443 452 } 453 454 function delete_all_for_user( $user_id ) { 455 global $wpdb, $bp; 456 457 return $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d", $user_id ) ); 458 } 444 459 } 445 460 -
trunk/bp-groups/bp-groups-cssjs.php
r309 r373 8 8 function groups_add_js() { 9 9 global $bp; 10 11 if ( $bp['current_component'] == $bp['groups']['slug'] ) 12 wp_enqueue_script( 'bp-groups-js', site_url() . '/wp-content/mu-plugins/bp-groups/js/general.js' ); 13 } 14 add_action( 'template_redirect', 'groups_add_js' ); 15 16 function groups_add_cropper_js() { 17 global $create_group_step; 10 18 11 if ( !isset($_GET['page']) )12 $_GET['page'] = null;13 14 if ( strpos( $_GET['page'], 'groups' ) !== false || $bp['current_component'] == $bp['groups']['slug'] ) {15 echo '16 <script src="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-groups/js/general.js" type="text/javascript"></script>';19 if ( $create_group_step == '3' ) { 20 wp_enqueue_script('jquery'); 21 wp_enqueue_script('prototype'); 22 wp_enqueue_script('scriptaculous-root'); 23 wp_enqueue_script('cropper'); 24 add_action( 'wp_head', 'bp_core_add_cropper_js' ); 17 25 } 18 26 } 19 add_action( 'wp_head', 'groups_add_js' ); 20 add_action( 'admin_head', 'groups_add_js' ); 27 add_action( 'template_redirect', 'groups_add_cropper_js' ); 21 28 22 /**************************************************************************23 add_css()24 25 Inserts the CSS needed to style the groups pages.26 **************************************************************************/27 28 function groups_add_css()29 {30 ?>31 32 <?php33 }34 29 35 30 ?> -
trunk/bp-groups/bp-groups-templatetags.php
r367 r373 350 350 case '1': ?> 351 351 <label for="group-name">* <?php _e('Group Name') ?></label> 352 <input type="text" name="group-name" id="group-name" value="<?php echo $group_obj->name?>" />352 <input type="text" name="group-name" id="group-name" value="<?php echo ( $group_obj ) ? $group_obj->name : $_POST['group-name']; ?>" /> 353 353 354 354 <label for="group-desc">* <?php _e('Group Description') ?></label> 355 <textarea name="group-desc" id="group-desc"><?php echo $group_obj->description?></textarea>355 <textarea name="group-desc" id="group-desc"><?php echo ( $group_obj ) ? $group_obj->description : $_POST['group-desc']; ?></textarea> 356 356 357 357 <label for="group-news">* <?php _e('Recent News') ?></label> 358 <textarea name="group-news" id="group-news"><?php echo $group_obj->news?></textarea>358 <textarea name="group-news" id="group-news"><?php echo ( $group_obj ) ? $group_obj->news : $_POST['group-news']; ?></textarea> 359 359 360 360 <input type="submit" value="<?php _e('Save and Continue') ?> »" id="save" name="save" /> -
trunk/bp-messages.php
r359 r373 3 3 4 4 define ( 'BP_MESSAGES_IS_INSTALLED', 1 ); 5 define ( 'BP_MESSAGES_VERSION', '0.3. 4' );5 define ( 'BP_MESSAGES_VERSION', '0.3.5' ); 6 6 7 7 include_once( 'bp-messages/bp-messages-classes.php' ); … … 100 100 'table_name_notices' => $wpdb->base_prefix . 'bp_messages_notices', 101 101 'format_activity_function' => 'messages_format_activity', 102 'image_base' => get_option('siteurl') . '/wp-content/mu-plugins/bp-messages/images',102 'image_base' => site_url() . '/wp-content/mu-plugins/bp-messages/images', 103 103 'slug' => 'messages' 104 104 ); -
trunk/bp-messages/bp-messages-cssjs.php
r309 r373 1 1 <?php 2 2 3 function messages_add_ js() {3 function messages_add_tinymce() { 4 4 global $bp; 5 5 6 6 if ( ( $bp['current_component'] == $bp['messages']['slug'] && $bp['current_action'] == 'compose' ) || ( $bp['current_component'] == $bp['messages']['slug'] && $bp['current_action'] == 'view' ) ) { 7 7 echo ' 8 <script type="text/javascript" src="' . get_option('siteurl') . '/wp-includes/js/tinymce/tiny_mce.js"></script>8 <script type="text/javascript" src="' . site_url() . '/wp-includes/js/tinymce/tiny_mce.js"></script> 9 9 <script type="text/javascript"> 10 10 <!-- … … 19 19 theme_advanced_resize_horizontal : false, 20 20 theme_advanced_buttons1:"bold,italic,strikethrough,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,|,link,unlink,image,wp_more,|,fullscreen,wp_adv",theme_advanced_buttons2:"formatselect,underline,justifyfull,forecolor,|,pastetext,pasteword,removeformat,|,media,charmap,|,outdent,indent,|,undo,redo,wp_help",theme_advanced_buttons3:"", 21 content_css : "' . get_option('siteurl') . '/wp-includes/js/tinymce/plugins/wordpress/wordpress.css",21 content_css : "' . site_url() . '/wp-includes/js/tinymce/plugins/wordpress/wordpress.css", 22 22 mode : "exact", 23 23 elements : "message_content", … … 30 30 } 31 31 32 if ( strpos( $_GET['page'], 'messages' ) !== false || $bp['current_component'] == $bp['messages']['slug'] ) {33 echo '34 <script src="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-messages/js/general.js" type="text/javascript"></script>';35 }36 32 } 37 add_action( 'wp_head', 'messages_add_js' ); 38 //add_action( 'admin_menu', 'messages_add_js' ); 33 add_action( 'wp_head', 'messages_add_tinymce' ); 34 35 function messages_add_js() { 36 global $bp; 37 38 if ( $bp['current_component'] == $bp['messages']['slug'] ) 39 wp_enqueue_script( 'bp-messages-js', site_url() . '/wp-content/mu-plugins/bp-messages/js/general.js' ); 40 } 41 add_action( 'template_redirect', 'messages_add_js' ); 39 42 40 43 ?> -
trunk/bp-wire.php
r359 r373 3 3 4 4 define ( 'BP_WIRE_IS_INSTALLED', 1 ); 5 define ( 'BP_WIRE_VERSION', '0.1 ' );5 define ( 'BP_WIRE_VERSION', '0.1.1' ); 6 6 7 7 include_once( 'bp-wire/bp-wire-classes.php' ); … … 42 42 43 43 $bp['wire'] = array( 44 'image_base' => get_option('siteurl') . '/wp-content/mu-plugins/bp-wire/images',44 'image_base' => site_url() . '/wp-content/mu-plugins/bp-wire/images', 45 45 'slug' => 'wire' 46 46 ); -
trunk/bp-xprofile.php
r364 r373 4 4 5 5 define ( 'BP_XPROFILE_IS_INSTALLED', 1 ); 6 define ( 'BP_XPROFILE_VERSION', '0.3. 9' );6 define ( 'BP_XPROFILE_VERSION', '0.3.10' ); 7 7 8 8 require_once( 'bp-xprofile/bp-xprofile-classes.php' ); … … 114 114 'table_name_data' => $wpdb->base_prefix . 'bp_xprofile_data', 115 115 'format_activity_function' => 'xprofile_format_activity', 116 'image_base' => get_option('siteurl') . '/wp-content/mu-plugins/bp-xprofile/images',116 'image_base' => site_url() . '/wp-content/mu-plugins/bp-xprofile/images', 117 117 'slug' => 'profile' 118 118 ); -
trunk/bp-xprofile/bp-xprofile-cssjs.php
r309 r373 3 3 function xprofile_add_signup_css() { 4 4 if ( $_SERVER['SCRIPT_NAME'] == '/wp-signup.php' ) 5 echo '<link rel="stylesheet" href="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-xprofile/css/signup.css" type="text/css" />';5 echo '<link rel="stylesheet" href="' . site_url() . '/wp-content/mu-plugins/bp-xprofile/css/signup.css" type="text/css" />'; 6 6 } 7 7 add_action( 'wp_head', 'xprofile_add_signup_css' ); … … 10 10 function xprofile_add_admin_css() { 11 11 if ( strpos( $_GET['page'], 'xprofile' ) !== false ) { 12 echo '<link rel="stylesheet" href="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-xprofile/css/admin.css" type="text/css" />';12 echo '<link rel="stylesheet" href="' . site_url() . '/wp-content/mu-plugins/bp-xprofile/css/admin.css" type="text/css" />'; 13 13 } 14 14 } … … 18 18 function xprofile_add_admin_js() { 19 19 if ( strpos( $_GET['page'], 'xprofile' ) !== false ) { 20 wp_enqueue_script( 'bp-xprofile-admin-js', get_option('siteurl') . "/wp-content/mu-plugins/bp-xprofile/js/admin.js" );20 wp_enqueue_script( 'bp-xprofile-admin-js', site_url() . "/wp-content/mu-plugins/bp-xprofile/js/admin.js" ); 21 21 add_action( 'admin_head', 'bp_core_add_cropper_js' ); 22 22 } … … 24 24 add_action( 'admin_menu', 'xprofile_add_admin_js' ); 25 25 26 function xprofile_add_cropper_js() { 27 global $bp; 28 29 if ( $_SERVER['SCRIPT_NAME'] == '/wp-activate.php' || $bp['current_action'] == 'change-avatar' || ( isset($_GET['page']) && $_GET['page'] == 'bp-xprofile.php' ) ) { 30 wp_enqueue_script('jquery'); 31 wp_enqueue_script('prototype'); 32 wp_enqueue_script('scriptaculous-root'); 33 wp_enqueue_script('cropper'); 34 add_action( 'wp_head', 'bp_core_add_cropper_js' ); 35 } 36 37 if ( isset($_GET['page']) && $_GET['page'] == 'bp-xprofile.php' ) { 38 add_action( 'admin_head', 'bp_core_add_cropper_js' ); 39 } 40 } 41 add_action( 'activate_header', 'xprofile_add_cropper_js' ); 42 add_action( 'template_redirect', 'xprofile_add_cropper_js' ); 43 add_action( 'admin_menu', 'xprofile_add_cropper_js' ); 44 26 45 ?> -
trunk/bp-xprofile/bp-xprofile-signup.php
r363 r373 339 339 /* Make this blog the "home base" for the new user */ 340 340 update_usermeta( $user_id, 'home_base', $blog_id ); 341 update_usermeta( $user_id, 'last_activity', time() ); 341 342 342 343 /* Set the BuddyPress theme as the theme for this blog */ … … 419 420 } 420 421 421 422 function xprofile_add_jquery() {423 if ( $_SERVER['SCRIPT_NAME'] == '/wp-activate.php' ) {424 echo '<script type="text/javascript" src="' . get_option('home') . '/wp-includes/js/prototype.js"></script>';425 echo '<script type="text/javascript" src="' . get_option('home') . '/wp-includes/js/scriptaculous/scriptaculous.js"></script>';426 echo '<script type="text/javascript" src="' . get_option('home') . '/wp-includes/js/scriptaculous/dragdrop.js"></script>';427 echo '<script type="text/javascript" src="' . get_option('home') . '/wp-includes/js/crop/cropper.js"></script>';428 echo '<script type="text/javascript" src="' . get_option('home') . '/wp-includes/js/jquery/jquery.js"></script>';429 }430 431 bp_core_add_cropper_js();432 }433 add_action( 'wp_head', 'xprofile_add_jquery' );434 422 435 423 // function xprofile_replace_blog_references() { -
trunk/buddypress-theme/home/comments-popup.php
r262 r373 56 56 <p>Line and paragraph breaks automatic, e-mail address never displayed, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p> 57 57 58 <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">58 <form action="<?php echo site_url(); ?>/wp-comments-post.php" method="post" id="commentform"> 59 59 <?php if ( $user_ID ) : ?> 60 <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout »</a></p>60 <p>Logged in as <a href="<?php echo site_url(); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo site_url(); ?>/wp-login.php?action=logout" title="Log out of this account">Logout »</a></p> 61 61 <?php else : ?> 62 62 <p> -
trunk/buddypress-theme/home/comments.php
r262 r373 67 67 68 68 <?php if ( get_option('comment_registration') && !$user_ID ) : ?> 69 <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>69 <p>You must be <a href="<?php echo site_url(); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p> 70 70 <?php else : ?> 71 71 72 <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">72 <form action="<?php echo site_url(); ?>/wp-comments-post.php" method="post" id="commentform"> 73 73 74 74 <?php if ( $user_ID ) : ?> 75 75 76 <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout »</a></p>76 <p>Logged in as <a href="<?php echo site_url(); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo site_url(); ?>/wp-login.php?action=logout" title="Log out of this account">Logout »</a></p> 77 77 78 78 <?php else : ?>
Note: See TracChangeset
for help on using the changeset viewer.