Skip to:
Content

BuddyPress.org

Ticket #4527: patchfile.patch

File patchfile.patch, 2.3 KB (added by tiraeth, 13 years ago)

Fixed patch file

Line 
172a73,125
2>  * Makes BuddyPress aware of sites that shouldn't be recordable.
3>  * If $user_id is provided, the developer can restrict site from
4>  * being recordable only to particular users.
5>  *
6>  * @since BuddyPress (1.6.1)
7>  * @param int $blog_id
8>  * @param int|null $user_id
9>  * @uses apply_filters
10>  * @return bool True if blog is recordable, false elsewhere
11>  */
12> function bp_blogs_is_blog_recordable( $blog_id, $user_id = null ) {
13>
14>       $recordable_globally = apply_filters( 'bp_blogs_is_blog_recordable', true, $blog_id );
15>
16>       if ( $user_id )
17>               $recordable_for_user = apply_filters( 'bp_blogs_is_blog_recordable_for_user', $recordable_globally, $blog_id, $user_id );
18>       else
19>               $recordable_for_user = $recordable_globally;
20>
21>       if ( $recordable_for_user )
22>               return true;
23>
24>       return $recordable_globally;
25> }
26>
27> /**
28>  * Makes BuddyPress aware of sites that activities shouldn't be trackable.
29>  * If $user_id is provided, the developer can restrict site from
30>  * being trackable only to particular users.
31>  *
32>  * @since BuddyPress (1.6.1)
33>  * @param int $blog_id
34>  * @param int|null $user_id
35>  * @uses bp_blogs_is_blog_recordable
36>  * @uses apply_filters
37>  * @return bool True if blog is trackable, false elsewhere
38>  */
39> function bp_blogs_is_blog_trackable( $blog_id, $user_id = null ) {
40>
41>       $trackable_globally = apply_filters( 'bp_blogs_is_blog_trackable', bp_blogs_is_blog_recordable( $blog_id, $user_id ), $blog_id );
42>
43>       if ( $user_id )
44>               $trackable_for_user = apply_filters( 'bp_blogs_is_blog_trackable_for_user', $trackable_globally, $blog_id, $user_id );
45>       else
46>               $trackable_for_user = $trackable_globally;
47>
48>       if ( $trackable_for_user )
49>               return $trackable_for_user;
50>
51>       return $trackable_globally;
52> }
53>
54> /**
5585a139,141
56>       if ( !bp_blogs_is_blog_recordable( $blog_id, $user_id ) )
57>               return false;
58>
59106c162
60<       if ( !$is_private && !$no_activity ) {
61---
62>       if ( !$is_private && !$no_activity && bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) {
63157a214,217
64>   // If blog is not trackable, do not record the activity.
65>   if ( !bp_blogs_is_blog_trackable( $blog_id, $user_id ) )
66>     return false;
67>
68264a325,328
69>   // If blog is not trackable, do not record the activity.
70>   if ( !bp_blogs_is_blog_trackable( $blog_id, $user_id ) )
71>     return false;
72>