Ejemplo n.º 1
0
<?php

define('BB_IS_ADMIN', true);
require_once '../bb-load.php';
bb_ssl_redirect();
bb_auth();
if (bb_get_option('bb_db_version') > bb_get_option_from_db('bb_db_version')) {
    bb_safe_redirect('upgrade.php');
    die;
}
require_once BB_PATH . 'bb-admin/includes/functions.bb-admin.php';
$bb_admin_page = bb_find_filename($_SERVER['PHP_SELF']);
$_check_callback = false;
if ($bb_admin_page == 'admin-base.php') {
    $bb_admin_page = (string) @$_GET['plugin'];
    $_check_callback = true;
}
wp_enqueue_script('common');
bb_user_settings();
if (isset($_GET['foldmenu'])) {
    if ($_GET['foldmenu']) {
        bb_update_user_setting('fm', 'f');
    } else {
        bb_delete_user_setting('fm');
    }
    bb_safe_redirect(remove_query_arg('foldmenu', stripslashes($_SERVER['REQUEST_URI'])));
    die;
}
bb_admin_menu_generator();
bb_get_current_admin_menu();
if ($_check_callback) {
function bb_get_location()
{
    // Not for display.  Do not internationalize.
    static $file;
    static $filename;
    if (!isset($file)) {
        $path = '';
        foreach (array($_SERVER['SCRIPT_NAME'], $_SERVER['SCRIPT_FILENAME'], $_SERVER['PHP_SELF']) as $_path) {
            if (false !== strpos($_path, '.php')) {
                $path = $_path;
                break;
            }
        }
        $filename = bb_find_filename($path);
        // Make $file relative to bbPress root directory
        $file = str_replace(bb_get_option('path'), '', $path);
    }
    switch ($filename) {
        case 'index.php':
        case 'page.php':
            $location = 'front-page';
            break;
        case 'forum.php':
            $location = 'forum-page';
            break;
        case 'tags.php':
            $location = 'tag-page';
            break;
        case 'edit.php':
            $location = 'topic-edit-page';
            break;
        case 'topic.php':
            $location = 'topic-page';
            break;
        case 'rss.php':
            $location = 'feed-page';
            break;
        case 'search.php':
            $location = 'search-page';
            break;
        case 'profile.php':
            $location = 'profile-page';
            break;
        case 'favorites.php':
            $location = 'favorites-page';
            break;
        case 'view.php':
            $location = 'view-page';
            break;
        case 'statistics.php':
            $location = 'stats-page';
            break;
        case 'bb-login.php':
            $location = 'login-page';
            break;
        case 'register.php':
            $location = 'register-page';
            break;
        default:
            $location = apply_filters('bb_get_location', '', $file);
            break;
    }
    return $location;
}
function bb_anon_get_bb_post($loc = '', $file = '')
{
    if (bb_find_filename('/' . $file) == 'bb-post.php') {
        return 'bb-post';
    }
}
Ejemplo n.º 4
0
function bb_attachments_location()
{
    $file = '';
    foreach (array($_SERVER['PHP_SELF'], $_SERVER['SCRIPT_FILENAME'], $_SERVER['SCRIPT_NAME']) as $name) {
        if (false !== strpos($name, '.php')) {
            $file = $name;
        }
    }
    return bb_find_filename($file);
}
Ejemplo n.º 5
0
function recaptcha_bbpress_register_page()
{
    foreach (array($_SERVER['PHP_SELF'], $_SERVER['SCRIPT_FILENAME'], $_SERVER['SCRIPT_NAME']) as $page) {
        if (strpos($page, '.php') !== false) {
            $file = $page;
        }
    }
    return bb_find_filename($file) == "register.php";
}