Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/05/2012 06:17:43 AM (13 years ago)
Author:
johnjamesjacoby
Message:

First pass at rearranging settings and forums settings screens to accommodate bbPress 2.x migration:

  • Simplify and move old bb-config.php file write logic into Settings screen
  • Introduce new functions for checking what possible mode the Forums screen is in
  • Deprecate old forum admin code for now, will probably be removed later
  • Deprecate $bp->bbconfig setting and use bp_get_option() instead
  • Clean up the Settings screen and add dedicated groups for Profiles and Forums
  • See #3598
  • More to do
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-forums/bp-forums-functions.php

    r5871 r5885  
    11<?php
     2
    23// Exit if accessed directly
    34if ( !defined( 'ABSPATH' ) ) exit;
    45
     6/** bbPress 2.x ***************************************************************/
     7
     8/**
     9 * Used to see if bbPress 2.x is installed and active
     10 *
     11 * @since BuddyPress (1.6)
     12 * @return boolean True if bbPress 2.x is active, false if not
     13 */
     14function bp_forums_is_bbpress_active() {
     15
     16    // Single site
     17    if ( is_plugin_active( 'bbpress/bbpress.php' ) )
     18        return true;
     19
     20    // Network active
     21    if ( is_plugin_active_for_network( 'bbpress/bbpress.php' ) )
     22        return true;
     23
     24    // Nope
     25    return false;
     26}
     27
     28/** bbPress 1.x ***************************************************************/
     29
     30/**
     31 * If the bb-config-location option exists, bbPress 1.x was previously installed
     32 *
     33 * @since BuddyPress (1.2)
     34 * @return boolean True if option exists, false if not
     35 */
    536function bp_forums_is_installed_correctly() {
    6     global $bp;
    7 
    8     if ( isset( $bp->forums->bbconfig ) && is_file( $bp->forums->bbconfig ) )
     37    if ( bp_get_option( 'bb-config-location' ) )
    938        return true;
    1039
Note: See TracChangeset for help on using the changeset viewer.