Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: [New Plugin] BuddyPress Group Forum Extras


3sixty
Participant

@3sixty

@3sixty

You are correct, it does display in the order created. Would still like the ability to reorder someday if it’s possible.

I managed to choose my own forum order with this adaptation of “foreach ( (array)$forumlisting as $listing)”

(though rich will cringe when he sees how I mangled/reverse engineered his great code)

<?php $forum_entries = array(9, 10, 7, 6, 3, 2, 1); /*this is the order I want my forums to appear in the forum index*/ ?>

<?php foreach ($forum_entries as $forum_entry) {

foreach ( (array)$forumlisting as $listing) {

if ($listing->id == $forum_entry) {

if (!is_user_logged_in() && $listing->status == ‘private’) {

$forumlink = $bp->root_domain . ‘/’ . $bp->groups->slug . ‘/’ . $listing->slug . ‘/’;

} else {

$forumlink = $bp->root_domain . ‘/’ . $bp->groups->slug . ‘/’ . $listing->slug . ‘/forum/’;

} ?>

<tr>

<td class=”num td-title”><?php if ($groupavatar) bp_forum_extras_the_forum_avatar( ‘item_id=’. $listing->id ) ?>

<h5>“><?php echo $listing->forum_name; ?></h5>

<small> – <?php echo $key . ‘ ‘ . $listing->forum_desc; ?></small></td>

<td class=”num td-topiccount alt”><?php echo $listing->topics; ?></td>

<td class=”num td-postcount”><?php echo $listing->posts; ?></td>

<td class=”num td-members alt”><?php echo $listing->total_member_count; ?></td>

</tr>

<?php } ?>

<?php } ?>

<?php } ?>

</table>

<?php }

Skip to toolbar