function bp_friends_random_friends() { global $bp; if ( !$friend_ids = wp_cache_get( 'friends_friend_ids_' . $bp->displayed_user->id, 'bp' ) ) { $friend_ids = BP_Friends_Friendship::get_random_friends( $bp->displayed_user->id ); wp_cache_set( 'friends_friend_ids_' . $bp->displayed_user->id, $friend_ids, 'bp' ); } ?> <div class="info-group"> <h4><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?> (<?php echo BP_Friends_Friendship::total_friend_count( $bp->displayed_user->id ) ?>) <span><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>"><?php _e('See All', 'buddypress') ?> →</a></span></h4> <?php if ( $friend_ids ) { ?> <ul class="horiz-gallery"> <?php for ( $i = 0; $i < count( $friend_ids ); $i++ ) { ?> <li> <a href="<?php echo bp_core_get_user_domain( $friend_ids[$i] ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $friend_ids[$i], 'type' => 'thumb' ) ) ?></a> <h5><?php echo bp_core_get_userlink($friend_ids[$i]) ?></h5> </li> <?php } ?> </ul> <?php } else { ?> <div id="message" class="info"> <p><?php bp_word_or_name( __( "You haven't added any friend connections yet.", 'buddypress' ), __( "%s hasn't created any friend connections yet.", 'buddypress' ) ) ?></p> </div> <?php } ?> <div class="clear"></div> </div> <?php }
<?php } ?> </ul> <?php } else { ?> <?php if (bp_group_show_no_groups_message()) { ?> <div id="message" class="info"> <p><?php bp_word_or_name(__("You haven't joined any groups yet.", 'buddypress'), __("%s hasn't joined any groups yet.", 'buddypress')); ?> </p> </div> <?php if (bp_is_home()) { ?> <h3><?php _e('Why not join a few of these groups?', 'buddypress'); ?> </h3> <?php bp_groups_random_selection(); ?>
<?php if (function_exists('bp_friends_random_friends')) { ?> <?php bp_friends_random_friends(); ?> <?php } ?> <?php bp_custom_profile_boxes(); ?> <?php if (function_exists('bp_wire_get_post_list')) { ?> <?php bp_wire_get_post_list(bp_current_user_id(), bp_word_or_name(__("My Wire", 'buddypress'), __("%s's Wire", 'buddypress'), true, false), bp_word_or_name(__("No one has posted to your wire yet.", 'buddypress'), __("No one has posted to %s's wire yet.", 'buddypress'), true, false), bp_profile_wire_can_post()); ?> <?php } ?> </div> </div> </div> <?php get_footer();
?> </p> </li> <?php } ?> </ul> <?php } else { ?> <div id="message" class="info"> <p><?php bp_word_or_name(__("You haven't created any blogs yet.", 'buddypress'), __("%s hasn't created any public blogs yet.", 'buddypress')); ?> <?php bp_create_blog_link(); ?> </p> </div> <?php } ?> </div> </div>
function bp_album_get_prev_picture_or_album_link($text = '« ', $title = true) { global $pictures_template; if ($pictures_template->has_prev_pic()) { $text .= $title ? bp_album_get_prev_picture_title() : ''; return '<a href="' . bp_album_get_prev_picture_url() . '" class="picture-prev-link"><span>' . $text . '</span> </a>'; } else { return '<a href="' . bp_album_get_pictures_url() . '" class="picture-album-link picture-prev-link"><span> ' . bp_word_or_name(__("Return to your album", 'bp-album'), __("Return to %s album", 'bp-album'), false, false) . '</span> </a>'; } }
/** * bp_album_setup_nav() * * Sets up the user profile navigation items for the component. This adds the top level nav * item and all the sub level nav items to the navigation array. This is then * rendered in the template. * * @version 0.1.8.12 * @since 0.1.8.0 */ function bp_album_setup_nav() { global $bp, $pictures_template; $nav_item_name = apply_filters('bp_album_nav_item_name', __('Album', 'bp-album')); bp_core_new_nav_item(array('name' => $nav_item_name, 'slug' => $bp->album->slug, 'position' => 80, 'screen_function' => 'bp_album_screen_pictures', 'default_subnav_slug' => $bp->album->pictures_slug, 'show_for_displayed_user' => true)); $album_link = ''; $album_link_title = ''; if ($bp->current_component == $bp->album->slug) { $album_link = ($bp->displayed_user->id ? $bp->displayed_user->domain : $bp->loggedin_user->domain) . $bp->album->slug . '/'; $album_link_title = $bp->displayed_user->id ? bp_word_or_name(__("My pictures", 'bp-album'), __("%s's pictures", 'bp-album'), false, false) : __("My pictures", 'bp-album'); } bp_core_new_subnav_item(array('name' => $album_link_title, 'slug' => $bp->album->pictures_slug, 'parent_slug' => $bp->album->slug, 'parent_url' => $album_link, 'screen_function' => 'bp_album_screen_pictures', 'position' => 10)); if ($bp->current_component == $bp->album->slug && $bp->current_action == $bp->album->single_slug) { add_filter('bp_get_displayed_user_nav_' . $bp->album->single_slug, 'bp_album_single_subnav_filter', 10, 2); bp_core_new_subnav_item(array('name' => __('Picture', 'bp-album'), 'slug' => $bp->album->single_slug, 'parent_slug' => $bp->album->slug, 'parent_url' => $album_link, 'screen_function' => 'bp_album_screen_single', 'position' => 20)); } bp_core_new_subnav_item(array('name' => __('Upload picture', 'bp-album'), 'slug' => $bp->album->upload_slug, 'parent_slug' => $bp->album->slug, 'parent_url' => $album_link, 'screen_function' => 'bp_album_screen_upload', 'position' => 30, 'user_has_access' => bp_is_my_profile())); }
bp_album_picture_title_truncate(); ?> </a> </div> <?php } ?> </div> <?php } else { ?> <div id="message" class="info"> <p><?php echo bp_word_or_name(__("You don't have any photos yet. Why not upload some!", 'bp-album'), __("Either %s hasn't uploaded any pictures yet or they have restricted access", 'bp-album'), false, false); ?> </p> </div> <?php } ?> </div><!-- #item-body --> </div><!-- .padder --> </div><!-- #content --> <?php locate_template(array('sidebar.php'), true);
/** * Output a block of random friends. * * No longer used in BuddyPress. * * @todo Deprecate */ function bp_friends_random_friends() { if (!($friend_ids = wp_cache_get('friends_friend_ids_' . bp_displayed_user_id(), 'bp'))) { $friend_ids = BP_Friends_Friendship::get_random_friends(bp_displayed_user_id()); wp_cache_set('friends_friend_ids_' . bp_displayed_user_id(), $friend_ids, 'bp'); } ?> <div class="info-group"> <h4><?php bp_word_or_name(__("My Friends", 'buddypress'), __("%s's Friends", 'buddypress')); ?> (<?php echo BP_Friends_Friendship::total_friend_count(bp_displayed_user_id()); ?> ) <span><a href="<?php echo trailingslashit(bp_displayed_user_domain() . bp_get_friends_slug()); ?> "><?php _e('See All', 'buddypress'); ?> </a></span></h4> <?php if ($friend_ids) { ?> <ul class="horiz-gallery"> <?php for ($i = 0, $count = count($friend_ids); $i < $count; ++$i) { ?> <li> <a href="<?php echo bp_core_get_user_domain($friend_ids[$i]); ?> "><?php echo bp_core_fetch_avatar(array('item_id' => $friend_ids[$i], 'type' => 'thumb')); ?> </a> <h5><?php echo bp_core_get_userlink($friend_ids[$i]); ?> </h5> </li> <?php } ?> </ul> <?php } else { ?> <div id="message" class="info"> <p><?php bp_word_or_name(__("You haven't added any friend connections yet.", 'buddypress'), __("%s hasn't created any friend connections yet.", 'buddypress')); ?> </p> </div> <?php } ?> <div class="clear"></div> </div> <?php }
<?php get_header(); ?> <div class="content-header"> <ul class="content-header-nav"> <?php bp_groups_header_tabs(); ?> </ul> </div> <div id="content"> <h2><?php bp_word_or_name(__("My Groups", 'buddypress'), __("%s's Groups", 'buddypress')); ?> » <?php bp_groups_filter_title(); ?> </h2> <div class="left-menu"> <?php bp_group_search_form(); ?> </div> <div class="main-column"> <?php do_action('template_notices');
<p class="postmetadata"><?php bp_post_tags('<span class="tags">', ', ', '</span>'); ?> <span class="comments"><?php bp_post_comments(__('No Comments'), __('1 Comment'), __('% Comments')); ?> </span></p> <hr /> </div> <?php } ?> <?php } else { ?> <div id="message" class="info"> <p><?php bp_word_or_name(__("You haven't made any posts yet.", 'buddypress'), __("%s hasn't made any posts yet.", 'buddypress')); ?> </p> </div> <?php } ?> </div> <?php get_footer();
<?php if (bp_friends_is_filtered()) { ?> <div id="message" class="info"> <p><?php _e("No friends matched your search filter terms", 'buddypress'); ?> </p> </div> <?php } else { ?> <div id="message" class="info"> <p><?php bp_word_or_name(__("Your friends list is currently empty", 'buddypress'), __("%s's friends list is currently empty", 'buddypress')); ?> </p> </div> <?php } ?> <?php if (bp_is_home() && !bp_friends_is_filtered()) { ?> <h3><?php _e('Why not make friends with some of these members?', 'buddypress'); ?> </h3> <?php
function bp_album_screen_single_image() { ?> <?php if (bp_album_has_pictures()) { bp_album_the_picture(); ?> <div class="picture-single"> <div class="single-picture-links"><?php bp_album_adjacent_links(); ?> </div> <h3><?php bp_album_picture_title(); ?> </h3> <div class="picture-outer-container"> <div class="picture-inner-container"> <div class="picture-middle"> <img src="<?php bp_album_picture_middle_url(); ?> " /> </div> </div> </div> <p class="picture-description"><?php bp_album_picture_desc(); ?> </p> <div class="single-picture-meta"> <div class="picture-edit-link"><?php bp_album_picture_edit_link(); ?> </div> <div class="picture-delete-link"><?php bp_album_picture_delete_link(); ?> </div> </div> </div> <div class="activity"> <?php bp_album_load_subtemplate(apply_filters('bp_album_template_screen_comments', 'album/comments')); ?> </div> <?php } else { ?> <div id="message" class="info activity"> <p><?php echo bp_word_or_name(__("This url is not valid.", 'bp-album'), __("Either this url is not valid or picture has restricted access.", 'bp-album'), false, false); ?> </p> </div> <?php } ?> <?php }
function bp_groups_random_groups($total_groups = 5) { global $bp; if (!($group_ids = wp_cache_get('groups_random_user_groups_' . $bp->displayed_user->id . '_' . $total_groups, 'bp'))) { $group_ids = groups_get_random_groups_for_user($bp->displayed_user->id, $total_groups, 1); wp_cache_set('groups_random_user_groups_' . $bp->displayed_user->id . '_' . $total_groups, $group_ids, 'bp'); } ?> <div class="info-group"> <h4><?php bp_word_or_name(__("My Groups", 'buddypress'), __("%s's Groups", 'buddypress')); ?> (<?php echo BP_Groups_Member::total_group_count(); ?> ) <a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug; ?> "><?php _e('See All', 'buddypress'); ?> »</a></h4> <?php if ($group_ids) { ?> <ul class="horiz-gallery"> <?php for ($i = 0; $i < count($group_ids); $i++) { if (!($group = wp_cache_get('groups_group_nouserdata_' . $group_ids[$i], 'bp'))) { $group = new BP_Groups_Group($group_ids[$i], false, false); wp_cache_set('groups_group_nouserdata_' . $group_ids[$i], $group, 'bp'); } ?> <li> <a href="<?php echo bp_get_group_permalink($group); ?> "><img src="<?php echo attribute_escape($group->avatar_thumb); ?> " class="avatar" alt="<?php _e('Group Avatar', 'buddypress'); ?> " /></a> <h5><a href="<?php echo bp_get_group_permalink($group); ?> "><?php echo attribute_escape($group->name); ?> </a></h5> </li> <?php } ?> </ul> <?php } else { ?> <div id="message" class="info"> <p><?php bp_word_or_name(__("You haven't joined any groups yet.", 'buddypress'), __("%s hasn't joined any groups yet.", 'buddypress')); ?> </p> </div> <?php } ?> <div class="clear"></div> </div> <?php }
<?php get_header(); ?> <div class="content-header"> <ul class="content-header-nav"> <?php bp_friends_header_tabs(); ?> </ul> </div> <div id="main"> <h2><?php bp_word_or_name(__("My Friends", 'buddypress'), __("%s's Friends", 'buddypress')); ?> → <?php bp_friends_filter_title(); ?> </h2> <div class="page-menu"> <?php bp_friend_search_form(); ?> </div> <div class="main-column"> <?php do_action('template_notices');
?> </div> <?php bp_custom_profile_sidebar_boxes(); ?> </div> <div class="main-column"> <?php bp_get_profile_header(); ?> <?php if (function_exists('bp_activity_get_list')) { ?> <?php bp_activity_get_list(bp_current_user_id(), bp_word_or_name(__("Mi actividad", 'buddypress'), __("Actividad de %s", 'buddypress'), true, false), bp_word_or_name(__("Aun no has hecho nada.", 'buddypress'), __("%s no ha hecho nada aun.", 'buddypress'), true, false)); ?> <?php } ?> </div> </div> <?php get_footer();
bp_album_picture_delete_link(); ?> </p> <?php bp_album_load_subtemplate(apply_filters('bp_album_template_screen_comments', 'album/comments')); ?> </div> <?php } else { ?> <div id="message" class="info"> <p><?php echo bp_word_or_name(__("This url is not valid.", 'bp-album'), __("Either this url is not valid or picture has restricted access.", 'bp-album'), false, false); ?> </p> </div> <?php } ?> </div><!-- #item-body --> </div><!-- .padder --> </div><!-- #content --> <?php locate_template(array('sidebar.php'), true);
printf(__('Commented on the post <a href="%1$s">%2$s</a> on the blog <a href="%3$s">%4$s</a>.', 'buddypress'), bp_get_comment_post_permalink(), bp_get_comment_post_title(), bp_get_comment_blog_permalink(), bp_get_comment_blog_name()); ?> </span> </li> <?php } ?> </ul> <?php } else { ?> <div id="message" class="info"> <p><?php bp_word_or_name(__("You haven't posted any comments yet.", 'buddypress'), __("%s hasn't posted any comments yet.", 'buddypress')); ?> </p> </div> <?php } ?> </div> </div> <?php get_footer();
<?php bp_activity_content(); ?> </li> <?php } ?> </ul> <?php } else { ?> <div id="message" class="info"> <p><?php echo bp_word_or_name(__("You haven't done anything yet.", 'buddypress'), __("%s hasn't done anything yet.", 'buddypress'), true, false); ?> </p> </div> <?php } ?> </div> </div> </div> <?php get_footer();
/** * My History Title * @since 0.1 * @version 1.1 */ public function my_history_title() { $me = str_replace('%label%', $this->point_types[$this->selected_type], $this->buddypress['history_menu_title']['me']); $others = str_replace('%label%', $this->point_types[$this->selected_type], $this->buddypress['history_menu_title']['others']); $title = bp_word_or_name($me, $others, false, false); $title = $this->core->template_tags_general($title); echo apply_filters('mycred_br_history_page_title', $title, $this); }
/** * bp_cubepoint_setup_nav() * * Sets up the user profile navigation items for the component. This adds the top level nav * item and all the sub level nav items to the navigation array. This is then * rendered in the template. * * @version 1.9.8.2 * @since 1.0 */ function bp_cubepoint_setup_nav() { global $bp; $cb_bp_sitewidemtitle = get_option('bp_sitewidemtitle_cp_bp'); $cb_bp_earnpointtitle = get_option('bp_earnpoints_menutitle_cp_bp'); $cb_bp_awardstitle = get_option('bp_awards_menutitle_cp_bp'); if ($bp->displayed_user->id) { $cubepoint_link = $bp->displayed_user->domain . $bp->cubepoint->slug . '/'; $cubepoint_link_title = bp_word_or_name(__("My Points", 'cp_buddypress'), __("%s's points", 'cp_buddypress'), false, false); } else { $cubepoint_link = $bp->loggedin_user->domain . $bp->cubepoint->slug . '/'; $cubepoint_link_title = __("My Points", 'cp_buddypress'); } // Add 'Points' to the main user profile navigation bp_core_new_nav_item(array('name' => __('Points', 'cp_buddypress'), 'slug' => $bp->cubepoint->slug, 'position' => 80, 'screen_function' => 'bp_cubepoint_screen_points', 'default_subnav_slug' => $bp->cubepoint->points_slug)); bp_core_new_subnav_item(array('name' => $cubepoint_link_title, 'slug' => $bp->cubepoint->points_slug, 'parent_slug' => $bp->cubepoint->slug, 'parent_url' => $cubepoint_link, 'screen_function' => 'bp_cubepoint_screen_points', 'position' => 10)); if (get_option('bp_sitewide_menu_cp_bp')) { bp_core_new_subnav_item(array('name' => __($cb_bp_sitewidemtitle, 'cp_buddypress'), 'slug' => $bp->cubepoint->table_slug, 'parent_slug' => $bp->cubepoint->slug, 'parent_url' => $cubepoint_link, 'screen_function' => 'bp_cubepoint_screen_table', 'position' => 30)); } if (get_option('bp_earnpoints_menu_cp_bp')) { bp_core_new_subnav_item(array('name' => __($cb_bp_earnpointtitle, 'cp_buddypress'), 'slug' => $bp->cubepoint->earnpoints_slug, 'parent_slug' => $bp->cubepoint->slug, 'parent_url' => $cubepoint_link, 'screen_function' => 'bp_cubepoint_screen_earnpoints', 'position' => 50)); } if (get_option('bp_awards_menu_onoff_cp_bp')) { bp_core_new_subnav_item(array('name' => __($cb_bp_awardstitle, 'cp_buddypress'), 'slug' => $bp->cubepoint->awards_slug, 'parent_slug' => $bp->cubepoint->slug, 'parent_url' => $cubepoint_link, 'screen_function' => 'bp_cubepoint_screen_awards', 'position' => 70)); } }