$body .= "<p>".sprintf(__("Your %s request to %s has been accepted", WPS_TEXT_DOMAIN), get_option(WPS_OPTIONS_PREFIX.'_alt_friend'), $current_user->display_name)."</p>"; $profile_url = __wps__get_url('profile'); $profile_url .= __wps__string_query($profile_url)."uid=".$current_user->ID."&view=friends"; $body .= "<p>".__("Go to", WPS_TEXT_DOMAIN)." <a href='".$profile_url."'>".get_bloginfo('name')."</a>...</p>"; __wps__sendmail($friend_to_email, sprintf(__("%s request accepted", WPS_TEXT_DOMAIN), get_option(WPS_OPTIONS_PREFIX.'_alt_friend')), $body); // Tell friends if (!get_option(WPS_OPTIONS_PREFIX.'_wps_lite') && __wps__is_plus()) { $userdata = get_userdata($friend_to); $profile_url = __wps__get_url('profile'); $profile_url .= __wps__string_query($profile_url); $post = __('Has made friends with', WPS_TEXT_DOMAIN).' <a href="'.$profile_url."uid=".$current_user->ID.'">'.$current_user->display_name.'</a>'; $post = '<br /><div style="float:left;">'.get_avatar($current_user->ID, 32).'</div>'.$post; __wps__add_activity_comment($friend_to, $userdata->display_name, $friend_to, $post, 'friend'); } // Hook for further actions do_action('symposium_friend_request_accepted_hook', $friend_to, $current_user->ID); } echo $friend_to; } else { echo "NOT LOGGED IN"; } exit; }
function add_to_create_activity_feed($aid) { global $wpdb, $current_user; // Get name of album $sql = "SELECT name FROM ".$wpdb->base_prefix."symposium_gallery WHERE gid = %d"; $name = $wpdb->get_var($wpdb->prepare($sql, $aid)); // Work out message $msg = __("Added to", WPS_TEXT_DOMAIN).' '.$name.'[]'.$aid.'[]added'; // First remove any older messages to avoid duplication that mention this album $sql = "DELETE FROM ".$wpdb->base_prefix."symposium_comments WHERE subject_uid = ".$current_user->ID." AND author_uid = ".$current_user->ID." AND comment LIKE '%".$name."%' AND type = 'gallery'"; $wpdb->query($sql); // Now add to activity feed __wps__add_activity_comment($current_user->ID, $current_user->display_name, $current_user->ID, $msg, 'gallery'); }