[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/deprecated/ -> 1.7.php (source)

   1  <?php
   2  /**
   3   * Deprecated Functions
   4   *
   5   * @package BuddyPress
   6   * @subpackage Core
   7   * @deprecated Since 1.7.0
   8   */
   9  
  10  // Exit if accessed directly.
  11  defined( 'ABSPATH' ) || exit;
  12  
  13  /**
  14   * Output the BuddyPress maintenance mode
  15   *
  16   * @since 1.6.0
  17   * @deprecated 1.7.0
  18   */
  19  function bp_maintenance_mode() {
  20      echo bp_get_maintenance_mode();
  21  }
  22      /**
  23       * Return the BuddyPress maintenance mode
  24       *
  25       * @since 1.6.0
  26       * @deprecated 1.7.0
  27       * @return string The BuddyPress maintenance mode
  28       */
  29  	function bp_get_maintenance_mode() {
  30          return buddypress()->maintenance_mode;
  31      }
  32  
  33  /**
  34   * @deprecated 1.7.0
  35   */
  36  function xprofile_get_profile() {
  37      _deprecated_function( __FUNCTION__, '1.7' );
  38      bp_locate_template( array( 'profile/profile-loop.php' ), true );
  39  }
  40  
  41  /**
  42   * @deprecated 1.7.0
  43   */
  44  function bp_get_profile_header() {
  45      _deprecated_function( __FUNCTION__, '1.7' );
  46      bp_locate_template( array( 'profile/profile-header.php' ), true );
  47  }
  48  
  49  /**
  50   * @deprecated 1.7.0
  51   * @param string $component_name
  52   * @return boolean
  53   */
  54  function bp_exists( $component_name ) {
  55      _deprecated_function( __FUNCTION__, '1.7' );
  56      if ( function_exists( $component_name . '_install' ) )
  57          return true;
  58  
  59      return false;
  60  }
  61  
  62  /**
  63   * @deprecated 1.7.0
  64   */
  65  function bp_get_plugin_sidebar() {
  66      _deprecated_function( __FUNCTION__, '1.7' );
  67      bp_locate_template( array( 'plugin-sidebar.php' ), true );
  68  }
  69  
  70  /**
  71   * On multiblog installations you must first allow themes to be activated and
  72   * show up on the theme selection screen. This function will let the BuddyPress
  73   * bundled themes show up on the root blog selection screen and bypass this
  74   * step. It also means that the themes won't show for selection on other blogs.
  75   *
  76   * @deprecated 1.7.0
  77   * @return array
  78   */
  79  function bp_core_allow_default_theme( $themes ) {
  80      _deprecated_function( __FUNCTION__, '1.7' );
  81  
  82      if ( !bp_current_user_can( 'bp_moderate' ) )
  83          return $themes;
  84  
  85      if ( bp_get_root_blog_id() != get_current_blog_id() )
  86          return $themes;
  87  
  88      if ( isset( $themes['bp-default'] ) )
  89          return $themes;
  90  
  91      $themes['bp-default'] = true;
  92  
  93      return $themes;
  94  }
  95  
  96  /**
  97   * No longer used by BuddyPress core
  98   *
  99   * @deprecated 1.7.0
 100   * @param string $page
 101   * @return boolean True if is BuddyPress page
 102   */
 103  function bp_is_page( $page = '' ) {
 104      _deprecated_function( __FUNCTION__, '1.7' );
 105  
 106      if ( !bp_is_user() && bp_is_current_component( $page )  )
 107          return true;
 108  
 109      if ( 'home' == $page )
 110          return is_front_page();
 111  
 112      return false;
 113  }
 114  
 115  /** Admin *********************************************************************/
 116  
 117  /**
 118   * This function was originally used to update pre-1.1 schemas, but that was
 119   * before we had a legitimate update process.
 120   *
 121   * @deprecated 1.7.0
 122   * @global WPDB $wpdb
 123   */
 124  function bp_update_db_stuff() {
 125      global $wpdb;
 126  
 127      $bp        = buddypress();
 128      $bp_prefix = bp_core_get_table_prefix();
 129  
 130      // Rename the old user activity cached table if needed.
 131      if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_activity_user_activity_cached%'" ) ) {
 132          $wpdb->query( "RENAME TABLE {$bp_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" );
 133      }
 134  
 135      // Rename fields from pre BP 1.2
 136      if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) {
 137          if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) ) {
 138              $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" );
 139          }
 140  
 141          if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) ) {
 142              $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" );
 143          }
 144      }
 145  
 146      // On first installation - record all existing blogs in the system.
 147      if ( !(int) $bp->site_options['bp-blogs-first-install'] ) {
 148          bp_blogs_record_existing_blogs();
 149          bp_update_option( 'bp-blogs-first-install', 1 );
 150      }
 151  
 152      if ( is_multisite() ) {
 153          bp_core_add_illegal_names();
 154      }
 155  
 156      // Update and remove the message threads table if it exists.
 157      if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) {
 158          if ( BP_Messages_Thread::update_tables() ) {
 159              $wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" );
 160          }
 161      }
 162  }


Generated: Thu Nov 21 01:00:57 2024 Cross-referenced by PHPXref 0.7.1