Compare commits
10 Commits
1f505a5383
...
338db6954f
| Author | SHA1 | Date | |
|---|---|---|---|
| 338db6954f | |||
| fc0a29b5d8 | |||
| 223a330645 | |||
| 36007b24bc | |||
| 74e072c24e | |||
| 5eb143b141 | |||
| 1c7c7a642d | |||
| b9348351af | |||
| 48ccd06dcf | |||
| fe80a2a007 |
@ -12,13 +12,37 @@ function bp_get_dedication_slug() {
|
||||
return apply_filters( 'bp_get_dedication_slug', $dedication_slug );
|
||||
}
|
||||
|
||||
function bp_dedication_exist_dedications_from_user( $user_id ) {
|
||||
if ( !$user_id )
|
||||
return false;
|
||||
|
||||
return (count_user_posts( $user_id ) > 0);
|
||||
}
|
||||
|
||||
function bp_dedication_exist_dedications_to_user( $user_id ) {
|
||||
if ( !$user_id )
|
||||
return false;
|
||||
|
||||
$args = array(
|
||||
'post_status' => array('publish', 'private'),
|
||||
'numberposts' => 1,
|
||||
'category' => 'dedication',
|
||||
'meta_key' => 'ghostpool_destination_user_id',
|
||||
'meta_value' => $user_id
|
||||
);
|
||||
$posts_array = get_posts( $args );
|
||||
|
||||
return (!empty($posts_array));
|
||||
}
|
||||
|
||||
|
||||
function bp_dedication_get_dedications_from_user( $user_id ) {
|
||||
if ( !$user_id )
|
||||
return false;
|
||||
|
||||
$args = array(
|
||||
'post_status' => array('publish', 'private'),
|
||||
'numberposts' => 10,
|
||||
'numberposts' => -1,
|
||||
'category' => get_cat_id('dedication'),
|
||||
'author' => $user_id
|
||||
);
|
||||
@ -33,7 +57,7 @@ function bp_dedication_get_dedications_to_user( $user_id ) {
|
||||
|
||||
$args = array(
|
||||
'post_status' => array('publish', 'private'),
|
||||
'numberposts' => 10,
|
||||
'numberposts' => -1,
|
||||
'category' => 'dedication',
|
||||
'meta_key' => 'ghostpool_destination_user_id',
|
||||
'meta_value' => $user_id
|
||||
|
||||
@ -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 );
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 2.2 KiB |
11
wp-content/themes/score/_mails/mail_new_dedication.php
Normal file
11
wp-content/themes/score/_mails/mail_new_dedication.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php echo "
|
||||
<p><a href='$post_link'>$sender_name ($sender_username) has sent you a dedication.</a></p>
|
||||
<h3>How to dedicate a song</h3>
|
||||
<p>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.<br>
|
||||
<p>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.<br>
|
||||
<p>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.<br>
|
||||
<p>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.<br>
|
||||
<p>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.</p>
|
||||
<hr/>
|
||||
<p>This email was sent by: <a href='http://www.asong2u.com/'>asong2u.com</a></p>
|
||||
"; ?>
|
||||
@ -1,58 +1,57 @@
|
||||
<?php
|
||||
global $bp, $post, $gp_settings;
|
||||
require(ghostpool_inc . 'options.php');
|
||||
$from_dedications = bp_dedication_get_dedications_to_user($bp->displayed_user->id);
|
||||
$count = 0;
|
||||
$dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) . $bp->dedications->slug . '/dedicated-2u/page/2/';
|
||||
?>
|
||||
<h4><?php _e('Dedicated 2 me'); ?></h4>
|
||||
<?php foreach ($from_dedications as $post) :
|
||||
$count++;
|
||||
if ($count > 10) {?>
|
||||
<a href="<?php echo $dedication_link; ?>" class="read-more" title="<?php _e('See More', 'gp_lang'); ?>"><?php _e('See More', 'gp_lang'); ?> »</a>
|
||||
<img class='read-more-loader' src='<?php echo get_template_directory_uri(); ?>/lib/images/loader.gif' style='display:none;'/>
|
||||
<?php break; } ?>
|
||||
|
||||
<?php setup_postdata($post); ?>
|
||||
|
||||
<?php
|
||||
$gp_settings['thumbnail_width'] = $theme_cat_thumbnail_width;
|
||||
$gp_settings['thumbnail_height'] = $theme_cat_thumbnail_height;
|
||||
?>
|
||||
|
||||
<?php include(dirname(__FILE__).'/../../loop-dedication-data.php'); ?>
|
||||
|
||||
<div class="post-<?php the_ID(); ?> home-dedicated-2-me post-loop"<?php // post_class('post-loop'); ?>>
|
||||
<!--Begin Image-->
|
||||
<?php if (has_post_thumbnail()) { ?>
|
||||
<div class="post-thumbnail<?php if ($gp_settings['image_wrap'] == "Disable") { ?> thumbnail-no-wrap<?php } ?>">
|
||||
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<?php if (($theme_show_new_label) && ($gp_settings['unreaded'])) { ?><span class="new-label"></span><?php } ?>
|
||||
<?php $image = vt_resize(get_post_thumbnail_id(), '', $gp_settings['image_width'], $gp_settings['image_height'], true); ?>
|
||||
<img width="<?php echo $image['width']; ?>" height="<?php echo $image['height']; ?>" src="<?php echo $image['url']; ?>" alt="<?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();
|
||||
} ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End Image-->
|
||||
|
||||
<!--Begin Post Text-->
|
||||
<div class="post-text">
|
||||
<h2><a href="<?php the_permalink(); ?>" title="<?php echo $gp_settings['artist_song']; ?>"><?php echo $gp_settings['artist_song_span_short']; ?></a></h2>
|
||||
<?php echo $gp_settings['from_flag']; ?>
|
||||
<span>FROM: <?php echo $gp_settings['from_user_link']; ?></span>
|
||||
</div>
|
||||
<!--End Post Text-->
|
||||
<br/>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php $from_dedications = NULL; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
|
||||
<?php
|
||||
global $bp, $post, $gp_settings;
|
||||
require(ghostpool_inc . 'options.php');
|
||||
$from_dedications = bp_dedication_get_dedications_to_user($bp->displayed_user->id);
|
||||
$count = 0;
|
||||
$dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) . $bp->dedications->slug . '/dedicated-2u/page/2/';
|
||||
?>
|
||||
<h4><?php _e('Dedicated 2 me'); ?></h4>
|
||||
<?php foreach ($from_dedications as $post) :
|
||||
$count++;
|
||||
if ($count > 10) {?>
|
||||
<a href="<?php echo $dedication_link; ?>" class="read-more" title="<?php _e('See More', 'gp_lang'); ?>"><?php _e('See More', 'gp_lang'); ?> »</a>
|
||||
<img class='read-more-loader' src='<?php echo get_template_directory_uri(); ?>/lib/images/loader.gif' style='display:none;'/>
|
||||
<?php break; } ?>
|
||||
|
||||
<?php setup_postdata($post); ?>
|
||||
|
||||
<?php
|
||||
$gp_settings['thumbnail_width'] = $theme_cat_thumbnail_width;
|
||||
$gp_settings['thumbnail_height'] = $theme_cat_thumbnail_height;
|
||||
?>
|
||||
|
||||
<?php include(dirname(__FILE__).'/../../loop-dedication-data.php'); ?>
|
||||
|
||||
<div class="post-<?php the_ID(); ?> home-dedicated-2-me post-loop"<?php // post_class('post-loop'); ?>>
|
||||
<!--Begin Image-->
|
||||
<?php if (has_post_thumbnail()) { ?>
|
||||
<div class="post-thumbnail<?php if ($gp_settings['image_wrap'] == "Disable") { ?> thumbnail-no-wrap<?php } ?>">
|
||||
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<?php if (($theme_show_new_label) && ($gp_settings['unreaded'])) { ?><span class="new-label"></span><?php } ?>
|
||||
<?php $image = vt_resize(get_post_thumbnail_id(), '', $gp_settings['image_width'], $gp_settings['image_height'], true); ?>
|
||||
<img width="<?php echo $image['width']; ?>" height="<?php echo $image['height']; ?>" src="<?php echo $image['url']; ?>" alt="<?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();
|
||||
} ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End Image-->
|
||||
|
||||
<!--Begin Post Text-->
|
||||
<div class="post-text">
|
||||
<h2><a href="<?php the_permalink(); ?>" title="<?php echo $gp_settings['artist_song']; ?>"><?php echo $gp_settings['artist_song_span_short']; ?></a></h2>
|
||||
<?php echo $gp_settings['from_flag']; ?>
|
||||
<span>FROM: <?php echo $gp_settings['from_user_link']; ?></span>
|
||||
</div>
|
||||
<!--End Post Text-->
|
||||
<br/>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
|
||||
|
||||
@ -1,57 +1,56 @@
|
||||
<?php
|
||||
global $bp, $post, $gp_settings;
|
||||
require(ghostpool_inc . 'options.php');
|
||||
$from_dedications = bp_dedication_get_dedications_from_user($bp->displayed_user->id);
|
||||
$count = 0;
|
||||
$dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) . $bp->dedications->slug . '/my-dedications/page/2/';
|
||||
?>
|
||||
<h4><?php _e('My dedications'); ?></h4>
|
||||
<?php foreach ($from_dedications as $post) :
|
||||
$count++;
|
||||
if ($count > 10) {?>
|
||||
<a href="<?php echo $dedication_link; ?>" class="read-more" title="<?php _e('See More', 'gp_lang'); ?>"><?php _e('See More', 'gp_lang'); ?> »</a>
|
||||
<img class='read-more-loader' src='<?php echo get_template_directory_uri(); ?>/lib/images/loader.gif' style='display:none;'/>
|
||||
<?php break; } ?>
|
||||
|
||||
<?php setup_postdata($post); ?>
|
||||
|
||||
<?php
|
||||
$gp_settings['thumbnail_width'] = $theme_cat_thumbnail_width;
|
||||
$gp_settings['thumbnail_height'] = $theme_cat_thumbnail_height;
|
||||
?>
|
||||
|
||||
<?php include(dirname(__FILE__).'/../../loop-dedication-data.php'); ?>
|
||||
|
||||
<div class="post-<?php the_ID(); ?> home-my-dedications post-loop" <?php //post_class('post-loop'); ?>>
|
||||
<!--Begin Image-->
|
||||
<?php if (has_post_thumbnail()) { ?>
|
||||
<div class="post-thumbnail<?php if ($gp_settings['image_wrap'] == "Disable") { ?> thumbnail-no-wrap<?php } ?>">
|
||||
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<?php $image = vt_resize(get_post_thumbnail_id(), '', $gp_settings['image_width'], $gp_settings['image_height'], true); ?>
|
||||
<img width="<?php echo $image['width']; ?>" height="<?php echo $image['height']; ?>" src="<?php echo $image['url']; ?>" alt="<?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();
|
||||
} ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End Image-->
|
||||
|
||||
<!--Begin Post Text-->
|
||||
<div class="post-text">
|
||||
<h2><a href="<?php the_permalink(); ?>" title="<?php echo $gp_settings['artist_song']; ?>"><?php echo $gp_settings['artist_song_span_short']; ?></a></h2>
|
||||
<?php echo $gp_settings['to_flag']; ?>
|
||||
<span>TO: <?php echo $gp_settings['to_user_link']; ?></span>
|
||||
</div>
|
||||
<!--End Post Text-->
|
||||
<br/>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php $from_dedications = NULL; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
|
||||
<?php
|
||||
global $bp, $post, $gp_settings;
|
||||
require(ghostpool_inc . 'options.php');
|
||||
$from_dedications = bp_dedication_get_dedications_from_user($bp->displayed_user->id);
|
||||
$count = 0;
|
||||
$dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) . $bp->dedications->slug . '/my-dedications/page/2/';
|
||||
?>
|
||||
<h4><?php _e('My dedications'); ?></h4>
|
||||
<?php foreach ($from_dedications as $post) :
|
||||
$count++;
|
||||
if ($count > 10) {?>
|
||||
<a href="<?php echo $dedication_link; ?>" class="read-more" title="<?php _e('See More', 'gp_lang'); ?>"><?php _e('See More', 'gp_lang'); ?> »</a>
|
||||
<img class='read-more-loader' src='<?php echo get_template_directory_uri(); ?>/lib/images/loader.gif' style='display:none;'/>
|
||||
<?php break; } ?>
|
||||
|
||||
<?php setup_postdata($post); ?>
|
||||
|
||||
<?php
|
||||
$gp_settings['thumbnail_width'] = $theme_cat_thumbnail_width;
|
||||
$gp_settings['thumbnail_height'] = $theme_cat_thumbnail_height;
|
||||
?>
|
||||
|
||||
<?php include(dirname(__FILE__).'/../../loop-dedication-data.php'); ?>
|
||||
|
||||
<div class="post-<?php the_ID(); ?> home-my-dedications post-loop" <?php //post_class('post-loop'); ?>>
|
||||
<!--Begin Image-->
|
||||
<?php if (has_post_thumbnail()) { ?>
|
||||
<div class="post-thumbnail<?php if ($gp_settings['image_wrap'] == "Disable") { ?> thumbnail-no-wrap<?php } ?>">
|
||||
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<?php $image = vt_resize(get_post_thumbnail_id(), '', $gp_settings['image_width'], $gp_settings['image_height'], true); ?>
|
||||
<img width="<?php echo $image['width']; ?>" height="<?php echo $image['height']; ?>" src="<?php echo $image['url']; ?>" alt="<?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();
|
||||
} ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End Image-->
|
||||
|
||||
<!--Begin Post Text-->
|
||||
<div class="post-text">
|
||||
<h2><a href="<?php the_permalink(); ?>" title="<?php echo $gp_settings['artist_song']; ?>"><?php echo $gp_settings['artist_song_span_short']; ?></a></h2>
|
||||
<?php echo $gp_settings['to_flag']; ?>
|
||||
<span>TO: <?php echo $gp_settings['to_user_link']; ?></span>
|
||||
</div>
|
||||
<!--End Post Text-->
|
||||
<br/>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
|
||||
|
||||
@ -86,6 +86,7 @@ if (function_exists('bp_is_active') && file_exists(ghostpool_bp . 'functions-bud
|
||||
require_once(ghostpool_bp . 'search-buddypress.php');
|
||||
}
|
||||
|
||||
|
||||
/* * ************************* Flags img function *********************** */
|
||||
function gp_get_flag_img($country_code = '', $flagsize=32) {
|
||||
$src = get_template_directory_uri() . '/lib/images/flags/'.$flagsize.'/';
|
||||
@ -700,9 +701,12 @@ function make_encoded_dedications_visible_for_nonusers($visibility) {
|
||||
add_filter('pbp_login_required_check', 'make_encoded_dedications_visible_for_nonusers', 1);
|
||||
|
||||
function gp_encoded_dedication_redirect_for_nonusers($current_uri, $redirect_to) {
|
||||
$args = array();
|
||||
wp_parse_str($_SERVER['QUERY_STRING'], $args);
|
||||
|
||||
if (key_exists('refid', $args)) {
|
||||
setcookie("refid", 1, time()+60, SITECOOKIEPATH); // Cookie con 1 minuto de validez
|
||||
|
||||
$decoded_url = bp_dedication_decode($args['refid']);
|
||||
if (key_exists('y', $args)) {
|
||||
$decoded_url = add_query_arg('fs', 2, $decoded_url); // Para usuarios que están registrados
|
||||
@ -717,8 +721,10 @@ add_filter('pbp_redirect_login_page', 'gp_encoded_dedication_redirect_for_nonuse
|
||||
|
||||
|
||||
function gp_encoded_dedication_redirect_for_users() {
|
||||
$args = array();
|
||||
if ( true == is_user_logged_in() ) {
|
||||
wp_parse_str($_SERVER['QUERY_STRING'], $args);
|
||||
wp_parse_str($_SERVER['QUERY_STRING'], $args);
|
||||
|
||||
if (key_exists('refid', $args)) {
|
||||
$decoded_url = bp_dedication_decode($args['refid']);
|
||||
if (key_exists('y', $args)) {
|
||||
@ -726,12 +732,36 @@ function gp_encoded_dedication_redirect_for_users() {
|
||||
} else {
|
||||
$decoded_url = add_query_arg('fs', 1, $decoded_url); // Para usuarios no registrados
|
||||
}
|
||||
|
||||
wp_redirect($decoded_url);
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action('wp', 'gp_encoded_dedication_redirect_for_users', 2);
|
||||
|
||||
function gp_encoded_private_dedication_specials($posts = array()) {
|
||||
global $wp_query;
|
||||
|
||||
if ($wp_query->is_single && $wp_query->is_singular && $wp_query->query_vars && $posts) {
|
||||
/* TODO: do we need to ensure wp_query->query_vars['post_type'] == $_first_post->post_type ? */
|
||||
$_first_post = reset($posts);
|
||||
|
||||
/* the hack: only do this if it is of type special and the status is draft */
|
||||
if ($_first_post->post_status == 'private') {
|
||||
$wp_query->post = $_first_post; /* quick and dirty hack so that you don't get a 404 */
|
||||
$wp_query->post->post_status = 'publish';
|
||||
|
||||
$wp_query->post_count = sizeof($posts); /* these 3 lines probably aren't necessary */
|
||||
$wp_query->found_posts = sizeof($posts);
|
||||
$wp_query->is_404 = false;
|
||||
}
|
||||
}
|
||||
return $posts;
|
||||
}
|
||||
|
||||
if (!is_admin() && isset($_COOKIE['refid'])) {
|
||||
add_filter('posts_results', 'gp_encoded_private_dedication_specials');
|
||||
}
|
||||
|
||||
|
||||
function asociate_dedications_to_new_user($user_id) {
|
||||
@ -824,15 +854,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 );
|
||||
remove_action('wp_head', 'wp_generator');
|
||||
|
||||
?>
|
||||
@ -1,85 +1,123 @@
|
||||
<?php
|
||||
|
||||
get_header();
|
||||
global $gp_settings, $post, $current_user;
|
||||
get_currentuserinfo();
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
$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);
|
||||
?>
|
||||
|
||||
<div id="content"<?php if($gp_settings['dropdown_filter'] == "0") { ?> class="shift-down"<?php } ?>>
|
||||
|
||||
<div id="precontent-wrapper">
|
||||
<div id="dedicationComments_container" class="columns two first text-left"> </div>
|
||||
<div id="sidebar-home" class="columns two last text-left">
|
||||
<?php dynamic_sidebar('homepage-1'); ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
<div class="contentInner">
|
||||
<?php if (have_posts()) : while (have_posts()) : the_post(); include('loop-dedication-data.php'); ?>
|
||||
<div <?php post_class('post-loop'); ?>>
|
||||
<!--Begin Image-->
|
||||
<?php if(has_post_thumbnail()) { ?>
|
||||
<div class="post-thumbnail<?php if($gp_settings['image_wrap'] == "Disable") { ?> thumbnail-no-wrap<?php } ?>">
|
||||
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<?php $image = vt_resize(get_post_thumbnail_id(), '', $gp_settings['image_width'], $gp_settings['image_height'], true); ?>
|
||||
<img width="<?php echo $image['width']; ?>" height="<?php echo $image['height']; ?>" src="<?php echo $image['url']; ?>" alt="<?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(); } ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End Image-->
|
||||
|
||||
<!--Begin Post Text-->
|
||||
<div class="post-text">
|
||||
<h2><a href="<?php the_permalink(); ?>" title="<?php echo $gp_settings['artist_song']; ?>"><?php echo $gp_settings['artist_song_span_short']; ?></a></h2>
|
||||
<?php echo $gp_settings['from_flag']; ?><span>FROM: <?php echo $gp_settings['from_user_link']; ?></span>
|
||||
<?php echo $gp_settings['to_flag']; ?>
|
||||
<span>TO: <?php echo $gp_settings['to_user_link']; ?></span>
|
||||
</div>
|
||||
<!--End Post Text-->
|
||||
|
||||
</div>
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php
|
||||
if($gp_settings['pagination'] == "0") {
|
||||
gp_ajax_pagination();
|
||||
} else { ?>
|
||||
<div class="more-posts">
|
||||
<?php
|
||||
$category_id = get_cat_ID( DEDICATION_CATEGORY_SLUG );
|
||||
$category_link = get_category_link( $category_id );
|
||||
?>
|
||||
<a href="<?php echo esc_url( $category_link ); ?>" class="read-more" title="<?php _e('See More', 'gp_lang'); ?>"><?php _e('See More', 'gp_lang'); ?> »</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($gp_settings['dropdown_filter'] == "0") { require_once('dropdown-filter.php'); } ?>
|
||||
<?php else : ?>
|
||||
<h4><?php _e('Try searching for a different term.', 'gp_lang'); ?></h4>
|
||||
<?php endif; ?>
|
||||
<?php wp_reset_query(); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php get_sidebar(); ?>
|
||||
<?php
|
||||
|
||||
get_header();
|
||||
global $gp_settings, $post, $current_user;
|
||||
get_currentuserinfo();
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
//$args = "cat=".$gp_settings['cats']."&caller_get_posts=1&orderby=$orderby&order=$order&gdsr_sort=$gdsr_sort&gdsr_order=$gdsr_order&paged=$paged&posts_per_page=-1";
|
||||
/*
|
||||
$args = array(
|
||||
"cat" => $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);
|
||||
?>
|
||||
|
||||
<div id="content"<?php if($gp_settings['dropdown_filter'] == "0") { ?> class="shift-down"<?php } ?>>
|
||||
|
||||
<div id="precontent-wrapper">
|
||||
<div id="dedicationComments_container" class="columns two first text-left"> </div>
|
||||
<div id="sidebar-home" class="columns two last text-left">
|
||||
<?php dynamic_sidebar('homepage-1'); ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
<div class="contentInner">
|
||||
<?php if (have_posts()) : while (have_posts()) : the_post(); include('loop-dedication-data.php'); ?>
|
||||
<div <?php post_class('post-loop'); ?>>
|
||||
<!--Begin Image-->
|
||||
<?php if(has_post_thumbnail()) { ?>
|
||||
<div class="post-thumbnail<?php if($gp_settings['image_wrap'] == "Disable") { ?> thumbnail-no-wrap<?php } ?>">
|
||||
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<?php $image = vt_resize(get_post_thumbnail_id(), '', $gp_settings['image_width'], $gp_settings['image_height'], true); ?>
|
||||
<img width="<?php echo $image['width']; ?>" height="<?php echo $image['height']; ?>" src="<?php echo $image['url']; ?>" alt="<?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(); } ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End Image-->
|
||||
|
||||
<!--Begin Post Text-->
|
||||
<div class="post-text">
|
||||
<h2><a href="<?php the_permalink(); ?>" title="<?php echo $gp_settings['artist_song']; ?>"><?php echo $gp_settings['artist_song_span_short']; ?></a></h2>
|
||||
<?php echo $gp_settings['from_flag']; ?><span>FROM: <?php echo $gp_settings['from_user_link']; ?></span>
|
||||
<?php echo $gp_settings['to_flag']; ?>
|
||||
<span>TO: <?php echo $gp_settings['to_user_link']; ?></span>
|
||||
</div>
|
||||
<!--End Post Text-->
|
||||
|
||||
</div>
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php
|
||||
if($gp_settings['pagination'] == "0") {
|
||||
gp_ajax_pagination();
|
||||
} else { ?>
|
||||
<div class="more-posts">
|
||||
<?php
|
||||
$category_id = get_cat_ID( DEDICATION_CATEGORY_SLUG );
|
||||
$category_link = get_category_link( $category_id );
|
||||
?>
|
||||
<a href="<?php echo esc_url( $category_link ); ?>" class="read-more" title="<?php _e('See More', 'gp_lang'); ?>"><?php _e('See More', 'gp_lang'); ?> »</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($gp_settings['dropdown_filter'] == "0") { require_once('dropdown-filter.php'); } ?>
|
||||
<?php else : ?>
|
||||
<h4><?php _e('Try searching for a different term.', 'gp_lang'); ?></h4>
|
||||
<?php endif; ?>
|
||||
<?php wp_reset_query(); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php get_sidebar(); ?>
|
||||
<?php get_footer(); ?>
|
||||
@ -711,7 +711,7 @@ function bp_datebox_field ($html, $type, $day, $month, $year, $default_select )
|
||||
add_filter( 'bp_get_the_profile_field_datebox', 'bp_datebox_field', 10, 6 );
|
||||
|
||||
function gp_bp_add_default_avatar( $url ) {
|
||||
return get_stylesheet_directory_uri() .'/lib/images/photo_profile_red.png';
|
||||
return get_stylesheet_directory_uri() .'/lib/images/photo_profile.jpg';
|
||||
}
|
||||
add_filter( 'bp_core_mysteryman_src', 'gp_bp_add_default_avatar' );
|
||||
|
||||
|
||||
@ -168,12 +168,13 @@ div#container div#login p#backtoblog {
|
||||
}
|
||||
div#container div#login p#nav {
|
||||
color: #0154AC;
|
||||
display: inline-block;
|
||||
display: block;
|
||||
margin-left: 0;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
right: 55px;
|
||||
text-align: right;
|
||||
right: 62px;
|
||||
text-align: left;
|
||||
width: 48px;
|
||||
top: 42px;
|
||||
}
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
@ -194,7 +195,7 @@ div#container div#login p#nav a#forgotYourPassword {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
position: absolute;
|
||||
right: 92px;
|
||||
right: 97px;
|
||||
text-decoration: none;
|
||||
top: 0;
|
||||
width: 127px;
|
||||
|
||||
BIN
wp-content/themes/score/lib/images/photo_profile.jpg
Normal file
BIN
wp-content/themes/score/lib/images/photo_profile.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@ -1,131 +1,138 @@
|
||||
<?php
|
||||
require_once( ABSPATH . "wp-config.php" );
|
||||
|
||||
function gp_enqueue_ajax_scripts() {
|
||||
if (!is_admin()) {
|
||||
// embed the javascript file that makes the AJAX request
|
||||
wp_enqueue_script( 'gp_ajax_video_data_request', get_template_directory_uri() . '/lib/scripts/custom-ajax.min.js', array( 'jquery' ) );
|
||||
//wp_enqueue_script( 'gp_ajax_video_data_request', get_template_directory_uri() . '/lib/scripts/custom-ajax.js', array( 'jquery' ) );
|
||||
|
||||
// declare the URL to the file that handles the AJAX request (wp-admin/admin-ajax.php)
|
||||
wp_localize_script( 'gp_ajax_video_data_request', 'MyAjax', array(
|
||||
//'ajaxurl' => 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'] .= '<span>FROM: ' . $gp_settings['from_user_link'] . '</span> ';
|
||||
$array[$i]['from_to_text'] .= $gp_settings['to_flag'];
|
||||
$array[$i]['from_to_text'] .= '<span>TO: ' . $gp_settings['to_user_link'] . '</span>';
|
||||
|
||||
$i++;
|
||||
|
||||
break;
|
||||
}
|
||||
wp_reset_postdata();
|
||||
$listavideos = NULL;
|
||||
|
||||
$salida = '';
|
||||
foreach($array as $video) {
|
||||
$salida .= '<li id="playlist-element-' . $video['id'] . '" data-path="' . $video['video_path'] . '" data-type="' . $video['video_type']. '">';
|
||||
$salida .= '<span id="postdata-id-' . $video['id'] . '">' . $video['id'] . '</span>';
|
||||
$salida .= '<span id="postdata-title-' . $video['id'] . '"><a href="' . $video['permalink']. '" title="' . $video['title']. '">' . $video['title']. '</a></span>';
|
||||
$salida .= '<span id="postdata-artist-' . $video['id'] . '">' . $video['artist']. '</span>';
|
||||
$salida .= '<span id="postdata-song-' . $video['id'] . '">' . $video['song']. '</span>';
|
||||
$salida .= '<span id="postdata-link-' . $video['id'] . '">' . $video['permalink']. '</span>';
|
||||
$salida .= '<span id="postdata-extlink-' . $video['id'] . '">' . $video['extlink']. '</span>';
|
||||
$salida .= '<span id="postdata-comments-' . $video['id'] . '"></span>';
|
||||
|
||||
if ($video['unreaded']) {
|
||||
$salida .= '<span id="postdata-mark-read-' . $video['id'] . '">';
|
||||
$salida .= mar_read_unread_links('', '', false);
|
||||
$salida .= '</span>';
|
||||
}
|
||||
$salida .= '<span id="postdata-from-to-' . $video['id'] . '">';
|
||||
$salida .= $video['from_to_text'];
|
||||
$salida .= '</span>';
|
||||
|
||||
$salida .= '</li>';
|
||||
}
|
||||
$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');
|
||||
|
||||
?>
|
||||
<?php
|
||||
require_once( ABSPATH . "wp-config.php" );
|
||||
|
||||
function gp_enqueue_ajax_scripts() {
|
||||
if (!is_admin()) {
|
||||
// embed the javascript file that makes the AJAX request
|
||||
wp_enqueue_script( 'gp_ajax_video_data_request', get_template_directory_uri() . '/lib/scripts/custom-ajax.min.js', array( 'jquery' ) );
|
||||
//wp_enqueue_script( 'gp_ajax_video_data_request', get_template_directory_uri() . '/lib/scripts/custom-ajax.js', array( 'jquery' ) );
|
||||
|
||||
// declare the URL to the file that handles the AJAX request (wp-admin/admin-ajax.php)
|
||||
wp_localize_script( 'gp_ajax_video_data_request', 'MyAjax', array(
|
||||
//'ajaxurl' => 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' => -1,
|
||||
'posts_per_page' => -1,
|
||||
'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: Si tiene ninguna dedicatoria (por él / para él)
|
||||
// mejor mostrar estas dedicadas. El resto se descartan.
|
||||
if ( $bp->current_component == BP_DEDICATION_SLUG ) {
|
||||
$usuario_tiene_dedicatorias = (bp_dedication_exist_dedications_to_user($displayed_id)) ||
|
||||
(bp_dedication_exist_dedications_from_user($displayed_id));
|
||||
|
||||
if ($usuario_tiene_dedicatorias && ($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]['img_src'] = $gp_settings['img_src'];
|
||||
$array[$i]['unreaded'] = $gp_settings['unreaded'];
|
||||
|
||||
$array[$i]['from_to_text'] = $gp_settings['from_flag'];
|
||||
$array[$i]['from_to_text'] .= '<span>FROM: ' . $gp_settings['from_user_link'] . '</span> ';
|
||||
$array[$i]['from_to_text'] .= $gp_settings['to_flag'];
|
||||
$array[$i]['from_to_text'] .= '<span>TO: ' . $gp_settings['to_user_link'] . '</span>';
|
||||
|
||||
$i++;
|
||||
|
||||
break;
|
||||
}
|
||||
wp_reset_postdata();
|
||||
$listavideos = NULL;
|
||||
|
||||
$salida = '';
|
||||
foreach($array as $video) {
|
||||
$salida .= '<li id="playlist-element-' . $video['id'] . '" data-path="' . $video['video_path'] . '" data-type="' . $video['video_type']. '">';
|
||||
$salida .= '<span id="postdata-id-' . $video['id'] . '">' . $video['id'] . '</span>';
|
||||
$salida .= '<span id="postdata-title-' . $video['id'] . '"><a href="' . $video['permalink']. '" title="' . $video['title']. '">' . $video['title']. '</a></span>';
|
||||
$salida .= '<span id="postdata-artist-' . $video['id'] . '">' . $video['artist']. '</span>';
|
||||
$salida .= '<span id="postdata-song-' . $video['id'] . '">' . $video['song']. '</span>';
|
||||
$salida .= '<span id="postdata-link-' . $video['id'] . '">' . $video['permalink']. '</span>';
|
||||
$salida .= '<span id="postdata-extlink-' . $video['id'] . '">' . $video['extlink']. '</span>';
|
||||
$salida .= '<span id="postdata-comments-' . $video['id'] . '"></span>';
|
||||
$salida .= '<span id="postdata-imgsrc-' . $video['id'] . '"><img src="' . $video['img_src']. '"/></span>';
|
||||
|
||||
if ($video['unreaded']) {
|
||||
$salida .= '<span id="postdata-mark-read-' . $video['id'] . '">';
|
||||
$salida .= mar_read_unread_links('', '', false);
|
||||
$salida .= '</span>';
|
||||
}
|
||||
$salida .= '<span id="postdata-from-to-' . $video['id'] . '">';
|
||||
$salida .= $video['from_to_text'];
|
||||
$salida .= '</span>';
|
||||
|
||||
$salida .= '</li>';
|
||||
}
|
||||
$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');
|
||||
|
||||
?>
|
||||
|
||||
@ -127,15 +127,19 @@ function updateInfo() {
|
||||
var song = jQuery('#postdata-song-' + id).html();
|
||||
var link = jQuery('#postdata-link-' + id).html();
|
||||
var enc_link = jQuery('#postdata-extlink-' + id).html();
|
||||
var src_img = jQuery('#postdata-imgsrc-' + id + ' img').attr("src");
|
||||
|
||||
var nUrl = oUrl + 'id/' + the_id;
|
||||
|
||||
jQuery('#dedicate_this_song_button').attr("href", nUrl);
|
||||
|
||||
// Social networks
|
||||
nUrl = 'https://www.facebook.com/sharer.php?u=' + enc_link;
|
||||
nUrl = 'http://www.facebook.com/sharer.php?s=100';
|
||||
nUrl = nUrl + '&p[url]=' + enc_link;
|
||||
nUrl = nUrl + '&p[title]=' + jQuery('#postdata-title-' + id).text();
|
||||
nUrl = nUrl + '&p[summary]=' + artist + ' ' + song;
|
||||
nUrl = nUrl + '&p[images][0]=' + src_img;
|
||||
jQuery('#fsbbtn a').attr("href", nUrl);
|
||||
nUrl = 'http://twitter.com/intent/tweet?source=sharethiscom&url=' + enc_link;
|
||||
nUrl = 'http://twitter.com/intent/tweet?source=asong2u&url=' + enc_link;
|
||||
jQuery('#twtbtn a').attr("href", nUrl);
|
||||
nUrl = 'https://plusone.google.com/_/+1/confirm?url=' + enc_link;
|
||||
jQuery('#gpsbtn a').attr("href", nUrl);
|
||||
|
||||
@ -7,10 +7,10 @@ jQuery(".dedication-profile .home_column_my_dedications img.read-more-loader").r
|
||||
function(a){a=jQuery(a).find("#content").children();jQuery.each(a,function(){jQuery(this).hasClass("post-loop")&&(jQuery(this).removeClass("post type-post status-publish format-standard hentry category-dedication"),jQuery(this).addClass("home-my-dedications"),jQuery(this).addClass("home-dedicated-2-me"));jQuery(".dedication-profile .home_column_dedicated_2_me img.read-more-loader").remove();jQuery(".dedication-profile .home_column_dedicated_2_me a.read-more").remove();jQuery(".dedication-profile .home_column_dedicated_2_me").append(jQuery(this))})})})});
|
||||
var aIndex=-1,oUrl="";
|
||||
function updateInfo(){var a=jQuery.fn.videoGallery.getMediaID(),a=jQuery(jQuery("#playlist li").get(a)).attr("id").replace("playlist-element-","");if(aIndex!=a&&0<=a){aIndex=a;""==oUrl&&(oUrl=jQuery("#dedicate_this_song_button").attr("href"));var b=jQuery("#postdata-id-"+a).text(),e=jQuery("#postdata-title-"+a).html(),c=jQuery("#postdata-from-to-"+a).html(),f=jQuery("#postdata-artist-"+a).html(),g=jQuery("#postdata-song-"+a).html(),h=jQuery("#postdata-link-"+a).html(),d=jQuery("#postdata-extlink-"+a).html(),
|
||||
b=oUrl+"id/"+b;jQuery("#dedicate_this_song_button").attr("href",b);jQuery("#fsbbtn a").attr("href","https://www.facebook.com/sharer.php?u="+d);jQuery("#twtbtn a").attr("href","http://twitter.com/intent/tweet?source=sharethiscom&url="+d);jQuery("#gpsbtn a").attr("href","https://plusone.google.com/_/+1/confirm?url="+d);jQuery("#mysbtn a").attr("href",'javascript:void(window.open("http://www.myspace.com/Modules/PostTo/Pages/?u='+d+'"+encodeURIComponent(document.location.toString()),"ptm","height=450,width=550").focus())');
|
||||
jQuery("#dedication-data-panel").hide("fast");jQuery("#dedication-data-panel").slideUp("fast",function(){jQuery("#dedication-data-panel").html(c);jQuery("#dedicationTitle-data-panel").html(c)});jQuery("#dedication-data-panel").slideDown();jQuery("#dedicationFooter_container").slideUp("fast",function(){jQuery("#dedicationArtits").html(f);jQuery("#dedicationSong").html(g)});jQuery("#dedicationFooter_container").slideDown("fast",function(){});jQuery("#dedicationTitle").html(e);shrinkTitle();jQuery("#dedicationTitle a").jTypeWriter();
|
||||
jQuery("#dedicationComments_container").slideUp("fast",function(){jQuery("#dedicationComments_container").load(h+" #comments","",function(){init_comments();jQuery("#dedicationComments_container").on("submit","#commentform",function(){prepare_new_comment_home();return!1})})});jQuery("#dedicationComments_container").slideDown();0<jQuery("#postdata-mark-read-"+a).length&&(markAsRead(a),jQuery("#postdata-mark-read-"+a).remove(),jQuery(".post-"+a+".home-dedicated-2-me a .new-label").remove())}}
|
||||
function markAsRead(a){jQuery.post(mark_as_read_js.ajaxurl,{action:"mark_post_as_read",post_read:a},function(){"1"==mark_as_read_js.show_alerts&&alert(read_message);jQuery("#header .navmenu .profile .sign").text(jQuery("#header .navmenu .profile .sign").text()-1)});return!1}
|
||||
i=jQuery("#postdata-imgsrc-"+a+" img").attr("src"),b=oUrl+"id/"+b;jQuery("#dedicate_this_song_button").attr("href",b);b="http://www.facebook.com/sharer.php?s=100&p[url]="+d+"&p[title]="+jQuery("#postdata-title-"+a).text();b=b+"&p[summary]="+f+" "+g;b=b+"&p[images][0]="+i;jQuery("#fsbbtn a").attr("href",b);jQuery("#twtbtn a").attr("href","http://twitter.com/intent/tweet?source=asong2u&url="+d);jQuery("#gpsbtn a").attr("href","https://plusone.google.com/_/+1/confirm?url="+d);jQuery("#mysbtn a").attr("href",
|
||||
'javascript:void(window.open("http://www.myspace.com/Modules/PostTo/Pages/?u='+d+'"+encodeURIComponent(document.location.toString()),"ptm","height=450,width=550").focus())');jQuery("#dedication-data-panel").hide("fast");jQuery("#dedication-data-panel").slideUp("fast",function(){jQuery("#dedication-data-panel").html(c);jQuery("#dedicationTitle-data-panel").html(c)});jQuery("#dedication-data-panel").slideDown();jQuery("#dedicationFooter_container").slideUp("fast",function(){jQuery("#dedicationArtits").html(f);
|
||||
jQuery("#dedicationSong").html(g)});jQuery("#dedicationFooter_container").slideDown("fast",function(){});jQuery("#dedicationTitle").html(e);shrinkTitle();jQuery("#dedicationTitle a").jTypeWriter();jQuery("#dedicationComments_container").slideUp("fast",function(){jQuery("#dedicationComments_container").load(h+" #comments","",function(){init_comments();jQuery("#dedicationComments_container").on("submit","#commentform",function(){prepare_new_comment_home();return!1})})});jQuery("#dedicationComments_container").slideDown();
|
||||
0<jQuery("#postdata-mark-read-"+a).length&&(markAsRead(a),jQuery("#postdata-mark-read-"+a).remove(),jQuery(".post-"+a+".home-dedicated-2-me a .new-label").remove())}}function markAsRead(a){jQuery.post(mark_as_read_js.ajaxurl,{action:"mark_post_as_read",post_read:a},function(){"1"==mark_as_read_js.show_alerts&&alert(read_message);jQuery("#header .navmenu .profile .sign").text(jQuery("#header .navmenu .profile .sign").text()-1)});return!1}
|
||||
function shrinkTitle(){var a=document.getElementById("dedicationTitle"),b=document.getElementById("dedicationTitle_container");for(a.style.fontSize="42px";a.offsetWidth>b.offsetWidth;)size=parseInt(a.style.fontSize.replace("px","")),size-=1,a.style.fontSize=size+"px";a.style.fontSize-=NaN}
|
||||
jQuery(window).ready(function(){0<jQuery("#slider-wrapper").length&&jQuery("#content-wrapper .post-loop .post-thumbnail a").live("click",function(a){a.preventDefault();a=jQuery(this).parent().parent();a=jQuery(a).attr("class").split(" ");jQuery(a).each(function(a,e){var c=e.replace("post-","");if(jQuery.isNumeric(c))return loadVideo(c),jQuery("html, body").animate({scrollTop:0},600),!1});return!1})});
|
||||
jQuery(document).ready(function(){jQuery("#sidebar .sidebarposts .top_10 .posts").hide();jQuery("#sidebar .sidebarposts .top_10 h3").click(function(){jQuery("#sidebar .sidebarposts .top_10 .posts").toggle("slow",function(){})})});jQuery(document).ready(function(){jQuery("#my-friends-big-avatars div.see_more").hide();jQuery("#my-friends-big-avatars span.see_more").click(function(){jQuery("#my-friends-big-avatars span.see_more").hide();jQuery("#my-friends-big-avatars div.see_more").toggle("fast",function(){})})});
|
||||
|
||||
@ -17,6 +17,11 @@ if(get_post_meta($post->ID, 'ghostpool_thumbnail_height', true) && get_post_meta
|
||||
$gp_settings['image_height'] = $gp_settings['thumbnail_height'];
|
||||
}
|
||||
|
||||
$post_thumbnail_img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID));
|
||||
if ($post_thumbnail_img)
|
||||
$gp_settings['img_src'] = $post_thumbnail_img[0];
|
||||
|
||||
|
||||
$gp_settings['enc_link'] = add_query_arg('refid', bp_dedication_encode(get_permalink()), get_option('siteurl') . '/index.php');
|
||||
|
||||
// Song data
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
<ul>
|
||||
<?php if (is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
|
||||
|
||||
<li class="selected" id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/' ?>"><?php printf( __( 'My Friends <span>%s</span>', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
|
||||
<li class="selected" id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/' ?>"><?php printf( __( 'My Friends', 'buddypress' ) ); ?></a></li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
|
||||
<?php if (bp_friend_get_total_requests_count() != "0" ): ?>
|
||||
|
||||
<li id="members-request"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/request/' ?>"><?php printf( __( 'Friend requests <span>%s</span>', 'buddypress' ), bp_friend_get_total_requests_count(bp_loggedin_user_id()) ); ?></a></li>
|
||||
<li id="members-request2"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/' ?>"><?php printf( __( '<div>Friend requests %s</div>', 'buddypress' ), bp_friend_get_total_requests_count(bp_loggedin_user_id()) ); ?></a></li>
|
||||
|
||||
<?php endif;?>
|
||||
|
||||
|
||||
@ -15,15 +15,26 @@ get_currentuserinfo();
|
||||
if ($_ishome || ( $bp->current_component == BP_DEDICATION_SLUG )) {
|
||||
$dedication_orderby = "rand";
|
||||
$category_name = 'dedication';
|
||||
$post_status = array('publish');
|
||||
|
||||
|
||||
if (( $bp->current_component == BP_DEDICATION_SLUG )) {
|
||||
$post_status = array('publish', 'private');
|
||||
} else {
|
||||
$post_status = array('publish');
|
||||
}
|
||||
|
||||
$args = array(
|
||||
'post_type' => array('post'),
|
||||
'orderby' => $dedication_orderby,
|
||||
'numberposts' => -1,
|
||||
'posts_per_page' => -1,
|
||||
'post_status' => $post_status,
|
||||
'category_name' => $category_name,
|
||||
'post_status' => $post_status,
|
||||
);
|
||||
|
||||
$usuario_tiene_dedicatorias = (bp_dedication_exist_dedications_to_user($displayed_id)) ||
|
||||
(bp_dedication_exist_dedications_from_user($displayed_id));
|
||||
|
||||
query_posts($args);
|
||||
}
|
||||
|
||||
@ -59,11 +70,11 @@ if (have_posts()) {
|
||||
<ul id='playlist'>
|
||||
<?php
|
||||
while (have_posts()) : the_post(); include('loop-dedication-data.php');
|
||||
|
||||
$displayed_id = bp_displayed_user_id();
|
||||
|
||||
// Perfil del usuario: sólo mostrar las dedicadas por él y para él. El resto se descartan.
|
||||
if ( $bp->current_component == BP_DEDICATION_SLUG ) {
|
||||
// Perfil del usuario: Si tiene ninguna dedicatoria (por él / para él)
|
||||
// mejor mostrar estas dedicadas. El resto se descartan.
|
||||
if ( $bp->current_component == BP_DEDICATION_SLUG && $usuario_tiene_dedicatorias) {
|
||||
if (($displayed_id != $gp_settings['from_user_id']) && ($displayed_id != $gp_settings['to_user_id'])) {
|
||||
continue; // me salto esta dedicatoria
|
||||
}
|
||||
@ -77,14 +88,16 @@ if (have_posts()) {
|
||||
<span id="postdata-link-<?php the_ID(); ?>"><?php the_permalink(); ?></span>
|
||||
<span id="postdata-extlink-<?php the_ID(); ?>"><?php echo $gp_settings['enc_link']; ?></span>
|
||||
<span id="postdata-comments-<?php the_ID(); ?>"></span>
|
||||
<span id="postdata-imgsrc-<?php the_ID(); ?>"><img src="<?php echo $gp_settings['img_src']; ?>"/></span>
|
||||
<?php if (($theme_show_new_label) && ($gp_settings['unreaded'])) { ?><span id="postdata-mark-read-<?php the_ID(); ?>"><?php echo mar_read_unread_links('', '', false); ?></span><?php } ?>
|
||||
<span id="postdata-from-to-<?php the_ID(); ?>">
|
||||
<span id="postdata-from-to-<?php the_ID(); ?>">
|
||||
<?php echo $gp_settings['from_flag']; ?><span>FROM: <?php echo $gp_settings['from_user_link']; ?></span>
|
||||
<?php echo $gp_settings['to_flag']; ?>
|
||||
<span>TO: <?php echo $gp_settings['to_user_link']; ?></span>
|
||||
</span>
|
||||
</li>
|
||||
<?php break; endwhile; ?>
|
||||
<?php _log('Se acabó!'); ?>
|
||||
</ul>
|
||||
</div> <!-- componentPlaylist -->
|
||||
<div class="slideshow_controls">
|
||||
|
||||
@ -444,7 +444,7 @@ case 'retrievepassword' :
|
||||
<p id="nav">
|
||||
<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e('Log in') ?></a>
|
||||
<?php if ( get_option( 'users_can_register' ) ) : ?>
|
||||
| <a href="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login' ) ); ?>"><?php _e( 'Register' ); ?></a>
|
||||
| <a href="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login' ) ); ?>"><?php _e( 'Join' ); ?></a>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
@ -500,7 +500,7 @@ case 'rp' :
|
||||
<p id="nav">
|
||||
<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
|
||||
<?php if ( get_option( 'users_can_register' ) ) : ?>
|
||||
| <a href="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login' ) ); ?>"><?php _e( 'Register' ); ?></a>
|
||||
| <a href="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login' ) ); ?>"><?php _e( 'Join' ); ?></a>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
@ -702,7 +702,7 @@ default:
|
||||
<p id="nav">
|
||||
<?php if ( isset($_GET['checkemail']) && in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?>
|
||||
<?php elseif ( get_option('users_can_register') ) : ?>
|
||||
<a href="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login' ) ); ?>"><?php _e( 'Register' ); ?></a> |
|
||||
<a href="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login' ) ); ?>"><?php _e( 'Join' ); ?></a> |
|
||||
<a id="forgotYourPassword" href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ); ?>"><?php _e( 'Forgot your password?' ); ?></a>
|
||||
<?php else : ?>
|
||||
<a id="forgotYourPassword" href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ); ?>"><?php _e( 'Forgot your password?' ); ?></a>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user