"><?php bp_group_avatar('type=thumb&width=150&height=150'); ?> </a> </div> <div class="item col-md-6"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"><span class="activity"><?php printf(__('active %s', 'wplms_modern'), bp_get_group_last_active()); ?> </span></div> <div class="item-desc"><?php bp_group_description_excerpt(); ?> </div> <?php do_action('bp_directory_groups_item'); ?> </div> <div class="action col-md-3">
function groups_ajax_widget_groups_list() { global $bp; check_ajax_referer('groups_widget_groups_list'); switch ( $_POST['filter'] ) { case 'newest-groups': $type = 'newest'; break; case 'recently-active-groups': $type = 'active'; break; case 'popular-groups': $type = 'popular'; break; } if ( bp_has_groups( 'type=' . $type . '&per_page=' . $_POST['max_groups'] . '&max=' . $_POST['max_groups'] ) ) : ?> <?php echo "0[[SPLIT]]"; ?> <ul id="groups-list" class="item-list"> <?php while ( bp_groups() ) : bp_the_group(); ?> <li> <div class="item-avatar"> <a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div> <div class="item-meta"> <span class="activity"> <?php if ( 'newest-groups' == $_POST['filter'] ) { printf( __( 'created %s ago', 'buddypress' ), bp_get_group_date_created() ); } else if ( 'recently-active-groups' == $_POST['filter'] ) { printf( __( 'active %s ago', 'buddypress' ), bp_get_group_last_active() ); } else if ( 'popular-groups' == $_POST['filter'] ) { bp_group_member_count(); } ?> </span> </div> </div> </li> <?php endwhile; ?> </ul> <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?> <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr( $_POST['max_groups'] ); ?>" /> <?php else: ?> <?php echo "-1[[SPLIT]]<li>" . __("No groups matched the current filter.", 'buddypress'); ?> <?php endif; }
/** * Extends our frontend output method. * * @param array $args Array of arguments for the widget. * @param array $instance Widget instance data. */ public function widget($args, $instance) { /** * Filters the user ID to use with the widget instance. * * @since 1.5.0 * * @param string $value Empty user ID. */ $user_id = apply_filters('bp_group_widget_user_id', '0'); extract($args); if (empty($instance['group_default'])) { $instance['group_default'] = 'popular'; } if (empty($instance['title'])) { $instance['title'] = __('Groups', 'buddypress'); } /** * Filters the title of the Groups widget. * * @since 1.8.0 * @since 2.3.0 Added 'instance' and 'id_base' to arguments passed to filter. * * @param string $title The widget title. * @param array $instance The settings for the particular instance of the widget. * @param string $id_base Root ID for all widgets of this type. */ $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); /** * Filters the separator of the group widget links. * * @since 2.4.0 * * @param string $separator Separator string. Default '|'. */ $separator = apply_filters('bp_groups_widget_separator', '|'); echo $before_widget; $title = !empty($instance['link_title']) ? '<a href="' . bp_get_groups_directory_permalink() . '">' . $title . '</a>' : $title; echo $before_title . $title . $after_title; $max_groups = !empty($instance['max_groups']) ? (int) $instance['max_groups'] : 5; $group_args = array('user_id' => $user_id, 'type' => $instance['group_default'], 'per_page' => $max_groups, 'max' => $max_groups); ?> <?php if (bp_has_groups($group_args)) { ?> <div class="item-options" id="groups-list-options"> <a href="<?php bp_groups_directory_permalink(); ?> " id="newest-groups"<?php if ($instance['group_default'] == 'newest') { ?> class="selected"<?php } ?> ><?php _e("Newest", 'buddypress'); ?> </a> <span class="bp-separator" role="separator"><?php echo esc_html($separator); ?> </span> <a href="<?php bp_groups_directory_permalink(); ?> " id="recently-active-groups"<?php if ($instance['group_default'] == 'active') { ?> class="selected"<?php } ?> ><?php _e("Active", 'buddypress'); ?> </a> <span class="bp-separator" role="separator"><?php echo esc_html($separator); ?> </span> <a href="<?php bp_groups_directory_permalink(); ?> " id="popular-groups" <?php if ($instance['group_default'] == 'popular') { ?> class="selected"<?php } ?> ><?php _e("Popular", 'buddypress'); ?> </a> </div> <ul id="groups-list" class="item-list"> <?php while (bp_groups()) { bp_the_group(); ?> <li <?php bp_group_class(); ?> > <div class="item-avatar"> <a href="<?php bp_group_permalink(); ?> " title="<?php bp_group_name(); ?> "><?php bp_group_avatar_thumb(); ?> </a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> " title="<?php bp_group_name(); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"> <span class="activity"> <?php if ('newest' == $instance['group_default']) { printf(__('created %s', 'buddypress'), bp_get_group_date_created()); } elseif ('active' == $instance['group_default']) { printf(__('active %s', 'buddypress'), bp_get_group_last_active()); } elseif ('popular' == $instance['group_default']) { bp_group_member_count(); } ?> </span> </div> </div> </li> <?php } ?> </ul> <?php wp_nonce_field('groups_widget_groups_list', '_wpnonce-groups'); ?> <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr($max_groups); ?> " /> <?php } else { ?> <div class="widget-error"> <?php _e('There are no groups to display.', 'buddypress'); ?> </div> <?php } ?> <?php echo $after_widget; ?> <?php }
"><?php bp_group_avatar('type=thumb&width=72&height=72'); ?> </a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"><span class="activity"><?php printf(__('active %s', 'buddypress'), bp_get_group_last_active()); ?> </span></div> <div class="item-desc"><?php bp_group_description_excerpt(); ?> </div> <?php do_action('bp_directory_groups_item'); ?> </div> <div class="action">
function bp_group_last_active($group = false) { echo bp_get_group_last_active($group); }
<span class="highlight"><?php bp_group_type(); ?> </span> <h3><a href="<?php bp_group_permalink(); ?> " title="<?php bp_group_name(); ?> "><?php bp_group_name(); ?> </a></h3> <span class="activity"><?php printf(__('active %s', 'vibe'), bp_get_group_last_active()); ?> </span> <?php do_action('bp_before_group_header_meta'); ?> <div id="item-meta"> <div id="item-buttons"> <?php do_action('bp_group_header_actions'); ?>
<h2><a href="<?php bp_group_permalink(); ?> " title="<?php bp_group_name(); ?> "><?php bp_group_name(); ?> </a></h2> <p><span class="highlight"><?php bp_group_type(); ?> </span></p> <p><span class="activity"><?php printf(__('active %s', 'bp-magic'), bp_get_group_last_active()); ?> </span></p> </div> </div><!-- #item-header-avatar --> <div id="item-header-content"> <?php do_action('bp_before_group_header_meta'); ?> <div id="item-meta">
<div id="item-header-content"> <h2><a href="<?php bp_group_permalink(); ?> " title="<?php bp_group_name(); ?> "><?php bp_group_name(); ?> </a></h2> <span class="highlight"><?php bp_group_type(); ?> </span> <span class="activity"><?php printf(__('active %s', 'logicalboneshug'), bp_get_group_last_active()); ?> </span> <?php do_action('bp_before_group_header_meta'); ?> <div id="item-meta"> <?php bp_group_description(); ?> <div id="item-buttons">
/** * AJAX callback for the Groups List widget. * * @since 1.0.0 */ function groups_ajax_widget_groups_list() { check_ajax_referer('groups_widget_groups_list'); switch ($_POST['filter']) { case 'newest-groups': $type = 'newest'; break; case 'recently-active-groups': $type = 'active'; break; case 'popular-groups': $type = 'popular'; break; } $per_page = isset($_POST['max_groups']) ? intval($_POST['max_groups']) : 5; $groups_args = array('user_id' => 0, 'type' => $type, 'per_page' => $per_page, 'max' => $per_page); if (bp_has_groups($groups_args)) { ?> <?php echo "0[[SPLIT]]"; ?> <?php while (bp_groups()) { bp_the_group(); ?> <li <?php bp_group_class(); ?> > <div class="item-avatar"> <a href="<?php bp_group_permalink(); ?> "><?php bp_group_avatar_thumb(); ?> </a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> " title="<?php bp_group_name(); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"> <span class="activity"> <?php if ('newest-groups' == $_POST['filter']) { printf(__('created %s', 'buddypress'), bp_get_group_date_created()); } elseif ('recently-active-groups' == $_POST['filter']) { printf(__('active %s', 'buddypress'), bp_get_group_last_active()); } elseif ('popular-groups' == $_POST['filter']) { bp_group_member_count(); } ?> </span> </div> </div> </li> <?php } ?> <?php wp_nonce_field('groups_widget_groups_list', '_wpnonce-groups'); ?> <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr($_POST['max_groups']); ?> " /> <?php } else { ?> <?php echo "-1[[SPLIT]]<li>" . __("No groups matched the current filter.", 'buddypress'); ?> <?php } }
/** * BP Groups Grid */ function bp_groups_grid($atts) { $default_columns = 3; //four columns $allowed_columns = array(2, 3, 4, 6); extract(shortcode_atts(array('type' => 'active', 'max_item' => 10, 'columns' => $default_columns), $atts)); $columns = floor(12 / $columns); // ensure that columns is scalable if (!in_array($columns, $allowed_columns)) { // default to default columns settings, just in case $columns = $default_columns; } $columns_classes = 'col-md-' . $columns . ' col-sm-' . $columns . ' col-xs-6'; $params = array('type' => $type, 'per_page' => $max_item); $output = ''; if (function_exists('bp_has_groups')) { if (bp_has_groups($params)) { ob_start(); ?> <ul class="clearfix gears-bp-groups-grid"> <?php while (bp_groups()) { ?> <?php bp_the_group(); ?> <li class="bp-groups-grid-item <?php echo $columns_classes; ?> "> <?php $name = bp_get_group_name(); ?> <?php $permalink = bp_get_group_permalink(); ?> <?php $last_active = bp_get_group_last_active(); ?> <?php $members_count = bp_get_group_member_count(); ?> <?php $modal_content = esc_attr($members_count . ' · ' . __('Active ', 'gears') . $last_active . ''); ?> <a title="<?php echo esc_attr($name); ?> " href="<?php echo esc_url($permalink); ?> "> <span class="groups-name"> <?php echo esc_attr($name); ?> <span class="groups-count"> <?php echo intval($members_count); ?> <?php if ($members_count == 1) { ?> <?php _e('Member', 'gears'); ?> <?php } else { ?> <?php _e('Members', 'gears'); ?> <?php } ?> </span> </span> </a> <a title="<?php echo esc_attr($name); ?> " href="<?php echo esc_url($permalink); ?> "> <?php echo bp_get_group_avatar(array('type' => 'full')); ?> </a> </li> <?php } ?> </ul> <?php $output = ob_get_clean(); return $output; } else { return '<div class="alert alert-info">' . __('There are no groups to display. Please try again soon.', 'gears') . '</div>'; } } else { return $this->bp_not_installed; } }
?> " title="<?php bp_group_name(); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"> <span class="activity"> <?php if ('newest' == $group_default) { printf(esc_html__('created %s', 'training'), bp_get_group_date_created()); } if ('active' == $group_default) { printf(esc_html__('active %s', 'training'), bp_get_group_last_active()); } elseif ('popular' == $group_default) { bp_group_member_count(); } ?> </span> <p></p> </div> </div> </li> <?php } ?> </ul> </div>
function widget($args, $instance) { global $bp; extract($args); $parent_id = isset($bp->groups->current_group->id) ? $bp->groups->current_group->id : 0; echo $before_widget; echo $before_title; if ($parent_id == 0) { echo $instance['title']; } else { echo $instance['sub_title']; } echo $after_title; ?> <?php if (!class_exists('BP_Groups_Group')) { _e('You must enable Groups component to use this widget.', 'bp-group-hierarchy'); return; } ?> <?php if (bp_has_groups_hierarchy('type=' . $instance['sort_type'] . '&per_page=' . $instance['max_groups'] . '&max=' . $instance['max_groups'] . '&parent_id=' . $parent_id)) { ?> <ul id="toplevel-groups-list" class="item-list"> <?php while (bp_groups()) { bp_the_group(); ?> <li> <div class="item-avatar"> <a href="<?php bp_group_permalink(); ?> "><?php bp_group_avatar_thumb(); ?> </a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> " title="<?php echo strip_tags(bp_get_group_description_excerpt()); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"><span class="activity"> <?php switch ($instance['sort_type']) { case 'newest': printf(__('created %s', 'buddypress'), bp_get_group_date_created()); break; case 'alphabetical': case 'active': printf(__('active %s', 'buddypress'), bp_get_group_last_active()); break; case 'popular': bp_group_member_count(); break; case 'prolific': printf(_n('%d member group', '%d member groups', bp_group_hierarchy_has_subgroups(), 'bp-group-hierarchy'), bp_group_hierarchy_has_subgroups()); } ?> </span></div> <?php if ($instance['show_desc']) { ?> <div class="item-desc"><?php bp_group_description_excerpt(); ?> </div> <?php } ?> </div> </li> <?php } ?> </ul> <?php wp_nonce_field('groups_widget_groups_list', '_wpnonce-groups'); ?> <input type="hidden" name="toplevel_groups_widget_max" id="toplevel_groups_widget_max" value="<?php echo esc_attr($instance['max_groups']); ?> " /> <?php } else { ?> <div class="widget-error"> <?php _e('There are no groups to display.', 'buddypress'); ?> </div> <?php } ?> <?php echo $after_widget; ?> <?php }
function display($page = 1) { global $bp, $groups_template; $parent_template = $groups_template; $hide_button = false; if (isset($_REQUEST['grpage'])) { $page = (int) $_REQUEST['grpage']; } else { if (!is_numeric($page)) { $page = 1; } else { $page = (int) $page; } } /** Respect BuddyPress group creation restriction */ if (function_exists('bp_user_can_create_groups')) { $hide_button = !bp_user_can_create_groups(); } bp_has_groups_hierarchy(array('type' => 'alphabetical', 'parent_id' => $bp->groups->current_group->id, 'page' => $page)); ?> <div class="group"> <?php if (($bp->is_item_admin || $bp->groups->current_group->can_create_subitems) && !$hide_button) { ?> <div class="generic-button group-button"> <a title="<?php printf(__('Create a %s', 'bp-group-hierarchy'), __('Member Group', 'bp-group-hierarchy')); ?> " href="<?php echo $bp->root_domain . '/' . bp_get_groups_root_slug() . '/' . 'create' . '/?parent_id=' . $bp->groups->current_group->id; ?> "><?php printf(__('Create a %s', 'bp-group-hierarchy'), __('Member Group', 'bp-group-hierarchy')); ?> </a> </div><br /><br /> <?php } ?> <?php if ($groups_template && count($groups_template->groups) > 0) { ?> <div id="pag-top" class="pagination"> <div class="pag-count" id="group-dir-count-top"> <?php bp_groups_pagination_count(); ?> </div> <div class="pagination-links" id="group-dir-pag-top"> <?php bp_groups_pagination_links(); ?> </div> </div> <ul id="groups-list" class="item-list"> <?php while (bp_groups()) { bp_the_group(); ?> <?php $subgroup = $groups_template->group; ?> <?php if ($subgroup->status == 'hidden' && !(groups_is_user_member($bp->loggedin_user->id, $subgroup->id) || groups_is_user_admin($bp->loggedin_user->id, $bp->groups->current_group->id))) { continue; } ?> <li id="tree-childof_<?php bp_group_id(); ?> "> <div class="item-avatar"> <a href="<?php bp_group_permalink(); ?> "><?php bp_group_avatar('type=thumb&width=50&height=50'); ?> </a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"><span class="activity"><?php printf(__('active %s', 'buddypress'), bp_get_group_last_active()); ?> </span></div> <div class="item-desc"><?php bp_group_description_excerpt(); ?> </div> <?php do_action('bp_directory_groups_item'); ?> </div> <div class="action"> <?php do_action('bp_directory_groups_actions'); ?> <div class="meta"> <?php bp_group_type(); ?> / <?php bp_group_member_count(); ?> </div> </div> <div class="clear"></div> </li> <?php } ?> </ul> <div id="pag-bottom" class="pagination"> <div class="pag-count" id="group-dir-count-bottom"> <?php bp_groups_pagination_count(); ?> </div> <div class="pagination-links" id="group-dir-pag-bottom"> <?php bp_groups_pagination_links(); ?> </div> </div> <script type="text/javascript"> jQuery('#nav-hierarchy-personal-li').attr('id','group-hierarchy-personal-li'); jQuery('#nav-hierarchy-groups-li').attr('id','group-hierarchy-group-li'); </script> <?php } else { ?> <p><?php _e('No member groups were found.', 'bp-group-hierarchy'); ?> </p> <?php } ?> </div> <?php // reset the $groups_template global and continue with the page $groups_template = $parent_template; }
function bp_get_the_site_group_last_active() { global $site_groups_template; return apply_filters('bp_get_the_site_group_last_active', sprintf(__('active %s ago', 'buddypress'), bp_get_group_last_active($site_groups_template->group))); }
</a> </div> <?php } ?> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"><span class="activity"><?php printf(__('active %s', 'wonderflux'), bp_get_group_last_active()); ?> </span></div> <div class="item-desc"><?php bp_group_description_excerpt(); ?> </div> <?php /** * Fires inside the listing of an individual group listing item. * * @since 1.1.0 */ do_action('bp_directory_groups_item');
<div class="clearfix"></div> <ul id="groups-list" class="row clearfix" role="main"> <?php while ( bp_groups() ) : bp_the_group(); ?> <li class="yit_animate fadeInUp col-md-4 col-sm-6 masonry_item"> <div class="item-container"> <div class="item-header clearfix"> <div class="item-avatar"> <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a> </div> <div class="item"> <div class="item-username"><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a></div> <div class="item-meta"><span class="activity"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span></div> </div> </div> <div class="item-quote"> <div class="item-desc"><?php bp_group_description_excerpt(); ?></div> <?php do_action( 'bp_directory_groups_item' ); ?> </div> <div class="action"> <?php //do_action( 'bp_directory_groups_actions' ); ?> <div class="meta">
function bp_group_last_active() { echo bp_get_group_last_active(); }
"><?php bp_group_avatar('type=full&width=70&height=70'); ?> </a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"><span class="activity"><?php printf(__('active %s', 'buddypress-global-search'), bp_get_group_last_active()); ?> </span></div> <div class="item-desc"><?php bp_group_description_excerpt(); ?> </div> <?php do_action('bp_directory_groups_item'); ?> </div> <div class="action">
<?php do_action( 'bp_after_group_menu_mods' ) ?> <?php endif; ?> <?php endif; ?> </div><!-- #item-actions --> <div id="item-header-avatar"> <a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"> <?php bp_group_avatar() ?> </a> </div><!-- #item-header-avatar --> <div id="item-header-content"> <h2><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></h2> <span class="highlight"><?php bp_group_type() ?></span> <span class="activity"><?php printf( __( 'active %s ago', 'buddypress' ), bp_get_group_last_active() ) ?></span> <?php do_action( 'bp_before_group_header_meta' ) ?> <div id="item-meta"> <?php bp_group_description() ?> <div id="item-buttons"> <?php do_action( 'bp_group_header_actions' ); ?> </div><!-- #item-buttons --> <?php do_action( 'bp_group_header_meta' ) ?> </div> </div><!-- #item-header-content -->
<h2><a href="<?php bp_group_permalink(); ?> " title="<?php bp_group_name(); ?> "><?php bp_group_name(); ?> </a></h2> <span class="highlight label label-default"><?php bp_group_type(); ?> </span> <span class="label label-default activity"><?php printf(__('active %s', 'firmasite'), bp_get_group_last_active()); ?> </span> <?php do_action('bp_before_group_header_meta'); ?> <div id="item-meta"> <?php bp_group_description(); ?> <div id="item-buttons" class="clearfix">
"><?php bp_group_avatar('type=thumb&width=50&height=50'); ?> </a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"><span class="activity"><?php printf(__('active %s', 'product'), bp_get_group_last_active()); ?> </span></div> <div class="item-desc"><?php bp_group_description_excerpt(); ?> </div> <?php do_action('bp_directory_groups_item'); ?> </div> <div class="action">
function x_buddypress_groups_list_item_header() { ?> <div class="x-list-item-header"> <div class="x-list-item-avatar-wrap item-avatar"> <a href="<?php bp_group_permalink(); ?> "><?php bp_group_avatar('type=thumb&width=45&height=45'); ?> </a> </div> <div class="x-list-item-header-info item-header"> <p> <a href="<?php bp_group_permalink(); ?> "><?php bp_group_name(); ?> </a> <span class="activity"><?php printf(__('active %s', 'buddypress'), bp_get_group_last_active()); ?> </span> </p> </div> </div> <?php }
/** * Output the 'last active' string for the current group in the loop. * * @since 1.0.0 * @since 2.7.0 Added $args as a parameter. * * @param object|bool $group Optional. Group object. Default: current group in loop. * @param array|string $args Optional. {@see bp_get_group_last_active()}. */ function bp_group_last_active($group = false, $args = array()) { echo bp_get_group_last_active($group, $args); }
bp_group_avatar('type=thumb&width=35&height=35'); ?> </a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> "><?php bp_group_name(); ?> </a></div> <!-- <div class="item-meta"><span class="activity"><?php printf(__('active %s', 'huddle'), bp_get_group_last_active()); ?> </span></div> --> <div class="item-meta"><?php bp_group_member_count(); ?> </div> <?php do_action('bp_directory_groups_item'); ?> </div> <div class="action">
function widget($args, $instance) { $user_id = apply_filters('bp_group_widget_user_id', '0'); extract($args); if (empty($instance['group_default'])) { $instance['group_default'] = 'popular'; } if (empty($instance['title'])) { $instance['title'] = __('Groups', 'buddypress'); } echo $before_widget; $title = !empty($instance['link_title']) ? '<a href="' . trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug()) . '">' . $instance['title'] . '</a>' : $instance['title']; echo $before_title . $title . $after_title; ?> <?php if (bp_has_groups('user_id=' . $user_id . '&type=' . $instance['group_default'] . '&max=' . $instance['max_groups'] . '&per_page=' . $instance['max_groups'])) { ?> <div class="item-options" id="groups-list-options"> <a href="<?php echo site_url(bp_get_groups_root_slug()); ?> " id="newest-groups"<?php if ($instance['group_default'] == 'newest') { ?> class="selected"<?php } ?> ><?php _e("Newest", 'buddypress'); ?> </a> | <a href="<?php echo site_url(bp_get_groups_root_slug()); ?> " id="recently-active-groups"<?php if ($instance['group_default'] == 'active') { ?> class="selected"<?php } ?> ><?php _e("Active", 'buddypress'); ?> </a> | <a href="<?php echo site_url(bp_get_groups_root_slug()); ?> " id="popular-groups" <?php if ($instance['group_default'] == 'popular') { ?> class="selected"<?php } ?> ><?php _e("Popular", 'buddypress'); ?> </a> </div> <ul id="groups-list" class="item-list"> <?php while (bp_groups()) { bp_the_group(); ?> <li> <div class="item-avatar"> <a href="<?php bp_group_permalink(); ?> " title="<?php bp_group_name(); ?> "><?php bp_group_avatar_thumb(); ?> </a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> " title="<?php bp_group_name(); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"> <span class="activity"> <?php if ('newest' == $instance['group_default']) { printf(__('created %s', 'buddypress'), bp_get_group_date_created()); } if ('active' == $instance['group_default']) { printf(__('active %s', 'buddypress'), bp_get_group_last_active()); } else { if ('popular' == $instance['group_default']) { bp_group_member_count(); } } ?> </span> </div> </div> </li> <?php } ?> </ul> <?php wp_nonce_field('groups_widget_groups_list', '_wpnonce-groups'); ?> <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr($instance['max_groups']); ?> " /> <?php } else { ?> <div class="widget-error"> <?php _e('There are no groups to display.', 'buddypress'); ?> </div> <?php } ?> <?php echo $after_widget; ?> <?php }
<div id="item-header-content"> <h2><a href="<?php bp_group_permalink(); ?> " title="<?php bp_group_name(); ?> "><?php bp_group_name(); ?> </a></h2> <span class="highlight"><?php bp_group_type(); ?> </span> <span class="activity"><?php printf(__('active %s ago', 'cc'), bp_get_group_last_active()); ?> </span> <?php do_action('bp_before_group_header_meta'); ?> <div id="item-meta"> <?php bp_group_description(); ?> <?php bp_group_join_button(); ?>