Skip to:
Content

BuddyPress.org

Ticket #2975: 2975.001.patch

File 2975.001.patch, 5.2 KB (added by r-a-y, 15 years ago)
  • buddypress/bp-themes/bp-default/header.php

     
    11<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    22
    33<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    4 
    54        <head profile="http://gmpg.org/xfn/11">
    6 
    75                <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    8 
    96                <title><?php bp_page_title() ?></title>
    10 
    11                 <?php do_action( 'bp_head' ) ?>
    12 
    13                 <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
    14 
    157                <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    168
    17                 <?php if ( function_exists( 'bp_sitewide_activity_feed_link' ) ) : ?>
    18                         <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php _e('Site Wide Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_sitewide_activity_feed_link() ?>" />
    19                 <?php endif; ?>
    20 
    21                 <?php if ( function_exists( 'bp_member_activity_feed_link' ) && bp_is_member() ) : ?>
    22                         <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php bp_displayed_user_fullname() ?> | <?php _e( 'Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_member_activity_feed_link() ?>" />
    23                 <?php endif; ?>
    24 
    25                 <?php if ( function_exists( 'bp_group_activity_feed_link' ) && bp_is_group() ) : ?>
    26                         <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php bp_current_group_name() ?> | <?php _e( 'Group Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_group_activity_feed_link() ?>" />
    27                 <?php endif; ?>
     9                <?php do_action( 'bp_head' ) ?>
    2810
    2911                <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    3012
    3113                <?php wp_head(); ?>
    32 
    3314        </head>
    3415
    3516        <body <?php body_class() ?> id="bp-default">
     
    3718                <?php do_action( 'bp_before_header' ) ?>
    3819
    3920                <div id="header">
    40 
    4121                        <h1 id="logo" role="banner"><a href="<?php echo home_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bp_site_name() ?></a></h1>
    4222
    4323                        <div id="navigation" role="navigation">
     
    4828                                <div class="padder">
    4929
    5030                                <?php if ( bp_search_form_enabled() ) : ?>
    51 
    5231                                        <form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
    5332                                                <input type="text" id="search-terms" name="search-terms" value="" />
    5433                                                <?php echo bp_search_form_type_select() ?>
     
    5635                                                <input type="submit" name="search-submit" id="search-submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
    5736                                                <?php wp_nonce_field( 'bp_search_form' ) ?>
    5837                                        </form><!-- #search-form -->
    59 
    6038                                <?php endif; ?>
    6139
    6240                                <?php do_action( 'bp_search_login_bar' ) ?>
  • buddypress/bp-themes/bp-default/functions.php

     
    103103        // Blog button
    104104        if ( bp_is_active( 'blogs' ) )
    105105                add_action( 'bp_directory_blogs_actions',  'bp_blogs_visit_blog_button' );
     106
     107        // Activity feeds
     108        add_action( 'bp_head', 'bp_dtheme_sitewide_feed' );
     109        add_action( 'bp_head', 'bp_dtheme_member_feed' );
     110        add_action( 'bp_head', 'bp_dtheme_group_feed' );
    106111}
    107112add_action( 'after_setup_theme', 'bp_dtheme_setup' );
    108113endif;
     
    437442function bp_dtheme_activity_secondary_avatars( $action, $activity ) {
    438443        switch ( $activity->component ) {
    439444                case 'groups' :
    440                 case 'blogs' :
    441445                case 'friends' :
    442446                        // Only insert avatar if one exists
    443447                        if ( $secondary_avatar = bp_get_activity_secondary_avatar() ) {
     
    489493                <?php do_action( 'bp_nav_items' ); ?>
    490494        </ul><!-- #nav -->
    491495<?php
     496}
     497
     498/**
     499 * Hook activity feed to <head>
     500 *
     501 * @see bp_dtheme_setup()
     502 * @since 1.3
     503 */
     504function bp_dtheme_sitewide_feed() {
     505        if ( bp_is_active( 'activity' ) ) :
     506?>
     507<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php _e('Site Wide Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_sitewide_activity_feed_link() ?>" />
     508<?php
     509        endif;
     510}
     511
     512/**
     513 * Hook member activity feed to <head>
     514 *
     515 * @see bp_dtheme_setup()
     516 * @since 1.3
     517 */
     518function bp_dtheme_member_feed() {
     519        if ( bp_is_active( 'activity' ) && bp_is_member() ) :
     520?>
     521                <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php bp_displayed_user_fullname() ?> | <?php _e( 'Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_member_activity_feed_link() ?>" />
     522<?php
     523        endif;
     524}
     525
     526/**
     527 * Hook group activity feed to <head>
     528 *
     529 * @see bp_dtheme_setup()
     530 * @since 1.3
     531 */
     532function bp_dtheme_group_feed() {
     533        if ( bp_is_active( 'activity' ) && bp_is_group() ) :
     534?>
     535                <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php bp_current_group_name() ?> | <?php _e( 'Group Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_group_activity_feed_link() ?>" />
     536<?php
     537        endif;
    492538}
    493539
    494540// Everything beyond this point is deprecated as of BuddyPress 1.3. This will be removed in a future version.