Changeset 6579
- Timestamp:
- 12/10/2012 06:50:12 AM (14 years ago)
- Location:
- trunk/bp-core
- Files:
-
- 5 edited
-
admin/bp-core-functions.php (modified) (3 diffs)
-
bp-core-actions.php (modified) (1 diff)
-
bp-core-admin.php (modified) (8 diffs)
-
bp-core-functions.php (modified) (3 diffs)
-
bp-core-update.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-functions.php
r6558 r6579 162 162 163 163 /** 164 * Redirect user to bbPress's What's New page on activation165 * 166 * @since bbPress (r4389)167 * 168 * @internal Used internally to redirect bbPress to the about page on activation164 * Redirect user to BuddyPress's What's New page on activation 165 * 166 * @since BuddyPress (1.7) 167 * 168 * @internal Used internally to redirect BuddyPress to the about page on activation 169 169 * 170 170 * @uses get_transient() To see if transient to redirect exists … … 175 175 * @uses admin_url() To get the admin URL to index.php 176 176 * 177 * @return If no transient, or i n network admin, or is bulk activation177 * @return If no transient, or is bulk activation 178 178 */ 179 179 function bp_do_activation_redirect() { … … 187 187 188 188 // Bail if activating from network, or bulk 189 if ( is _network_admin() || isset( $_GET['activate-multi'] ) )190 return; 191 192 // Redirect to bbPress about page193 wp_safe_redirect( add_query_arg( array( 'page' => 'bp-about' ), admin_url( 'index.php' ) ) );189 if ( isset( $_GET['activate-multi'] ) ) 190 return; 191 192 // Redirect to BuddyPress about page 193 wp_safe_redirect( add_query_arg( array( 'page' => 'bp-about' ), bp_get_admin_url( 'index.php' ) ) ); 194 194 } 195 195 -
trunk/bp-core/bp-core-actions.php
r6531 r6579 93 93 add_action( 'bp_loaded', 'bp_admin' ); 94 94 } 95 96 // Activation redirect 97 add_action( 'bp_activation', 'bp_add_activation_redirect' ); -
trunk/bp-core/bp-core-admin.php
r6558 r6579 375 375 public function about_screen() { 376 376 377 // Switch page to use for settings 378 $settings_page = bp_is_network_activated() ? 'settings.php' : 'options-general.php'; 379 377 380 list( $display_version ) = explode( '-', bp_get_version() ); ?> 378 381 … … 442 445 443 446 <div class="return-to-dashboard"> 444 <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'b uddypress' ), 'options-general.php') ) ); ?>"><?php _e( 'Go to Community Settings' ); ?></a>447 <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $settings_page ) ) ); ?>"><?php _e( 'Go to Community Settings' ); ?></a> 445 448 </div> 446 449 … … 459 462 */ 460 463 public function credits_screen() { 464 465 // Switch page to use for settings 466 $settings_page = bp_is_network_activated() ? 'settings.php' : 'options-general.php'; 461 467 462 468 list( $display_version ) = explode( '-', bp_get_version() ); ?> … … 480 486 <ul class="wp-people-group " id="wp-people-group-project-leaders"> 481 487 <li class="wp-person" id="wp-person-apeatling"> 482 <a href="http://profiles.wordpress.org/apeatling"><img src="http://0.gravatar.com/avatar/ 767fc9c115a1b989744c755db47feb60?s=60" class="gravatar" alt="Andy Peatling" /></a>488 <a href="http://profiles.wordpress.org/apeatling"><img src="http://0.gravatar.com/avatar/bb29d699b5cba218c313b61aa82249da?s=60" class="gravatar" alt="Andy Peatling" /></a> 483 489 <a class="web" href="http://profiles.wordpress.org/apeatling">Andy Peatling</a> 484 490 <span class="title"><?php _e( 'Founding Developer', 'buddypress' ); ?></span> … … 490 496 </li> 491 497 <li class="wp-person" id="wp-person-boonebgorges"> 492 <a href="http://profiles.wordpress.org/boonebgorges"><img src="http://0.gravatar.com/avatar/ 6a7c997edea340616bcc6d0fe03f65dd?s=60" class="gravatar" alt="Boone B. Gorges" /></a>498 <a href="http://profiles.wordpress.org/boonebgorges"><img src="http://0.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=60" class="gravatar" alt="Boone B. Gorges" /></a> 493 499 <a class="web" href="http://profiles.wordpress.org/boonebgorges">Boone B. Gorges</a> 494 500 <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span> 495 501 </li> 496 502 <li class="wp-person" id="wp-person-djpaul"> 497 <a href="http://profiles.wordpress.org/djpaul"><img src="http://0.gravatar.com/avatar/ e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Paul Gibbs" /></a>503 <a href="http://profiles.wordpress.org/djpaul"><img src="http://0.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=60" class="gravatar" alt="Paul Gibbs" /></a> 498 504 <a class="web" href="http://profiles.wordpress.org/djpaul">Paul Gibbs</a> 499 505 <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span> … … 503 509 <h4 class="wp-people-group"><?php _e( 'Contributing Developers', 'buddypress' ); ?></h4> 504 510 <ul class="wp-people-group " id="wp-people-group-contributing-developers"> 505 <li class="wp-person" id="wp-person- jmdodd">506 <a href="http://profiles.wordpress.org/ jmdodd"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=60" class="gravatar" alt="Jennifer M. Dodd" /></a>507 <a class="web" href="http://profiles.wordpress.org/ jmdodd">Jennifer M. Dodd</a>508 <span class="title">< /span>509 </li> 510 <li class="wp-person" id="wp-person- jaredatch">511 <a href="http://profiles.wordpress.org/ jaredatch"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Jared Atchison" /></a>512 <a class="web" href="http://profiles.wordpress.org/ jaredatch">Jared Atchison</a>513 <span class="title">< /span>514 </li> 515 <li class="wp-person" id="wp-person- gautamgupta">516 <a href="http://profiles.wordpress.org/ gautamgupta"><img src="http://0.gravatar.com/avatar/b0810422cbe6e4eead4def5ae7a90b34?s=60" class="gravatar" alt="Gautam Gupta" /></a>517 <a class="web" href="http://profiles.wordpress.org/ gautamgupta">Gautam Gupta</a>518 <span class="title">< /span>511 <li class="wp-person" id="wp-person-r-a-y"> 512 <a href="http://profiles.wordpress.org/r-a-y"><img src="http://0.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=60" class="gravatar" alt="Ray" /></a> 513 <a class="web" href="http://profiles.wordpress.org/r-a-y">Ray</a> 514 <span class="title"><?php _e( 'Quality Officer', 'buddypress' ); ?></span> 515 </li> 516 <li class="wp-person" id="wp-person-karmatosed"> 517 <a href="http://profiles.wordpress.org/karmatosed"><img src="http://0.gravatar.com/avatar/d36d2c1821af9249b69ff7f5ed60529b?s=60" class="gravatar" alt="Tammie Lister" /></a> 518 <a class="web" href="http://profiles.wordpress.org/karmatosed">Tammie Lister</a> 519 <span class="title"><?php _e( 'Mark-up Officer', 'buddypress' ); ?></span> 520 </li> 521 <li class="wp-person" id="wp-person-mercime"> 522 <a href="http://profiles.wordpress.org/mercime"><img src="http://0.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=60" class="gravatar" alt="Mercime" /></a> 523 <a class="web" href="http://profiles.wordpress.org/mercime">Mercime</a> 524 <span class="title"><?php _e( 'Support Officer', 'buddypress' ); ?></span> 519 525 </li> 520 526 </ul> … … 522 528 <h4 class="wp-people-group"><?php _e( 'Codex Rockstars', 'buddypress' ); ?></h4> 523 529 <ul class="wp-people-group " id="wp-people-group-codex-rockstars"> 524 <li class="wp-person" id="wp-person-masonjames"> 525 <a href="http://profiles.wordpress.org/masonjames"><img src="http://0.gravatar.com/avatar/99dee4d5287d0f9e26ff72e7228d97ac?s=60" class="gravatar" alt="Mason James" /></a> 526 <a class="web" href="http://profiles.wordpress.org/masonjames">Mason James</a> 527 <span class="title"></span> 528 </li> 529 <li class="wp-person" id="wp-person-wordsforwp"> 530 <a href="http://profiles.wordpress.org/wordsforwp"><img src="http://0.gravatar.com/avatar/5437119b446adad1af813c44944e6c9c?s=60" class="gravatar" alt="Siobhan McKeown" /></a> 531 <a class="web" href="http://profiles.wordpress.org/wordsforwp">Siobhan McKeown</a> 532 <span class="title"></span> 533 </li> 534 <li class="wp-person" id="wp-person-JarretC"> 535 <a href="http://profiles.wordpress.org/JarretC"><img src="http://0.gravatar.com/avatar/e00501bf782b42d5db19ff75fca14f6a?s=60" class="gravatar" alt="Jarret Cade" /></a> 536 <a class="web" href="http://profiles.wordpress.org/JarretC">Jarret Cade</a> 530 <li class="wp-person" id="wp-person-modemlooper"> 531 <a href="http://profiles.wordpress.org/modemlooper"><img src="http://0.gravatar.com/avatar/1c07be1016e845de514931477c939307?s=60" class="gravatar" alt="Modemlooper" /></a> 532 <a class="web" href="http://profiles.wordpress.org/modemlooper">Modemlooper</a> 533 <span class="title"><?php _e( 'Mobile Officer', 'buddypress' ); ?></span> 534 </li> 535 <li class="wp-person" id="wp-person-dennissmolek"> 536 <a href="http://profiles.wordpress.org/dennissmolek"><img src="http://0.gravatar.com/avatar/015eeb0cebb40f949d0f317e2dfe66c3?s=60" class="gravatar" alt="Dennis Smolek" /></a> 537 <a class="web" href="http://profiles.wordpress.org/dennissmolek">Dennis Smolek</a> 537 538 <span class="title"></span> 538 539 </li> … … 577 578 578 579 <div class="return-to-dashboard"> 579 <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'b uddypress' ), 'options-general.php') ) ); ?>"><?php _e( 'Go to Community Settings' ); ?></a>580 <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $settings_page ) ) ); ?>"><?php _e( 'Go to Community Settings' ); ?></a> 580 581 </div> 581 582 -
trunk/bp-core/bp-core-functions.php
r6558 r6579 26 26 * 27 27 * @since BuddyPress (1.6) 28 * @global BuddyPress $bp29 28 * @return string The BuddyPress version 30 29 */ 31 30 function bp_get_version() { 32 global $bp; 33 return $bp->version; 31 return buddypress()->version; 34 32 } 35 33 … … 47 45 * 48 46 * @since BuddyPress (1.6) 49 * @global BuddyPress $bp50 47 * @return string The BuddyPress version 51 48 */ 52 49 function bp_get_db_version() { 53 global $bp; 54 return $bp->db_version; 50 return buddypress()->db_version; 55 51 } 56 52 … … 68 64 * 69 65 * @since BuddyPress (1.6) 70 * @global BuddyPress $bp71 66 * @return string The BuddyPress version direct from the database 72 67 */ 73 68 function bp_get_db_version_raw() { 74 global $bp; 75 76 $retval = 0; 77 if ( !empty( $bp->db_version_raw ) ) 78 $retval = $bp->db_version_raw; 79 80 return $retval; 69 $bp = buddypress(); 70 return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0; 81 71 } 82 72 -
trunk/bp-core/bp-core-update.php
r6436 r6579 12 12 13 13 /** 14 * Compare the BuddyPress version to the DB version to determine if updating15 * 16 * @since BuddyPress (1. 6)14 * If there is no raw DB version, this is the first installation 15 * 16 * @since BuddyPress (1.7) 17 17 * 18 18 * @uses get_option() … … 20 20 * @return bool True if update, False if not 21 21 */ 22 function bp_is_install() { 23 return ! bp_get_db_version_raw(); 24 } 25 26 /** 27 * Compare the BuddyPress version to the DB version to determine if updating 28 * 29 * @since BuddyPress (1.6) 30 * 31 * @uses get_option() 32 * @uses bp_get_db_version() To get BuddyPress's database version 33 * @return bool True if update, False if not 34 */ 22 35 function bp_is_update() { 23 36 … … 42 55 */ 43 56 function bp_is_activation( $basename = '' ) { 44 $bp = buddypress(); 45 57 $bp = buddypress(); 46 58 $action = false; 47 if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) 59 60 if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) { 48 61 $action = $_REQUEST['action']; 49 elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) )62 } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) { 50 63 $action = $_REQUEST['action2']; 64 } 51 65 52 66 // Bail if not activating 53 if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) ) 54 return false; 67 if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) ) { 68 return false; 69 } 55 70 56 71 // The plugin(s) being activated 57 if ( $action == 'activate' ) 72 if ( $action == 'activate' ) { 58 73 $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); 59 else74 } else { 60 75 $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); 76 } 61 77 62 78 // Set basename if empty 63 if ( empty( $basename ) && !empty( $bp->basename ) ) 79 if ( empty( $basename ) && !empty( $bp->basename ) ) { 64 80 $basename = $bp->basename; 81 } 65 82 66 83 // Bail if no basename 67 if ( empty( $basename ) ) 68 return false; 84 if ( empty( $basename ) ) { 85 return false; 86 } 69 87 70 88 // Is BuddyPress being activated? … … 81 99 */ 82 100 function bp_is_deactivation( $basename = '' ) { 83 $bp = buddypress(); 84 101 $bp = buddypress(); 85 102 $action = false; 86 if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) 103 104 if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) { 87 105 $action = $_REQUEST['action']; 88 elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) )106 } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) { 89 107 $action = $_REQUEST['action2']; 108 } 90 109 91 110 // Bail if not deactivating 92 if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) 93 return false; 111 if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) { 112 return false; 113 } 94 114 95 115 // The plugin(s) being deactivated 96 if ( $action == 'deactivate' )116 if ( 'deactivate' == $action ) { 97 117 $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); 98 else118 } else { 99 119 $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); 120 } 100 121 101 122 // Set basename if empty 102 if ( empty( $basename ) && !empty( $bp->basename ) ) 123 if ( empty( $basename ) && !empty( $bp->basename ) ) { 103 124 $basename = $bp->basename; 125 } 104 126 105 127 // Bail if no basename 106 if ( empty( $basename ) ) 107 return false; 128 if ( empty( $basename ) ) { 129 return false; 130 } 108 131 109 132 // Is bbPress being deactivated? … … 135 158 136 159 // Are we running an outdated version of BuddyPress? 137 if ( bp_is_update() ) { 138 139 // Bump the version 140 bp_version_bump(); 141 142 // Run the deactivation function to wipe roles, caps, and rewrite rules 143 bp_deactivation(); 144 145 // Run the activation function to reset roles, caps, and rewrite rules 146 bp_activation(); 147 } 160 if ( ! bp_is_update() ) 161 return; 162 163 bp_version_updater(); 164 } 165 166 /** 167 * bbPress's version updater looks at what the current database version is, and 168 * runs whatever other code is needed. 169 * 170 * This is most-often used when the data schema changes, but should also be used 171 * to correct issues with bbPress meta-data silently on software update. 172 * 173 * @since bbPress (r4104) 174 */ 175 function bp_version_updater() { 176 177 // Get the raw database version 178 $raw_db_version = (int) bp_get_db_version_raw(); 179 180 /** 1.6 Branch ************************************************************/ 181 182 // 1.6 183 if ( $raw_db_version < 6067 ) { 184 // Do nothing 185 } 186 187 /** All done! *************************************************************/ 188 189 // Bump the version 190 bp_version_bump(); 191 } 192 193 /** 194 * Redirect user to BuddyPress's What's New page on activation 195 * 196 * @since BuddyPress (1.7) 197 * 198 * @internal Used internally to redirect BuddyPress to the about page on activation 199 * 200 * @uses set_transient() To drop the activation transient for 30 seconds 201 * 202 * @return If bulk activation 203 */ 204 function bp_add_activation_redirect() { 205 206 // Bail if activating from network, or bulk 207 if ( isset( $_GET['activate-multi'] ) ) 208 return; 209 210 // Add the transient to redirect 211 set_transient( '_bp_activation_redirect', true, 30 ); 148 212 } 149 213
Note: See TracChangeset
for help on using the changeset viewer.