Skip to:
Content
Pages
Categories
Search
Top
Bottom

URGENT: How do I initialize BP on a plain php-site


  • RaphaelJeger
    Participant

    @raphaeljeger

    Hi

    I’ve installed BP in a subdirectory of my existing php-site.
    I am able to pull information from buddypress like this:

    etc.

    But when I output the $bp global with:

    `function bp_dump() {
    global $bp;

    foreach ( (array)$bp as $key => $value ) {
    echo ‘

    ';
    echo '' . $key . ':
    ';
    print_r( $value );
    echo '

    ‘;
    }
    die;
    }
    add_action( ‘wp’, ‘bp_dump’ );`

    it shows f.e. that I am not logged in, doesn’t matter if I am logged in in the same browser-session or not.

    So it seems I am completely missing some “initializing” or something or what is causing this?

    Please help, I need urgent help on this!
    Raphael

Viewing 3 replies - 1 through 3 (of 3 total)

  • Boone Gorges
    Keymaster

    @boonebgorges

    If by “plain PHP” you mean that it’s not WP, then that’s your problem. You must be running WP to make BP work. Try:
    `require_once( /path/to/wp/wp-load.php );`


    RaphaelJeger
    Participant

    @raphaeljeger

    Hi Boone

    I know it’s my problem ;) of course WP is installed and I managed to solve the problem. Users where not logged in because the user-cookie was only set on the wp-subdomain and not on the root-domain, which I was able to solve easily when I knew about it with the plugin “root cookie”.

    Thanks for your suggestion, so far it works. However, I have another problem now:

    I would expect that the following code outputs all activity on the group “myTestGroup”, but it doesn’t – it outputs everything. Where’s my fault?

    `

    `

    Thank you so very much for your help!
    Raphael


    RaphaelJeger
    Participant

    @raphaeljeger

    ok, in the example above I’m actually searching for the group “wittenham_clumps”, but anyway, it doesn’t work…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘URGENT: How do I initialize BP on a plain php-site’ is closed to new replies.
Skip to toolbar