diff --git a/wp-content/plugins/bp-dedication/dedication.php b/wp-content/plugins/bp-dedication/dedication.php index 4665f8c..862a599 100644 --- a/wp-content/plugins/bp-dedication/dedication.php +++ b/wp-content/plugins/bp-dedication/dedication.php @@ -88,15 +88,7 @@ class BP_Dedication extends BP_Component { 'includes/bp-dedication-functions.php', 'includes/bp-dedication-classes.php', 'includes/bp-dedication-ajax.php', - /* 'includes/bp-example-filters.php', - - - 'includes/bp-example-template.php', - - 'includes/bp-example-notifications.php', - 'includes/bp-example-widgets.php', - 'includes/bp-example-cssjs.php', - 'includes/bp-example-ajax.php' */ + 'includes/bp-dedication-notifications.php', ); parent::includes($includes); diff --git a/wp-content/plugins/bp-dedication/includes/bp-dedication-create-dedication.php b/wp-content/plugins/bp-dedication/includes/bp-dedication-create-dedication.php index a129ebb..a4baefd 100644 --- a/wp-content/plugins/bp-dedication/includes/bp-dedication-create-dedication.php +++ b/wp-content/plugins/bp-dedication/includes/bp-dedication-create-dedication.php @@ -128,26 +128,10 @@ function bp_dedication_create_new_dedication() { return false; } - $user_id = $bp->loggedin_user->id; - $user_link = bp_core_get_userlink($user_id); + /*$user_id = $bp->loggedin_user->id; + $user_link = bp_core_get_userlink($user_id);*/ - /* bp_dedication_record_activity(array( - 'type' => 'accepted_terms', - 'action' => apply_filters('bp_dedication_create_new_dedication_activity_action', - sprintf(__('%s sent a new dedication %s!', 'bp-dedication'), $user_link, $link), $user_id, ), - )); */ - - /* See bp_example_reject_terms() for an explanation of deleting activity items */ -// if ( function_exists( 'bp_activity_delete') ) -// bp_activity_delete( array( 'type' => 'rejected_terms', 'user_id' => $bp->loggedin_user->id ) ); - - /* Add a do_action here so other plugins can hook in */ - do_action('bp_dedication_create_new_dedication', $bp->loggedin_user->id); - - /* * * - * You'd want to do something here, like set a flag in the database, or set usermeta. - * just for the sake of the demo we're going to return true. - */ + do_action( 'bp_dedication_create_new_dedication', $post_id, $friend_info->ID, $bp->loggedin_user->id); return true; } diff --git a/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php b/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php new file mode 100644 index 0000000..9cd9cfe --- /dev/null +++ b/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php @@ -0,0 +1,38 @@ +dedications->slug . '/new-dedication/user/' . $from_user_id; + $post_link = get_permalink($post_id); + + /* Set up and send the message */ + $to = $reciever_ud->user_email; + $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s dedicated a song 2 u!', 'bp-dedication' ), stripslashes($sender_name) ); + + $message = sprintf( __( +'%s sent you a dedication! + +To see %s\'s dedication: %s + +--------------------- +', 'bp-dedication' ), $sender_name, $sender_name, $post_link ); + + //$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'bp-example' ), $reciever_settings_link ); + + // Send it! + wp_mail( $to, $subject, $message ); +} +add_action( 'bp_dedication_create_new_dedication', 'bp_dedication_send_dedication_notification', 10, 3 ); + +?> diff --git a/wp-content/plugins/bp-dedication/includes/bp-dedication-screens.php b/wp-content/plugins/bp-dedication/includes/bp-dedication-screens.php index df5c60f..44640c3 100644 --- a/wp-content/plugins/bp-dedication/includes/bp-dedication-screens.php +++ b/wp-content/plugins/bp-dedication/includes/bp-dedication-screens.php @@ -25,9 +25,6 @@ function bp_dedication_index() { } function bp_dedication_index_title() { - ?> -
' + value);
alert(data);
- }
+ }*/
var options = {
minLength: 1,
@@ -32,6 +56,15 @@ jQuery(document).ready(function(){
j("#dedicate_to_input").change(function(){
if(j('#dedicate_to_input').val() == '') {
+ j('#friend_ids').val('');
+ j('#friend_email').val('');
+ }
+
+ if(j('#dedicate_to_input').val().indexOf('@', 0) != -1 && j('#dedicate_to_input').val().indexOf('.', 0) != -1) {
+ j('#friend_email').val(j('#dedicate_to_input').val());
+ j('#friend_ids').val(',-1');
+ } else {
+ j('#friend_email').val('');
j('#friend_ids').val('');
}
});
@@ -45,11 +78,11 @@ jQuery(document).ready(function(){
// using jYoutube jQuery plugin
url = j.jYoutube(j('#video_url').val());
title = getYouTubeInfo(j('#video_url').val(),
- function(artist, song){
- j('#artist_name').val(artist);
- j('#song_name').val(song);
+ function(artist, song){
+ j('#artist_name').val(artist);
+ j('#song_name').val(song);
- });
+ });
// Now append this image to