<!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" />
<title>[BuddyPress][5891] trunk: Allow pagination arguments for template loops to be renamed.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/5891">5891</a></dd>
<dt>Author</dt> <dd>djpaul</dd>
<dt>Date</dt> <dd>2012-03-06 07:15:09 +0000 (Tue, 06 Mar 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>Allow pagination arguments for template loops to be renamed. Remove PHP4 constructors. Fixes <a href="http://buddypress.trac.wordpress.org/ticket/3679">#3679</a>, props r-a-y and cnorris23</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivitytemplatephp">trunk/bp-activity/bp-activity-template.php</a></li>
<li><a href="#trunkbpblogsbpblogstemplatephp">trunk/bp-blogs/bp-blogs-template.php</a></li>
<li><a href="#trunkbpforumsbpforumstemplatephp">trunk/bp-forums/bp-forums-template.php</a></li>
<li><a href="#trunkbpgroupsbpgroupstemplatephp">trunk/bp-groups/bp-groups-template.php</a></li>
<li><a href="#trunkbpmembersbpmemberstemplatephp">trunk/bp-members/bp-members-template.php</a></li>
<li><a href="#trunkbpmessagesbpmessagestemplatephp">trunk/bp-messages/bp-messages-template.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivitytemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-template.php (5890 => 5891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-template.php        2012-03-06 06:52:47 UTC (rev 5890)
+++ trunk/bp-activity/bp-activity-template.php        2012-03-06 07:15:09 UTC (rev 5891)
</span><span class="lines">@@ -104,10 +104,10 @@
</span><span class="cx">
</span><span class="cx">         var $full_name;
</span><span class="cx">
</span><del>-        function __construct( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude = false, $in = false, $spam = 'ham_only' ) {
</del><ins>+        function __construct( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude = false, $in = false, $spam = 'ham_only', $page_arg = 'acpage' ) {
</ins><span class="cx">                 global $bp;
</span><span class="cx">
</span><del>-                $this->pag_page = isset( $_REQUEST['acpage'] ) ? intval( $_REQUEST['acpage'] ) : $page;
</del><ins>+                $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
</ins><span class="cx">                 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
</span><span class="cx">
</span><span class="cx">                 // Check if blog/forum replies are disabled
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx">
</span><span class="cx">                 if ( (int) $this->total_activity_count && (int) $this->pag_num ) {
</span><span class="cx">                         $this->pag_links = paginate_links( array(
</span><del>-                                'base' => add_query_arg( 'acpage', '%#%' ),
</del><ins>+                                'base' => add_query_arg( $page_arg, '%#%' ),
</ins><span class="cx">                                 'format' => '',
</span><span class="cx">                                 'total' => ceil( (int) $this->total_activity_count / (int) $this->pag_num ),
</span><span class="cx">                                 'current' => (int) $this->pag_page,
</span><span class="lines">@@ -299,6 +299,8 @@
</span><span class="cx">                 'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide?
</span><span class="cx">                 'spam' => 'ham_only', // Hide spammed items
</span><span class="cx">
</span><ins>+                'page_arg' => 'acpage', // See https://buddypress.trac.wordpress.org/ticket/3679
+
</ins><span class="cx">                 // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions)
</span><span class="cx">                 'scope' => $scope,
</span><span class="cx">
</span><span class="lines">@@ -387,7 +389,7 @@
</span><span class="cx">         if ( !empty( $include ) && ( 'ham_only' == $spam ) )
</span><span class="cx">                 $spam = 'all';
</span><span class="cx">
</span><del>-        $activities_template = new BP_Activity_Template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in, $spam );
</del><ins>+        $activities_template = new BP_Activity_Template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in, $spam, $page_arg );
</ins><span class="cx">
</span><span class="cx">         return apply_filters( 'bp_has_activities', $activities_template->has_activities(), $activities_template );
</span><span class="cx"> }
</span><span class="lines">@@ -896,9 +898,9 @@
</span><span class="cx">                 } else if ( !empty( $activities_template->current_comment->display_name ) ) {
</span><span class="cx">                         $dn_default = $activities_template->current_comment->display_name;
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $alt_default = isset( $dn_default ) ? sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name ) : __( 'Profile picture', 'buddypress' );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $defaults = array(
</span><span class="cx">                         'alt' => $alt_default,
</span><span class="cx">                         'class' => 'avatar',
</span><span class="lines">@@ -992,7 +994,7 @@
</span><span class="cx">                         case 'groups' :
</span><span class="cx">                                 $object = 'group';
</span><span class="cx">                                 $item_id = $activities_template->activity->item_id;
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 if ( empty( $alt ) ) {
</span><span class="cx">                                         $group = groups_get_group( $item_id );
</span><span class="cx">                                         if ( isset( $group->name ) ) {
</span></span></pre></div>
<a id="trunkbpblogsbpblogstemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs/bp-blogs-template.php (5890 => 5891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs/bp-blogs-template.php        2012-03-06 06:52:47 UTC (rev 5890)
+++ trunk/bp-blogs/bp-blogs-template.php        2012-03-06 07:15:09 UTC (rev 5891)
</span><span class="lines">@@ -102,13 +102,9 @@
</span><span class="cx">         var $pag_links;
</span><span class="cx">         var $total_blog_count;
</span><span class="cx">
</span><del>-        function bp_blogs_template( $type, $page, $per_page, $max, $user_id, $search_terms ) {
-                $this->__construct( $type, $page, $per_page, $max, $user_id, $search_terms );
-        }
</del><ins>+        function __construct( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg = 'bpage' ) {
</ins><span class="cx">
</span><del>-        function __construct( $type, $page, $per_page, $max, $user_id, $search_terms ) {
-
-                $this->pag_page = isset( $_REQUEST['bpage'] ) ? intval( $_REQUEST['bpage'] ) : $page;
</del><ins>+                $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
</ins><span class="cx">                 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
</span><span class="cx">
</span><span class="cx">                 if ( isset( $_REQUEST['letter'] ) && '' != $_REQUEST['letter'] )
</span><span class="lines">@@ -135,7 +131,7 @@
</span><span class="cx">
</span><span class="cx">                 if ( (int) $this->total_blog_count && (int) $this->pag_num ) {
</span><span class="cx">                         $this->pag_links = paginate_links( array(
</span><del>-                                'base' => add_query_arg( 'bpage', '%#%' ),
</del><ins>+                                'base' => add_query_arg( $page_arg, '%#%' ),
</ins><span class="cx">                                 'format' => '',
</span><span class="cx">                                 'total' => ceil( (int) $this->total_blog_count / (int) $this->pag_num ),
</span><span class="cx">                                 'current' => (int) $this->pag_page,
</span><span class="lines">@@ -208,7 +204,7 @@
</span><span class="cx">         $user_id = 0;
</span><span class="cx">         $search_terms = null;
</span><span class="cx">
</span><del>-        /* User filtering */
</del><ins>+        // User filtering
</ins><span class="cx">         if ( bp_displayed_user_id() )
</span><span class="cx">                 $user_id = bp_displayed_user_id();
</span><span class="cx">
</span><span class="lines">@@ -218,8 +214,10 @@
</span><span class="cx">                 'per_page' => 20,
</span><span class="cx">                 'max' => false,
</span><span class="cx">
</span><del>-                'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to
-                'search_terms' => $search_terms // Pass search terms to filter on the blog title or description.
</del><ins>+                'page_arg' => 'bpage', // See https://buddypress.trac.wordpress.org/ticket/3679
+
+                'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to
+                'search_terms' => $search_terms // Pass search terms to filter on the blog title or description.
</ins><span class="cx">         );
</span><span class="cx">
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="lines">@@ -238,7 +236,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        $blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms );
</del><ins>+        $blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg );
</ins><span class="cx">         return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), $blogs_template );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -279,7 +277,7 @@
</span><span class="cx"> }
</span><span class="cx">         function bp_get_blog_avatar( $args = '' ) {
</span><span class="cx">                 global $blogs_template;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $defaults = array(
</span><span class="cx">                         'type' => 'full',
</span><span class="cx">                         'width' => false,
</span><span class="lines">@@ -527,7 +525,7 @@
</span><span class="cx">          */
</span><span class="cx">         function bp_blogs_get_subdomain_base() {
</span><span class="cx">                 global $current_site;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 return apply_filters( 'bp_blogs_subdomain_base', preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path );
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpforumsbpforumstemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-template.php (5890 => 5891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-template.php        2012-03-06 06:52:47 UTC (rev 5890)
+++ trunk/bp-forums/bp-forums-template.php        2012-03-06 07:15:09 UTC (rev 5891)
</span><span class="lines">@@ -97,10 +97,6 @@
</span><span class="cx">         var $sort_by;
</span><span class="cx">         var $order;
</span><span class="cx">
</span><del>-        function BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) {
-                $this->__construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset, $number );
-        }
-
</del><span class="cx">         function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) {
</span><span class="cx">                 global $bp;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-template.php (5890 => 5891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-template.php        2012-03-06 06:52:47 UTC (rev 5890)
+++ trunk/bp-groups/bp-groups-template.php        2012-03-06 07:15:09 UTC (rev 5891)
</span><span class="lines">@@ -107,13 +107,9 @@
</span><span class="cx">         var $sort_by;
</span><span class="cx">         var $order;
</span><span class="cx">
</span><del>-        function bp_groups_template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false ) {
-                $this->__construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $include, $populate_extras, $exclude, $show_hidden );
-        }
</del><ins>+        function __construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false, $page_arg = 'grpage' ){
</ins><span class="cx">
</span><del>-        function __construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false ){
-
-                $this->pag_page = isset( $_REQUEST['grpage'] ) ? intval( $_REQUEST['grpage'] ) : $page;
</del><ins>+                $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
</ins><span class="cx">                 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
</span><span class="cx">
</span><span class="cx">                 if ( bp_current_user_can( 'bp_moderate' ) || ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) )
</span><span class="lines">@@ -170,7 +166,7 @@
</span><span class="cx">                 // Build pagination links
</span><span class="cx">                 if ( (int) $this->total_group_count && (int) $this->pag_num ) {
</span><span class="cx">                         $this->pag_links = paginate_links( array(
</span><del>-                                'base' => add_query_arg( array( 'grpage' => '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ),
</del><ins>+                                'base' => add_query_arg( array( $page_arg => '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ),
</ins><span class="cx">                                 'format' => '',
</span><span class="cx">                                 'total' => ceil( (int) $this->total_group_count / (int) $this->pag_num ),
</span><span class="cx">                                 'current' => $this->pag_page,
</span><span class="lines">@@ -265,6 +261,8 @@
</span><span class="cx">                 'max' => false,
</span><span class="cx">                 'show_hidden' => false,
</span><span class="cx">
</span><ins>+                'page_arg' => 'grpage', // See https://buddypress.trac.wordpress.org/ticket/3679
+
</ins><span class="cx">                 'user_id' => $user_id, // Pass a user ID to limit to groups this user has joined
</span><span class="cx">                 'slug' => $slug, // Pass a group slug to only return that group
</span><span class="cx">                 'search_terms' => '', // Pass search terms to return only matching groups
</span><span class="lines">@@ -286,7 +284,7 @@
</span><span class="cx">                         $search_terms = false;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        $groups_template = new BP_Groups_Template( (int) $user_id, $type, (int) $page, (int) $per_page, (int) $max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden );
</del><ins>+        $groups_template = new BP_Groups_Template( (int) $user_id, $type, (int) $page, (int) $per_page, (int) $max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden, $page_arg );
</ins><span class="cx">         return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template );
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpmembersbpmemberstemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-members/bp-members-template.php (5890 => 5891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-members/bp-members-template.php        2012-03-06 06:52:47 UTC (rev 5890)
+++ trunk/bp-members/bp-members-template.php        2012-03-06 07:15:09 UTC (rev 5891)
</span><span class="lines">@@ -169,9 +169,9 @@
</span><span class="cx">         var $pag_links;
</span><span class="cx">         var $total_member_count;
</span><span class="cx">
</span><del>-        function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) {
</del><ins>+        function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg = 'upage' ) {
</ins><span class="cx">
</span><del>-                $this->pag_page = !empty( $_REQUEST['upage'] ) ? intval( $_REQUEST['upage'] ) : (int) $page_number;
</del><ins>+                $this->pag_page = !empty( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : (int) $page_number;
</ins><span class="cx">                 $this->pag_num = !empty( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : (int) $per_page;
</span><span class="cx">                 $this->type = $type;
</span><span class="cx">
</span><span class="lines">@@ -199,7 +199,7 @@
</span><span class="cx">
</span><span class="cx">                 if ( (int) $this->total_member_count && (int) $this->pag_num ) {
</span><span class="cx">                         $this->pag_links = paginate_links( array(
</span><del>-                                'base' => add_query_arg( 'upage', '%#%' ),
</del><ins>+                                'base' => add_query_arg( $page_arg, '%#%' ),
</ins><span class="cx">                                 'format' => '',
</span><span class="cx">                                 'total' => ceil( (int) $this->total_member_count / (int) $this->pag_num ),
</span><span class="cx">                                 'current' => (int) $this->pag_page,
</span><span class="lines">@@ -285,6 +285,8 @@
</span><span class="cx">                 'per_page' => 20,
</span><span class="cx">                 'max' => false,
</span><span class="cx">
</span><ins>+                'page_arg' => 'upage', // See https://buddypress.trac.wordpress.org/ticket/3679
+
</ins><span class="cx">                 'include' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users
</span><span class="cx">                 'exclude' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users
</span><span class="cx">
</span><span class="lines">@@ -316,7 +318,7 @@
</span><span class="cx">         if ( empty( $include ) && bp_is_friends_component() && bp_is_current_action( 'requests' ) )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        $members_template = new BP_Core_Members_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $include, (bool)$populate_extras, $exclude, $meta_key, $meta_value );
</del><ins>+        $members_template = new BP_Core_Members_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $include, (bool)$populate_extras, $exclude, $meta_key, $meta_value, $page_arg );
</ins><span class="cx">         return apply_filters( 'bp_has_members', $members_template->has_members(), $members_template );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -866,9 +868,9 @@
</span><span class="cx">         function bp_user_link() { bp_displayed_user_domain(); } // Deprecated.
</span><span class="cx">
</span><span class="cx"> function bp_displayed_user_id() {
</span><del>-        
</del><ins>+
</ins><span class="cx">         static $id = 0;
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( empty( $id ) ) {
</span><span class="cx">                 global $bp;
</span><span class="cx">                 $id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0;
</span><span class="lines">@@ -880,7 +882,7 @@
</span><span class="cx"> function bp_loggedin_user_id() {
</span><span class="cx">
</span><span class="cx">         static $id = 0;
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( empty( $id ) ) {
</span><span class="cx">                 global $bp;
</span><span class="cx">                 $id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0;
</span></span></pre></div>
<a id="trunkbpmessagesbpmessagestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages/bp-messages-template.php (5890 => 5891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages/bp-messages-template.php        2012-03-06 06:52:47 UTC (rev 5890)
+++ trunk/bp-messages/bp-messages-template.php        2012-03-06 07:15:09 UTC (rev 5891)
</span><span class="lines">@@ -29,19 +29,15 @@
</span><span class="cx">         var $pag_links;
</span><span class="cx">         var $search_terms;
</span><span class="cx">
</span><del>-        function bp_messages_box_template( $user_id, $box, $per_page, $max, $type ) {
-                $this->__construct( $user_id, $box, $per_page, $max, $type );
-        }
-
-        function __construct( $user_id, $box, $per_page, $max, $type, $search_terms ) {
-                $this->pag_page = isset( $_GET['mpage'] ) ? intval( $_GET['mpage'] ) : 1;
</del><ins>+        function __construct( $user_id, $box, $per_page, $max, $type, $search_terms, $page_arg = 'mpage' ) {
+                $this->pag_page = isset( $_GET[$page_arg] ) ? intval( $_GET[$page_arg] ) : 1;
</ins><span class="cx">                 $this->pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page;
</span><span class="cx">
</span><span class="cx">                 $this->user_id = $user_id;
</span><span class="cx">                 $this->box = $box;
</span><span class="cx">                 $this->type = $type;
</span><span class="cx">                 $this->search_terms = $search_terms;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if ( 'notices' == $this->box ) {
</span><span class="cx">                         $this->threads = BP_Messages_Notice::get_notices();
</span><span class="cx">                 } else {
</span><span class="lines">@@ -78,7 +74,7 @@
</span><span class="cx">
</span><span class="cx">                 if ( (int) $this->total_thread_count && (int) $this->pag_num ) {
</span><span class="cx">                         $this->pag_links = paginate_links( array(
</span><del>-                                'base' => add_query_arg( 'mpage', '%#%' ),
</del><ins>+                                'base' => add_query_arg( $page_arg, '%#%' ),
</ins><span class="cx">                                 'format' => '',
</span><span class="cx">                                 'total' => ceil( (int) $this->total_thread_count / (int) $this->pag_num ),
</span><span class="cx">                                 'current' => $this->pag_page,
</span><span class="lines">@@ -175,7 +171,8 @@
</span><span class="cx">                 'per_page' => 10,
</span><span class="cx">                 'max' => false,
</span><span class="cx">                 'type' => 'all',
</span><del>-                'search_terms' => isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : ''
</del><ins>+                'search_terms' => isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '',
+                'page_arg' => 'mpage', // See https://buddypress.trac.wordpress.org/ticket/3679
</ins><span class="cx">         );
</span><span class="cx">
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="lines">@@ -196,7 +193,7 @@
</span><span class="cx">                         $box = 'notices';
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                $messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type, $search_terms );
</del><ins>+                $messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type, $search_terms, $page_arg );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         return apply_filters( 'bp_has_message_threads', $messages_template->has_threads(), $messages_template );
</span><span class="lines">@@ -322,7 +319,7 @@
</span><span class="cx"> }
</span><span class="cx">         function bp_get_message_thread_avatar() {
</span><span class="cx">                 global $messages_template;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array( 'item_id' => $messages_template->thread->last_sender_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $messages_template->thread->last_sender_id ) ) ) ) );
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>