<!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] [2559] trunk: Remove redundant querystring cookie.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>2559</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-02-03 12:48:39 +0000 (Wed, 03 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove redundant querystring cookie.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivitytemplatetagsphp">trunk/bp-activity/bp-activity-templatetags.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incajaxphp">trunk/bp-themes/bp-default/_inc/ajax.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incglobaljs">trunk/bp-themes/bp-default/_inc/global.js</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 (2558 => 2559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-templatetags.php        2010-02-03 11:32:07 UTC (rev 2558)
+++ trunk/bp-activity/bp-activity-templatetags.php        2010-02-03 12:48:39 UTC (rev 2559)
</span><span class="lines">@@ -180,6 +180,9 @@
</span><span class="cx">         if ( !empty( $bp->groups->current_group ) ) {
</span><span class="cx">                 $object = $bp->groups->id;
</span><span class="cx">                 $primary_id = $bp->groups->current_group->id;
</span><ins>+
+                if ( 'public' != $bp->groups->current_group->status && groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
+                        $show_hidden = true;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* Support for permalinks on single item pages: /groups/my-group/activity/124/ */
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/ajax.php (2558 => 2559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2010-02-03 11:32:07 UTC (rev 2558)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2010-02-03 12:48:39 UTC (rev 2559)
</span><span class="lines">@@ -177,73 +177,71 @@
</span><span class="cx"> add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity' );
</span><span class="cx"> add_action( 'wp_ajax_delete_activity', 'bp_dtheme_delete_activity' );
</span><span class="cx">
</span><del>-function bp_dtheme_activity_loop( $scope = false, $filter = false, $query_string = false, $per_page = 20, $page = 1 ) {
</del><ins>+function bp_dtheme_activity_loop( $scope = false, $filter = false, $per_page = 20, $page = 1 ) {
</ins><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        if ( !$query_string ) {
-                /* If we are on a profile page we only want to show that users activity */
-                if ( $bp->displayed_user->id ) {
-                        $query_string = 'user_id=' . $bp->displayed_user->id;
-                } else {
-                        if ( !empty( $bp->groups->current_group ) )
-                                $scope = 'all';
</del><ins>+        /* If we are on a profile page we only want to show that users activity */
+        if ( $bp->displayed_user->id ) {
+                $query_string = 'user_id=' . $bp->displayed_user->id;
+        } else {
+                if ( !empty( $bp->groups->current_group ) )
+                        $scope = 'all';
</ins><span class="cx">
</span><del>-                        $feed_url = site_url( BP_ACTIVITY_SLUG . '/feed/' );
</del><ins>+                $feed_url = site_url( BP_ACTIVITY_SLUG . '/feed/' );
</ins><span class="cx">
</span><del>-                        switch ( $scope ) {
-                                case 'friends':
-                                        $friend_ids = implode( ',', friends_get_friend_user_ids( $bp->loggedin_user->id ) );
-                                        $query_string = 'user_id=' . $friend_ids;
-                                        $feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/friends/feed/';
-                                        break;
-                                case 'groups':
-                                        $groups = groups_get_user_groups( $bp->loggedin_user->id );
-                                        $group_ids = implode( ',', $groups['groups'] );
-                                        $query_string = 'object=groups&primary_id=' . $group_ids . '&show_hidden=1';
-                                        $feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/groups/feed/';
-                                        break;
-                                case 'favorites':
-                                        $favs = bp_activity_get_user_favorites( $bp->loggedin_user->id );
</del><ins>+                switch ( $scope ) {
+                        case 'friends':
+                                $friend_ids = implode( ',', friends_get_friend_user_ids( $bp->loggedin_user->id ) );
+                                $query_string = 'user_id=' . $friend_ids;
+                                $feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/friends/feed/';
+                                break;
+                        case 'groups':
+                                $groups = groups_get_user_groups( $bp->loggedin_user->id );
+                                $group_ids = implode( ',', $groups['groups'] );
+                                $query_string = 'object=groups&primary_id=' . $group_ids . '&show_hidden=1';
+                                $feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/groups/feed/';
+                                break;
+                        case 'favorites':
+                                $favs = bp_activity_get_user_favorites( $bp->loggedin_user->id );
</ins><span class="cx">
</span><del>-                                        if ( empty( $favs ) )
-                                                $favorite_ids = false;
</del><ins>+                                if ( empty( $favs ) )
+                                        $favorite_ids = false;
</ins><span class="cx">
</span><del>-                                        $favorite_ids = implode( ',', (array)$favs );
-                                        $query_string = 'include=' . $favorite_ids;
-                                        $feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/favorites/feed/';
-                                        break;
-                                case 'mentions':
-                                        $query_string = 'show_hidden=1&search_terms=@' . bp_core_get_username( $bp->loggedin_user->id, $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login );
-                                        $feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/mentions/feed/';
</del><ins>+                                $favorite_ids = implode( ',', (array)$favs );
+                                $query_string = 'include=' . $favorite_ids;
+                                $feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/favorites/feed/';
+                                break;
+                        case 'mentions':
+                                $query_string = 'show_hidden=1&search_terms=@' . bp_core_get_username( $bp->loggedin_user->id, $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login );
+                                $feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/mentions/feed/';
</ins><span class="cx">
</span><del>-                                        /* Reset the number of new @ mentions for the user */
-                                        delete_usermeta( $bp->loggedin_user->id, 'bp_new_mention_count' );
-                                        break;
-                        }
</del><ins>+                                /* Reset the number of new @ mentions for the user */
+                                delete_usermeta( $bp->loggedin_user->id, 'bp_new_mention_count' );
+                                break;
</ins><span class="cx">                 }
</span><ins>+        }
</ins><span class="cx">
</span><del>-                /* Build the filter */
-                if ( $filter && $filter != '-1' )
-                        $query_string .= '&action=' . $filter;
</del><ins>+        /* Build the filter */
+        if ( $filter && $filter != '-1' )
+                $query_string .= '&action=' . $filter;
</ins><span class="cx">
</span><del>-                /* If we are viewing a group then filter the activity just for this group */
-                if ( !empty( $bp->groups->current_group ) ) {
-                        $query_string .= '&object=' . $bp->groups->id . '&primary_id=' . $bp->groups->current_group->id;
</del><ins>+        /* If we are viewing a group then filter the activity just for this group */
+        if ( !empty( $bp->groups->current_group ) ) {
+                $query_string .= '&object=' . $bp->groups->id . '&primary_id=' . $bp->groups->current_group->id;
</ins><span class="cx">
</span><del>-                        /* If we're viewing a non-private group and the user is a member, show the hidden activity for the group */
-                        if ( 'public' != $bp->groups->current_group->status && groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
-                                $query_string .= '&show_hidden=1';
-                }
</del><ins>+                /* If we're viewing a non-private group and the user is a member, show the hidden activity for the group */
+                if ( 'public' != $bp->groups->current_group->status && groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
+                        $query_string .= '&show_hidden=1';
+        }
</ins><span class="cx">
</span><del>-                /* Add the per_page param */
-                $query_string .= '&per_page=' . $per_page;
</del><ins>+        /* Add the per_page param */
+        $query_string .= '&per_page=' . $per_page;
</ins><span class="cx">
</span><del>-                /* Add the comments param */
-                if ( $bp->displayed_user->id || 'mentions' == $scope )
-                        $query_string .= '&display_comments=stream';
-                else
-                        $query_string .= '&display_comments=threaded';
-        }
</del><ins>+        /* Add the comments param */
+        if ( $bp->displayed_user->id || 'mentions' == $scope )
+                $query_string .= '&display_comments=stream';
+        else
+                $query_string .= '&display_comments=threaded';
</ins><span class="cx">
</span><span class="cx">         /* Add the new page param */
</span><span class="cx">         $args = explode( '&', trim( $query_string ) );
</span><span class="lines">@@ -272,7 +270,7 @@
</span><span class="cx"> add_action( 'wp_ajax_activity_widget_filter', 'bp_dtheme_ajax_widget_filter' );
</span><span class="cx">
</span><span class="cx"> function bp_dtheme_ajax_load_older_updates() {
</span><del>-        bp_dtheme_activity_loop( false, false, $_POST['query_string'], 20, $_POST['page'] );
</del><ins>+        bp_dtheme_activity_loop( false, false, 20, $_POST['page'] );
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_activity_get_older_updates', 'bp_dtheme_ajax_load_older_updates' );
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incglobaljs"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/global.js (2558 => 2559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/global.js        2010-02-03 11:32:07 UTC (rev 2558)
+++ trunk/bp-themes/bp-default/_inc/global.js        2010-02-03 12:48:39 UTC (rev 2559)
</span><span class="lines">@@ -107,7 +107,6 @@
</span><span class="cx">
</span><span class="cx">                 /* Reset the page */
</span><span class="cx">                 j.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );
</span><del>-                j.cookie( 'bp-activity-querystring', null, {path: '/'} );
</del><span class="cx">
</span><span class="cx">                 /* Activity Stream Tabs */
</span><span class="cx">                 var scope = target.attr('id').substr( 9, target.attr('id').length );
</span><span class="lines">@@ -231,16 +230,12 @@
</span><span class="cx">                         j.post( ajaxurl, {
</span><span class="cx">                                 action: 'activity_get_older_updates',
</span><span class="cx">                                 'cookie': encodeURIComponent(document.cookie),
</span><del>-                                'query_string': j.cookie('bp-activity-querystring'),
</del><span class="cx">                                 'page': oldest_page
</span><span class="cx">                         },
</span><span class="cx">                         function(response)
</span><span class="cx">                         {
</span><span class="cx">                                 j("li.load-more").removeClass('loading');
</span><del>-
-                                j.cookie( 'bp-activity-querystring', response.query_string, {path: '/'} );
</del><span class="cx">                                 j.cookie( 'bp-activity-oldestpage', oldest_page, {path: '/'} );
</span><del>-
</del><span class="cx">                                 j("ul.activity-list").append(response.contents);
</span><span class="cx">
</span><span class="cx">                                 target.parent().hide();
</span><span class="lines">@@ -1009,7 +1004,7 @@
</span><span class="cx">         j('a.logout').click( function() {
</span><span class="cx">                 j.cookie('bp-activity-scope', null, {path: '/'});
</span><span class="cx">                 j.cookie('bp-activity-filter', null, {path: '/'});
</span><del>-                j.cookie('bp-activity-querystring', null, {path: '/'});
</del><ins>+                j.cookie('bp-activity-oldestpage', null, {path: '/'});
</ins><span class="cx">
</span><span class="cx">                 var objects = [ 'members', 'groups', 'blogs', 'forums' ];
</span><span class="cx">                 j(objects).each( function(i) {
</span><span class="lines">@@ -1026,7 +1021,6 @@
</span><span class="cx"> function bp_init_activity() {
</span><span class="cx">         /* Reset the page */
</span><span class="cx">         j.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );
</span><del>-        j.cookie( 'bp-activity-querystring', null, {path: '/'} );
</del><span class="cx">
</span><span class="cx">         if ( null != j.cookie('bp-activity-filter') && j('#activity-filter-select').length )
</span><span class="cx">                 j('#activity-filter-select select option[value=' + j.cookie('bp-activity-filter') + ']').attr( 'selected', 'selected' );
</span><span class="lines">@@ -1153,7 +1147,6 @@
</span><span class="cx">         function(response)
</span><span class="cx">         {
</span><span class="cx">                 j('.widget_bp_activity_widget h2 span.ajax-loader').hide();
</span><del>-                j.cookie( 'bp-activity-querystring', response.query_string, {path: '/'} );
</del><span class="cx">
</span><span class="cx">                 j('div.activity').fadeOut( 100, function() {
</span><span class="cx">                         j(this).html(response.contents);
</span></span></pre>
</div>
</div>
</body>
</html>