[buddypress-trac] [BuddyPress Trac] #5687: Activity Load more button doesn't work for custom non-components scopes

buddypress-trac noreply at wordpress.org
Fri Jun 6 09:13:26 UTC 2014


#5687: Activity Load more button doesn't work for custom non-components scopes
-------------------------------+------------------------------
 Reporter:  slaFFik            |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Activity           |     Version:
 Severity:  major              |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------
Changes (by imath):

 * keywords:   => reporter-feedback


Comment:

 Hi slaFFik,

 Thanks for your feedback, i wonder how you manage to display activities
 for your scope in the Activity directory at first place..

 But let's first start with your scope carrying trouble. Actually in the
 arguments you shared the scope is '''included in the cookie arg''' :
 {{{bp-activity-scope%3Dfavorites}}} so to get it you'll need to parse the
 cookie like it is done at the top (line 476 to 480) of the function
 bp_legacy_theme_ajax_querystring() in /bp-template/bp-legacy/buddypres

 Line 514-519 in {{{bp-activity-template.php}}} are there to set the scope
 for the user's profile tab as there's no ajax when clicking on LI elements
 of the subnav in this part.

 But as i've said in intro, i'm a bit amazed by the fact you are displaying
 activities of your scope.. Because the filter template argument is only
 set for built in scopes :
 see lines 578 to 635 of {{{bp-activity-template.php}}} so at the end
 whatever the scope you are using in your activity directory extra tab.. if
 it's not :
 - 'just-me',
 - 'friends'
 - 'groups'
 - 'favorites'
 - 'mentions'
 then the scope won't be converted into the object argument of the filter
 template arg.

 You can check this by var_dumping the $template_args var after line 671 of
 {{{bp-activity-template.php}}}

 Here's a test i've made in a bp-custom.php file :
 {{{
 function slaffik_li() {
         // scope is js parsed to what is after "activity-" in the LI id.
         ?>
         <li id="activity-slaffik"><a href="#"
 title="testing">Slaffik</a></li>
         <?php
 }
 add_action( 'bp_activity_type_tabs', 'slaffik_li' );
 }}}
 I haven't gone further to edit the activity table to force some items to
 have a component field set to slaffik because even if the scope is carried
 into the {{{bp_has_activities}}} as i've said, it won't be converted into
 {{{'filter' => array( 'object' => 'slaffik' )}}}

 So i'd be very curious to see the code you are using :)

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5687#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list