<!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] [3337] trunk:
Relativizes various URL creation and current_component/
current_action checks to use slugs rather than string literals.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>3337</dd>
<dt>Author</dt> <dd>boonebgorges</dd>
<dt>Date</dt> <dd>2010-11-02 03:01:31 +0000 (Tue, 02 Nov 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Relativizes various URL creation and current_component/current_action checks to use slugs rather than string literals. Fixes #2338</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivitytemplatetagsphp">trunk/bp-activity/bp-activity-templatetags.php</a></li>
<li><a href="#trunkbpactivityphp">trunk/bp-activity.php</a></li>
<li><a href="#trunkbpblogsphp">trunk/bp-blogs.php</a></li>
<li><a href="#trunkbpcorebpcoretemplatetagsphp">trunk/bp-core/bp-core-templatetags.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivitytemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-templatetags.php (3336 => 3337)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-templatetags.php        2010-11-01 23:04:53 UTC (rev 3336)
+++ trunk/bp-activity/bp-activity-templatetags.php        2010-11-02 03:01:31 UTC (rev 3337)
</span><span class="lines">@@ -991,17 +991,19 @@
</span><span class="cx"> function bp_member_activity_feed_link() {
</span><span class="cx">         echo bp_get_member_activity_feed_link();
</span><span class="cx"> }
</span><del>-function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link(); }
</del><ins>+function bp_activities_member_rss_link() {
+        echo bp_get_member_activity_feed_link();
+}
</ins><span class="cx">
</span><span class="cx">         function bp_get_member_activity_feed_link() {
</span><span class="cx">                 global $bp;
</span><span class="cx">
</span><span class="cx">                 if ( $bp->current_component == $bp->profile->slug || 'just-me' == $bp->current_action )
</span><span class="cx">                         $link = $bp->displayed_user->domain . $bp->activity->slug . '/feed/';
</span><del>-                else if ( 'friends' == $bp->current_action )
-                        $link = $bp->displayed_user->domain . $bp->activity->slug . '/friends/feed/';
-                else if ( 'groups' == $bp->current_action )
-                        $link = $bp->displayed_user->domain . $bp->activity->slug . '/groups/feed/';
</del><ins>+                else if ( $bp->friends->slug == $bp->current_action )
+                        $link = $bp->displayed_user->domain . $bp->activity->slug . '/' . $bp->friends->slug . '/feed/';
+                else if ( $bp->groups->slug == $bp->current_action )
+                        $link = $bp->displayed_user->domain . $bp->activity->slug . '/' . $bp->groups->slug . '/feed/';
</ins><span class="cx">                 else if ( 'favorites' == $bp->current_action )
</span><span class="cx">                         $link = $bp->displayed_user->domain . $bp->activity->slug . '/favorites/feed/';
</span><span class="cx">                 else if ( 'mentions' == $bp->current_action )
</span></span></pre></div>
<a id="trunkbpactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity.php (3336 => 3337)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity.php        2010-11-01 23:04:53 UTC (rev 3336)
+++ trunk/bp-activity.php        2010-11-02 03:01:31 UTC (rev 3337)
</span><span class="lines">@@ -427,7 +427,7 @@
</span><span class="cx"> function bp_activity_action_friends_feed() {
</span><span class="cx">         global $bp, $wp_query;
</span><span class="cx">
</span><del>-        if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'friends' || $bp->action_variables[0] != 'feed' )
</del><ins>+        if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->friends->slug || $bp->action_variables[0] != 'feed' )
</ins><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         $wp_query->is_404 = false;
</span><span class="lines">@@ -441,7 +441,7 @@
</span><span class="cx"> function bp_activity_action_my_groups_feed() {
</span><span class="cx">         global $bp, $wp_query;
</span><span class="cx">
</span><del>-        if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'groups' || $bp->action_variables[0] != 'feed' )
</del><ins>+        if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->groups->slug || $bp->action_variables[0] != 'feed' )
</ins><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         $wp_query->is_404 = false;
</span></span></pre></div>
<a id="trunkbpblogsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs.php (3336 => 3337)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs.php        2010-11-01 23:04:53 UTC (rev 3336)
+++ trunk/bp-blogs.php        2010-11-02 03:01:31 UTC (rev 3337)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">         $blogs_link = $bp->loggedin_user->domain . $bp->blogs->slug . '/';
</span><span class="cx">
</span><span class="cx">         /* Set up the component options navigation for Blog */
</span><del>-        if ( 'blogs' == $bp->current_component ) {
</del><ins>+        if ( $bp->blogs->slug == $bp->current_component ) {
</ins><span class="cx">                 if ( bp_is_my_profile() ) {
</span><span class="cx">                         if ( function_exists('xprofile_setup_nav') ) {
</span><span class="cx">                                 $bp->bp_options_title = __('My Blogs', 'buddypress');
</span></span></pre></div>
<a id="trunkbpcorebpcoretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-templatetags.php (3336 => 3337)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-templatetags.php        2010-11-01 23:04:53 UTC (rev 3336)
+++ trunk/bp-core/bp-core-templatetags.php        2010-11-02 03:01:31 UTC (rev 3337)
</span><span class="lines">@@ -1613,7 +1613,7 @@
</span><span class="cx"> function bp_is_user_activity() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        if ( $bp->activity->name == $bp->current_component )
</del><ins>+        if ( $bp->activity->slug == $bp->current_component )
</ins><span class="cx">                 return true;
</span><span class="cx">
</span><span class="cx">         return false;
</span><span class="lines">@@ -1622,7 +1622,7 @@
</span><span class="cx"> function bp_is_user_friends_activity() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        if ( $bp->activity->name == $bp->current_component && 'my-friends' == $bp->current_action )
</del><ins>+        if ( $bp->activity->slug == $bp->current_component && 'my-friends' == $bp->current_action )
</ins><span class="cx">                 return true;
</span><span class="cx">
</span><span class="cx">         return false;
</span><span class="lines">@@ -1667,7 +1667,7 @@
</span><span class="cx"> function bp_is_user_groups() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        if ( $bp->groups->name == $bp->current_component )
</del><ins>+        if ( $bp->groups->slug == $bp->current_component )
</ins><span class="cx">                 return true;
</span><span class="cx">
</span><span class="cx">         return false;
</span><span class="lines">@@ -1794,7 +1794,7 @@
</span><span class="cx"> function bp_is_user_blogs() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        if ( $bp->blogs->name == $bp->current_component )
</del><ins>+        if ( $bp->blogs->slug == $bp->current_component )
</ins><span class="cx">                 return true;
</span><span class="cx">
</span><span class="cx">         return false;
</span><span class="lines">@@ -1803,7 +1803,7 @@
</span><span class="cx"> function bp_is_user_recent_posts() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        if ( $bp->blogs->name == $bp->current_component && 'recent-posts' == $bp->current_action )
</del><ins>+        if ( $bp->blogs->slug == $bp->current_component && 'recent-posts' == $bp->current_action )
</ins><span class="cx">                 return true;
</span><span class="cx">
</span><span class="cx">         return false;
</span><span class="lines">@@ -1812,7 +1812,7 @@
</span><span class="cx"> function bp_is_user_recent_commments() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        if ( $bp->blogs->name == $bp->current_component && 'recent-comments' == $bp->current_action )
</del><ins>+        if ( $bp->blogs->slug == $bp->current_component && 'recent-comments' == $bp->current_action )
</ins><span class="cx">                 return true;
</span><span class="cx">
</span><span class="cx">         return false;
</span></span></pre>
</div>
</div>
</body>
</html>