<?php
/*
Module:       MyArcadePlugin BuddyPress Actions
Author:       Daniel Bakovic
Author URI:   http://myarcadeplugin.com
Version:      1.00
*/


/* Add a new activity stream item for when people change their Profile Picute */


/**
 * Add a new activity stream item on different MyArcadePlugin actions
 * 
 * @global type $RAD7BAEB04AA39BA976C968AE16AD843A
 * @return boolean 
 */
function FB47B3BF4F0C959040E28EF749DB9A5AA($R9FE302BDF914868081913A22F58F9E7E) {
  bp_activity_add( array(
  'user_id'   => $R9FE302BDF914868081913A22F58F9E7E['user_id'],
  'action'    => $R9FE302BDF914868081913A22F58F9E7E['action'],
  'content'   => $R9FE302BDF914868081913A22F58F9E7E['content'],
  'component' => 'profile',
  'type'      => $R9FE302BDF914868081913A22F58F9E7E['type']
 ) );
}


function FBA022456C7BE359AC1B704CD7D65AEAA($RD94C2157798BCCE313068BF1BF25A119) {
  global $wpdb;
  
  if ( !function_exists( 'bp_activity_add' ) ) return false;
  if ( !bp_is_active( 'activity' ) ) return false;
    
  // Get post id
  $REAE2C9BFA83FCD3B65DBE365C23645EB = $wpdb->get_var("SELECT postid FROM ".MYARCADE_GAME_TABLE. " WHERE game_tag = '".$RD94C2157798BCCE313068BF1BF25A119['game_tag']."'");
  
  if ($REAE2C9BFA83FCD3B65DBE365C23645EB) {
    $post = get_post($REAE2C9BFA83FCD3B65DBE365C23645EB);
    $R891698573F68736CE92899C227E546AE = get_permalink($REAE2C9BFA83FCD3B65DBE365C23645EB);    
    $R68F8095AEBF44126A85A3E4C8F110BEA = '<a href="'.$R891698573F68736CE92899C227E546AE.'" title="">'.$post->post_title.'</a>';    
    
    $RD77E61EE257ADA058D18555EEFAB66FA = bp_core_get_userlink( $RD94C2157798BCCE313068BF1BF25A119['user_id'] );
    
    $R157A6826A8BF1F36EBBE3DEC02351744 = sprintf( __( 'I just played %s and got %s points!', MYARCADE_TEXT_DOMAIN), $R68F8095AEBF44126A85A3E4C8F110BEA, $RD94C2157798BCCE313068BF1BF25A119['score'] );
    $RD35A39212FD75E833AEA38F90831B2CB  = sprintf( __( '%s submitted new score', MYARCADE_TEXT_DOMAIN), $RD77E61EE257ADA058D18555EEFAB66FA );
    
    FB47B3BF4F0C959040E28EF749DB9A5AA( array( 'user_id' => $RD94C2157798BCCE313068BF1BF25A119['user_id'], 'content' => $R157A6826A8BF1F36EBBE3DEC02351744, 'action' => $RD35A39212FD75E833AEA38F90831B2CB, 'type' => 'new_score' ));
  }
}
add_action( 'myarcade_new_score', 'FBA022456C7BE359AC1B704CD7D65AEAA' );


function F52E5E151DA4DD70D7272ECB4E9798B90($R68D6A098DF80CD93C21C99FB4D10746B) {
  global $wpdb;
  
  if ( !function_exists( 'bp_activity_add' ) ) return false;
  if ( !bp_is_active( 'activity' ) ) return false;
    
  // Get post id
  $REAE2C9BFA83FCD3B65DBE365C23645EB = $wpdb->get_var("SELECT postid FROM ".MYARCADE_GAME_TABLE. " WHERE game_tag = '".$R68D6A098DF80CD93C21C99FB4D10746B['game_tag']."'");
  
  if ($REAE2C9BFA83FCD3B65DBE365C23645EB) {
    $post = get_post($REAE2C9BFA83FCD3B65DBE365C23645EB);
    $R891698573F68736CE92899C227E546AE = get_permalink($REAE2C9BFA83FCD3B65DBE365C23645EB);    
    $R68F8095AEBF44126A85A3E4C8F110BEA = '<a href="'.$R891698573F68736CE92899C227E546AE.'" title="">'.$post->post_title.'</a>';    
    
    $RD77E61EE257ADA058D18555EEFAB66FA = bp_core_get_userlink( $R68D6A098DF80CD93C21C99FB4D10746B['user_id'] );
    
    $R157A6826A8BF1F36EBBE3DEC02351744 = sprintf( __( 'I just achieved a %s on %s!', MYARCADE_TEXT_DOMAIN), $R68D6A098DF80CD93C21C99FB4D10746B['name'] , $R68F8095AEBF44126A85A3E4C8F110BEA );
    $RD35A39212FD75E833AEA38F90831B2CB  = sprintf( __( '%s submitted new achivement', MYARCADE_TEXT_DOMAIN), $RD77E61EE257ADA058D18555EEFAB66FA );
    
    FB47B3BF4F0C959040E28EF749DB9A5AA( array( 'user_id' => $R68D6A098DF80CD93C21C99FB4D10746B['user_id'], 'content' => $R157A6826A8BF1F36EBBE3DEC02351744, 'action' => $RD35A39212FD75E833AEA38F90831B2CB, 'type' => 'new_achivement' ));
  }
}
add_action( 'myarcade_new_medal', 'F52E5E151DA4DD70D7272ECB4E9798B90' );
?>