diff --git src/bp-blogs/bp-blogs-screens.php src/bp-blogs/bp-blogs-screens.php
index b1ab651..8b6f91a 100644
|
|
|
class BP_Blogs_Theme_Compat { |
| 141 | 141 | */ |
| 142 | 142 | public function directory_dummy_post() { |
| 143 | 143 | |
| 144 | | $title = apply_filters( 'bp_blogs_directory_header', __( 'Sites', 'buddypress' ) ); |
| 145 | | |
| 146 | 144 | bp_theme_compat_reset_post( array( |
| 147 | 145 | 'ID' => 0, |
| 148 | | 'post_title' => $title, |
| | 146 | 'post_title' => __( 'Sites', 'buddypress' ), |
| 149 | 147 | 'post_author' => 0, |
| 150 | 148 | 'post_date' => 0, |
| 151 | 149 | 'post_content' => '', |
| … |
… |
class BP_Blogs_Theme_Compat { |
| 201 | 199 | |
| 202 | 200 | // Title based on ability to create blogs |
| 203 | 201 | if ( is_user_logged_in() && bp_blog_signup_enabled() ) { |
| 204 | | $title = '<a class="button bp-title-button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '">' . __( 'Sites', 'buddypress' ) . '</a> ' . __( 'Create a Site', 'buddypress' ); |
| | 202 | $title = __( 'Create a Site', 'buddypress' ); |
| 205 | 203 | } else { |
| 206 | 204 | $title = __( 'Sites', 'buddypress' ); |
| 207 | 205 | } |
diff --git src/bp-blogs/bp-blogs-template.php src/bp-blogs/bp-blogs-template.php
index 1cd4425..040e945 100644
|
|
|
function bp_blog_create_button() { |
| 1215 | 1215 | 'component' => 'blogs', |
| 1216 | 1216 | 'link_text' => __( 'Create a Site', 'buddypress' ), |
| 1217 | 1217 | 'link_title' => __( 'Create a Site', 'buddypress' ), |
| 1218 | | 'link_class' => 'button blog-create bp-title-button', |
| | 1218 | 'link_class' => 'blog-create no-ajax', |
| 1219 | 1219 | 'link_href' => trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_blogs_root_slug() ) . trailingslashit( 'create' ), |
| 1220 | 1220 | 'wrapper' => false, |
| 1221 | 1221 | ); |
| … |
… |
function bp_blogs_get_profile_stats( $args = '' ) { |
| 1326 | 1326 | // Filter and return |
| 1327 | 1327 | return apply_filters( 'bp_blogs_get_profile_stats', $r['output'], $r ); |
| 1328 | 1328 | } |
| | 1329 | |
| | 1330 | /** |
| | 1331 | * Checks if a specific theme is still filtering the Blogs directory title |
| | 1332 | * if so, move it into the Blogs directory item tabs |
| | 1333 | * |
| | 1334 | * @since BuddyPress (?) |
| | 1335 | * |
| | 1336 | * @return string HTML Output |
| | 1337 | */ |
| | 1338 | function bp_blogs_backcompat_create_blog() { |
| | 1339 | // Bail if bp-legacy is in use |
| | 1340 | if ( did_action( 'bp_blogs_directory_blog_types', 'bp_legacy_theme_blog_create_button', 999 ) ) { |
| | 1341 | return; |
| | 1342 | } |
| | 1343 | |
| | 1344 | // Get the button if the specific theme is still filtering the Blogs directory title |
| | 1345 | $create_blog_button = trim( apply_filters( 'bp_blogs_directory_header', '' ) ); |
| | 1346 | |
| | 1347 | if ( empty( $create_blog_button ) ) { |
| | 1348 | return; |
| | 1349 | } |
| | 1350 | ?> |
| | 1351 | <li id="blog-create-button"><?php echo $create_blog_button ;?></li> |
| | 1352 | <?php |
| | 1353 | } |
| | 1354 | add_action( 'bp_blogs_directory_blog_types', 'bp_blogs_backcompat_create_blog', 1000 ); |
diff --git src/bp-groups/bp-groups-screens.php src/bp-groups/bp-groups-screens.php
index e89c72b..cdd7f34 100644
|
|
|
class BP_Groups_Theme_Compat { |
| 1099 | 1099 | * @since BuddyPress (1.7.0) |
| 1100 | 1100 | */ |
| 1101 | 1101 | public function directory_dummy_post() { |
| 1102 | | |
| 1103 | | $title = apply_filters( 'bp_groups_directory_header', bp_get_directory_title( 'groups' ) ); |
| 1104 | | |
| 1105 | 1102 | bp_theme_compat_reset_post( array( |
| 1106 | 1103 | 'ID' => 0, |
| 1107 | | 'post_title' => $title, |
| | 1104 | 'post_title' => bp_get_directory_title( 'groups' ), |
| 1108 | 1105 | 'post_author' => 0, |
| 1109 | 1106 | 'post_date' => 0, |
| 1110 | 1107 | 'post_content' => '', |
| … |
… |
class BP_Groups_Theme_Compat { |
| 1222 | 1219 | public function single_dummy_post() { |
| 1223 | 1220 | bp_theme_compat_reset_post( array( |
| 1224 | 1221 | 'ID' => 0, |
| 1225 | | 'post_title' => '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . bp_get_current_group_name() . '</a>', |
| | 1222 | 'post_title' => bp_get_current_group_name(), |
| 1226 | 1223 | 'post_author' => 0, |
| 1227 | 1224 | 'post_date' => 0, |
| 1228 | 1225 | 'post_content' => '', |
diff --git src/bp-groups/bp-groups-template.php src/bp-groups/bp-groups-template.php
index f729076..7d697c8 100644
|
|
|
function bp_group_create_button() { |
| 2850 | 2850 | 'component' => 'groups', |
| 2851 | 2851 | 'link_text' => __( 'Create a Group', 'buddypress' ), |
| 2852 | 2852 | 'link_title' => __( 'Create a Group', 'buddypress' ), |
| 2853 | | 'link_class' => 'button group-create bp-title-button', |
| | 2853 | 'link_class' => 'group-create no-ajax', |
| 2854 | 2854 | 'link_href' => trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_groups_root_slug() ) . trailingslashit( 'create' ), |
| 2855 | 2855 | 'wrapper' => false, |
| 2856 | 2856 | ); |
| … |
… |
function bp_groups_get_profile_stats( $args = '' ) { |
| 4778 | 4778 | // Filter and return |
| 4779 | 4779 | return apply_filters( 'bp_groups_get_profile_stats', $r['output'], $r ); |
| 4780 | 4780 | } |
| | 4781 | |
| | 4782 | /** |
| | 4783 | * Checks if a specific theme is still filtering the Groups directory title |
| | 4784 | * if so, move it into the Groups directory item tabs |
| | 4785 | * |
| | 4786 | * @since BuddyPress (?) |
| | 4787 | * |
| | 4788 | * @return string HTML Output |
| | 4789 | */ |
| | 4790 | function bp_groups_backcompat_create_group() { |
| | 4791 | // Bail if bp-legacy is in use |
| | 4792 | if ( did_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_button', 999 ) ) { |
| | 4793 | return; |
| | 4794 | } |
| | 4795 | |
| | 4796 | // Get the button if the specific theme is still filtering the Groups directory title |
| | 4797 | $create_group_button = trim( apply_filters( 'bp_groups_directory_header', '' ) ); |
| | 4798 | |
| | 4799 | if ( empty( $create_group_button ) ) { |
| | 4800 | return; |
| | 4801 | } |
| | 4802 | ?> |
| | 4803 | <li id="group-create-button"><?php echo $create_group_button ;?></li> |
| | 4804 | <?php |
| | 4805 | } |
| | 4806 | add_action( 'bp_groups_directory_group_filter', 'bp_groups_backcompat_create_group', 1000 ); |
diff --git src/bp-members/bp-members-screens.php src/bp-members/bp-members-screens.php
index 80f5565..9341d78 100644
|
|
|
function bp_core_screen_activation() { |
| 235 | 235 | |
| 236 | 236 | // grab the key (the old way) |
| 237 | 237 | $key = isset( $_GET['key'] ) ? $_GET['key'] : ''; |
| 238 | | |
| | 238 | |
| 239 | 239 | // grab the key (the new way) |
| 240 | 240 | if ( empty( $key ) ) { |
| 241 | 241 | $key = bp_current_action(); |
| … |
… |
function bp_core_screen_activation() { |
| 245 | 245 | if ( empty( $key ) ) { |
| 246 | 246 | return; |
| 247 | 247 | } |
| 248 | | |
| | 248 | |
| 249 | 249 | // Activate the signup |
| 250 | 250 | $user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $key ) ); |
| 251 | 251 | |
| … |
… |
class BP_Members_Theme_Compat { |
| 425 | 425 | public function single_dummy_post() { |
| 426 | 426 | bp_theme_compat_reset_post( array( |
| 427 | 427 | 'ID' => 0, |
| 428 | | 'post_title' => '<a href="' . bp_get_displayed_user_link() . '">' . bp_get_displayed_user_fullname() . '</a>', |
| | 428 | 'post_title' => bp_get_displayed_user_fullname(), |
| 429 | 429 | 'post_author' => 0, |
| 430 | 430 | 'post_date' => 0, |
| 431 | 431 | 'post_content' => '', |
diff --git src/bp-templates/bp-legacy/buddypress-functions.php src/bp-templates/bp-legacy/buddypress-functions.php
index 47bc605..6a8f87e 100644
|
|
|
class BP_Legacy extends BP_Theme_Compat { |
| 108 | 108 | |
| 109 | 109 | // Group buttons |
| 110 | 110 | if ( bp_is_active( 'groups' ) ) { |
| 111 | | add_action( 'bp_group_header_actions', 'bp_group_join_button', 5 ); |
| 112 | | add_action( 'bp_group_header_actions', 'bp_group_new_topic_button', 20 ); |
| 113 | | add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); |
| 114 | | add_filter( 'bp_groups_directory_header', 'bp_legacy_theme_group_create_button' ); |
| 115 | | add_filter( 'bp_blogs_directory_header', 'bp_legacy_theme_blog_create_button' ); |
| | 111 | add_action( 'bp_group_header_actions', 'bp_group_join_button', 5 ); |
| | 112 | add_action( 'bp_group_header_actions', 'bp_group_new_topic_button', 20 ); |
| | 113 | add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); |
| | 114 | add_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_button', 999 ); |
| 116 | 115 | } |
| 117 | 116 | |
| 118 | 117 | // Blog button |
| 119 | | if ( bp_is_active( 'blogs' ) ) |
| 120 | | add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' ); |
| | 118 | if ( bp_is_active( 'blogs' ) ) { |
| | 119 | add_action( 'bp_blogs_directory_blog_types', 'bp_legacy_theme_blog_create_button', 999 ); |
| | 120 | add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' ); |
| | 121 | } |
| 121 | 122 | |
| 122 | 123 | } |
| 123 | 124 | |
| … |
… |
new BP_Legacy(); |
| 443 | 444 | endif; |
| 444 | 445 | |
| 445 | 446 | /** |
| 446 | | * Add the Create a Group button to the Groups directory title. |
| | 447 | * Add the Create a Group button to the Groups directory item tabs. |
| 447 | 448 | * |
| 448 | | * bp-legacy puts the Create a Group button into the page title, to mimic |
| 449 | | * the behavior of bp-default. |
| | 449 | * bp-legacy puts the Create a Group button into the directory item tabs |
| | 450 | * to avoid adding extra html to the title of the page |
| 450 | 451 | * |
| 451 | 452 | * @since BuddyPress (2.0.0) |
| 452 | 453 | * |
| 453 | | * @param string $title Groups directory title. |
| 454 | 454 | * @return string |
| 455 | 455 | */ |
| 456 | | function bp_legacy_theme_group_create_button( $title ) { |
| 457 | | return $title . ' ' . bp_get_group_create_button(); |
| | 456 | function bp_legacy_theme_group_create_button() { |
| | 457 | $create_group_button = bp_get_group_create_button(); |
| | 458 | |
| | 459 | if ( empty( $create_group_button ) ) { |
| | 460 | return; |
| | 461 | } |
| | 462 | ?> |
| | 463 | <li id="group-create-button"><?php echo $create_group_button ;?></li> |
| | 464 | <?php |
| 458 | 465 | } |
| 459 | 466 | |
| 460 | 467 | /** |
| 461 | | * Add the Create a Site button to the Sites directory title. |
| | 468 | * Add the Create a Site button to the Sites directory item tabs. |
| 462 | 469 | * |
| 463 | | * bp-legacy puts the Create a Site button into the page title, to mimic |
| 464 | | * the behavior of bp-default. |
| | 470 | * bp-legacy puts the Create a Site button into the directory item tabs |
| | 471 | * to avoid adding extra html to the title of the page |
| 465 | 472 | * |
| 466 | 473 | * @since BuddyPress (2.0.0) |
| 467 | 474 | * |
| 468 | | * @param string $title Sites directory title. |
| 469 | 475 | * @return string |
| 470 | 476 | */ |
| 471 | | function bp_legacy_theme_blog_create_button( $title ) { |
| 472 | | return $title . ' ' . bp_get_blog_create_button(); |
| | 477 | function bp_legacy_theme_blog_create_button() { |
| | 478 | $create_blog_button = bp_get_blog_create_button(); |
| | 479 | |
| | 480 | if ( empty( $create_blog_button ) ) { |
| | 481 | return; |
| | 482 | } |
| | 483 | ?> |
| | 484 | <li id="blog-create-button"><?php echo $create_blog_button ;?></li> |
| | 485 | <?php |
| 473 | 486 | } |
| 474 | 487 | /** |
| 475 | 488 | * This function looks scarier than it actually is. :) |
diff --git src/bp-templates/bp-legacy/css/buddypress.css src/bp-templates/bp-legacy/css/buddypress.css
index f924fe5..0e6216a 100644
|
|
|
body.no-js #buddypress #notifications-bulk-management #select-all-notifications |
| 764 | 764 | #buddypress input[type=reset], |
| 765 | 765 | #buddypress ul.button-nav li a, |
| 766 | 766 | #buddypress div.generic-button a, |
| 767 | | #buddypress .comment-reply-link, |
| 768 | | a.bp-title-button { |
| | 767 | #buddypress .comment-reply-link { |
| 769 | 768 | background: #fff; /* Old browsers */ |
| 770 | 769 | border: 1px solid #ccc; |
| 771 | 770 | color: #777; |
| … |
… |
a.bp-title-button { |
| 776 | 775 | text-align: center; |
| 777 | 776 | text-decoration: none; |
| 778 | 777 | } |
| | 778 | |
| 779 | 779 | #buddypress button:hover, |
| 780 | 780 | #buddypress a.button:hover, |
| 781 | 781 | #buddypress a.button:focus, |
| … |
… |
body.activity-permalink #buddypress ul.item-list li.activity-item { |
| 1315 | 1315 | float: right; |
| 1316 | 1316 | margin: 7px 0 0; |
| 1317 | 1317 | } |
| | 1318 | #buddypress div.item-list-tabs ul li#group-create-button, |
| | 1319 | #buddypress div.item-list-tabs ul li#blog-create-button { |
| | 1320 | margin:0; |
| | 1321 | } |
| 1318 | 1322 | #buddypress div.item-list-tabs#subnav ul li.last { |
| 1319 | 1323 | margin-top: 4px; |
| 1320 | 1324 | } |
| … |
… |
body.register #buddypress div.page ul { |
| 1586 | 1590 | margin-bottom: 1em; |
| 1587 | 1591 | width: 50%; |
| 1588 | 1592 | } |
| 1589 | | a.bp-title-button { |
| 1590 | | margin-left: 10px; |
| 1591 | | } |
| 1592 | 1593 | #buddypress form.standard-form .main-column div.action{ |
| 1593 | 1594 | position: relative; |
| 1594 | 1595 | margin-bottom:1em; |
| … |
… |
body.register #buddypress div.page ul { |
| 1665 | 1666 | #buddypress li div.item{ |
| 1666 | 1667 | margin-left: 45px; |
| 1667 | 1668 | } |
| 1668 | | h1 a.bp-title-button { |
| 1669 | | clear: left; |
| 1670 | | float: left; |
| 1671 | | margin: 10px 0 20px; |
| 1672 | | } |
| 1673 | 1669 | } |
diff --git src/bp-templates/bp-legacy/js/buddypress.js src/bp-templates/bp-legacy/js/buddypress.js
index e8e61f3..90f6023 100644
|
|
|
jq(document).ready( function() { |
| 835 | 835 | |
| 836 | 836 | /* When a navigation tab is clicked - e.g. | All Groups | My Groups | */ |
| 837 | 837 | jq('div.item-list-tabs').on( 'click', function(event) { |
| 838 | | if ( jq(this).hasClass('no-ajax') ) { |
| | 838 | if ( jq(this).hasClass('no-ajax') || jq( event.target ).hasClass('no-ajax') ) { |
| 839 | 839 | return; |
| 840 | 840 | } |
| 841 | 841 | |