Skip to:
Content
Pages
Categories
Search
Top
Bottom

Multisite displaying forum list

  • Hi all,

    I am currently running a multi-site wordpress site which has separate bbpress installations, as there are common forums, plus private ones for each sub site. As I needed multiple different private forums I though this was the best method to achieve this. I was wondering if it is possible to, using shortcode or otherwise, show a list of forums from more than one subsite on a page?

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

  • travis.hill
    Participant

    @travishill

    I don’t think this can currently be achieved, however, it wouldn’t be hard to code something to accomplish it.

    Well, I am currently modifying the bbp-forum-index shortcdde so that it will take a site id as an optional parameter.

    This is the method I have so far, but I am not sure how to call the bbp_has_forums() on the other site, as I do not know a huge amount of php

    Any help would be appreciated

    public function display_forum_index( $attr, $content = '' ) {
    global $bbp;

    if ( !empty( $content ) || !is_numeric( $attr['id'] ) ) )
    return $content;

    if ( empty( $attr['id'] )
    {
    $current_site = get_current_site();
    $site_id = $current_site->id;
    }
    else
    {
    $site_id = $attr['id'];
    }
    // Unset globals
    $this->unset_globals();

    // Start output buffer
    $this->start( 'bbp_forum_archive' );

    // Breadcrumb
    bbp_breadcrumb();

    // Before forums index
    do_action( 'bbp_template_before_forums_index' );

    // Load the forums index
    if ( bbp_has_forums() )
    bbp_get_template_part( 'bbpress/loop', 'forums' );

    // No forums
    else
    bbp_get_template_part( 'bbpress/feedback', 'no-forums' );

    // After forums index
    do_action( 'bbp_template_after_forums_index' );

    // Return contents of output buffer
    return $this->end();
    }


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Don’t modify the core function. Makes a plugin and make your own Shortcodes instead. You’ll need to look into how switch_to_blog works. You’ll also need to see how my Switch Site Rewrite plugin reloads the permalinks for each switch. The reason this isn’t in core is its a labor intensive set of requests for the server to pull off, particularly across multiple servers or data centers in large installations.

    Thanks for the help.

    I did not end up having to reload the permalinks but that may something to do with my site settings.

    I also turned it into a plugin which can be seen here

    http://pastebin.com/2mDe0qpW

    It is set up so that

    [bbp-forum-header]

    [bbp-forum-site-index id=8]

    [bbp-forum-site-index id=7]

    [bbp-forum-footer]

    will provide a single list of all forums on sites 8 and 7 if anyone else would like to try it


    zabre00
    Participant

    @zabre00

    I know its been 3 years but just wondering if theres been any development on this? @trobee your code a script still work. Just wondering if you still after 3 years, have the single list shortcodes available? I would really appreciate it!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar