Changeset 2381 for trunk/bp-groups.php
- Timestamp:
- 01/20/2010 04:21:20 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-groups.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups.php
r2352 r2381 306 306 307 307 groups_record_activity( array( 308 'content' => apply_filters( 'groups_activity_accepted_invite', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . attribute_escape( $group->name ) . '</a>' ), $bp->loggedin_user->id, &$group ), 309 'primary_link' => apply_filters( 'groups_activity_accepted_invite_primary_link', bp_get_group_permalink( $group ), &$group ), 310 'component_action' => 'joined_group', 308 'action' => apply_filters( 'groups_activity_accepted_invite_action', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . attribute_escape( $group->name ) . '</a>' ), $bp->loggedin_user->id, &$group ), 309 'type' => 'joined_group', 311 310 'item_id' => $group->id 312 311 ) ); … … 1155 1154 /* Once we compelete all steps, record the group creation in the activity stream. */ 1156 1155 groups_record_activity( array( 1157 'content' => apply_filters( 'groups_activity_created_group', sprintf( __( '%s created the group %s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ) ), 1158 'primary_link' => apply_filters( 'groups_activity_created_group_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ), 1159 'component_action' => 'created_group', 1156 'action' => apply_filters( 'groups_activity_created_group_action', sprintf( __( '%s created the group %s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ) ), 1157 'type' => 'created_group', 1160 1158 'item_id' => $bp->groups->new_group_id 1161 1159 ) ); … … 1321 1319 $defaults = array( 1322 1320 'user_id' => $bp->loggedin_user->id, 1323 'content' => false, 1324 'primary_link' => false, 1325 'component_name' => $bp->groups->id, 1326 'component_action' => false, 1321 'action' => '', 1322 'content' => '', 1323 'primary_link' => '', 1324 'component' => $bp->groups->id, 1325 'type' => false, 1327 1326 'item_id' => false, 1328 1327 'secondary_item_id' => false, … … 1334 1333 extract( $r, EXTR_SKIP ); 1335 1334 1336 return bp_activity_add( array( 'user_id' => $user_id, ' content' => $content, 'primary_link' => $primary_link, 'component_name' => $component_name, 'component_action' => $component_action, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );1335 return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 1337 1336 } 1338 1337 … … 1602 1601 /* Delete all group activity from activity streams */ 1603 1602 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) { 1604 bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component _name' => $bp->groups->id ) );1603 bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component' => $bp->groups->id ) ); 1605 1604 } 1606 1605 … … 1702 1701 /* Record this in activity streams */ 1703 1702 groups_record_activity( array( 1704 'content' => apply_filters( 'groups_activity_joined_group', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ) ), 1705 'primary_link' => apply_filters( 'groups_activity_joined_group_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ), 1706 'component_action' => 'joined_group', 1703 'action' => apply_filters( 'groups_activity_joined_group', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ) ), 1704 'type' => 'joined_group', 1707 1705 'item_id' => $group_id 1708 1706 ) ); … … 1894 1892 1895 1893 /* Record this in activity streams */ 1896 $activity_ content= sprintf( __( '%s posted an update in the group %s:', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );1897 $activity_content .= '<div class="activity-inner">' . $content . '</div>';1894 $activity_action = sprintf( __( '%s posted an update in the group %s:', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 1895 $activity_content = '<div class="activity-inner">' . $content . '</div>'; 1898 1896 1899 1897 $activity_id = groups_record_activity( array( 1900 1898 'user_id' => $user_id, 1899 'action' => apply_filters( 'groups_activity_new_update_action', $activity_action ), 1901 1900 'content' => apply_filters( 'groups_activity_new_update_content', $activity_content ), 1902 'primary_link' => apply_filters( 'groups_activity_new_update_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ), 1903 'component_action' => 'activity_update', 1901 'type' => 'activity_update', 1904 1902 'item_id' => $bp->groups->current_group->id 1905 1903 ) ); … … 1941 1939 $topic = bp_forums_get_topic_details( $topic_id ); 1942 1940 1943 $activity_ content= sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );1944 $activity_content .= '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>';1941 $activity_action = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 1942 $activity_content = '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>'; 1945 1943 1946 1944 /* Record this in activity streams */ 1947 1945 groups_record_activity( array( 1948 'content' => apply_filters( 'groups_activity_new_forum_post', $activity_content, $post_text, &$topic, &$forum_post ), 1946 'action' => apply_filters( 'groups_activity_new_forum_post_action', $activity_action, $post_text, &$topic, &$forum_post ), 1947 'content' => apply_filters( 'groups_activity_new_forum_post_content', $activity_content, $post_text, &$topic, &$forum_post ), 1949 1948 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ), 1950 ' component_action' => 'new_forum_post',1949 'type' => 'new_forum_post', 1951 1950 'item_id' => $bp->groups->current_group->id, 1952 1951 'secondary_item_id' => $forum_post … … 1975 1974 $topic = bp_forums_get_topic_details( $topic_id ); 1976 1975 1977 $activity_ content= sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );1978 $activity_content .= '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>';1976 $activity_action = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 1977 $activity_content = '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>'; 1979 1978 1980 1979 /* Record this in activity streams */ 1981 1980 groups_record_activity( array( 1982 'content' => apply_filters( 'groups_activity_new_forum_topic', $activity_content, $topic_text, &$topic ), 1981 'action' => apply_filters( 'groups_activity_new_forum_topic_action', $activity_action, $topic_text, &$topic ), 1982 'content' => apply_filters( 'groups_activity_new_forum_topic_content', $activity_content, $topic_text, &$topic ), 1983 1983 'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ), 1984 ' component_action' => 'new_forum_topic',1984 'type' => 'new_forum_topic', 1985 1985 'item_id' => $bp->groups->current_group->id, 1986 1986 'secondary_item_id' => $topic->topic_id … … 2004 2004 /* Update the activity stream item */ 2005 2005 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) 2006 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component _name' => $bp->groups->id, 'component_action' => 'new_forum_topic' ) );2007 2008 $activity_ content= sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );2009 $activity_content .= '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>';2006 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) ); 2007 2008 $activity_action = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 2009 $activity_content = '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>'; 2010 2010 2011 2011 /* Record this in activity streams */ 2012 2012 groups_record_activity( array( 2013 'content' => apply_filters( 'groups_activity_new_forum_topic', $activity_content, $topic_text, &$topic ), 2013 'action' => apply_filters( 'groups_activity_new_forum_topic_action', $activity_action, $topic_text, &$topic ), 2014 'content' => apply_filters( 'groups_activity_new_forum_topic_content', $activity_content, $topic_text, &$topic ), 2014 2015 'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ), 2015 ' component_action' => 'new_forum_topic',2016 'type' => 'new_forum_topic', 2016 2017 'item_id' => (int)$bp->groups->current_group->id, 2017 2018 'user_id' => (int)$topic->topic_poster, … … 2041 2042 /* Update the activity stream item */ 2042 2043 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) 2043 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component _name' => $bp->groups->id, 'component_action' => 'new_forum_post' ) );2044 2045 $activity_ content= sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );2046 $activity_content .= '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>';2044 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) ); 2045 2046 $activity_action = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 2047 $activity_content = '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>'; 2047 2048 2048 2049 /* Record this in activity streams */ 2049 2050 groups_record_activity( array( 2050 'content' => apply_filters( 'groups_activity_new_forum_post', $activity_content, $post_text, &$topic, &$forum_post ), 2051 'action' => apply_filters( 'groups_activity_new_forum_post_action', $activity_action, $post_text, &$topic, &$forum_post ), 2052 'content' => apply_filters( 'groups_activity_new_forum_post_content', $activity_content, $post_text, &$topic, &$forum_post ), 2051 2053 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ), 2052 ' component_action' => 'new_forum_post',2054 'type' => 'new_forum_post', 2053 2055 'item_id' => (int)$bp->groups->current_group->id, 2054 2056 'user_id' => (int)$post->poster_id, … … 2071 2073 /* Delete the activity stream item */ 2072 2074 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) { 2073 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component _name' => $bp->groups->id, 'component_action' => 'new_forum_topic' ) );2074 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component _name' => $bp->groups->id, 'component_action' => 'new_forum_post' ) );2075 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) ); 2076 bp_activity_delete_by_item_id( array( 'item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) ); 2075 2077 } 2076 2078 … … 2089 2091 /* Delete the activity stream item */ 2090 2092 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) { 2091 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component _name' => $bp->groups->id, 'component_action' => 'new_forum_post' ) );2093 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) ); 2092 2094 } 2093 2095 … … 2344 2346 2345 2347 groups_record_activity( array( 2346 'content' => apply_filters( 'groups_activity_membership_accepted', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . attribute_escape( $group->name ) . '</a>' ), $user_id, &$group ), 2347 'primary_link' => apply_filters( 'groups_activity_membership_accepted_primary_link', bp_get_group_permalink( $group ), &$group ), 2348 'component_action' => 'joined_group', 2348 'action' => apply_filters( 'groups_activity_membership_accepted_action', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . attribute_escape( $group->name ) . '</a>' ), $user_id, &$group ), 2349 'type' => 'joined_group', 2349 2350 'item_id' => $group->id, 2350 2351 'user_id' => $user_id
Note: See TracChangeset
for help on using the changeset viewer.