<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[BuddyPress] [2223] trunk: Custom header image support.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>2223</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-12-30 08:30:49 +0000 (Wed, 30 Dec 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Custom header image support. Removing counts from admin menus due to inconsistencies, will re-look at this in 1.3.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpblogsphp">trunk/bp-blogs.php</a></li>
<li><a href="#trunkbpfriendsphp">trunk/bp-friends.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incajaxphp">trunk/bp-themes/bp-default/_inc/ajax.php</a></li>
<li><a href="#trunkbpthemesbpdefault_inccssadminbarcss">trunk/bp-themes/bp-default/_inc/css/adminbar.css</a></li>
<li><a href="#trunkbpthemesbpdefaultactivityentryphp">trunk/bp-themes/bp-default/activity/entry.php</a></li>
<li><a href="#trunkbpthemesbpdefaultactivityindexphp">trunk/bp-themes/bp-default/activity/index.php</a></li>
<li><a href="#trunkbpthemesbpdefaultfunctionsphp">trunk/bp-themes/bp-default/functions.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpblogsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs.php (2222 => 2223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs.php        2009-12-29 16:50:48 UTC (rev 2222)
+++ trunk/bp-blogs.php        2009-12-30 08:30:49 UTC (rev 2223)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         /* Add 'Blogs' to the main navigation */
</span><del>-        bp_core_new_nav_item( array( 'name' => sprintf( __( 'Blogs (%d)', 'buddypress' ), bp_blogs_total_blogs_for_user() ), 'slug' => $bp->blogs->slug, 'position' => 30, 'screen_function' => 'bp_blogs_screen_my_blogs', 'default_subnav_slug' => 'my-blogs', 'item_css_id' => $bp->blogs->id ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' => sprintf( __( 'Blogs <span>(%d)</span>', 'buddypress' ), bp_blogs_total_blogs_for_user() ), 'slug' => $bp->blogs->slug, 'position' => 30, 'screen_function' => 'bp_blogs_screen_my_blogs', 'default_subnav_slug' => 'my-blogs', 'item_css_id' => $bp->blogs->id ) );
</ins><span class="cx">
</span><span class="cx">         $blogs_link = $bp->loggedin_user->domain . $bp->blogs->slug . '/';
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpfriendsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends.php (2222 => 2223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends.php        2009-12-29 16:50:48 UTC (rev 2222)
+++ trunk/bp-friends.php        2009-12-30 08:30:49 UTC (rev 2223)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><span class="cx">         /* Add 'Friends' to the main navigation */
</span><del>-        bp_core_new_nav_item( array( 'name' => sprintf( __( 'Friends (%d)', 'buddypress' ), friends_get_total_friend_count() ), 'slug' => $bp->friends->slug, 'position' => 60, 'screen_function' => 'friends_screen_my_friends', 'default_subnav_slug' => 'my-friends', 'item_css_id' => $bp->friends->id ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' => sprintf( __( 'Friends <span>(%d)</span>', 'buddypress' ), friends_get_total_friend_count() ), 'slug' => $bp->friends->slug, 'position' => 60, 'screen_function' => 'friends_screen_my_friends', 'default_subnav_slug' => 'my-friends', 'item_css_id' => $bp->friends->id ) );
</ins><span class="cx">
</span><span class="cx">         $friends_link = $bp->loggedin_user->domain . $bp->friends->slug . '/';
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2222 => 2223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2009-12-29 16:50:48 UTC (rev 2222)
+++ trunk/bp-groups.php        2009-12-30 08:30:49 UTC (rev 2223)
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx">
</span><span class="cx">                 /* This is a single group page. */
</span><span class="cx">                 $bp->is_single_item = true;
</span><del>-                $bp->groups->current_group = &new BP_Groups_Group( $group_id );
</del><ins>+                $bp->groups->current_group = new BP_Groups_Group( $group_id );
</ins><span class="cx">
</span><span class="cx">                 /* Using "item" not "group" for generic support in other components. */
</span><span class="cx">                 if ( is_site_admin() )
</span><span class="lines">@@ -196,13 +196,13 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* Add 'Groups' to the main navigation */
</span><del>-        bp_core_new_nav_item( array( 'name' => sprintf( __( 'Groups (%d)', 'buddypress' ), groups_total_groups_for_user() ), 'slug' => $bp->groups->slug, 'position' => 70, 'screen_function' => 'groups_screen_my_groups', 'default_subnav_slug' => 'my-groups', 'item_css_id' => $bp->groups->id ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' => sprintf( __( 'Groups <span>(%d)</span>', 'buddypress' ), groups_total_groups_for_user() ), 'slug' => $bp->groups->slug, 'position' => 70, 'screen_function' => 'groups_screen_my_groups', 'default_subnav_slug' => 'my-groups', 'item_css_id' => $bp->groups->id ) );
</ins><span class="cx">
</span><span class="cx">         $groups_link = $bp->loggedin_user->domain . $bp->groups->slug . '/';
</span><span class="cx">
</span><span class="cx">         /* Add the subnav items to the groups nav item */
</span><span class="cx">         bp_core_new_subnav_item( array( 'name' => __( 'My Groups', 'buddypress' ), 'slug' => 'my-groups', 'parent_url' => $groups_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_my_groups', 'position' => 10, 'item_css_id' => 'groups-my-groups' ) );
</span><del>-        bp_core_new_subnav_item( array( 'name' => __( 'Invites', 'buddypress' ), 'slug' => 'invites', 'parent_url' => $groups_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_invites', 'position' => 30, 'user_has_access' => bp_is_home() ) );
</del><ins>+        bp_core_new_subnav_item( array( 'name' => __( 'Invites', 'buddypress' ), 'slug' => 'invites', 'parent_url' => $groups_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_invites', 'position' => 30, 'user_has_access' => bp_is_my_profile() ) );
</ins><span class="cx">
</span><span class="cx">         if ( $bp->current_component == $bp->groups->slug ) {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/ajax.php (2222 => 2223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2009-12-29 16:50:48 UTC (rev 2222)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2009-12-30 08:30:49 UTC (rev 2223)
</span><span class="lines">@@ -378,7 +378,7 @@
</span><span class="cx">
</span><span class="cx">         update_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities', $new_favs );
</span><span class="cx">
</span><del>-        _e( 'Mark Favorite', 'buddypress' );
</del><ins>+        _e( 'Favorite', 'buddypress' );
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_activity_mark_unfav', 'bp_dtheme_unmark_activity_favorite' );
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_inccssadminbarcss"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/css/adminbar.css (2222 => 2223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/css/adminbar.css        2009-12-29 16:50:48 UTC (rev 2222)
+++ trunk/bp-themes/bp-default/_inc/css/adminbar.css        2009-12-30 08:30:49 UTC (rev 2223)
</span><span class="lines">@@ -58,12 +58,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         #wp-admin-bar li a span {
</span><del>-                background: #fff;
-                padding:2px 5px;
-                color: #555;
-                -moz-border-radius: 3px;
-                -webkit-border-radius: 3px;
-                border-radius: 3px;
</del><ins>+                display: none;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx"> #wp-admin-bar li:hover, #wp-admin-bar li.hover {
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultactivityentryphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/activity/entry.php (2222 => 2223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/activity/entry.php        2009-12-29 16:50:48 UTC (rev 2222)
+++ trunk/bp-themes/bp-default/activity/entry.php        2009-12-30 08:30:49 UTC (rev 2223)
</span><span class="lines">@@ -9,20 +9,20 @@
</span><span class="cx">
</span><span class="cx">                 <div class="activity-meta">
</span><span class="cx">                         <?php if ( is_user_logged_in() && bp_activity_can_comment() ) : ?>
</span><del>-                                <a href="#acomment-<?php bp_activity_id() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Comment', 'buddypress' ) ?> (<?php bp_activity_comment_count() ?>)</a>
</del><ins>+                                <a href="#acomment-<?php bp_activity_id() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Reply', 'buddypress' ) ?> (<?php bp_activity_comment_count() ?>)</a>
</ins><span class="cx">                         <?php endif; ?>
</span><span class="cx">
</span><del>-                        <?php if ( !bp_is_activity_permalink() ) : ?>
-                                <a href="<?php bp_activity_thread_permalink() ?>" class="view" title="<?php _e( 'View Thread', 'buddypress' ) ?>"><?php _e( 'View Thread', 'buddypress' ) ?></a>
-                        <?php endif; ?>
-
</del><span class="cx">                         <?php if ( is_user_logged_in() ) : ?>
</span><span class="cx">                                 <?php if ( !bp_get_activity_is_favorite() ) : ?>
</span><del>-                                        <a href="" class="fav" title="<?php _e( 'Mark Favorite', 'buddypress' ) ?>"><?php _e( 'Mark Favorite', 'buddypress' ) ?></a>
</del><ins>+                                        <a href="" class="fav" title="<?php _e( 'Mark as Favorite', 'buddypress' ) ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a>
</ins><span class="cx">                                 <?php else : ?>
</span><span class="cx">                                         <a href="" class="unfav" title="<?php _e( 'Remove Favorite', 'buddypress' ) ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a>
</span><span class="cx">                                 <?php endif; ?>
</span><span class="cx">                         <?php endif;?>
</span><ins>+
+                        <?php if ( !bp_is_activity_permalink() ) : ?>
+                                <a href="<?php bp_activity_thread_permalink() ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ) ?>"><?php _e( '#', 'buddypress' ) ?></a>
+                        <?php endif; ?>
</ins><span class="cx">                 </div>
</span><span class="cx">         </div>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultactivityindexphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/activity/index.php (2222 => 2223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/activity/index.php        2009-12-29 16:50:48 UTC (rev 2222)
+++ trunk/bp-themes/bp-default/activity/index.php        2009-12-30 08:30:49 UTC (rev 2223)
</span><span class="lines">@@ -17,6 +17,8 @@
</span><span class="cx">
</span><span class="cx">                                 <div class="clear"></div>
</span><span class="cx">
</span><ins>+                                <?php do_action( 'template_notices' ) ?>
+
</ins><span class="cx">                                 <div class="item-list-tabs">
</span><span class="cx">                                         <ul>
</span><span class="cx">                                                 <li class="selected" id="activity-all"><a href="<?php bp_root_domain() ?>"><?php printf( __( 'All Members (%s)', 'buddypress' ), bp_get_total_site_member_count() ) ?></a></li>
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/functions.php (2222 => 2223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/functions.php        2009-12-29 16:50:48 UTC (rev 2222)
+++ trunk/bp-themes/bp-default/functions.php        2009-12-30 08:30:49 UTC (rev 2223)
</span><span class="lines">@@ -101,6 +101,81 @@
</span><span class="cx"> <?php
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/* Set the defaults for the custom header image (http://ryan.boren.me/2007/01/07/custom-image-header-api/) */
+define( 'HEADER_TEXTCOLOR', 'FFFFFF' );
+define( 'HEADER_IMAGE', '%s/_inc/images/default_header.jpg' ); // %s is theme dir uri
+define( 'HEADER_IMAGE_WIDTH', 1250 );
+define( 'HEADER_IMAGE_HEIGHT', 125 );
+
+function bp_dtheme_header_style() { ?>
+        <style type="text/css">
+                #header{
+                        background-image: url(<?php header_image() ?>);
+                }
+                <?php if ( 'blank' == get_header_textcolor() ) { ?>
+                #header h1, #header #desc {
+                        display: none;
+                }
+                <?php } else { ?>
+                #header h1 a, #desc {
+                        color:#<?php header_textcolor() ?>;
+                }
+                <?php } ?>
+        </style>
+<?php
+}
+
+function bp_dtheme_admin_header_style() { ?>
+        <style type="text/css">
+                #headimg {
+                        position: relative;
+                        color: #fff;
+                        background: url(<?php header_image() ?>);
+                        -moz-border-radius-bottomleft: 6px;
+                        -webkit-border-bottom-left-radius: 6px;
+                        -moz-border-radius-bottomright: 6px;
+                        -webkit-border-bottom-right-radius: 6px;
+                        margin-bottom: 20px;
+                        height: 100px;
+                        padding-top: 25px;
+                }
+
+                #headimg h1{
+                        position: absolute;
+                        bottom: 15px;
+                        left: 15px;
+                        width: 44%;
+                        margin: 0;
+                        font-family: Arial, Tahoma, sans-serif;
+                }
+                #headimg h1 a{
+                        color:#<?php header_textcolor() ?>;
+                        text-decoration: none;
+                        border-bottom: none;
+                }
+                #headimg #desc{
+                        color:#<?php header_textcolor() ?>;
+                        font-size:1em;
+                        margin-top:-0.5em;
+                }
+
+                #desc {
+                        display: none;
+                }
+
+                <?php if ( 'blank' == get_header_textcolor() ) { ?>
+                #headimg h1, #headimg #desc {
+                        display: none;
+                }
+                #headimg h1 a, #headimg #desc {
+                        color:#<?php echo HEADER_TEXTCOLOR ?>;
+                }
+                <?php } ?>
+        </style>
+<?php
+}
+add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );
+
</ins><span class="cx"> function bp_dtheme_remove_redundant() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>