Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show: By Latest Post | By Group

Viewing 16 replies - 1 through 16 (of 16 total)
  • @lph2005

    Participant

    Sorry – this should have gone into the “How-To” Group … might want to move it …

    @lph2005

    Participant

    A search doesn’t bring up an answer – anyone know how to find this code?

    @lph2005

    Participant

    It’s great to see this site active – but (smile) – is the theme developer online these days to answer this question? I’d love for the forum topic list to be sorted into groups ….

    @lph2005

    Participant

    Is this code anywhere? I can’t believe I’m the only one interested in this code – it makes so much sense – to be able to sort the latest topics into groups …

    Sigh.

    @mercime

    Participant

    @LPH2005 – I haven’t seen code released to public, but seen it done by:
    @apeatling for https://buddypress.org/support/topics/grouped/
    @deanjrobinson for http://help.deanjrobinson.com/ notice that his groups are categorized as well.
    Per Dean – “a custom forum loop inside a custom groups loop.”

    @modemlooper

    Moderator

    Couldn’t you create your own loop that calls the groups forums that you want. Then repeat it a few times for each group forum you want to list?

    if ( bp_has_groups( ‘slug=GroupName’) ) :
    locate_template( array( ‘forums/forums-loop.php’ ), true )
    endif;

    Or what about the forum extra’s plugin? https://wordpress.org/extend/plugins/buddypress-group-forum-extras/

    @lph2005

    Participant

    Now we are talking! Thank you both for information.

    Yes, I’ve seen the /grouped and that is why I asked about it. It’s the way the forum topics need to be shown on my site.

    Oooo … @deanjrobinson has done a SWEET job on http://help.deanjrobinson.com/

    Now – if only someone would share what they’ve done! It looks like Dean planned on a theme – but plans can always get off to a slow start :)

    @Modemlooper – well – I have the forum extra’s plugin and that gives an index. But the preference is to have the group shown with the latest topics below them (pagination necessary).

    @lph2005

    Participant

    @Modemlooper

    I’ve been looking at your code and can’t seem to get the GroupName slug to match up with anything. Is the GroupName the URL? Or is it something else?

    @lph2005

    Participant

    Tried to modify /forum/index.php and insert slug=GroupName if statement and all of the topics are returned … so either the slug name is incorrect or the code … or the placement of the code … or … just too many options here.

    Guess this means BP devs should consider a better way to do this when bbpress becomes its own plugin acting in concert with BP (4th quarter of this year or so). This should just simply be an option.

    @lph2005

    Participant

    UGH. I’m getting so irritated that it’s time to leave the computer. There must be a way to get my site to work like https://buddypress.org/support/topics/grouped/. It seems such a simple request. I can’t believe it isn’t an option or obvious. Nothing I’ve tried seems to work.

    Time for a break. Maybe someone with knowledge will take pity here and help.

    @boonebgorges

    Keymaster

    Here’s the short version.

    In [theme]/forums/index.php, do a conditional check for $bp->current_action == ‘grouped’. (Depending on the URL structure of your site, you might have to use $bp->action_variables[0].) In other words, the ‘grouped’ code should only be displayed if ( $bp->current_action == ‘grouped’ ).

    Then do a bp_has_groups loop for all the groups you want to appear. If that’s all your groups, you can just do bp_has_groups(). If you only want to do a certain number of groups, like on this site, do bp_has_groups( ‘include=4,5,6’ ) where 4, 5, 6 are groups that you want to include in the ‘grouped’ view.

    Then, inside the `while ( bp_groups() ) : bp_the_group()` loop, do a normal forums loop. Something like
    `if ( bp_has_forum_topics( ‘forum_id=’ . groups_get_groupmeta( bp_get_group_id(), ‘forum_id’ ) ) )`
    plus whatever arguments for max number, etc you want.

    @lph2005

    Participant

    I’m back: fed and rested.

    Thank you Boone for helping. I’m only looking for topics shown as sorted by group … So, let me repeat some of this back and see if my understanding was your intent.

    First, [theme]/forums/index.php is the file to edit.

    Second, if I only want topics sorted within groups then I can create a bp_has_groups() that includes the while statements you suggest.

    Third, thank you (again!) for the short version. I’ll see what I can do to try to figure this out.

    In the meantime, if someone already has code to share then please feel free to post.

    @lph2005

    Participant

    Yippeee ! LOL

    OK. All emotion aside – I’m almost there! http://www.thechembook.com/tutoring/

    There needs to be some ways to limit the number of topics shown.

    Boone, I almost did what you suggested but decided to copy the table code from the /forum-loop.php directly into the index.php file rather than calling the forum-loop.

    Also, the code for limiting to only certain groups isn’t working for me. I must be doing something wrong there.

    Here is what is online right now (and almost works!)

    http://pastebin.com/BMfzexrz

    @boonebgorges

    Keymaster

    I told you to use include= but I realized that you can’t pass multiple groups into bp_has_groups() in the 1.2 branch. My bad.

    So you might want to try @modemlooper‘s advice. The group slug is whatever shows up in the URL as the group name. For example, a group with URL http://example.com/groups/i-am-awesome has the slug i-am-awesome. You should be able to get that group only by using the following:
    `if ( bp_has_groups( ‘slug=i-am-awesome’ ) )`
    Then, as Modemlooper says, you’d have to do it a couple times for each group. Or better yet, make an array and loop over it:
    `$groups_to_show = array( ‘i-am-awesome’, ‘i-am-cool’, ‘bodacious’ );
    foreach ( $groups_to_show as $g ) {
    if ( bp_has_groups( ‘slug=’ . $g ) ) {
    // do all your group-specific stuff here
    }
    }
    `

    @lph2005

    Participant

    Thank you but I can’t seem to get

    if ( bp_has_groups( ‘slug=announcements’) )

    to do anything for me. It’s just ignored … hmm.

    In contrast, I can get max=5 to work

    if ( bp_has_groups( ‘max=5’ ) )

    Update

    These are the options:

    https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-groups-loop/

    But slug doesn’t seem to work for me.

    @lph2005

    Participant

    Done. Fixed the css and child theme so that the tutoring area looks acceptable.

    http://www.thechembook.com/tutoring/

    Here is the code in case someone else is interested. This is the [child-theme]/forums/index.php file

    http://pastebin.com/cEGmNL5X

    Hope this helps.

Viewing 16 replies - 1 through 16 (of 16 total)
  • The topic ‘Show: By Latest Post | By Group’ is closed to new replies.
Skip to toolbar