Tarea #1039 -> Cuando se envia una dedicatoria, redirigir al terminar el video

git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@134 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
This commit is contained in:
David Arranz 2012-08-27 17:15:29 +00:00
parent 9c18968e59
commit df2a1060a7
3 changed files with 32 additions and 7 deletions

View File

@ -14,11 +14,10 @@ function bp_dedication_send_dedication_notification( $post_id, $to_user_email, $
/* Let's grab both user's names to use in the email. */
$sender_ud = get_userdata( $from_user_id );
$sender_username = $sender_ud->user_login;
$sender_name = bp_core_get_user_displayname( $sender_username );
//$reciever_name = bp_core_get_user_displayname( $to_user_id, false );
//$reciever_name = bp_core_get_user_displayname( $to_user_id, false );
/* Now we need to construct the URL's that we are going to use in the email */
@ -28,6 +27,13 @@ function bp_dedication_send_dedication_notification( $post_id, $to_user_email, $
$post_link = get_option('siteurl') . '/index.php';
$post_link = add_query_arg('refid', $enc_link, $post_link);
// existe el destinatario como usuario?
$reciever_ud = get_user_by('email', $to_user_email);
if ($reciever_ud) {
$post_link = add_query_arg('y', '1', $post_link);
}
//$post_link = bp_dedication_getTinyUrl($post_link);
/* Set up and send the message */

View File

@ -656,7 +656,12 @@ add_filter('query_vars', 'add_fs_var');
function play_video_on_full_screen() {
$fs = get_query_var('fs');
return ($fs == '1');
return ($fs && ($fs != '0'));
}
function play_video_for_registeres_user() {
$fs = get_query_var('fs');
return ($fs == '2');
}
if(!function_exists('_log')){
@ -689,7 +694,12 @@ function gp_encoded_dedication_redirect_for_nonusers($current_uri, $redirect_to)
if (key_exists('refid', $args)) {
setcookie("refid", 1, time()+60, SITECOOKIEPATH); // Cookie con 1 minuto de validez
$decoded_url = bp_dedication_decode($args['refid']);
return add_query_arg('fs', 1, $decoded_url);
if (key_exists('y', $args)) {
$decoded_url = add_query_arg('fs', 2, $decoded_url); // Para usuarios que están registrados
} else {
$decoded_url = add_query_arg('fs', 1, $decoded_url); // Para usuarios no registrados
}
return $decoded_url;
}
else return $current_uri;
}
@ -701,7 +711,12 @@ function gp_encoded_dedication_redirect_for_users() {
wp_parse_str($_SERVER['QUERY_STRING'], $args);
if (key_exists('refid', $args)) {
$decoded_url = bp_dedication_decode($args['refid']);
wp_redirect(add_query_arg('fs', 1, $decoded_url));
if (key_exists('y', $args)) {
$decoded_url = add_query_arg('fs', 2, $decoded_url); // Para usuarios que están registrados
} else {
$decoded_url = add_query_arg('fs', 1, $decoded_url); // Para usuarios no registrados
}
wp_redirect($decoded_url);
}
}
}

View File

@ -182,7 +182,11 @@ if (have_posts()) {
<?php if ( is_user_logged_in() ) { ?>
window.location.href = "<?php echo home_url(); ?>";
<?php } else { ?>
window.location.href = "<?php echo home_url(); ?>/register/";
<?php if (play_video_for_registeres_user()) { ?>
window.location.href = "<?php echo home_url(); ?>/login/";
<?php } else { ?>
window.location.href = "<?php echo home_url(); ?>/register/";
<?php } ?>
<?php } ?>
}
</script>