diff --git a/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php b/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php index d2e982c..1b99afe 100644 --- a/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php +++ b/wp-content/plugins/bp-dedication/includes/bp-dedication-notifications.php @@ -34,23 +34,28 @@ function bp_dedication_send_dedication_notification( $post_id, $to_user_email, $ $post_link = add_query_arg('y', '1', $post_link); } - //$post_link = bp_dedication_getTinyUrl($post_link); - /* Set up and send the message */ - $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s has dedicated a song 2u!', 'bp-dedication' ), stripslashes($sender_name) ); - - $message = sprintf( __( -'%s (%s) has sent you a dedication! - -To see %s\'s dedication: %s - ---------------------- -', 'bp-dedication' ), $sender_name, $sender_username, $sender_username, $post_link ); - - //$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'bp-example' ), $reciever_settings_link ); - + $subject = get_blog_option( 1, 'blogname' ) . '. ' . sprintf( __( '%s has dedicated a song 2u', 'bp-dedication' ), stripslashes($sender_name) ); + + //create a boundary for the email. This + //$boundary = uniqid('np'); + + // headers - specify your from email address and name here + // and specify the boundary for the email + //$headers = "MIME-Version: 1.0\r\n"; + //$headers .= "From: asong2u \r\n"; + //$headers .= "To: ".$to_user_email."\r\n"; + //$headers .= "Content-Type: text/html"; + //$headers .= "Content-Type: multipart/alternative; boundary=" . $boundary . "\r\n"; + + ob_start(); + include(TEMPLATEPATH . '/_mails/mail_new_dedication.php'); + $message = ob_get_contents(); + ob_end_clean(); + + // Send it! - $result = wp_mail( $to_user_email, $subject, $message ); + $result = wp_mail($to_user_email, $subject, $message, $headers); } add_action( 'bp_dedication_create_new_dedication', 'bp_dedication_send_dedication_notification', 10, 3 ); diff --git a/wp-content/themes/score/_mails/mail_new_dedication.php b/wp-content/themes/score/_mails/mail_new_dedication.php new file mode 100644 index 0000000..023f20d --- /dev/null +++ b/wp-content/themes/score/_mails/mail_new_dedication.php @@ -0,0 +1,11 @@ +$sender_name ($sender_username) has sent you a dedication.

+

How to dedicate a song

+

It's very easy. You only have to follow a few steps and in seconds you will have your video ready to send. You also have a tutorial that will show you how to do it, just in case.
+

All dedications go into our main page. Why? Because this is a site for everyone around the world. People will be sharing those magic moments with everybody else in different countries.
+

You also have the opportunity when you dedicate a song, to make it private and only that person will have the access to your dedication. Then, only you and him/her will be able to see it.
+

Try to send a video song of your favorite bands official video, in concert etc, instead of the cover, so everyone can enjoy them. We know, sometimes it's hard to find them and you only get to find the cover or a photograph.
+

But if you waste a little time trying to find it, your friends will appreciate it. It`s a little boring to watch a photograph for more than three minutes, so try to avoid it. We are sure everybody will appreciate it.

+
+

This email was sent by: asong2u.com

+"; ?> diff --git a/wp-content/themes/score/dedications/single/home-column-dedicated-2-me.php b/wp-content/themes/score/dedications/single/home-column-dedicated-2-me.php index 2fa22bd..6a9a63c 100644 --- a/wp-content/themes/score/dedications/single/home-column-dedicated-2-me.php +++ b/wp-content/themes/score/dedications/single/home-column-dedicated-2-me.php @@ -1,58 +1,57 @@ -displayed_user->id); -$count = 0; -$dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) . $bp->dedications->slug . '/dedicated-2u/page/2/'; -?> -

- 10) {?> - » - - - - - - - - - -
> - - -
thumbnail-no-wrap"> - - - - - <?php if (get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) {
-                echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
-            } else {
-                echo get_the_title();
-            } ?> - -
- - - - -
-

- - FROM: -
- -
-
-
- - - - - - +displayed_user->id); +$count = 0; +$dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) . $bp->dedications->slug . '/dedicated-2u/page/2/'; +?> +

+ 10) {?> + » + + + + + + + + + +
> + + +
thumbnail-no-wrap"> + + + + + <?php if (get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) {
+                echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
+            } else {
+                echo get_the_title();
+            } ?> + +
+ + + + +
+

+ + FROM: +
+ +
+
+
+ + + + + diff --git a/wp-content/themes/score/dedications/single/home-column-my-dedications.php b/wp-content/themes/score/dedications/single/home-column-my-dedications.php index 89695b0..7644f4d 100644 --- a/wp-content/themes/score/dedications/single/home-column-my-dedications.php +++ b/wp-content/themes/score/dedications/single/home-column-my-dedications.php @@ -1,57 +1,56 @@ -displayed_user->id); -$count = 0; -$dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) . $bp->dedications->slug . '/my-dedications/page/2/'; -?> -

- 10) {?> - » - - - - - - - - - -
> - - -
thumbnail-no-wrap"> - - - - <?php if (get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) {
-                echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
-            } else {
-                echo get_the_title();
-            } ?> - -
- - - - -
-

- - TO: -
- -
-
-
- - - - - - +displayed_user->id); +$count = 0; +$dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) . $bp->dedications->slug . '/my-dedications/page/2/'; +?> +

+ 10) {?> + » + + + + + + + + + +
> + + +
thumbnail-no-wrap"> + + + + <?php if (get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) {
+                echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
+            } else {
+                echo get_the_title();
+            } ?> + +
+ + + + +
+

+ + TO: +
+ +
+
+
+ + + + + diff --git a/wp-content/themes/score/functions.php b/wp-content/themes/score/functions.php index 46db354..4e9238c 100644 --- a/wp-content/themes/score/functions.php +++ b/wp-content/themes/score/functions.php @@ -824,15 +824,16 @@ function gp_get_unread_dedications() { } function set_from_email($email) { - /*$new_email = $email; - if ($email == 'noreply@asong2u.com') :*/ - $new_email = 'asong2u@asong2u.com'; - //endif; - return $new_email; + return 'asong2u@asong2u.com'; } add_filter('wp_mail_from', 'set_from_email'); +function set_mail_content_type() { + return "text/html"; +} +add_filter ("wp_mail_content_type", "set_mail_content_type"); remove_action( 'login_head', 'wp_no_robots', 10 ); + ?> \ No newline at end of file diff --git a/wp-content/themes/score/index.php b/wp-content/themes/score/index.php index b78975b..78fa356 100644 --- a/wp-content/themes/score/index.php +++ b/wp-content/themes/score/index.php @@ -1,85 +1,123 @@ - - - $gp_settings['cats'], - "ignore_sticky_posts" => 1, - "orderby" => $orderby, - "order" => $order, - "paged" => $paged, - "posts_per_page" => $gp_settings['posts_per_page'], - //"post__not_in" => $ids_descartados -); - -query_posts($args); -?> - -
class="shift-down"> - -
-
 
- -
-
-
- - -
- -
> - - -
thumbnail-no-wrap"> - - - - <?php if(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) { echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); } else { echo get_the_title(); } ?> - -
- - - - -
-

- FROM:   - - TO: -
- - -
- - - - - - - - -

- - -
-
- - + + + $gp_settings['cats'], + "ignore_sticky_posts" => 1, + "orderby" => $orderby, + "order" => $order, + "paged" => $paged, + "posts_per_page" => -1 +); + +query_posts($args); +$urls_video = array(); +$ids_descartados = array(); + +if (have_posts()) : + while (have_posts()) : + the_post(); + include('loop-dedication-data.php'); + + // Usuario actual puede ver la dedicatoria? + if ($post->post_status == 'private') { + if (($current_user->ID != $gp_settings['from_user_id']) && ($current_user->ID != $gp_settings['to_user_id'])) { + $ids_descartados[] = $post->ID; + } + } + + if ($theme_homepage_not_repeat_videos) { + // Si la URL del video ya ha salido en una dedicatoria anterior, me la salto + if (in_array($gp_settings['video'], $urls_video)) { + $ids_descartados[] = $post->ID; + } + } + + $urls_video[] = $gp_settings['video']; + endwhile; +endif;*/ +$orderby = 'rand'; +$args = array( + "cat" => $gp_settings['cats'], + "ignore_sticky_posts" => 1, + "orderby" => $orderby, + "order" => $order, + "paged" => $paged, + "posts_per_page" => $gp_settings['posts_per_page'], + //"post__not_in" => $ids_descartados +); + +query_posts($args); +?> + +
class="shift-down"> + +
+
 
+ +
+
+
+ + +
+ +
> + + +
thumbnail-no-wrap"> + + + + <?php if(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) { echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); } else { echo get_the_title(); } ?> + +
+ + + + +
+

+ FROM:   + + TO: +
+ + +
+ + + + + + + + +

+ + +
+
+ + \ No newline at end of file diff --git a/wp-content/themes/score/lib/inc/fetch-video-data.php b/wp-content/themes/score/lib/inc/fetch-video-data.php index b15d92a..075de1f 100644 --- a/wp-content/themes/score/lib/inc/fetch-video-data.php +++ b/wp-content/themes/score/lib/inc/fetch-video-data.php @@ -1,131 +1,132 @@ - admin_url( 'admin-ajax.php' ), - 'postCommentNonce' => wp_create_nonce( 'myajax-post-comment-nonce' ) - )); - } -} -add_action('wp_print_scripts', 'gp_enqueue_ajax_scripts'); - -function gp_ajax_video_data() { - global $gp_settings, $post, $current_user, $bp; - get_currentuserinfo(); - - $nonce = $_POST['postCommentNonce']; - if ( ! wp_verify_nonce( $nonce, 'myajax-post-comment-nonce' ) ) - die ( 'Busted!'); - - // get the submitted parameters - if (isset($_POST['id'])) - $postID = $_POST['id']; - - header('Cache-Control: no-cache, must-revalidate'); - header('Content-type: application/json'); - - $displayed_id = bp_displayed_user_id(); - $dedication_orderby = "rand"; //date"; - $category_name = 'dedication'; - $post_status = array('publish', 'private'); - - if ($postID > 0) { - $args = array( - 'p' => $postID - ); - } else { - $args = array( - 'post_type' => array('post'), - 'orderby' => $dedication_orderby, - 'posts_per_page' => 10, - 'post_status' => $post_status, - 'category_name' => $category_name, - ); - } - $array = array(); - $i = 0; - - $listavideos = new WP_Query($args); - - while ($listavideos->have_posts()) { - $listavideos->the_post(); - require(dirname(__FILE__).'/../../loop-dedication-data.php'); - - // Perfil del usuario: sólo mostrar las dedicadas por él y para él. El resto se descartan. - if ( $bp->current_component == BP_DEDICATION_SLUG ) { - if (($displayed_id != $gp_settings['from_user_id']) && ($displayed_id != $gp_settings['to_user_id'])) { - continue; // me salto esta dedicatoria - } - } - - // Página de inicio / página del video: Usuario actual puede ver la dedicatoria? - if ($post->post_status == 'private') { - if (($current_user->ID != $gp_settings['from_user_id']) && ($current_user->ID != $gp_settings['to_user_id'])) { - continue; // me salto esta dedicatoria - } - } - - $array[$i] = array(); - $array[$i]['id'] = $post->ID; - $array[$i]['title'] = $post->post_title; - $array[$i]['video'] = $gp_settings['video']; - $array[$i]['video_id'] = $gp_settings['video_id']; - $array[$i]['video_path'] = $gp_settings['video_path']; - $array[$i]['video_type'] = $gp_settings['video_type']; - $array[$i]['permalink'] = $post->guid; - $array[$i]['extlink'] = $gp_settings['enc_link']; - $array[$i]['artist'] = $gp_settings['artist_short']; - $array[$i]['song'] = $gp_settings['song_short']; - $array[$i]['unreaded'] = $gp_settings['unreaded']; - - $array[$i]['from_to_text'] = $gp_settings['from_flag']; - $array[$i]['from_to_text'] .= 'FROM: ' . $gp_settings['from_user_link'] . ' '; - $array[$i]['from_to_text'] .= $gp_settings['to_flag']; - $array[$i]['from_to_text'] .= 'TO: ' . $gp_settings['to_user_link'] . ''; - - $i++; - - break; - } - wp_reset_postdata(); - $listavideos = NULL; - - $salida = ''; - foreach($array as $video) { - $salida .= '
  • '; - $salida .= '' . $video['id'] . ''; - $salida .= '' . $video['title']. ''; - $salida .= '' . $video['artist']. ''; - $salida .= '' . $video['song']. ''; - $salida .= '' . $video['permalink']. ''; - $salida .= '' . $video['extlink']. ''; - $salida .= ''; - - if ($video['unreaded']) { - $salida .= ''; - $salida .= mar_read_unread_links('', '', false); - $salida .= ''; - } - $salida .= ''; - $salida .= $video['from_to_text']; - $salida .= ''; - - $salida .= '
  • '; - } - $array = NULL; - - echo json_encode($salida); - - die(); -} -add_action('wp_ajax_gp_video_data', 'gp_ajax_video_data'); -//add_action('wp_ajax_nopriv_gp_video_data', 'gp_ajax_video_data'); - -?> + admin_url( 'admin-ajax.php' ), + 'postCommentNonce' => wp_create_nonce( 'myajax-post-comment-nonce' ) + )); + } +} +add_action('wp_print_scripts', 'gp_enqueue_ajax_scripts'); + +function gp_ajax_video_data() { + global $gp_settings, $post, $current_user, $bp; + get_currentuserinfo(); + + $nonce = $_POST['postCommentNonce']; + if ( ! wp_verify_nonce( $nonce, 'myajax-post-comment-nonce' ) ) + die ( 'Busted!'); + + // get the submitted parameters + if (isset($_POST['id'])) + $postID = $_POST['id']; + + header('Cache-Control: no-cache, must-revalidate'); + header('Content-type: application/json'); + + $displayed_id = bp_displayed_user_id(); + $dedication_orderby = "rand"; //date"; + $category_name = 'dedication'; + $post_status = array('publish', 'private'); + + if ($postID > 0) { + $args = array( + 'p' => $postID + ); + } else { + $args = array( + 'post_type' => array('post'), + 'orderby' => $dedication_orderby, + 'numberposts' => 10, + 'post_status' => $post_status, + 'category_name' => $category_name, + 'offset' => 1, + ); + } + $array = array(); + $i = 0; + + $listavideos = new WP_Query($args); + + while ($listavideos->have_posts()) { + $listavideos->the_post(); + require(dirname(__FILE__).'/../../loop-dedication-data.php'); + + // Perfil del usuario: sólo mostrar las dedicadas por él y para él. El resto se descartan. + if ( $bp->current_component == BP_DEDICATION_SLUG ) { + if (($displayed_id != $gp_settings['from_user_id']) && ($displayed_id != $gp_settings['to_user_id'])) { + continue; // me salto esta dedicatoria + } + } + + // Página de inicio / página del video: Usuario actual puede ver la dedicatoria? + if ($post->post_status == 'private') { + if (($current_user->ID != $gp_settings['from_user_id']) && ($current_user->ID != $gp_settings['to_user_id'])) { + continue; // me salto esta dedicatoria + } + } + + $array[$i] = array(); + $array[$i]['id'] = $post->ID; + $array[$i]['title'] = $post->post_title; + $array[$i]['video'] = $gp_settings['video']; + $array[$i]['video_id'] = $gp_settings['video_id']; + $array[$i]['video_path'] = $gp_settings['video_path']; + $array[$i]['video_type'] = $gp_settings['video_type']; + $array[$i]['permalink'] = $post->guid; + $array[$i]['extlink'] = $gp_settings['enc_link']; + $array[$i]['artist'] = $gp_settings['artist_short']; + $array[$i]['song'] = $gp_settings['song_short']; + $array[$i]['unreaded'] = $gp_settings['unreaded']; + + $array[$i]['from_to_text'] = $gp_settings['from_flag']; + $array[$i]['from_to_text'] .= 'FROM: ' . $gp_settings['from_user_link'] . ' '; + $array[$i]['from_to_text'] .= $gp_settings['to_flag']; + $array[$i]['from_to_text'] .= 'TO: ' . $gp_settings['to_user_link'] . ''; + + $i++; + + break; + } + wp_reset_postdata(); + $listavideos = NULL; + + $salida = ''; + foreach($array as $video) { + $salida .= '
  • '; + $salida .= '' . $video['id'] . ''; + $salida .= '' . $video['title']. ''; + $salida .= '' . $video['artist']. ''; + $salida .= '' . $video['song']. ''; + $salida .= '' . $video['permalink']. ''; + $salida .= '' . $video['extlink']. ''; + $salida .= ''; + + if ($video['unreaded']) { + $salida .= ''; + $salida .= mar_read_unread_links('', '', false); + $salida .= ''; + } + $salida .= ''; + $salida .= $video['from_to_text']; + $salida .= ''; + + $salida .= '
  • '; + } + $array = NULL; + + echo json_encode($salida); + + die(); +} +add_action('wp_ajax_gp_video_data', 'gp_ajax_video_data'); +//add_action('wp_ajax_nopriv_gp_video_data', 'gp_ajax_video_data'); + +?> diff --git a/wp-content/themes/score/video-slider.php b/wp-content/themes/score/video-slider.php index a6ba212..1b1fb33 100644 --- a/wp-content/themes/score/video-slider.php +++ b/wp-content/themes/score/video-slider.php @@ -20,7 +20,8 @@ if ($_ishome || ( $bp->current_component == BP_DEDICATION_SLUG )) { $args = array( 'post_type' => array('post'), 'orderby' => $dedication_orderby, - 'posts_per_page' => -1, + //'posts_per_page' => -1, + 'numberposts' => 5, 'post_status' => $post_status, 'category_name' => $category_name, );