Changeset 3937
- Timestamp:
- 01/26/2011 08:43:59 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-functions.php
r3917 r3937 308 308 309 309 // Delete activity stream item 310 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs-> slug, 'type' => 'new_blog' ) );310 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => 'new_blog' ) ); 311 311 312 312 do_action( 'bp_blogs_remove_blog', $blog_id ); … … 323 323 324 324 // Delete activity stream item 325 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs-> slug, 'type' => 'new_blog' ) );325 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => 'new_blog' ) ); 326 326 327 327 do_action( 'bp_blogs_remove_blog_for_user', $blog_id, $user_id ); -
trunk/bp-blogs/bp-blogs-template.php
r3778 r3937 97 97 98 98 $this->in_the_loop = true; 99 $this->blog = $this->next_blog();99 $this->blog = $this->next_blog(); 100 100 101 101 if ( 0 == $this->current_blog ) // loop has just started … … 118 118 * pass their parameters directly to the loop. 119 119 */ 120 $type = 'active';121 $user_id = 0;120 $type = 'active'; 121 $user_id = 0; 122 122 $search_terms = null; 123 123 … … 127 127 128 128 $defaults = array( 129 'type' => $type,130 'page' => 1,131 'per_page' => 20,132 'max' => false,133 134 'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to129 'type' => $type, 130 'page' => 1, 131 'per_page' => 20, 132 'max' => false, 133 134 'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to 135 135 'search_terms' => $search_terms // Pass search terms to filter on the blog title or description. 136 136 ); … … 171 171 172 172 $start_num = intval( ( $blogs_template->pag_page - 1 ) * $blogs_template->pag_num ) + 1; 173 $from_num = bp_core_number_format( $start_num );174 $to_num = bp_core_number_format( ( $start_num + ( $blogs_template->pag_num - 1 ) > $blogs_template->total_blog_count ) ? $blogs_template->total_blog_count : $start_num + ( $blogs_template->pag_num - 1 ) );175 $total = bp_core_number_format( $blogs_template->total_blog_count );173 $from_num = bp_core_number_format( $start_num ); 174 $to_num = bp_core_number_format( ( $start_num + ( $blogs_template->pag_num - 1 ) > $blogs_template->total_blog_count ) ? $blogs_template->total_blog_count : $start_num + ( $blogs_template->pag_num - 1 ) ); 175 $total = bp_core_number_format( $blogs_template->total_blog_count ); 176 176 177 177 echo sprintf( __( 'Viewing blog %1$s to %2$s (of %3$s blogs)', 'buddypress' ), $from_num, $to_num, $total ); ?> … … 195 195 196 196 $defaults = array( 197 'type' => 'full',198 'width' => false,199 'height' => false,200 'class' => 'avatar',201 'id' => false,202 'alt' => __( 'Blog authored by %s', 'buddypress' ),197 'type' => 'full', 198 'width' => false, 199 'height' => false, 200 'class' => 'avatar', 201 'id' => false, 202 'alt' => __( 'Blog authored by %s', 'buddypress' ), 203 203 'no_grav' => true 204 204 ); … … 274 274 275 275 function bp_blog_hidden_fields() { 276 if ( isset( $_REQUEST['s'] ) ) {276 if ( isset( $_REQUEST['s'] ) ) 277 277 echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ). '" name="search_terms" />'; 278 } 279 280 if ( isset( $_REQUEST['letter'] ) ) { 278 279 if ( isset( $_REQUEST['letter'] ) ) 281 280 echo '<input type="hidden" id="selected_letter" value="' . esc_attr( $_REQUEST['letter'] ) . '" name="selected_letter" />'; 282 } 283 284 if ( isset( $_REQUEST['blogs_search'] ) ) { 281 282 if ( isset( $_REQUEST['blogs_search'] ) ) 285 283 echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['blogs_search'] ) . '" name="search_terms" />'; 286 }287 284 } 288 285 … … 373 370 374 371 if ( $errmsg = $errors->get_error_message('blogname') ) { ?> 372 375 373 <p class="error"><?php echo $errmsg ?></p> 374 376 375 <?php } 377 376 … … 395 394 // Blog Title 396 395 ?> 396 397 397 <label for="blog_title"><?php _e('Blog Title:', 'buddypress') ?></label> 398 398 399 <?php if ( $errmsg = $errors->get_error_message('blog_title') ) { ?> 400 399 401 <p class="error"><?php echo $errmsg ?></p> 402 400 403 <?php } 401 404 echo '<input name="blog_title" type="text" id="blog_title" value="'.esc_html($blog_title, 1).'" /></p>'; … … 464 467 function bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = '' ) { 465 468 $protocol = is_ssl() ? 'https://' : 'http://'; 466 $blog_url = $protocol . $domain . $path; 467 ?> 468 <p><?php _e( 'Congratulations! You have successfully registered a new blog.', 'buddypress') ?></p>469 $blog_url = $protocol . $domain . $path; ?> 470 471 <p><?php _e( 'Congratulations! You have successfully registered a new blog.', 'buddypress' ) ?></p> 469 472 <p> 470 <?php printf(__( '<a href="%1$s">%2$s</a> is your new blog. <a href="%3$s">Login</a> as "%4$s" using your existing password.', 'buddypress'), $blog_url, $blog_url, $blog_url . "wp-login.php", $user_name)?>473 <?php printf(__( '<a href="%1$s">%2$s</a> is your new blog. <a href="%3$s">Login</a> as "%4$s" using your existing password.', 'buddypress' ), $blog_url, $blog_url, $blog_url . "wp-login.php", $user_name ); ?> 471 474 </p> 472 <?php 475 476 <?php 473 477 do_action('signup_finished'); 474 478 } … … 477 481 global $bp; 478 482 479 if ( bp_is_my_profile() ) { 480 echo apply_filters( 'bp_create_blog_link', '<a href="' . $bp->root_domain . '/' . $bp->blogs->slug . '/create">' . __('Create a Blog', 'buddypress') . '</a>' ); 481 } 483 if ( bp_is_my_profile() ) 484 echo apply_filters( 'bp_create_blog_link', '<a href="' . $bp->root_domain . '/' . $bp->blogs->root_slug . '/create/">' . __( 'Create a Blog', 'buddypress' ) . '</a>' ); 482 485 } 483 486 … … 489 492 return false; 490 493 491 $current_tab = $bp->current_action 492 ?> 494 $current_tab = $bp->current_action; ?> 495 493 496 <ul class="content-header-nav"> 494 <li<?php if ( 'my-blogs' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->blogs->slug ?>/my-blogs"><?php printf( __( "%s's Blogs", 'buddypress' ), $bp->displayed_user->fullname )?></a></li>495 <li<?php if ( 'recent-posts' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->blogs->slug ?>/recent-posts"><?php printf( __( "%s's Recent Posts", 'buddypress' ), $bp->displayed_user->fullname )?></a></li>496 <li<?php if ( 'recent-comments' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->blogs->slug ?>/recent-comments"><?php printf( __( "%s's Recent Comments", 'buddypress' ), $bp->displayed_user->fullname )?></a></li>497 <li<?php if ( 'my-blogs' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . $bp->blogs->slug . '/my-blogs' ); ?>"><?php printf( __( "%s's Blogs", 'buddypress' ), $bp->displayed_user->fullname ); ?></a></li> 498 <li<?php if ( 'recent-posts' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . $bp->blogs->slug . '/recent-posts' ); ?>"><?php printf( __( "%s's Recent Posts", 'buddypress' ), $bp->displayed_user->fullname ); ?></a></li> 499 <li<?php if ( 'recent-comments' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . $bp->blogs->slug . '/recent-comments' );?>"><?php printf( __( "%s's Recent Comments", 'buddypress' ), $bp->displayed_user->fullname ); ?></a></li> 497 500 </ul> 501 498 502 <?php 499 503 do_action( 'bp_blogs_blog_tabs', $current_tab ); … … 504 508 505 509 $default_search_value = bp_get_search_default_text(); 506 $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; 507 508 ?> 510 $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?> 511 509 512 <form action="" method="get" id="search-blogs-form"> 510 513 <label><input type="text" name="s" id="blogs_search" value="<?php echo esc_attr( $search_value ) ?>" onfocus="if (this.value == '<?php echo $default_search_value ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php echo $default_search_value ?>';}" /></label> 511 514 <input type="submit" id="blogs_search_submit" name="blogs_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" /> 512 515 </form> 516 513 517 <?php 514 518 } -
trunk/bp-core/bp-core-buddybar.php
r3917 r3937 446 446 if ( bp_blog_signup_enabled() ) { 447 447 echo '<li' . $alt . '>'; 448 echo '<a href="' . $bp->root_domain . '/' . $bp->blogs-> slug . '/create/">' . __( 'Create a Blog!', 'buddypress' ) . '</a>';448 echo '<a href="' . $bp->root_domain . '/' . $bp->blogs->root_slug . '/create/">' . __( 'Create a Blog!', 'buddypress' ) . '</a>'; 449 449 echo '</li>'; 450 450 } -
trunk/bp-core/bp-core-component.php
r3923 r3937 207 207 * Setup the navigation 208 208 * 209 * @param arr $main_nav 210 * @param arr $sub_nav 211 */ 212 function _setup_nav( $main_nav, $sub_nav ) { 213 bp_core_new_nav_item( $main_nav ); 214 215 foreach( $sub_nav as $nav ) 216 bp_core_new_subnav_item( $nav ); 209 * @param arr $main_nav Optional 210 * @param arr $sub_nav Optional 211 */ 212 function _setup_nav( $main_nav = '', $sub_nav = '' ) { 213 // No sub nav items without a main nav item 214 if ( !empty( $main_nav ) ) { 215 bp_core_new_nav_item( $main_nav ); 216 217 // Sub nav items are not required 218 if ( !empty( $sub_nav ) ) { 219 foreach( $sub_nav as $nav ) { 220 bp_core_new_subnav_item( $nav ); 221 } 222 } 223 } 217 224 218 225 // Call action
Note: See TracChangeset
for help on using the changeset viewer.