<!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] [2325] trunk: Fixes #1562 - group forum pagination links.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>2325</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-01-18 10:31:29 +0000 (Mon, 18 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fixes #1562 - group forum pagination links.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcoretemplatetagsphp">trunk/bp-core/bp-core-templatetags.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.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="trunkbpcorebpcoretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-templatetags.php (2324 => 2325)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-templatetags.php        2010-01-18 09:56:04 UTC (rev 2324)
+++ trunk/bp-core/bp-core-templatetags.php        2010-01-18 10:31:29 UTC (rev 2325)
</span><span class="lines">@@ -425,7 +425,7 @@
</span><span class="cx">         foreach( (array) $bp->bp_nav as $nav_item ) {
</span><span class="cx">                 /* If the current component matches the nav item id, then add a highlight CSS class. */
</span><span class="cx">                 if ( $bp->active_components[$bp->current_component] == $nav_item['css_id'] ) {
</span><del>-                        $selected = ' class="current"';
</del><ins>+                        $selected = ' class="current selected"';
</ins><span class="cx">                 } else {
</span><span class="cx">                         $selected = '';
</span><span class="cx">                 }
</span><span class="lines">@@ -439,7 +439,7 @@
</span><span class="cx">                         if ( function_exists('friends_install') ) {
</span><span class="cx">                                 if ( $nav_item['css_id'] == $bp->friends->id ) {
</span><span class="cx">                                         if ( friends_check_friendship( $bp->loggedin_user->id, $bp->displayed_user->id ) )
</span><del>-                                                $selected = ' class="current"';
</del><ins>+                                                $selected = ' class="current selected"';
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -478,7 +478,7 @@
</span><span class="cx">                         continue;
</span><span class="cx">
</span><span class="cx">                 if ( $bp->current_component == $user_nav_item['slug'] )
</span><del>-                        $selected = ' class="current"';
</del><ins>+                        $selected = ' class="current selected"';
</ins><span class="cx">                 else
</span><span class="cx">                         $selected = '';
</span><span class="cx">
</span><span class="lines">@@ -528,7 +528,7 @@
</span><span class="cx">
</span><span class="cx">                         /* If the current action or an action variable matches the nav item id, then add a highlight CSS class. */
</span><span class="cx">                         if ( $subnav_item['slug'] == $bp->current_action ) {
</span><del>-                                $selected = ' class="current"';
</del><ins>+                                $selected = ' class="current selected"';
</ins><span class="cx">                         } else {
</span><span class="cx">                                 $selected = '';
</span><span class="cx">                         }
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2324 => 2325)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2010-01-18 09:56:04 UTC (rev 2324)
+++ trunk/bp-groups.php        2010-01-18 10:31:29 UTC (rev 2325)
</span><span class="lines">@@ -225,29 +225,29 @@
</span><span class="cx">                         bp_core_new_nav_default( array( 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_home', 'subnav_slug' => 'home' ) );
</span><span class="cx">
</span><span class="cx">                         /* Add the "Home" subnav item, as this will always be present */
</span><del>-                        bp_core_new_subnav_item( array( 'name' => __( 'Home', 'buddypress' ), 'slug' => 'home', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_home', 'position' => 10, 'item_css_id' => 'group-home' ) );
</del><ins>+                        bp_core_new_subnav_item( array( 'name' => __( 'Home', 'buddypress' ), 'slug' => 'home', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_home', 'position' => 10, 'item_css_id' => 'home' ) );
</ins><span class="cx">
</span><span class="cx">                         /* If the user is a group mod or more, then show the group admin nav item */
</span><span class="cx">                         if ( $bp->is_item_mod || $bp->is_item_admin )
</span><del>-                                bp_core_new_subnav_item( array( 'name' => __( 'Admin', 'buddypress' ), 'slug' => 'admin', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_admin', 'position' => 20, 'user_has_access' => ( $bp->is_item_admin + (int)$bp->is_item_mod ), 'item_css_id' => 'group-admin' ) );
</del><ins>+                                bp_core_new_subnav_item( array( 'name' => __( 'Admin', 'buddypress' ), 'slug' => 'admin', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_admin', 'position' => 20, 'user_has_access' => ( $bp->is_item_admin + (int)$bp->is_item_mod ), 'item_css_id' => 'admin' ) );
</ins><span class="cx">
</span><span class="cx">                         // If this is a private group, and the user is not a member, show a "Request Membership" nav item.
</span><span class="cx">                         if ( !is_site_admin() && is_user_logged_in() && !$bp->groups->current_group->is_user_member && !groups_check_for_membership_request( $bp->loggedin_user->id, $bp->groups->current_group->id ) && $bp->groups->current_group->status == 'private' )
</span><span class="cx">                                 bp_core_new_subnav_item( array( 'name' => __( 'Request Membership', 'buddypress' ), 'slug' => 'request-membership', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_request_membership', 'position' => 30 ) );
</span><span class="cx">
</span><span class="cx">                         if ( $bp->groups->current_group->enable_forum && function_exists('bp_forums_setup') )
</span><del>-                                bp_core_new_subnav_item( array( 'name' => __( 'Forum', 'buddypress' ), 'slug' => 'forum', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_forum', 'position' => 40, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'group-forum' ) );
</del><ins>+                                bp_core_new_subnav_item( array( 'name' => __( 'Forum', 'buddypress' ), 'slug' => 'forum', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_forum', 'position' => 40, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'forums' ) );
</ins><span class="cx">
</span><span class="cx">                         if ( $bp->groups->current_group->enable_wire && function_exists('bp_wire_install') )
</span><del>-                                bp_core_new_subnav_item( array( 'name' => __( 'Wire', 'buddypress' ), 'slug' => BP_WIRE_SLUG, 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_wire', 'position' => 50, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'group-wire' ) );
</del><ins>+                                bp_core_new_subnav_item( array( 'name' => __( 'Wire', 'buddypress' ), 'slug' => BP_WIRE_SLUG, 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_wire', 'position' => 50, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'wire' ) );
</ins><span class="cx">
</span><del>-                        bp_core_new_subnav_item( array( 'name' => __( 'Members', 'buddypress' ), 'slug' => 'members', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_members', 'position' => 60, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'group-members' ) );
</del><ins>+                        bp_core_new_subnav_item( array( 'name' => __( 'Members', 'buddypress' ), 'slug' => 'members', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_members', 'position' => 60, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'members' ) );
</ins><span class="cx">
</span><span class="cx">                         if ( is_user_logged_in() && groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
</span><span class="cx">                                 if ( function_exists('friends_install') )
</span><del>-                                        bp_core_new_subnav_item( array( 'name' => __( 'Send Invites', 'buddypress' ), 'slug' => 'send-invites', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_invite', 'item_css_id' => 'group-invite', 'position' => 70, 'user_has_access' => $bp->groups->current_group->user_has_access ) );
</del><ins>+                                        bp_core_new_subnav_item( array( 'name' => __( 'Send Invites', 'buddypress' ), 'slug' => 'send-invites', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_invite', 'item_css_id' => 'invite', 'position' => 70, 'user_has_access' => $bp->groups->current_group->user_has_access ) );
</ins><span class="cx">
</span><del>-                                //bp_core_new_subnav_item( array( 'name' => __( 'Leave Group', 'buddypress' ), 'slug' => 'leave-group', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_leave', 'item_css_id' => 'group-leave', 'position' => 110, 'user_has_access' => $bp->groups->current_group->user_has_access ) );
</del><ins>+                                //bp_core_new_subnav_item( array( 'name' => __( 'Leave Group', 'buddypress' ), 'slug' => 'leave-group', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_leave', 'item_css_id' => 'eave', 'position' => 110, 'user_has_access' => $bp->groups->current_group->user_has_access ) );
</ins><span class="cx">                         }
</span><span class="cx">                 }
</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 (2324 => 2325)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/global.js        2010-01-18 09:56:04 UTC (rev 2324)
+++ trunk/bp-themes/bp-default/_inc/global.js        2010-01-18 10:31:29 UTC (rev 2325)
</span><span class="lines">@@ -11,20 +11,20 @@
</span><span class="cx">
</span><span class="cx">         /* Members */
</span><span class="cx">         if ( j('div.members').length )
</span><del>-                bp_filter_request( j.cookie('bp-members-type'), j.cookie('bp-members-filter'), 'members', 'div.members', j.cookie('bp-members-page'), j.cookie('bp-members-search-terms') );
</del><ins>+                bp_filter_request( j.cookie('bp-members-type'), j.cookie('bp-members-filter'), 'members', 'div.members', 1, j.cookie('bp-members-search-terms') );
</ins><span class="cx">
</span><span class="cx">         /* Groups */
</span><span class="cx">         if ( j('div.groups').length )
</span><del>-                bp_filter_request( j.cookie('bp-groups-type'), j.cookie('bp-groups-filter'), 'groups', 'div.groups', j.cookie('bp-groups-page'), j.cookie('bp-groups-search-terms') );
</del><ins>+                bp_filter_request( j.cookie('bp-groups-type'), j.cookie('bp-groups-filter'), 'groups', 'div.groups', 1, j.cookie('bp-groups-search-terms') );
</ins><span class="cx">
</span><span class="cx">         /* Blogs */
</span><span class="cx">         if ( j('div.blogs').length )
</span><del>-                bp_filter_request( j.cookie('bp-blogs-type'), j.cookie('bp-blogs-filter'), 'blogs', 'div.blogs', j.cookie('bp-blogs-page'), j.cookie('bp-blogs-search-terms') );
</del><ins>+                bp_filter_request( j.cookie('bp-blogs-type'), j.cookie('bp-blogs-filter'), 'blogs', 'div.blogs', 1, j.cookie('bp-blogs-search-terms') );
</ins><span class="cx">
</span><span class="cx">         /* Forums */
</span><span class="cx">         if ( j('div.forums').length ) {
</span><span class="cx">                 j('div#new-topic-post').hide();
</span><del>-                bp_filter_request( j.cookie('bp-forums-type'), j.cookie('bp-forums-filter'), 'forums', 'div.forums', j.cookie('bp-forums-page'), j.cookie('bp-forums-search-terms') );
</del><ins>+                bp_filter_request( j.cookie('bp-forums-type'), j.cookie('bp-forums-filter'), 'forums', 'div.forums', 1, j.cookie('bp-forums-search-terms') );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* @message Compose Scrolling */
</span><span class="lines">@@ -230,7 +230,7 @@
</span><span class="cx">                         j(this).removeClass('selected');
</span><span class="cx">                 });
</span><span class="cx">                 j('li#activity-' + type).addClass('selected');
</span><del>-                j('div.item-list-tabs li.selected, div.item-list-tabs li.current').addClass('loading');
</del><ins>+                j('div.item-list-tabs li.selected, div.item-list-tabs li.selected').addClass('loading');
</ins><span class="cx">                 j('#activity-filter-select select option[value=' + filter + ']').attr( 'selected', 'selected' );
</span><span class="cx">
</span><span class="cx">                 /* Reload the activity stream based on the selection */
</span><span class="lines">@@ -257,7 +257,7 @@
</span><span class="cx">                         if ( null != response.feed_url )
</span><span class="cx">                                 j('div#subnav li.feed a').attr('href', response.feed_url);
</span><span class="cx">
</span><del>-                        j('div.item-list-tabs li.selected, div.item-list-tabs li.current').removeClass('loading');
</del><ins>+                        j('div.item-list-tabs li.selected, div.item-list-tabs li.selected').removeClass('loading');
</ins><span class="cx">
</span><span class="cx">                         /* Selectively hide comments */
</span><span class="cx">                         bp_dtheme_hide_comments();
</span><span class="lines">@@ -585,8 +585,8 @@
</span><span class="cx">                 j('div.item-list-tabs li').each( function() {
</span><span class="cx">                         j(this).removeClass('selected');
</span><span class="cx">                 });
</span><del>-                j('div.item-list-tabs li#' + id + '-' + type).addClass('selected');
-                j('div.item-list-tabs li.selected, div.item-list-tabs li.current').addClass('loading');
</del><ins>+                j('div.item-list-tabs li#' + id + '-' + type + ', div.item-list-tabs li.current').addClass('selected');
+                j('div.item-list-tabs li.selected, div.item-list-tabs li.selected').addClass('loading');
</ins><span class="cx">                 j('div.item-list-tabs select option[value=' + filter + ']').attr( 'selected', 'selected' );
</span><span class="cx">
</span><span class="cx">                 j.post( ajaxurl, {
</span><span class="lines">@@ -605,7 +605,7 @@
</span><span class="cx">                                 j(this).html(response);
</span><span class="cx">                                 j(this).fadeIn(100);
</span><span class="cx">                          });
</span><del>-                        j('div.item-list-tabs li.selected, div.item-list-tabs li.current').removeClass('loading');
</del><ins>+                        j('div.item-list-tabs li.selected, div.item-list-tabs li.selected').removeClass('loading');
</ins><span class="cx">                 });
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -613,7 +613,7 @@
</span><span class="cx">         j('div#content').click( function(event) {
</span><span class="cx">                 var target = j(event.target);
</span><span class="cx">
</span><del>-                if ( target.parent().parent().hasClass('pagination') ) {
</del><ins>+                if ( target.parent().parent().hasClass('pagination') && !target.parent().parent().hasClass('no-ajax') ) {
</ins><span class="cx">                         if ( j('div.item-list-tabs li.selected').length )
</span><span class="cx">                                 var el = j('div.item-list-tabs li.selected');
</span><span class="cx">                         else
</span><span class="lines">@@ -621,8 +621,13 @@
</span><span class="cx">
</span><span class="cx">                         var page_number = 1;
</span><span class="cx">                         var css_id = el.attr('id').split( '-' );
</span><del>-                        var object = css_id[0];
</del><span class="cx">
</span><ins>+                        /* Sub nav li ID's are slightly different */
+                        if ( 'sub-nav' == j('div.item-list-tabs').attr('id') )
+                                var object = css_id[2];
+                        else
+                                var object = css_id[0];
+
</ins><span class="cx">                         if ( j(target).hasClass('next') )
</span><span class="cx">                                 var page_number = Number( j('div.pagination span.current').html() ) + 1;
</span><span class="cx">                         else if ( j(target).hasClass('prev') )
</span></span></pre>
</div>
</div>
</body>
</html>