Changeset 1655 for trunk/bp-core/bp-core-templatetags.php
- Timestamp:
- 08/13/2009 01:24:21 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-templatetags.php
r1648 r1655 81 81 $link = str_replace( $bp->loggedin_user->domain, $bp->displayed_user->domain, $user_nav_item['link'] ); 82 82 else 83 $link = $ user_nav_item['link'];83 $link = $bp->displayed_user->domain . $user_nav_item['link']; 84 84 85 85 echo '<li' . $selected . '><a id="user-' . $user_nav_item['css_id'] . '" href="' . $link . '">' . $user_nav_item['name'] . '</a></li>'; … … 212 212 extract( $r, EXTR_SKIP ); 213 213 214 return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( ' user_id' => $bp->loggedin_user->id, 'type' => $type, 'width' => $width, 'height' => $height ) ) );214 return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'item_id' => $bp->loggedin_user->id, 'type' => $type, 'width' => $width, 'height' => $height ) ) ); 215 215 } 216 216 … … 230 230 extract( $r, EXTR_SKIP ); 231 231 232 return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( ' user_id' => $bp->displayed_user->id, 'type' => $type, 'width' => $width, 'height' => $height ) ) );232 return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( 'item_id' => $bp->displayed_user->id, 'type' => $type, 'width' => $width, 'height' => $height ) ) ); 233 233 } 234 234 … … 267 267 268 268 function bp_site_name() { 269 echo apply_filters( 'bp_site_name', get_blog_option( 1, 'blogname' ) );269 echo apply_filters( 'bp_site_name', get_blog_option( BP_ROOT_BLOG, 'blogname' ) ); 270 270 } 271 271 … … 317 317 ?> 318 318 319 <div class=" info-groupwp-profile">319 <div class="bp-widget wp-profile"> 320 320 <h4><?php _e( 'My Profile' ) ?></h4> 321 321 … … 533 533 if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/register.php') ) 534 534 return true; 535 535 536 if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/registration/register.php') ) 537 return true; 538 536 539 return false; 537 540 } 538 541 539 function bp_signup_page( $ echo= true ) {540 global $bp;541 542 if ( bp_has_custom_signup_page() ) {543 if ( $echo )544 echo $bp->root_domain . '/' . BP_REGISTER_SLUG; 545 else546 return $bp->root_domain . '/' . BP_REGISTER_SLUG;547 } else {548 if ( $echo )549 echo $bp->root_domain . '/wp-signup.php';550 else551 return $bp->root_domain . '/wp-signup.php';552 }553 }542 function bp_signup_page( $deprecated = true ) { 543 if ( !$deprecated ) 544 return bp_get_signup_page(); 545 else 546 echo bp_get_signup_page(); 547 } 548 function bp_get_signup_page() { 549 global $bp; 550 551 if ( bp_has_custom_signup_page() ) { 552 return apply_filters( 'bp_get_signup_page', $bp->root_domain . '/' . BP_REGISTER_SLUG ); 553 } else { 554 return apply_filters( 'bp_get_signup_page', $bp->root_domain . '/wp-signup.php' ); 555 } 556 } 554 557 555 558 function bp_has_custom_activation_page() { 556 if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( 1, 'template') . '/activate.php') ) 559 if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/activate.php') ) 560 return true; 561 562 if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/registration/activate.php') ) 557 563 return true; 558 564 … … 617 623 } 618 624 619 function bp_login_bar() { 620 global $bp; 621 622 if ( !is_user_logged_in() ) : ?> 623 624 <form name="login-form" id="login-form" action="<?php echo $bp->root_domain . '/wp-login.php' ?>" method="post"> 625 <input type="text" name="log" id="user_login" value="<?php _e( 'Username', 'buddypress' ) ?>" onfocus="if (this.value == '<?php _e( 'Username', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Username', 'buddypress' ) ?>';}" /> 626 <input type="password" name="pwd" id="user_pass" class="input" value="" /> 627 628 <input type="checkbox" name="rememberme" id="rememberme" value="forever" title="<?php _e( 'Remember Me', 'buddypress' ) ?>" /> 629 630 <input type="submit" name="wp-submit" id="wp-submit" value="<?php _e( 'Log In', 'buddypress' ) ?>"/> 631 <input type="button" name="signup-submit" id="signup-submit" value="<?php _e( 'Sign Up', 'buddypress' ) ?>" onclick="location.href='<?php echo bp_signup_page() ?>'" /> 632 633 <input type="hidden" name="redirect_to" value="http://<?php echo $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] ?>" /> 634 <input type="hidden" name="testcookie" value="1" /> 635 636 <?php do_action( 'bp_login_bar_logged_out' ) ?> 637 </form> 638 639 <?php else : ?> 640 641 <div id="logout-link"> 642 <?php bp_loggedinuser_avatar_thumbnail( 20, 20 ) ?> 643 <?php bp_loggedinuser_link() ?> 644 <?php 645 if ( function_exists('wp_logout_url') ) { 646 $logout_link = '/ <a href="' . wp_logout_url( $bp->root_domain ) . '">' . __( 'Log Out', 'buddypress' ) . '</a>'; 647 } else { 648 $logout_link = '/ <a href="' . $bp->root_domain . '/wp-login.php?action=logout&redirect_to=' . $bp->root_domain . '">' . __( 'Log Out', 'buddypress' ) . '</a>'; 649 } 650 651 echo apply_filters( 'bp_logout_link', $logout_link ); 652 ?> 653 654 <?php do_action( 'bp_login_bar_logged_in' ) ?> 655 </div> 656 657 <?php endif; 625 function bp_log_out_link() { 626 global $bp; 627 if ( function_exists('wp_logout_url') ) 628 $logout_link = '<a href="' . wp_logout_url( $bp->root_domain ) . '">' . __( 'Log Out', 'buddypress' ) . '</a>'; 629 else 630 $logout_link = '<a href="' . $bp->root_domain . '/wp-login.php?action=logout&redirect_to=' . $bp->root_domain . '">' . __( 'Log Out', 'buddypress' ) . '</a>'; 631 632 echo apply_filters( 'bp_logout_link', $logout_link ); 658 633 } 659 634 … … 868 843 } 869 844 } 845 846 function bp_signup_allowed() { 847 echo bp_get_signup_allowed(); 848 } 849 function bp_get_signup_allowed() { 850 return get_site_option( 'registration' ); 851 } 852 853 function bp_account_was_activated() { 854 global $bp; 855 856 return $bp->activation_complete; 857 } 870 858 871 859 … … 1052 1040 1053 1041 echo sprintf( __( 'Viewing member %d to %d (of %d members)', 'buddypress' ), $from_num, $to_num, $site_members_template->total_member_count ); ?> 1054 < img id="ajax-loader-members" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php1042 <span class="ajax-loader"></span><?php 1055 1043 } 1056 1044 … … 1252 1240 } 1253 1241 1242 function bp_root_domain() { 1243 echo bp_get_root_domain(); 1244 } 1245 function bp_get_root_domain() { 1246 global $bp; 1247 1248 return $bp->root_domain; 1249 } 1250 1254 1251 /* Template is_() functions to determine the current page */ 1255 1252 … … 1371 1368 } 1372 1369 1370 function bp_is_my_groups() { 1371 global $bp; 1372 1373 if ( BP_GROUPS_SLUG == $bp->current_component && ( !$bp->current_action || 'my-groups' == $bp->current_action ) ) 1374 return true; 1375 1376 return false; 1377 } 1378 1373 1379 function bp_is_group_home() { 1374 1380 global $bp; … … 1552 1558 1553 1559 return false; 1560 } 1561 1562 function bp_is_activation_page() { 1563 global $bp; 1564 1565 if ( BP_ACTIVATION_SLUG == $bp->current_component ) 1566 return true; 1567 1568 return false; 1569 } 1570 1571 function bp_is_register_page() { 1572 global $bp; 1573 1574 if ( BP_REGISTER_SLUG == $bp->current_component ) 1575 return true; 1576 1577 return false; 1554 1578 } 1555 1579 … … 1562 1586 1563 1587 function bp_get_the_body_class() { 1564 if ( bp_is_blog_page() )1588 if ( bp_is_blog_page() || bp_is_activation_page() || bp_is_register_page() ) 1565 1589 $class[] = 'blog-page'; 1566 else 1567 $class[] = 'social-page'; 1590 1591 if ( !bp_is_blog_page() && !is_home() && !bp_is_register_page() && !bp_is_activation_page() ) 1592 $class[] = 'internal-page'; 1593 1594 if ( bp_is_blog_page() && is_home() ) 1595 $class[] = 'home-page'; 1568 1596 1569 1597 if ( bp_is_directory() ) 1570 1598 $class[] = 'directory'; 1571 1572 if ( bp_is_activity() ) 1599 1600 if ( bp_is_profile() && !bp_is_blog_page() ) 1601 $class[] = 'profile'; 1602 1603 if ( bp_is_activity() && !bp_is_blog_page() ) 1573 1604 $class[] = 'activity'; 1574 1605 1575 if ( bp_is_blogs() )1606 if ( bp_is_blogs() && !bp_is_blog_page() ) 1576 1607 $class[] = 'blogs'; 1577 1608 1578 if ( bp_is_wire() )1609 if ( bp_is_wire() && !bp_is_blog_page() ) 1579 1610 $class[] = 'wire'; 1580 1611 1581 if ( bp_is_messages() )1612 if ( bp_is_messages() && !bp_is_blog_page() ) 1582 1613 $class[] = 'messages'; 1583 1614 1584 if ( bp_is_friends() )1615 if ( bp_is_friends() && !bp_is_blog_page() ) 1585 1616 $class[] = 'friends'; 1586 1617 1587 if ( bp_is_groups() )1618 if ( bp_is_groups() && !bp_is_blog_page() ) 1588 1619 $class[] = 'groups'; 1589 1620 1590 if ( bp_is_settings() )1621 if ( bp_is_settings() && !bp_is_blog_page() ) 1591 1622 $class[] = 'settings'; 1592 1623 … … 1612 1643 $class[] = 'recent-posts'; 1613 1644 1614 if ( bp_is_my_blogs() )1645 if ( bp_is_my_blogs() && !bp_is_directory() ) 1615 1646 $class[] = 'my-blogs'; 1647 1648 if ( bp_is_my_groups() && !bp_is_directory() ) 1649 $class[] = 'my-groups'; 1616 1650 1617 1651 if ( bp_is_group_leave() ) … … 1648 1682 $class[] = 'change-avatar'; 1649 1683 1650 if ( bp_is_profile() )1651 $class[] = 'profile';1652 1653 1684 if ( bp_is_profile_edit() ) 1654 1685 $class[] = 'profile-edit'; … … 1659 1690 if ( bp_is_my_activity() ) 1660 1691 $class[] = 'my-activity'; 1692 1693 if ( bp_is_register_page() ) 1694 $class[] = 'registration'; 1695 1696 if ( bp_is_activation_page() ) 1697 $class[] = 'activation'; 1661 1698 1662 1699 if ( is_single() )
Note: See TracChangeset
for help on using the changeset viewer.