Ejemplo n.º 1
3
/**
 * @param boolean $result
 * @param EM_Booking $EM_Booking
 * @return boolean
 */
function bp_em_record_activity_booking_save($result, $EM_Booking)
{
    if ($result) {
        $rejected_statuses = array(0, 2, 3);
        //these statuses apply to rejected/cancelled bookings
        $user = $EM_Booking->person;
        $member_slug = function_exists('bp_get_members_root_slug') ? bp_get_members_root_slug() : BP_MEMBERS_SLUG;
        $member_link = trailingslashit(bp_get_root_domain()) . $member_slug . '/' . $user->user_login;
        $user_link = "<a href='" . $member_link . "/'>" . $user->display_name . "</a>";
        $event_link = $EM_Booking->get_event()->output('#_EVENTLINK');
        $status = $EM_Booking->booking_status;
        $EM_Event = $EM_Booking->get_event();
        if (empty($EM_Event->group_id)) {
            if ($status == 1 || !get_option('dbem_bookings_approval') && $status < 2) {
                $action = sprintf(__('%s is attending %s.', 'dbem'), $user_link, $event_link);
            } elseif (($EM_Booking->previous_status == 1 || !get_option('dbem_bookings_approval') && $EM_Booking->previous_status < 2) && in_array($status, $rejected_statuses)) {
                $action = sprintf(__('%s will not be attending %s anymore.', 'dbem'), $user_link, $event_link);
            }
        } else {
            $group = new BP_Groups_Group($EM_Event->group_id);
            $group_link = '<a href="' . bp_get_group_permalink($group) . '">' . bp_get_group_name($group) . '</a>';
            if ($status == 1 || !get_option('dbem_bookings_approval') && $status < 2) {
                $action = sprintf(__('%s is attending %s of the group %s.', 'dbem'), $user_link, $event_link, $group_link);
            } elseif (($EM_Booking->previous_status == 1 || !get_option('dbem_bookings_approval') && $EM_Booking->previous_status < 2) && in_array($status, $rejected_statuses)) {
                $action = sprintf(__('%s will not be attending %s of group %s anymore.', 'dbem'), $user_link, $event_link, $group_link);
            }
        }
        if (!empty($action)) {
            bp_em_record_activity(array('user_id' => $EM_Booking->person->ID, 'action' => $action, 'primary_link' => $EM_Event->output('#_EVENTURL'), 'type' => 'new_booking', 'item_id' => $EM_Event->event_id, 'secondary_item_id' => $EM_Booking->booking_id, 'hide_sitewide' => $EM_Event->event_private));
            //group activity
            if (!empty($EM_Event->group_id)) {
                //tis a group event
                bp_em_record_activity(array('component' => 'groups', 'item_id' => $EM_Event->group_id, 'user_id' => $EM_Booking->person->ID, 'action' => $action, 'primary_link' => $EM_Event->output('#_EVENTURL'), 'type' => 'new_booking', 'secondary_item_id' => $EM_Booking->booking_id, 'hide_sitewide' => $EM_Event->event_private));
            }
        }
    }
    return $result;
}
Ejemplo n.º 2
1
function bp_reshare_add_reshare_button()
{
    global $bp;
    if (!is_user_logged_in()) {
        return false;
    }
    $activity_types_resharable = bp_reshare_activity_types();
    if (!in_array(bp_get_activity_type(), $activity_types_resharable)) {
        return false;
    }
    if (bp_reshare_activity_is_hidden()) {
        return false;
    }
    if (bp_reshare_is_user_profile_reshares() && $bp->displayed_user->id != $bp->loggedin_user->id) {
        return false;
    }
    $activity_first_id = bp_get_activity_id();
    if ('reshare_update' == bp_get_activity_type()) {
        $activity_first_id = bp_get_activity_secondary_item_id();
    }
    $rs_count = bp_activity_get_meta($activity_first_id, 'reshared_count');
    $rs_count = !empty($rs_count) ? $rs_count : 0;
    if ($bp->loggedin_user->id == bp_get_activity_user_id() || bp_reshare_user_did_reshared($activity_first_id)) {
        $reshared_class = 'reshared';
    }
    $action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/?to_reshare=' . $activity_first_id, '_reshare_update');
    if ($_POST['scope'] == 'reshares' || bp_reshare_is_user_profile_reshares() || bp_is_activity_component() && !bp_displayed_user_id() && $_COOKIE['bp-activity-scope'] == 'reshares') {
        $extra_class = 'unshare';
        $action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/?delete_reshare=' . bp_get_activity_id(), '_reshare_delete');
    }
    ?>
	
	<a href="<?php 
    echo $action_url;
    ?>
" class="button bp-primary-action bp-agu-reshare" id="bp-agu-reshare-<?php 
    bp_activity_id();
    ?>
" rel="<?php 
    echo $activity_first_id;
    ?>
"><span class="bp-agu-reshare-img <?php 
    echo $reshared_class . ' ' . $extra_class;
    ?>
"></span><span class="rs-count"><?php 
    echo $rs_count;
    ?>
</span></a>
	<?php 
}
Ejemplo n.º 3
0
 function bp_get_groups_action_link($action = '', $query_args = '', $nonce = false)
 {
     global $bp;
     // Must be displayed user
     if (empty($bp->groups->current_group->id)) {
         return;
     }
     // Append $action to $url if there is no $type
     if (!empty($action)) {
         $url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug . '/' . $action;
     } else {
         $url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug;
     }
     // Add a slash at the end of our user url
     $url = trailingslashit($url);
     // Add possible query arg
     if (!empty($query_args) && is_array($query_args)) {
         $url = add_query_arg($query_args, $url);
     }
     // To nonce, or not to nonce...
     if (true === $nonce) {
         $url = wp_nonce_url($url);
     } elseif (is_string($nonce)) {
         $url = wp_nonce_url($url, $nonce);
     }
     // Return the url, if there is one
     if (!empty($url)) {
         return $url;
     }
 }
Ejemplo n.º 4
0
 /**
  * Load Custom tabs on BuddyPress
  *
  * @global object $bp global BuddyPress object
  */
 function custom_media_nav_tab()
 {
     global $bp;
     if (!function_exists("bp_core_new_nav_item")) {
         return;
     }
     if (bp_is_blog_page() || !bp_is_group() && !(isset($bp->displayed_user) && isset($bp->displayed_user->id)) || apply_filters('rtmedia_render_bp_nav', false)) {
         return;
     }
     global $rtmedia;
     if (function_exists("bp_is_group") && !bp_is_group()) {
         if (isset($bp->displayed_user) && isset($bp->displayed_user->id)) {
             $profile_counts = $this->actual_counts($bp->displayed_user->id);
         }
         $tab_position = apply_filters('rtmedia_media_tab_position', 99);
         if ($rtmedia->options["buddypress_enableOnProfile"] != 0) {
             bp_core_new_nav_item(array('name' => RTMEDIA_MEDIA_LABEL . '<span>' . $profile_counts['total']['all'] . '</span>', 'slug' => apply_filters('rtmedia_media_tab_slug', RTMEDIA_MEDIA_SLUG), 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all', 'position' => $tab_position));
         }
     }
     if (bp_is_group() && $rtmedia->options["buddypress_enableOnGroup"] != 0) {
         global $bp;
         $media_enabled = true;
         //filter for rtMedia PRO for PER GROUP MEDIA enable/disable functionality
         $media_enabled = apply_filters('rtmedia_media_enabled_for_current_group', $media_enabled);
         // check if current user can view this group
         $current_group = groups_get_current_group();
         $is_visible_to_current_user = $current_group->is_visible;
         if ($media_enabled && $is_visible_to_current_user) {
             $group_counts = $this->actual_counts($bp->groups->current_group->id, "group");
             $bp->bp_options_nav[bp_get_current_group_slug()]['media'] = array('name' => RTMEDIA_MEDIA_LABEL . '<span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . RTMEDIA_MEDIA_SLUG, 'slug' => RTMEDIA_MEDIA_SLUG, 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all');
         }
     }
 }
 /**
  * Validates the URL to determine if the activity item is valid.
  *
  * @since 2.6.0
  *
  * @param  string   $url The URL to check.
  * @return int|bool Activity ID on success; boolean false on failure.
  */
 protected function validate_url_to_item_id($url)
 {
     if (bp_core_enable_root_profiles()) {
         $domain = bp_get_root_domain();
     } else {
         $domain = bp_get_members_directory_permalink();
     }
     // Check the URL to see if this is a single activity URL.
     if (0 !== strpos($url, $domain)) {
         return false;
     }
     // Check for activity slug.
     if (false === strpos($url, '/' . bp_get_activity_slug() . '/')) {
         return false;
     }
     // Do more checks.
     $url = trim(untrailingslashit($url));
     // Grab the activity ID.
     $activity_id = (int) substr($url, strrpos($url, '/') + 1);
     if (!empty($activity_id)) {
         // Check if activity item still exists.
         $activity = new BP_Activity_Activity($activity_id);
         // Okay, we're good to go!
         if (!empty($activity->component) && 0 === (int) $activity->is_spam) {
             return $activity_id;
         }
     }
     return false;
 }
 function add_cover()
 {
     if (!is_user_logged_in()) {
         return;
     }
     $user_ID = get_current_user_id();
     $output = '';
     if (groups_is_user_mod($user_ID, $this->group_id) || groups_is_user_admin($user_ID, $this->group_id)) {
         if ($this->get_cover()) {
             $message = __("Change Cover", 'bpcp');
         } else {
             $message = __("Add Cover", 'bpcp');
         }
         $group = groups_get_group(array('group_id' => $this->group_id));
         $group_permalink = trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/');
         $output .= '<div class="profile-cover-action">';
         $output .= '<a href="' . trailingslashit($group_permalink . 'admin') . $this->slug . '" class="button">' . $message . '</a>';
         $output .= '</div>';
     }
     $default_cover = bp_get_option('bpcp-group-default');
     if ($this->get_cover() || $default_cover) {
         $output .= '<div class="profile-cover-inner"></div>';
     }
     echo $output;
 }
Ejemplo n.º 7
0
function bp_forums_directory_forums_setup()
{
    global $bp;
    if (bp_is_forums_component() && (!bp_current_action() || 'tag' == bp_current_action() && bp_action_variables()) && !bp_current_item()) {
        if (!bp_forums_has_directory()) {
            return false;
        }
        if (!bp_forums_is_installed_correctly()) {
            bp_core_add_message(__('The forums component has not been set up yet.', 'buddypress'), 'error');
            bp_core_redirect(bp_get_root_domain());
        }
        bp_update_is_directory(true, 'forums');
        do_action('bbpress_init');
        // Check to see if the user has posted a new topic from the forums page.
        if (isset($_POST['submit_topic']) && bp_is_active('forums')) {
            check_admin_referer('bp_forums_new_topic');
            $bp->groups->current_group = groups_get_group(array('group_id' => $_POST['topic_group_id']));
            if (!empty($bp->groups->current_group->id)) {
                // Auto join this user if they are not yet a member of this group
                if (!is_super_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member($bp->loggedin_user->id, $bp->groups->current_group->id)) {
                    groups_join_group($bp->groups->current_group->id);
                }
                $error_message = '';
                $forum_id = groups_get_groupmeta($bp->groups->current_group->id, 'forum_id');
                if (!empty($forum_id)) {
                    if (empty($_POST['topic_title'])) {
                        $error_message = __('Please provide a title for your forum topic.', 'buddypress');
                    } else {
                        if (empty($_POST['topic_text'])) {
                            $error_message = __('Forum posts cannot be empty. Please enter some text.', 'buddypress');
                        }
                    }
                    if ($error_message) {
                        bp_core_add_message($error_message, 'error');
                        $redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum';
                    } else {
                        if (!($topic = groups_new_group_forum_topic($_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id))) {
                            bp_core_add_message(__('There was an error when creating the topic', 'buddypress'), 'error');
                            $redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum';
                        } else {
                            bp_core_add_message(__('The topic was created successfully', 'buddypress'));
                            $redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum/topic/' . $topic->topic_slug . '/';
                        }
                    }
                    bp_core_redirect($redirect);
                } else {
                    bp_core_add_message(__('Please pick the group forum where you would like to post this topic.', 'buddypress'), 'error');
                    bp_core_redirect(add_query_arg('new', '', bp_get_forums_directory_permalink()));
                }
            } else {
                bp_core_add_message(__('Please pick the group forum where you would like to post this topic.', 'buddypress'), 'error');
                bp_core_redirect(add_query_arg('new', '', bp_get_forums_directory_permalink()));
            }
        }
        do_action('bp_forums_directory_forums_setup');
        bp_core_load_template(apply_filters('bp_forums_template_directory_forums_setup', 'forums/index'));
    }
}
Ejemplo n.º 8
0
function bp_reshare_replace_activity_delete_link($link)
{
    // if activity type is a reshare, then we replace the delete link behavior
    if (bp_get_activity_type() == 'reshare_update') {
        $class = 'delete-reshare';
        $action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/?delete_reshare=' . bp_get_activity_id(), '_reshare_delete');
        $link = '<a href="' . $action_url . '" class="button item-button bp-secondary-action ' . $class . ' confirm" rel="nofollow">' . __('Delete', 'bp-reshare') . '</a>';
    }
    return apply_filters('bp_reshare_replace_activity_delete_link', $link);
}
Ejemplo n.º 9
0
 /**
  * @ticket BP6475
  */
 public function test_member_directory_when_nested_under_wp_page()
 {
     $p = $this->factory->post->create(array('post_type' => 'page', 'post_name' => 'foo'));
     $members_page = get_page_by_path('members');
     wp_update_post(array('ID' => $members_page->ID, 'post_parent' => $p));
     $members_page_permalink = bp_get_root_domain() . '/foo/members/';
     $this->go_to($members_page_permalink);
     $this->assertTrue(bp_is_members_component());
     $this->assertEquals('', bp_current_action());
 }
Ejemplo n.º 10
0
/**
 * Ensure that the 'Create a new site' link at wp-admin/my-sites.php points to the BP blog signup.
 *
 * @since BuddyPress (1.6.0)
 *
 * @uses apply_filters() Filter 'bp_blogs_creation_location' to alter the
 *       returned value.
 *
 * @param string $url The original URL (points to wp-signup.php by default).
 * @return string The new URL.
 */
function bp_blogs_creation_location($url)
{
    /**
     * Filters the 'Create a new site' link URL.
     *
     * @since BuddyPress (1.6.0)
     *
     * @param string $value URL for the 'Create a new site' signup page.
     */
    return apply_filters('bp_blogs_creation_location', trailingslashit(bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create', $url));
}
Ejemplo n.º 11
0
/**
 * 
 * @return type
 * @since 0.5
 * @version 1.2.2
 * v2, 10/5/2013
 */
function cac_catch_group_doc_request()
{
    $error = false;
    if (empty($_GET['get_group_doc'])) {
        return;
    }
    $doc_id = $_GET['get_group_doc'];
    // Check to see whether the current user has access to the doc in question
    $file_deets = explode('/', $doc_id);
    $group_id = $file_deets[0];
    $group = new BP_Groups_Group($group_id);
    $doc_name = $file_deets[1];
    if (empty($group->id)) {
        $error = array('message' => __('That group does not exist.', 'bp-group-documents'), 'redirect' => bp_get_root_domain());
    } else {
        if ($group->status != 'public') {
            // If the group is not public,
            if (!is_super_admin()) {
                //then the user must be logged in and
                // a member of the group to download the document
                if (!is_user_logged_in() || !groups_is_user_member(bp_loggedin_user_id(), $group_id)) {
                    $error = array('message' => sprintf(__('You must be a logged-in member of the group %s to access this document. If you are a member of the group, please log into the site and try again.', 'bp-group-documents'), $group->name), 'redirect' => bp_get_group_permalink($group));
                }
            }
        }
        // If we have gotten this far without an error, then the download can go through
        if (!$error) {
            $document = new BP_Group_Documents();
            $document->populate_by_file($doc_name);
            $doc_path = $document->get_path();
            clearstatcache();
            if (file_exists($doc_path)) {
                $mime_type = mime_content_type($doc_path);
                $doc_size = filesize($doc_path);
                header("Cache-Control: public, must-revalidate, post-check=0, pre-check=0");
                header("Pragma: hack");
                header("Content-Type: {$mime_type}; name='" . $file_deets[1] . "'");
                header("Content-Length: " . $doc_size);
                header('Content-Disposition: inline; filename="' . $file_deets[1] . '"');
                header("Content-Transfer-Encoding: binary");
                ob_clean();
                flush();
                readfile($doc_path);
                die;
            } else {
                // File does not exist
                $error = array('message' => _e('The file could not be found.', 'bp-group-documents'), 'redirect' => bp_get_group_permalink($group) . 'documents');
            }
        }
    }
    // If we have gotten this far, there was an error. Add a message and redirect
    bp_core_add_message($error['message'], 'error');
    bp_core_redirect($error['redirect']);
}
function bp_friend_suggest_hide_link($possible_friend)
{
    $url = bp_get_root_domain() . "/remove-friend-suggestion/?suggest_id=" . $possible_friend . "&_wpnonce=" . wp_create_nonce('friend-suggestion-remove-' . $possible_friend);
    ?>
<span class="remove-friend-suggestion"><a href="<?php 
    echo $url;
    ?>
" title="<?php 
    _e('Hide this suggestion', 'bp-friend-suggest');
    ?>
">x</a></span>
<?php 
}
Ejemplo n.º 13
0
 /**
  * Load Custom tabs on BuddyPress
  *
  * @global object $bp global BuddyPress object
  */
 function custom_media_nav_tab()
 {
     $bp = buddypress();
     if (!function_exists('bp_core_new_nav_item')) {
         return;
     }
     if (bp_is_blog_page() || !bp_is_group() && !(isset($bp->displayed_user) && isset($bp->displayed_user->id)) || apply_filters('rtmedia_render_bp_nav', false)) {
         return;
     }
     global $rtmedia;
     if (function_exists('bp_is_group') && !bp_is_group()) {
         if (isset($bp->displayed_user) && isset($bp->displayed_user->id)) {
             $profile_counts = $this->actual_counts($bp->displayed_user->id);
         }
         $tab_position = apply_filters('rtmedia_media_tab_position', 99);
         if (0 !== intval($rtmedia->options['buddypress_enableOnProfile'])) {
             bp_core_new_nav_item(array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $profile_counts['total']['all'] . '</span>', 'slug' => apply_filters('rtmedia_media_tab_slug', RTMEDIA_MEDIA_SLUG), 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all', 'position' => $tab_position));
         }
     }
     if (bp_is_group() && 0 !== intval($rtmedia->options['buddypress_enableOnGroup'])) {
         $media_enabled = true;
         //filter for rtMedia PRO for PER GROUP MEDIA enable/disable functionality
         $media_enabled = apply_filters('rtmedia_media_enabled_for_current_group', $media_enabled);
         // check if current user can view this group
         $current_group = groups_get_current_group();
         /**
          * remove `$current_group->is_visible` and add `bp_group_is_visible( $current_group )`
          * reason   : In Buddypress 2.7 `is_visible` return false so we can't display `media` tab on group
          * issue id	: http://git.rtcamp.com/rtmedia/rtMedia/issues/119
          */
         // $is_visible_to_current_user = $current_group->is_visible;
         $is_visible_to_current_user = bp_group_is_visible($current_group);
         if ($media_enabled && $is_visible_to_current_user) {
             $group_counts = $this->actual_counts($bp->groups->current_group->id, 'group');
             $slug = apply_filters('rtmedia_group_media_tab_slug', RTMEDIA_MEDIA_SLUG);
             if (isset($bp->version) && $bp->version > '2.5.3') {
                 /*
                  * As from BuddyPress 2.6, you can't access $bp->bp_options_nav directly.
                  * Use `bp_core_new_subnav_item` to add subnav item.
                  *
                  * Check https://buddypress.trac.wordpress.org/ticket/6534 and https://buddypress.trac.wordpress.org/changeset/10745
                  * for more details
                  */
                 bp_core_new_subnav_item(array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . $slug, 'slug' => $slug, 'parent_slug' => bp_get_current_group_slug(), 'parent_url' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/'), 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all'));
             } else {
                 $bp->bp_options_nav[bp_get_current_group_slug()]['media'] = array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . $slug, 'slug' => $slug, 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all');
             }
         }
     }
 }
Ejemplo n.º 14
0
/**
 * Add a Sites menu to the BuddyBar.
 *
 * @since BuddyPress (1.0.0)
 *
 * @global object $bp The BuddyPress global settings object.
 *
 * @return bool|null Returns false on failure. Otherwise echoes the menu item.
 */
function bp_adminbar_blogs_menu()
{
    global $bp;
    if (!is_user_logged_in() || !bp_is_active('blogs')) {
        return false;
    }
    if (!is_multisite()) {
        return false;
    }
    $blogs = wp_cache_get('bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', 'bp');
    if (empty($blogs)) {
        $blogs = bp_blogs_get_blogs_for_user(bp_loggedin_user_id(), true);
        wp_cache_set('bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', $blogs, 'bp');
    }
    $counter = 0;
    if (is_array($blogs['blogs']) && (int) $blogs['count']) {
        echo '<li id="bp-adminbar-blogs-menu"><a href="' . trailingslashit(bp_loggedin_user_domain() . bp_get_blogs_slug()) . '">';
        _e('My Sites', 'buddypress');
        echo '</a>';
        echo '<ul>';
        foreach ((array) $blogs['blogs'] as $blog) {
            $alt = 0 == $counter % 2 ? ' class="alt"' : '';
            $site_url = esc_attr($blog->siteurl);
            echo '<li' . $alt . '>';
            echo '<a href="' . $site_url . '">' . esc_html($blog->name) . '</a>';
            echo '<ul>';
            echo '<li class="alt"><a href="' . $site_url . 'wp-admin/">' . __('Dashboard', 'buddypress') . '</a></li>';
            echo '<li><a href="' . $site_url . 'wp-admin/post-new.php">' . __('New Post', 'buddypress') . '</a></li>';
            echo '<li class="alt"><a href="' . $site_url . 'wp-admin/edit.php">' . __('Manage Posts', 'buddypress') . '</a></li>';
            echo '<li><a href="' . $site_url . 'wp-admin/edit-comments.php">' . __('Manage Comments', 'buddypress') . '</a></li>';
            echo '</ul>';
            do_action('bp_adminbar_blog_items', $blog);
            echo '</li>';
            $counter++;
        }
        $alt = 0 == $counter % 2 ? ' class="alt"' : '';
        if (bp_blog_signup_enabled()) {
            echo '<li' . $alt . '>';
            echo '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __('Create a Site!', 'buddypress') . '</a>';
            echo '</li>';
        }
        echo '</ul>';
        echo '</li>';
    }
}
Ejemplo n.º 15
0
/**
 * Add a menu for the root site of this BuddyPress network
 *
 * @global type $nxt_admin_bar
 * @return If in ajax
 */
function bp_admin_bar_root_site()
{
    global $nxt_admin_bar;
    // Create the root blog menu
    $nxt_admin_bar->add_menu(array('id' => 'bp-root-blog', 'title' => get_blog_option(bp_get_root_blog_id(), 'blogname'), 'href' => bp_get_root_domain()));
    // Logged in user
    if (is_user_logged_in()) {
        // Dashboard links
        if (is_super_admin()) {
            // Add site admin link
            $nxt_admin_bar->add_menu(array('id' => 'dashboard', 'parent' => 'bp-root-blog', 'title' => __('Admin Dashboard', 'buddypress'), 'href' => get_admin_url(bp_get_root_blog_id())));
            // Add network admin link
            if (is_multisite()) {
                // Link to the network admin dashboard
                $nxt_admin_bar->add_menu(array('id' => 'network-dashboard', 'parent' => 'bp-root-blog', 'title' => __('Network Dashboard', 'buddypress'), 'href' => network_admin_url()));
            }
        }
    }
}
Ejemplo n.º 16
0
 /**
  * Check user access and redirect if access denied
  */
 public function maybe_redirect()
 {
     // always allow access to blog, registration and activation pages
     if (bp_is_blog_page() || bp_is_register_page() || bp_is_activation_page()) {
         return;
     }
     // grab toggle option from registry
     $opt_toggle = $this->get_suboption('toggle');
     // is option toggled on?
     if ($opt_toggle && true == $opt_toggle->get()) {
         // protection is enabled, is user logged in?
         if (!is_user_logged_in()) {
             // not logged in, redirect to registration page
             bp_core_redirect(bp_get_root_domain() . '/' . bp_get_root_slug('register'));
             // exit to avoid any accidental output
             exit;
         }
     }
 }
function bp_get_group_invite_user_remove_invite_url()
{
    global $invites_template;
    $user_id = intval($invites_template->invite->user->id);
    if (bp_is_current_action('create')) {
        $uninvite_url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/group-invites/?user_id=' . $user_id;
    } else {
        $uninvite_url = bp_get_group_permalink(groups_get_current_group()) . 'send-invites/remove/' . $user_id;
    }
    return wp_nonce_url($uninvite_url, 'groups_invite_uninvite_user');
}
Ejemplo n.º 18
0
		
			<a href="<?php 
    echo bp_loggedin_user_domain();
    ?>
">
				<?php 
    bp_loggedin_user_avatar('type=thumb&width=40&height=40');
    ?>
			</a>

			<h4><?php 
    echo bp_core_get_userlink(bp_loggedin_user_id());
    ?>
</h4>
			<a class="button logout" href="<?php 
    echo wp_logout_url(bp_get_root_domain());
    ?>
"><?php 
    _e('Log Out', 'buddypress');
    ?>
</a>

			<?php 
    do_action('bp_sidebar_me');
    ?>
	

		<?php 
    do_action('bp_after_sidebar_me');
    ?>
Ejemplo n.º 19
0
$max_pages = max(ceil($blogs_template->total_blog_count / 14), 1);
?>

			<h3><?php 
_e('Site Directory', 'huddle');
?>
</h3>
			<p class="subtitle">
				<?php 
bp_blogs_pagination_count();
?>
				<?php 
if (is_user_logged_in() && bp_blog_signup_enabled()) {
    ?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn-gray quick-create-blog" href="<?php 
    echo add_query_arg('w-iframe', '1', bp_get_root_domain() . '/' . bp_get_blogs_slug() . '/create/');
    ?>
"><?php 
    _e('Create a Blog', 'huddle');
    ?>
</a><?php 
}
?>
			</p>

			<?php 
do_action('bp_before_directory_blogs_content');
?>

			<div id="blog-dir-search" class="dir-search" role="search">
Ejemplo n.º 20
0
			<?php 
do_action('bp_before_directory_members_content');
?>

			<div id="members-dir-search" class="dir-search" role="search">

				<?php 
bp_directory_members_search_form();
?>

			</div><!-- #members-dir-search -->

			<div class="item-list-tabs" role="navigation">
				<ul>
					<li class="selected" id="members-all"><a href="<?php 
echo trailingslashit(bp_get_root_domain() . '/' . bp_get_members_root_slug());
?>
"><?php 
printf(__('All %1s <span>%2s</span>', 'buddypress'), ucfirst(buatp_get_dir_name()), bp_get_total_member_count());
?>
</a></li>

					<?php 
if (is_user_logged_in() && bp_is_active('friends') && bp_get_total_friend_count(bp_loggedin_user_id())) {
    ?>

						<li id="members-personal"><a href="<?php 
    echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/';
    ?>
"><?php 
    printf(__('My Friends <span>%s</span>', 'buddypress'), bp_get_total_friend_count(bp_loggedin_user_id()));
Ejemplo n.º 21
0
/**
 *  buddypress login widget
 *
 * @package Custom Community
 * @since 1.8.3
 */
function cc_login_widget()
{
    ?>
	<?php 
    global $cap;
    ?>
		<?php 
    do_action('bp_inside_before_sidebar');
    ?>
	
		<?php 
    if (is_user_logged_in()) {
        ?>
	
			<?php 
        do_action('bp_before_sidebar_me');
        ?>
			<div class="widget">
			<div id="sidebar-me">
				<a href="<?php 
        echo bp_loggedin_user_domain();
        ?>
">
					<?php 
        bp_loggedin_user_avatar('type=thumb&width=40&height=40');
        ?>
				</a>
	
				<h4><?php 
        echo bp_core_get_userlink(bp_loggedin_user_id());
        ?>
</h4>
				<a class="button logout" href="<?php 
        echo wp_logout_url(bp_get_root_domain());
        ?>
"><?php 
        _e('Log Out', 'cc');
        ?>
</a>
	
				<?php 
        do_action('bp_sidebar_me');
        ?>
			</div>
			</div>
			<?php 
        do_action('bp_after_sidebar_me');
        ?>
	
			<?php 
        if (function_exists('bp_message_get_notices')) {
            ?>
				<?php 
            bp_message_get_notices();
            /* Site wide notices to all users */
            ?>
			<?php 
        }
        ?>
	
		<?php 
    } else {
        ?>
	
			<?php 
        do_action('bp_before_sidebar_login_form');
        ?>
			<div class="widget">
			<p id="login-text">
			<?php 
        if (!$cap->bp_login_sidebar_text) {
            ?>
				<?php 
            _e('To start connecting please log in first.', 'cc');
            ?>
			<?php 
        } else {
            ?>
				<?php 
            echo $cap->bp_login_sidebar_text;
            ?>
			<?php 
        }
        ?>
				<?php 
        if (bp_get_signup_allowed()) {
            ?>
					<?php 
            printf(__(' You can also <a href="%s" title="Create an account">create an account</a>.', 'cc'), site_url(BP_REGISTER_SLUG . '/'));
            ?>
				<?php 
        }
        ?>
			</p>
	
			<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php 
        echo site_url('wp-login.php', 'login_post');
        ?>
" method="post">
				<label><?php 
        _e('Username', 'cc');
        ?>
<br />
				<input type="text" name="log" id="sidebar-user-login" class="input" value="" /></label>
	
				<label><?php 
        _e('Password', 'cc');
        ?>
<br />
				<input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" /></label>
	
				<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" /> <?php 
        _e('Remember Me', 'cc');
        ?>
</label></p>
	
				<?php 
        do_action('bp_sidebar_login_form');
        ?>
				<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php 
        _e('Log In', 'cc');
        ?>
" tabindex="100" />
				<input type="hidden" name="testcookie" value="1" />
			</form>
			</div>
			<?php 
        do_action('bp_after_sidebar_login_form');
        ?>
		<?php 
    }
}
Ejemplo n.º 22
0
}
?>
		<div class="padder">

		<?php 
do_action('bp_before_directory_blogs');
?>

		<form action="" method="post" id="blogs-directory-form" class="dir-form">

			<h3><?php 
_e('Site Directory', 'buddypress');
if (is_user_logged_in() && bp_blog_signup_enabled()) {
    ?>
 &nbsp;<a class="button" href="<?php 
    echo bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/';
    ?>
"><?php 
    _e('Create a Site', 'buddypress');
    ?>
</a><?php 
}
?>
</h3>

			<?php 
do_action('bp_before_directory_blogs_content');
?>

			<div id="blog-dir-search" class="dir-search" role="search">
Ejemplo n.º 23
0
			<div id="group-dir-search" class="dir-search" role="search">

				<?php 
bp_directory_groups_search_form();
?>

			</div><!-- #group-dir-search -->

			<?php 
do_action('template_notices');
?>

			<div class="item-list-tabs" role="navigation">
				<ul>
					<li class="selected" id="groups-all"><a href="<?php 
echo trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug());
?>
"><?php 
printf(__('All Groups <span>%s</span>', 'buddypress'), bp_get_total_group_count());
?>
</a></li>

					<?php 
if (is_user_logged_in() && bp_get_total_group_count_for_user(bp_loggedin_user_id())) {
    ?>

						<li id="groups-personal"><a href="<?php 
    echo trailingslashit(bp_loggedin_user_domain() . bp_get_groups_slug() . '/my-groups');
    ?>
"><?php 
    printf(__('My Groups <span>%s</span>', 'buddypress'), bp_get_total_group_count_for_user(bp_loggedin_user_id()));
Ejemplo n.º 24
0
 function _register()
 {
     global $bp;
     // If admin/create names and slugs are not provided, they fall back on the main
     // name and slug for the extension
     if (!$this->admin_name) {
         $this->admin_name = $this->name;
     }
     if (!$this->admin_slug) {
         $this->admin_slug = $this->slug;
     }
     if (!$this->create_name) {
         $this->create_name = $this->name;
     }
     if (!$this->create_slug) {
         $this->create_slug = $this->slug;
     }
     if (!empty($this->enable_create_step)) {
         // Insert the group creation step for the new group extension
         $bp->groups->group_creation_steps[$this->create_slug] = array('name' => $this->create_name, 'slug' => $this->create_slug, 'position' => $this->create_step_position);
         // Attach the group creation step display content action
         add_action('groups_custom_create_steps', array(&$this, 'create_screen'));
         // Attach the group creation step save content action
         add_action('groups_create_group_step_save_' . $this->create_slug, array(&$this, 'create_screen_save'));
     }
     // When we are viewing a single group, add the group extension nav item
     if (bp_is_group()) {
         if ($this->visibility == 'public' || $this->visibility != 'public' && $bp->groups->current_group->user_has_access) {
             if ($this->enable_nav_item) {
                 bp_core_new_subnav_item(array('name' => !$this->nav_item_name ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => $bp->groups->current_group->slug, 'parent_url' => bp_get_group_permalink($bp->groups->current_group), 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array(&$this, '_display_hook'), 'user_has_access' => $this->enable_nav_item));
                 // When we are viewing the extension display page, set the title and options title
                 if (bp_is_current_action($this->slug)) {
                     add_action('bp_template_content_header', create_function('', 'echo "' . esc_attr($this->name) . '";'));
                     add_action('bp_template_title', create_function('', 'echo "' . esc_attr($this->name) . '";'));
                 }
             }
             // Hook the group home widget
             if (!bp_current_action() && bp_is_current_action('home')) {
                 add_action($this->display_hook, array(&$this, 'widget_display'));
             }
         }
     }
     // Construct the admin edit tab for the new group extension
     if (!empty($this->enable_edit_item) && bp_is_item_admin()) {
         add_action('groups_admin_tabs', create_function('$current, $group_slug', '$selected = ""; if ( "' . esc_attr($this->admin_slug) . '" == $current ) $selected = " class=\\"current\\""; echo "<li{$selected}><a href=\\"' . trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr($this->admin_slug)) . '\\">' . esc_attr($this->admin_name) . '</a></li>";'), 10, 2);
         // Catch the edit screen and forward it to the plugin template
         if (bp_is_groups_component() && bp_is_current_action('admin') && bp_is_action_variable($this->admin_slug, 0)) {
             // Check whether the user is saving changes
             $this->edit_screen_save();
             add_action('groups_custom_edit_steps', array(&$this, 'edit_screen'));
             if ('' != locate_template(array('groups/single/home.php'), false)) {
                 bp_core_load_template(apply_filters('groups_template_group_home', 'groups/single/home'));
             } else {
                 add_action('bp_template_content_header', create_function('', 'echo "<ul class=\\"content-header-nav\\">"; bp_group_admin_tabs(); echo "</ul>";'));
                 add_action('bp_template_content', array(&$this, 'edit_screen'));
                 bp_core_load_template(apply_filters('bp_core_template_plugin', '/groups/single/plugins'));
             }
         }
     }
 }
Ejemplo n.º 25
0
/**
 * Handle the loading of the Activate screen.
 *
 * @todo Move the actual activation process into an action in bp-members-actions.php
 */
function bp_core_screen_activation()
{
    // Bail if not viewing the activation page
    if (!bp_is_current_component('activate')) {
        return false;
    }
    // If the user is already logged in, redirect away from here
    if (is_user_logged_in()) {
        // If activation page is also front page, set to members directory to
        // avoid an infinite loop. Otherwise, set to root domain.
        $redirect_to = bp_is_component_front_page('activate') ? bp_get_root_domain() . '/' . bp_get_members_root_slug() : bp_get_root_domain();
        // Trailing slash it, as we expect these URL's to be
        $redirect_to = trailingslashit($redirect_to);
        /**
         * Filters the URL to redirect logged in users to when visiting activation page.
         *
         * @since BuddyPress (1.9.0)
         *
         * @param string $redirect_to URL to redirect user to.
         */
        $redirect_to = apply_filters('bp_loggedin_activate_page_redirect_to', $redirect_to);
        // Redirect away from the activation page
        bp_core_redirect($redirect_to);
    }
    // grab the key (the old way)
    $key = isset($_GET['key']) ? $_GET['key'] : '';
    // grab the key (the new way)
    if (empty($key)) {
        $key = bp_current_action();
    }
    // Get BuddyPress
    $bp = buddypress();
    // we've got a key; let's attempt to activate the signup
    if (!empty($key)) {
        /**
         * Filters the activation signup.
         *
         * @since BuddyPress (1.1.0)
         *
         * @param bool|int $value Value returned by activation.
         *                        Integer on success, boolean on failure.
         */
        $user = apply_filters('bp_core_activate_account', bp_core_activate_signup($key));
        // If there were errors, add a message and redirect
        if (!empty($user->errors)) {
            bp_core_add_message($user->get_error_message(), 'error');
            bp_core_redirect(trailingslashit(bp_get_root_domain() . '/' . $bp->pages->activate->slug));
        }
        $hashed_key = wp_hash($key);
        // Check if the signup avatar folder exists. If it does, move the folder to
        // the BP user avatars directory
        if (file_exists(bp_core_avatar_upload_path() . '/avatars/signups/' . $hashed_key)) {
            @rename(bp_core_avatar_upload_path() . '/avatars/signups/' . $hashed_key, bp_core_avatar_upload_path() . '/avatars/' . $user);
        }
        bp_core_add_message(__('Your account is now active!', 'buddypress'));
        $bp->activation_complete = true;
    }
    /**
     * Filters the template to load for the Member activation page screen.
     *
     * @since BuddyPress (1.1.1)
     *
     * @param string $value Path to the Member activation template to load.
     */
    bp_core_load_template(apply_filters('bp_core_template_activate', array('activate', 'registration/activate')));
}
Ejemplo n.º 26
0
 function bp_core_wpsignup_redirect()
 {
     if ((!isset($_SERVER['SCRIPT_NAME']) || false === strpos($_SERVER['SCRIPT_NAME'], 'wp-signup.php')) && (!isset($_GET['action']) || $_GET['action'] != 'register')) {
         return false;
     }
     if (gconnect_locate_template(array('registration/register.php'), false) || gconnect_locate_template(array('register.php'), false)) {
         bp_core_redirect(bp_get_root_domain() . '/' . BP_REGISTER_SLUG . '/');
     }
 }
Ejemplo n.º 27
0
/**
 * Handles the deleting of a user
 */
function bp_settings_action_delete_account()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    // Bail if no submit action
    if (!isset($_POST['delete-account-understand'])) {
        return;
    }
    // Bail if not in settings
    if (!bp_is_settings_component() || !bp_is_current_action('delete-account')) {
        return false;
    }
    // 404 if there are any additional action variables attached
    if (bp_action_variables()) {
        bp_do_404();
        return;
    }
    // Bail if account deletion is disabled
    if (bp_disable_account_deletion() && !bp_current_user_can('delete_users')) {
        return false;
    }
    // Nonce check
    check_admin_referer('delete-account');
    // Get username now because it might be gone soon!
    $username = bp_get_displayed_user_fullname();
    // delete the users account
    if (bp_core_delete_account(bp_displayed_user_id())) {
        // Add feedback ater deleting a user
        bp_core_add_message(sprintf(__('%s was successfully deleted.', 'buddypress'), $username), 'success');
        // Redirect to the root domain
        bp_core_redirect(bp_get_root_domain());
    }
}
Ejemplo n.º 28
0
/**
 * Output deposits loop entry html.
 */
function humcore_deposits_entry_content()
{
    $metadata = (array) humcore_get_current_deposit();
    if (!empty($metadata['group'])) {
        $groups = array_filter($metadata['group']);
    }
    if (!empty($groups)) {
        $group_list = implode(', ', array_map('humcore_linkify_group', $groups));
    }
    if (!empty($metadata['subject'])) {
        $subjects = array_filter($metadata['subject']);
    }
    if (!empty($subjects)) {
        $subject_list = implode(', ', array_map('humcore_linkify_subject', $subjects));
    }
    $authors = array_filter($metadata['authors']);
    $author_uni = humcore_deposit_parse_author_info($metadata['author_info'][0], 1);
    $author_type = humcore_deposit_parse_author_info($metadata['author_info'][0], 3);
    $authors_list = implode(', ', array_map('humcore_linkify_author', $authors, $author_uni, $author_type));
    $item_url = sprintf('%1$s/deposits/item/%2$s', bp_get_root_domain(), $metadata['pid']);
    ?>
<h4 class="bp-group-documents-title"><a href="<?php 
    echo esc_url($item_url);
    ?>
/"><?php 
    echo $metadata['title_unchanged'];
    ?>
</a></h4>
<div class="bp-group-documents-meta">
<dl class='defList'>
<dt><?php 
    _e('Author(s):', 'humcore_domain');
    ?>
</dt>
<dd><?php 
    echo $authors_list;
    // XSS OK.
    ?>
</dd>
<?php 
    if (!empty($metadata['date'])) {
        ?>
<dt><?php 
        _e('Date:', 'humcore_domain');
        ?>
</dt>
<dd><a href="/deposits/?facets[pub_date_facet][]=<?php 
        echo urlencode($metadata['date']);
        ?>
"><?php 
        echo esc_html($metadata['date']);
        ?>
</a></dd>
<?php 
    }
    if (!empty($groups)) {
        ?>
<dt><?php 
        _e('Forum(s):', 'humcore_domain');
        ?>
</dt>
<dd><?php 
        echo $group_list;
        // XSS OK.
        ?>
</dd>
<?php 
    }
    if (!empty($subjects)) {
        ?>
<dt><?php 
        _e('Subject(s):', 'humcore_domain');
        ?>
</dt>
<dd><?php 
        echo $subject_list;
        // XSS OK.
        ?>
</dd>
<?php 
    }
    ?>

<?php 
    if (!empty($metadata['genre'])) {
        ?>
<dt><?php 
        _e('Item Type:', 'humcore_domain');
        ?>
</dt>
<dd><a href="/deposits/?facets[genre_facet][]=<?php 
        echo urlencode($metadata['genre']);
        ?>
"><?php 
        echo esc_html($metadata['genre']);
        ?>
</a></dd>
<?php 
    }
    ?>

<dt><?php 
    _e('Permanent URL:', 'humcore_domain');
    ?>
</dt>
<dd><a href="<?php 
    echo esc_attr($metadata['handle']);
    ?>
"><?php 
    echo esc_html($metadata['handle']);
    ?>
</a></dd>
</dl>
</div>
<br style='clear:both'>
<?php 
}
Ejemplo n.º 29
0
    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 
    }
Ejemplo n.º 30
0
bp_directory_forums_search_form();
?>

				</div>
			</form>

			<?php 
do_action('bp_before_topics');
?>

			<form action="" method="post" id="forums-directory-form" class="dir-form">

				<div class="item-list-tabs" role="navigation">
					<ul>
						<li class="selected" id="forums-all"><a href="<?php 
echo trailingslashit(bp_get_root_domain() . '/' . bp_get_forums_root_slug());
?>
"><?php 
printf(__('All Topics <span>%s</span>', 'buddypress'), bp_get_forum_topic_count());
?>
</a></li>

						<?php 
if (is_user_logged_in() && bp_get_forum_topic_count_for_user(bp_loggedin_user_id())) {
    ?>

							<li id="forums-personal"><a href="<?php 
    echo trailingslashit(bp_loggedin_user_domain() . bp_get_forums_slug() . '/topics');
    ?>
"><?php 
    printf(__('My Topics <span>%s</span>', 'buddypress'), bp_get_forum_topic_count_for_user(bp_loggedin_user_id()));