<!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' =&gt; sprintf( __( 'Blogs (%d)', 'buddypress' ), bp_blogs_total_blogs_for_user() ), 'slug' =&gt; $bp-&gt;blogs-&gt;slug, 'position' =&gt; 30, 'screen_function' =&gt; 'bp_blogs_screen_my_blogs', 'default_subnav_slug' =&gt; 'my-blogs', 'item_css_id' =&gt; $bp-&gt;blogs-&gt;id ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' =&gt; sprintf( __( 'Blogs &lt;span&gt;(%d)&lt;/span&gt;', 'buddypress' ), bp_blogs_total_blogs_for_user() ), 'slug' =&gt; $bp-&gt;blogs-&gt;slug, 'position' =&gt; 30, 'screen_function' =&gt; 'bp_blogs_screen_my_blogs', 'default_subnav_slug' =&gt; 'my-blogs', 'item_css_id' =&gt; $bp-&gt;blogs-&gt;id ) );
</ins><span class="cx"> 
</span><span class="cx">         $blogs_link = $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;blogs-&gt;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' =&gt; sprintf( __( 'Friends (%d)', 'buddypress' ), friends_get_total_friend_count() ), 'slug' =&gt; $bp-&gt;friends-&gt;slug, 'position' =&gt; 60, 'screen_function' =&gt; 'friends_screen_my_friends', 'default_subnav_slug' =&gt; 'my-friends', 'item_css_id' =&gt; $bp-&gt;friends-&gt;id ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' =&gt; sprintf( __( 'Friends &lt;span&gt;(%d)&lt;/span&gt;', 'buddypress' ), friends_get_total_friend_count() ), 'slug' =&gt; $bp-&gt;friends-&gt;slug, 'position' =&gt; 60, 'screen_function' =&gt; 'friends_screen_my_friends', 'default_subnav_slug' =&gt; 'my-friends', 'item_css_id' =&gt; $bp-&gt;friends-&gt;id ) );
</ins><span class="cx"> 
</span><span class="cx">         $friends_link = $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;friends-&gt;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-&gt;is_single_item = true;
</span><del>-                $bp-&gt;groups-&gt;current_group = &amp;new BP_Groups_Group( $group_id );
</del><ins>+                $bp-&gt;groups-&gt;current_group = new BP_Groups_Group( $group_id );
</ins><span class="cx"> 
</span><span class="cx">                 /* Using &quot;item&quot; not &quot;group&quot; 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' =&gt; sprintf( __( 'Groups (%d)', 'buddypress' ), groups_total_groups_for_user() ), 'slug' =&gt; $bp-&gt;groups-&gt;slug, 'position' =&gt; 70, 'screen_function' =&gt; 'groups_screen_my_groups', 'default_subnav_slug' =&gt; 'my-groups', 'item_css_id' =&gt; $bp-&gt;groups-&gt;id ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' =&gt; sprintf( __( 'Groups &lt;span&gt;(%d)&lt;/span&gt;', 'buddypress' ), groups_total_groups_for_user() ), 'slug' =&gt; $bp-&gt;groups-&gt;slug, 'position' =&gt; 70, 'screen_function' =&gt; 'groups_screen_my_groups', 'default_subnav_slug' =&gt; 'my-groups', 'item_css_id' =&gt; $bp-&gt;groups-&gt;id ) );
</ins><span class="cx"> 
</span><span class="cx">         $groups_link = $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;groups-&gt;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' =&gt; __( 'My Groups', 'buddypress' ), 'slug' =&gt; 'my-groups', 'parent_url' =&gt; $groups_link, 'parent_slug' =&gt; $bp-&gt;groups-&gt;slug, 'screen_function' =&gt; 'groups_screen_my_groups', 'position' =&gt; 10, 'item_css_id' =&gt; 'groups-my-groups' ) );
</span><del>-        bp_core_new_subnav_item( array( 'name' =&gt; __( 'Invites', 'buddypress' ), 'slug' =&gt; 'invites', 'parent_url' =&gt; $groups_link, 'parent_slug' =&gt; $bp-&gt;groups-&gt;slug, 'screen_function' =&gt; 'groups_screen_group_invites', 'position' =&gt; 30, 'user_has_access' =&gt; bp_is_home() ) );
</del><ins>+        bp_core_new_subnav_item( array( 'name' =&gt; __( 'Invites', 'buddypress' ), 'slug' =&gt; 'invites', 'parent_url' =&gt; $groups_link, 'parent_slug' =&gt; $bp-&gt;groups-&gt;slug, 'screen_function' =&gt; 'groups_screen_group_invites', 'position' =&gt; 30, 'user_has_access' =&gt; bp_is_my_profile() ) );
</ins><span class="cx"> 
</span><span class="cx">         if ( $bp-&gt;current_component == $bp-&gt;groups-&gt;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-&gt;loggedin_user-&gt;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">                 &lt;div class=&quot;activity-meta&quot;&gt;
</span><span class="cx">                         &lt;?php if ( is_user_logged_in() &amp;&amp; bp_activity_can_comment() ) : ?&gt;
</span><del>-                                &lt;a href=&quot;#acomment-&lt;?php bp_activity_id() ?&gt;&quot; class=&quot;acomment-reply&quot; id=&quot;acomment-comment-&lt;?php bp_activity_id() ?&gt;&quot;&gt;&lt;?php _e( 'Comment', 'buddypress' ) ?&gt; (&lt;?php bp_activity_comment_count() ?&gt;)&lt;/a&gt;
</del><ins>+                                &lt;a href=&quot;#acomment-&lt;?php bp_activity_id() ?&gt;&quot; class=&quot;acomment-reply&quot; id=&quot;acomment-comment-&lt;?php bp_activity_id() ?&gt;&quot;&gt;&lt;?php _e( 'Reply', 'buddypress' ) ?&gt; (&lt;?php bp_activity_comment_count() ?&gt;)&lt;/a&gt;
</ins><span class="cx">                         &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span><del>-                        &lt;?php if ( !bp_is_activity_permalink() ) : ?&gt;
-                                &lt;a href=&quot;&lt;?php bp_activity_thread_permalink() ?&gt;&quot; class=&quot;view&quot; title=&quot;&lt;?php _e( 'View Thread', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'View Thread', 'buddypress' ) ?&gt;&lt;/a&gt;
-                        &lt;?php endif; ?&gt;
-
</del><span class="cx">                         &lt;?php if ( is_user_logged_in() ) : ?&gt;
</span><span class="cx">                                 &lt;?php if ( !bp_get_activity_is_favorite() ) : ?&gt;
</span><del>-                                        &lt;a href=&quot;&quot; class=&quot;fav&quot; title=&quot;&lt;?php _e( 'Mark Favorite', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Mark Favorite', 'buddypress' ) ?&gt;&lt;/a&gt;
</del><ins>+                                        &lt;a href=&quot;&quot; class=&quot;fav&quot; title=&quot;&lt;?php _e( 'Mark as Favorite', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Favorite', 'buddypress' ) ?&gt;&lt;/a&gt;
</ins><span class="cx">                                 &lt;?php else : ?&gt;
</span><span class="cx">                                         &lt;a href=&quot;&quot; class=&quot;unfav&quot; title=&quot;&lt;?php _e( 'Remove Favorite', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Remove Favorite', 'buddypress' ) ?&gt;&lt;/a&gt;
</span><span class="cx">                                 &lt;?php endif; ?&gt;
</span><span class="cx">                         &lt;?php endif;?&gt;
</span><ins>+
+                        &lt;?php if ( !bp_is_activity_permalink() ) : ?&gt;
+                                &lt;a href=&quot;&lt;?php bp_activity_thread_permalink() ?&gt;&quot; class=&quot;view&quot; title=&quot;&lt;?php _e( 'View Thread / Permalink', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( '#', 'buddypress' ) ?&gt;&lt;/a&gt;
+                        &lt;?php endif; ?&gt;
</ins><span class="cx">                 &lt;/div&gt;
</span><span class="cx">         &lt;/div&gt;
</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">                                 &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
</span><span class="cx"> 
</span><ins>+                                &lt;?php do_action( 'template_notices' ) ?&gt;
+
</ins><span class="cx">                                 &lt;div class=&quot;item-list-tabs&quot;&gt;
</span><span class="cx">                                         &lt;ul&gt;
</span><span class="cx">                                                 &lt;li class=&quot;selected&quot; id=&quot;activity-all&quot;&gt;&lt;a href=&quot;&lt;?php bp_root_domain() ?&gt;&quot;&gt;&lt;?php printf( __( 'All Members (%s)', 'buddypress' ), bp_get_total_site_member_count() ) ?&gt;&lt;/a&gt;&lt;/li&gt;
</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"> &lt;?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() { ?&gt;
+        &lt;style type=&quot;text/css&quot;&gt;
+                #header{
+                        background-image: url(&lt;?php header_image() ?&gt;);
+                }
+                &lt;?php if ( 'blank' == get_header_textcolor() ) { ?&gt;
+                #header h1, #header #desc {
+                        display: none;
+                }
+                &lt;?php } else { ?&gt;
+                #header h1 a, #desc {
+                        color:#&lt;?php header_textcolor() ?&gt;;
+                }
+                &lt;?php } ?&gt;
+        &lt;/style&gt;
+&lt;?php
+}
+
+function bp_dtheme_admin_header_style() { ?&gt;
+        &lt;style type=&quot;text/css&quot;&gt;
+                #headimg {
+                        position: relative;
+                        color: #fff;
+                        background: url(&lt;?php header_image() ?&gt;);
+                        -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:#&lt;?php header_textcolor() ?&gt;;
+                        text-decoration: none;
+                        border-bottom: none;
+                }
+                #headimg #desc{
+                        color:#&lt;?php header_textcolor() ?&gt;;
+                        font-size:1em;
+                        margin-top:-0.5em;
+                }
+
+                #desc {
+                        display: none;
+                }
+
+                &lt;?php if ( 'blank' == get_header_textcolor() ) { ?&gt;
+                #headimg h1, #headimg #desc {
+                        display: none;
+                }
+                #headimg h1 a, #headimg #desc {
+                        color:#&lt;?php echo HEADER_TEXTCOLOR ?&gt;;
+                }
+                &lt;?php } ?&gt;
+        &lt;/style&gt;
+&lt;?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>