Created
July 6, 2011 08:55
-
-
Save sbrajesh/1066864 to your computer and use it in GitHub Desktop.
Create activity entry on profile background upload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action("bppg_background_uploaded","bppg_record_activity"); | |
function bppg_record_activity( $bg_image ) { | |
global $bp; | |
if ( !function_exists( 'bp_activity_add' ) ) | |
return false; | |
$r = array( | |
'user_id' => $bp->loggedin_user->id, | |
'content' =>false , | |
'action'=>sprintf("%s changed their profile background",bp_core_get_userlink( $bp->loggedin_user->id )), | |
'primary_link' => bp_core_get_userlink( $bp->loggedin_user->id ), | |
'component_name' => $bp->profile->id, | |
'component_action' =>"change_background", | |
'item_id' => $bp->loggedin_user->id, | |
'secondary_item_id' => false, | |
'recorded_time' => gmdate( "Y-m-d H:i:s" ), | |
'hide_sitewide' => false | |
); | |
extract( $r, EXTR_SKIP ); | |
return bp_activity_add( array( 'user_id' => $user_id, 'content' => $content,'action'=>$action, '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 ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment