<!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] [3443] trunk: Use WordPress' gravatar settings.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>3443</dd>
<dt>Author</dt> <dd>djpaul</dd>
<dt>Date</dt> <dd>2010-11-18 21:31:44 +0000 (Thu, 18 Nov 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use WordPress' gravatar settings. See #2712.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcoreadminbpcoreadminphp">trunk/bp-core/admin/bp-core-admin.php</a></li>
<li><a href="#trunkbpcorephp">trunk/bp-core.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcoreadminbpcoreadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/admin/bp-core-admin.php (3442 => 3443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-admin.php        2010-11-18 19:48:44 UTC (rev 3442)
+++ trunk/bp-core/admin/bp-core-admin.php        2010-11-18 21:31:44 UTC (rev 3443)
</span><span class="lines">@@ -124,18 +124,6 @@
</span><span class="cx">                                 </tr>
</span><span class="cx">                                 <?php endif; ?>
</span><span class="cx">
</span><del>-                                <tr>
-                                        <th scope="row"><?php _e( 'Default User Avatar', 'buddypress' ) ?></th>
-                                        <td>
-                                                <p><?php _e( 'For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their email address', 'buddypress' ) ?></p>
-
-                                                <label><input name="bp-admin[user-avatar-default]" id="avatar_mystery" value="mystery" type="radio" <?php if ( get_site_option( 'user-avatar-default' ) == 'mystery' ) : ?> checked="checked"<?php endif; ?> /> &nbsp;<img alt="" src="http://www.gravatar.com/avatar/<?php md5( $ud->user_email ) ?>&amp;?s=32&amp;d=<?php echo BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg' ?>&amp;r=PG&amp;forcedefault=1" class="avatar avatar-32" height="32" width="32"> &nbsp;<?php _e( 'Mystery Man', 'buddypress' ) ?></label><br>
-                                                <label><input name="bp-admin[user-avatar-default]" id="avatar_identicon" value="identicon" type="radio" <?php if ( get_site_option( 'user-avatar-default' ) == 'identicon' ) : ?> checked="checked"<?php endif; ?> /> &nbsp;<img alt="" src="http://www.gravatar.com/avatar/<?php md5( $ud->user_email ) ?>?s=32&amp;d=identicon&amp;r=PG&amp;forcedefault=1" class="avatar avatar-32" height="32" width="32"> &nbsp;<?php _e( 'Identicon (Generated)', 'buddypress' ) ?></label><br>
-                                                <label><input name="bp-admin[user-avatar-default]" id="avatar_wavatar" value="wavatar" type="radio" <?php if ( get_site_option( 'user-avatar-default' ) == 'wavatar' ) : ?> checked="checked"<?php endif; ?> /> &nbsp;<img alt="" src="http://www.gravatar.com/avatar/<?php md5( $ud->user_email ) ?>?s=32&amp;d=wavatar&amp;r=PG&amp;forcedefault=1" class="avatar avatar-32" height="32" width="32"> &nbsp;<?php _e( 'Wavatar (Generated)', 'buddypress' ) ?> </label><br>
-                                                <label><input name="bp-admin[user-avatar-default]" id="avatar_monsterid" value="monsterid" type="radio" <?php if ( get_site_option( 'user-avatar-default' ) == 'monsterid' ) : ?> checked="checked"<?php endif; ?> /> &nbsp;<img alt="" src="http://www.gravatar.com/avatar/<?php md5( $ud->user_email ) ?>?s=32&amp;d=monsterid&amp;r=PG&amp;forcedefault=1" class="avatar avatar-32" height="32" width="32"> &nbsp;<?php _e( 'MonsterID (Generated)', 'buddypress' ) ?></label>
-                                        </td>
-                                </tr>
-
</del><span class="cx">                                 <?php do_action( 'bp_core_admin_screen_fields' ) ?>
</span><span class="cx">                         </tbody>
</span><span class="cx">                         </table>
</span></span></pre></div>
<a id="trunkbpcorephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core.php (3442 => 3443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core.php        2010-11-18 19:48:44 UTC (rev 3442)
+++ trunk/bp-core.php        2010-11-18 21:31:44 UTC (rev 3443)
</span><span class="lines">@@ -72,58 +72,58 @@
</span><span class="cx">
</span><span class="cx">         $current_user = wp_get_current_user();
</span><span class="cx">
</span><del>-        /* Get the base database prefix */
</del><ins>+        // Get the base database prefix
</ins><span class="cx">         $bp->table_prefix = bp_core_get_table_prefix();
</span><span class="cx">
</span><del>-        /* The domain for the root of the site where the main blog resides */
</del><ins>+        // The domain for the root of the site where the main blog resides
</ins><span class="cx">         $bp->root_domain = bp_core_get_root_domain();
</span><span class="cx">
</span><del>-        /* The names of the core WordPress pages used to display BuddyPress content */
</del><ins>+        // The names of the core WordPress pages used to display BuddyPress content
</ins><span class="cx">         $bp->pages = $bp_pages;
</span><span class="cx">
</span><del>-        /* Set up the members id and active components entry */
</del><ins>+        // Set up the members id and active components entry
</ins><span class="cx">         $bp->members->id = 'members';
</span><span class="cx">         $bp->members->slug = $bp->pages->members->slug;
</span><span class="cx">         $bp->active_components[$bp->members->slug] = $bp->members->id;
</span><span class="cx">
</span><del>-        /* The user ID of the user who is currently logged in. */
</del><ins>+        // The user ID of the user who is currently logged in.
</ins><span class="cx">         $bp->loggedin_user->id = $current_user->ID;
</span><span class="cx">
</span><del>-        /* The domain for the user currently logged in. eg: http://domain.com/members/andy */
</del><ins>+        // The domain for the user currently logged in. eg: http://domain.com/members/andy
</ins><span class="cx">         $bp->loggedin_user->domain = bp_core_get_user_domain( $bp->loggedin_user->id );
</span><span class="cx">
</span><del>-        /* The core userdata of the user who is currently logged in. */
</del><ins>+        // The core userdata of the user who is currently logged in.
</ins><span class="cx">         $bp->loggedin_user->userdata = bp_core_get_core_userdata( $bp->loggedin_user->id );
</span><span class="cx">
</span><del>-        /* is_super_admin() hits the DB on single WP installs, so we need to get this separately so we can call it in a loop. */
</del><ins>+        // is_super_admin() hits the DB on single WP installs, so we need to get this separately so we can call it in a loop.
</ins><span class="cx">         $bp->loggedin_user->is_super_admin = is_super_admin();
</span><span class="cx">         $bp->loggedin_user->is_site_admin = $bp->loggedin_user->is_super_admin; // deprecated 1.2.6
</span><span class="cx">
</span><del>-        /* The user id of the user currently being viewed, set in /bp-core/bp-core-catchuri.php */
</del><ins>+        // The user id of the user currently being viewed, set in /bp-core/bp-core-catchuri.php
</ins><span class="cx">         $bp->displayed_user->id = $displayed_user_id;
</span><span class="cx">
</span><del>-        /* The domain for the user currently being displayed */
</del><ins>+        // The domain for the user currently being displayed
</ins><span class="cx">         $bp->displayed_user->domain = bp_core_get_user_domain( $bp->displayed_user->id );
</span><span class="cx">
</span><del>-        /* The core userdata of the user who is currently being displayed */
</del><ins>+        // The core userdata of the user who is currently being displayed
</ins><span class="cx">         $bp->displayed_user->userdata = bp_core_get_core_userdata( $bp->displayed_user->id );
</span><span class="cx">
</span><del>-        /* The component being used eg: http://domain.com/members/andy/ [profile] */
</del><ins>+        // The component being used eg: http://domain.com/members/andy/ [profile]
</ins><span class="cx">         $bp->current_component = $current_component; // type: string
</span><span class="cx">
</span><del>-        /* The current action for the component eg: http://domain.com/members/andy/profile/ [edit] */
</del><ins>+        // The current action for the component eg: http://domain.com/members/andy/profile/ [edit]
</ins><span class="cx">         $bp->current_action = $current_action; // type: string
</span><span class="cx">
</span><del>-        /* The action variables for the current action eg: http://domain.com/members/andy/profile/edit/ [group] / [6] */
</del><ins>+        // The action variables for the current action eg: http://domain.com/members/andy/profile/edit/ [group] / [6]
</ins><span class="cx">         $bp->action_variables = $action_variables; // type: array
</span><span class="cx">
</span><del>-        /* Only used where a component has a sub item, e.g. groups: http://domain.com/members/andy/groups/ [my-group] / home - manipulated in the actual component not in catch uri code.*/
</del><ins>+        // Only used where a component has a sub item, e.g. groups: http://domain.com/members/andy/groups/ [my-group] / home - manipulated in the actual component not in catch uri code.
</ins><span class="cx">         $bp->current_item = ''; // type: string
</span><span class="cx">
</span><del>-        /* Used for overriding the 2nd level navigation menu so it can be used to display custom navigation for an item (for example a group) */
</del><ins>+        // Used for overriding the 2nd level navigation menu so it can be used to display custom navigation for an item (for example a group)
</ins><span class="cx">         $bp->is_single_item = false;
</span><span class="cx">
</span><del>-        /* The default component to use if none are set and someone visits: http://domain.com/members/andy */
</del><ins>+        // The default component to use if none are set and someone visits: http://domain.com/members/andy
</ins><span class="cx">         if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) {
</span><span class="cx">                 if ( isset( $bp->pages->activity ) )
</span><span class="cx">                         $bp->default_component = $bp->pages->activity->name;
</span><span class="lines">@@ -133,25 +133,24 @@
</span><span class="cx">                 $bp->default_component = BP_DEFAULT_COMPONENT;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        /* Fetches all of the core database based BuddyPress settings in one foul swoop */
</del><ins>+        // Fetches all of the core database based BuddyPress settings in one foul swoop
</ins><span class="cx">         $bp->site_options = bp_core_get_site_options();
</span><span class="cx">
</span><del>-        /* Sets up the array container for the component navigation rendered by bp_get_nav() */
</del><ins>+        // Sets up the array container for the component navigation rendered by bp_get_nav()
</ins><span class="cx">         $bp->bp_nav = array();
</span><span class="cx">
</span><del>-        /* Sets up the array container for the component options navigation rendered by bp_get_options_nav() */
</del><ins>+        // Sets up the array container for the component options navigation rendered by bp_get_options_nav()
</ins><span class="cx">         $bp->bp_options_nav = array();
</span><span class="cx">
</span><del>-        /* Contains an array of all the active components. The key is the slug, value the internal ID of the component */
</del><ins>+        // Contains an array of all the active components. The key is the slug, value the internal ID of the component
</ins><span class="cx">         $bp->active_components = array();
</span><span class="cx">
</span><del>-        /* Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar */
-        $default_grav = isset( $bp->site_options['user-avatar-default'] ) ? $bp->site_options['user-avatar-default'] : 'wavatar';
-        $bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', $default_grav );
-        $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', 'identicon' );
-        $bp->grav_default->blog = apply_filters( 'bp_blog_gravatar_default', 'identicon' );
</del><ins>+        // Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar
+        $bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', $bp->site_options['avatar_default'] );
+        $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', $bp->grav_default->user );
+        $bp->grav_default->blog = apply_filters( 'bp_blog_gravatar_default', $bp->grav_default->user );
</ins><span class="cx">
</span><del>-        /* Fetch the full name for the logged in and current user */
</del><ins>+        // Fetch the full name for the logged in and current user
</ins><span class="cx">         $bp->loggedin_user->fullname = bp_core_get_user_displayname( $bp->loggedin_user->id );
</span><span class="cx">         $bp->displayed_user->fullname = bp_core_get_user_displayname( $bp->displayed_user->id );
</span><span class="cx">
</span><span class="lines">@@ -161,7 +160,7 @@
</span><span class="cx">          'is_item_admin' would be 1 if they are a group admin, 0 if they are not. */
</span><span class="cx">         $bp->is_item_admin = bp_user_has_access();
</span><span class="cx">
</span><del>-        /* Used to determine if the logged in user is a moderator for the current content. */
</del><ins>+        // Used to determine if the logged in user is a moderator for the current content.
</ins><span class="cx">         $bp->is_item_mod = false;
</span><span class="cx">
</span><span class="cx">         $bp->core->table_name_notifications = $bp->table_prefix . 'bp_notifications';
</span><span class="lines">@@ -1582,8 +1581,8 @@
</span><span class="cx">                 'bb-config-location',
</span><span class="cx">                 'hide-loggedout-adminbar',
</span><span class="cx">
</span><del>-                /* Useful WordPress settings used often */
-                'user-avatar-default',
</del><ins>+                // Useful WordPress settings used often
+                'avatar_default',
</ins><span class="cx">                 'tags_blog_id',
</span><span class="cx">                 'registration',
</span><span class="cx">                 'fileupload_maxk'
</span></span></pre>
</div>
</div>
</body>
</html>