Tarea #1054 -> Mejorar el rendimiento de la web
git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@161 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
This commit is contained in:
parent
05640be620
commit
ab145ccae0
@ -99,7 +99,7 @@ function bp_dedication_new_dedication() {
|
||||
if ( bp_is_dedication_component() && bp_is_current_action( 'new-dedication' ) && bp_is_action_variable( 'create', 0 ) ) {
|
||||
|
||||
if (bp_dedication_create_new_dedication()) {
|
||||
bp_core_add_message( __( 'Your dedication was created!', 'bp-dedication' ) );
|
||||
bp_core_add_message( __( 'Your dedication has been sent successfully', 'bp-dedication' ) );
|
||||
bp_core_redirect( bp_loggedin_user_domain() . bp_get_dedication_slug());
|
||||
} else {
|
||||
bp_core_add_message( __( 'Error. Your dedication not was created!', 'bp-dedication' ) );
|
||||
|
||||
@ -292,7 +292,7 @@ function invite_anyone_setup_nav() {
|
||||
) );
|
||||
|
||||
bp_core_new_subnav_item( array(
|
||||
'name' => __( 'Sent Invites', 'bp-invite-anyone' ),
|
||||
'name' => __( 'Sent invitations', 'bp-invite-anyone' ),
|
||||
'slug' => 'sent-invites',
|
||||
'parent_slug' => $bp->invite_anyone->slug,
|
||||
'parent_url' => $invite_anyone_link,
|
||||
@ -689,7 +689,7 @@ function invite_anyone_screen_two() {
|
||||
|
||||
?>
|
||||
|
||||
<h4><?php _e( 'Sent Invites', 'bp-invite-anyone' ); ?></h4>
|
||||
<h4><?php _e( 'Sent invitatios', 'bp-invite-anyone' ); ?></h4>
|
||||
|
||||
<?php $invites = invite_anyone_get_invitations_by_inviter_id( bp_loggedin_user_id(), $sort_by, $order, $pagination->get_per_page, $pagination->get_paged ) ?>
|
||||
|
||||
@ -709,9 +709,9 @@ function invite_anyone_screen_two() {
|
||||
</div>
|
||||
|
||||
<table class="invite-anyone-sent-invites zebra"
|
||||
summary="<?php _e( 'This table displays a list of all your sent invites.
|
||||
Invites that have been accepted are highlighted in the listings.
|
||||
You may clear any individual invites, all accepted invites or all of the invites from the list.', 'bp-invite-anyone' ) ?>">
|
||||
summary="<?php _e( 'This table displays a list of all your sent invitations.
|
||||
Invitations that have been accepted are highlighted in the listings.
|
||||
You may clear any individual invitation, all accepted invitations or all of the invitations from the list.', 'bp-invite-anyone' ) ?>">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"></th>
|
||||
@ -726,8 +726,8 @@ function invite_anyone_screen_two() {
|
||||
<tr id="batch-clear">
|
||||
<td colspan="5" >
|
||||
<ul id="invite-anyone-clear-links">
|
||||
<li> <a title="<?php _e( 'Clear all accepted invites from the list', 'bp-invite-anyone' ) ?>" class="confirm" href="<?php echo wp_nonce_url( $base_url . '?clear=accepted', 'invite_anyone_clear' ) ?>"><?php _e( 'Clear all accepted invitations', 'bp-invite-anyone' ) ?></a></li>
|
||||
<li class="last"><a title="<?php _e( 'Clear all your listed invites', 'bp-invite-anyone' ) ?>" class="confirm" href="<?php echo wp_nonce_url( $base_url . '?clear=all', 'invite_anyone_clear' ) ?>"><?php _e( 'Clear all invitations', 'bp-invite-anyone' ) ?></a></li>
|
||||
<li> <a title="<?php _e( 'Clear all accepted invitations from the list', 'bp-invite-anyone' ) ?>" class="confirm" href="<?php echo wp_nonce_url( $base_url . '?clear=accepted', 'invite_anyone_clear' ) ?>"><?php _e( 'Clear all accepted invitations', 'bp-invite-anyone' ) ?></a></li>
|
||||
<li class="last"><a title="<?php _e( 'Clear all your listed invitations', 'bp-invite-anyone' ) ?>" class="confirm" href="<?php echo wp_nonce_url( $base_url . '?clear=all', 'invite_anyone_clear' ) ?>"><?php _e( 'Clear all invitations', 'bp-invite-anyone' ) ?></a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
| Description : This file contains the default global
|
||||
| enviroment values
|
||||
| Author : Luca Grandicelli
|
||||
| Author URL : http://www.lucagrandicelli.com
|
||||
| Plugin URL : http://www.lucagrandicelli.com/special-recent-posts-plugin-for-wordpress/
|
||||
| Author URL :
|
||||
| Plugin URL :
|
||||
| --------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ $dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) .
|
||||
$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); ?>
|
||||
@ -21,7 +22,7 @@ $dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) .
|
||||
|
||||
<?php include(dirname(__FILE__).'/../../loop-dedication-data.php'); ?>
|
||||
|
||||
<div class="home-dedicated-2-me post-loop"<?php // post_class('post-loop'); ?>>
|
||||
<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 } ?>">
|
||||
|
||||
@ -10,6 +10,7 @@ $dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) .
|
||||
$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); ?>
|
||||
@ -21,7 +22,7 @@ $dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) .
|
||||
|
||||
<?php include(dirname(__FILE__).'/../../loop-dedication-data.php'); ?>
|
||||
|
||||
<div class="home-my-dedications post-loop" <?php // post_class('post-loop'); ?>>
|
||||
<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 } ?>">
|
||||
|
||||
@ -52,6 +52,7 @@ add_action( 'wp_footer', 'wp_print_head_scripts', 5 );
|
||||
// Main Theme Options
|
||||
require_once(ghostpool_admin . 'theme-options.php');
|
||||
require(ghostpool_inc . 'options.php');
|
||||
require(ghostpool_inc . 'fetch-video-data.php');
|
||||
|
||||
// Meta Options
|
||||
require_once(ghostpool_admin . 'theme-meta-options.php');
|
||||
@ -524,9 +525,7 @@ function gp_ajax_pagination($pages = '', $range = 2) {
|
||||
if ($paged + 1 <= $pages) {
|
||||
echo "<a href='" . get_pagenum_link($paged + 1) . "' class='read-more' title='". __('See More', 'gp_lang') . "'>" . __('See More', 'gp_lang') . "</a>";
|
||||
echo "<img class='read-more-loader' src='" . get_template_directory_uri() . "/lib/images/loader.gif' style='display:none;'/>";
|
||||
|
||||
}
|
||||
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ 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,
|
||||
@ -43,7 +44,7 @@ if (have_posts()) :
|
||||
|
||||
$urls_video[] = $gp_settings['video'];
|
||||
endwhile;
|
||||
endif;
|
||||
endif;*/
|
||||
|
||||
$args = array(
|
||||
"cat" => $gp_settings['cats'],
|
||||
@ -52,7 +53,7 @@ $args = array(
|
||||
"order" => $order,
|
||||
"paged" => $paged,
|
||||
"posts_per_page" => $gp_settings['posts_per_page'],
|
||||
"post__not_in" => $ids_descartados
|
||||
//"post__not_in" => $ids_descartados
|
||||
);
|
||||
|
||||
query_posts($args);
|
||||
|
||||
124
wp-content/themes/score/lib/inc/fetch-video-data.php
Normal file
124
wp-content/themes/score/lib/inc/fetch-video-data.php
Normal file
@ -0,0 +1,124 @@
|
||||
<?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;
|
||||
|
||||
$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' => -1,
|
||||
'post_status' => $post_status,
|
||||
'category_name' => $category_name,
|
||||
);
|
||||
}
|
||||
$array = array();
|
||||
$i = 0;
|
||||
|
||||
$video = new WP_Query($args);
|
||||
while ($video->have_posts()) {
|
||||
$video->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();
|
||||
|
||||
$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 (($theme_show_new_label) && ($video['unreadedid'])) {
|
||||
$salida .= '<span id="postdata-mark-read-' . $video['id'] . '">' . mar_read_unread_links('', '', false) . '</span>';
|
||||
}
|
||||
$salida .= '<span id="postdata-from-to-' . $video['id'] . '">';
|
||||
$salida .= $video['from_to_text'];
|
||||
$salida .= '</span>';
|
||||
|
||||
$salida .= '</li>';
|
||||
}
|
||||
|
||||
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');
|
||||
|
||||
?>
|
||||
@ -24,7 +24,6 @@ jQuery(document).ready(function(){
|
||||
} else {
|
||||
jQuery('#the_slider').addClass('fullscreen_div');
|
||||
_fullscreen.attr('src', _srcimg.replace('fullscreen.png', 'fullscreen_exit.png'));
|
||||
//_fullscreen.parent().appendTo(jQuery('.slideshow_controls'));
|
||||
_fullscreen.parent().appendTo(jQuery('#componentWrapper'));
|
||||
}
|
||||
calc_video_height();
|
||||
@ -62,36 +61,43 @@ jQuery(document).ready(function(){
|
||||
});
|
||||
|
||||
jQuery('.dedication-profile .home_column_my_dedications a.read-more').live('click', function(e){
|
||||
jQuery('.dedication-profile .home_column_my_dedications img.read-more-loader').css('display', 'inline');
|
||||
e.preventDefault();
|
||||
link = jQuery(this).attr('href');
|
||||
jQuery('.dedication-profile .home_column_my_dedications a.read-more').remove();
|
||||
|
||||
jQuery.get(link, function(data) {
|
||||
var kids = jQuery(data).find('#content').children();
|
||||
jQuery.each(kids, function(){
|
||||
if (jQuery(this).hasClass('post-loop')) {
|
||||
jQuery(this).removeClass();
|
||||
jQuery(this).addClass('home-my-dedications post-loop');
|
||||
jQuery(this).removeClass('post type-post status-publish format-standard hentry category-dedication');
|
||||
jQuery(this).addClass('home-my-dedications');
|
||||
}
|
||||
jQuery('.dedication-profile .home_column_my_dedications img.read-more-loader').remove();
|
||||
jQuery('.dedication-profile .home_column_my_dedications a.read-more').remove();
|
||||
|
||||
jQuery('.dedication-profile .home_column_my_dedications').append(jQuery(this));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
jQuery('.dedication-profile .home_column_dedicated_2_me a.read-more').live('click', function(e){
|
||||
jQuery('.dedication-profile .home_column_dedicated_2_me img.read-more-loader').css('display', 'inline');
|
||||
e.preventDefault();
|
||||
link = jQuery(this).attr('href');
|
||||
jQuery('.dedication-profile .home_column_dedicated_2_me a.read-more').remove();
|
||||
|
||||
jQuery.get(link, function(data) {
|
||||
var kids = jQuery(data).find('#content').children();
|
||||
jQuery.each(kids, function(){
|
||||
if (jQuery(this).hasClass('post-loop')) {
|
||||
jQuery(this).removeClass();
|
||||
jQuery(this).addClass('home-dedicated-2-me 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));
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -103,6 +109,9 @@ var oUrl='';
|
||||
|
||||
function updateInfo() {
|
||||
var id = jQuery.fn.videoGallery.getMediaID();
|
||||
var li_element = jQuery((jQuery('#playlist li').get(id))).attr('id');
|
||||
|
||||
id = li_element.replace('playlist-element-','');
|
||||
|
||||
if ((aIndex != id) && (id >= 0)) {
|
||||
aIndex = id;
|
||||
@ -120,6 +129,7 @@ function updateInfo() {
|
||||
var enc_link = jQuery('#postdata-extlink-' + id).html();
|
||||
|
||||
var nUrl = oUrl + 'id/' + the_id;
|
||||
|
||||
jQuery('#dedicate_this_song_button').attr("href", nUrl);
|
||||
|
||||
// Social networks
|
||||
@ -201,22 +211,20 @@ function shrinkTitle()
|
||||
}
|
||||
|
||||
jQuery(window).ready(function() {
|
||||
|
||||
if (jQuery('#slider-wrapper').length > 0 ) {
|
||||
jQuery('#content-wrapper .post-loop .post-thumbnail a').click(function(e) {
|
||||
e.preventDefault();
|
||||
var oUrl = jQuery(this).attr('href');
|
||||
jQuery('#playlist li [id^=postdata-link-]').each(function(indice, valor){
|
||||
var nUrl = jQuery(this).html();
|
||||
if (nUrl == oUrl) {
|
||||
jQuery('#componentWrapper').videoGallery.loadMedia(indice);
|
||||
jQuery('html, body').animate({ scrollTop: 0 }, 600);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
jQuery('#content-wrapper .post-loop .post-thumbnail a').live('click', function(e) {
|
||||
e.preventDefault();
|
||||
var nParent = (jQuery(this).parent().parent());
|
||||
var classList = jQuery(nParent).attr('class').split(' ');
|
||||
jQuery(classList).each(function(index, item) {
|
||||
var id = item.replace('post-','');
|
||||
if (jQuery.isNumeric(id)) {
|
||||
loadVideo(id);
|
||||
jQuery('html, body').animate({ scrollTop: 0 }, 600);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
File diff suppressed because one or more lines are too long
42
wp-content/themes/score/lib/scripts/custom-ajax.js
Normal file
42
wp-content/themes/score/lib/scripts/custom-ajax.js
Normal file
@ -0,0 +1,42 @@
|
||||
jQuery(window).ready(function() {
|
||||
|
||||
jQuery('.controls_prev').bind('click', function(){
|
||||
jQuery.fn.videoGallery.previousMedia();
|
||||
return false;
|
||||
});
|
||||
jQuery('.controls_next').bind('click', function(){
|
||||
if (jQuery.fn.videoGallery.isLastMedia()) {
|
||||
loadVideo(0);
|
||||
} else {
|
||||
jQuery.fn.videoGallery.nextMedia();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
function loadVideo(videoid) {
|
||||
jQuery.ajax({
|
||||
type:'POST',
|
||||
data:{
|
||||
postCommentNonce : MyAjax.postCommentNonce,
|
||||
action:'gp_video_data',
|
||||
id: videoid
|
||||
},
|
||||
url: ajaxurl,
|
||||
success: function(value) {
|
||||
jQuery('#playlist').append(value);
|
||||
jQuery.fn.videoGallery.inputPlaylist('playlist');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function activePlaylist(playlist) {
|
||||
jQuery.fn.videoGallery.destroyMedia();
|
||||
jQuery.fn.videoGallery.inputPlaylist(playlist);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
1
wp-content/themes/score/lib/scripts/custom-ajax.min.js
vendored
Normal file
1
wp-content/themes/score/lib/scripts/custom-ajax.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
jQuery(window).ready(function(){jQuery(".controls_prev").bind("click",function(){jQuery.fn.videoGallery.previousMedia();return!1});jQuery(".controls_next").bind("click",function(){jQuery.fn.videoGallery.isLastMedia()?loadVideo(0):jQuery.fn.videoGallery.nextMedia();return!1});return!1}); function loadVideo(a){jQuery.ajax({type:"POST",data:{postCommentNonce:MyAjax.postCommentNonce,action:"gp_video_data",id:a},url:ajaxurl,success:function(a){jQuery("#playlist").append(a);jQuery.fn.videoGallery.inputPlaylist("playlist")}});return!1}function activePlaylist(a){jQuery.fn.videoGallery.destroyMedia();jQuery.fn.videoGallery.inputPlaylist(a);return!1};
|
||||
@ -1,50 +1,53 @@
|
||||
<script>
|
||||
|
||||
jQuery(window).ready(function() {
|
||||
if (jQuery('#slider-wrapper')) {
|
||||
jQuery('#componentWrapper').videoGallery({
|
||||
componentFixedSize: true,
|
||||
animateVideoSizeOnPlaylistClose: true,
|
||||
thumbOrientation: 'vertical',
|
||||
activePlaylist:'playlist',
|
||||
activeVideo:0,
|
||||
autoPlay:true,
|
||||
loopingOn:false,
|
||||
randomPlay:false,
|
||||
autoAdvanceToNextVideo:true,
|
||||
youtubeChromeless:false,
|
||||
thumbWidth: 120,
|
||||
thumbHeight: 90,
|
||||
thumbsScrollValue: 150,
|
||||
autoOpenPlaylist: false,
|
||||
closePlaylistOnVideoSelect: false,
|
||||
thumbBackgroundColor: '#fff',
|
||||
iconLoader: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/loader.gif',
|
||||
iconClose: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/close.png',
|
||||
iconCloseOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/close_on.png',
|
||||
iconOpen: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/open.png',
|
||||
iconOpenOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/open_on.png',
|
||||
iconBackwardOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/backward_on.png',
|
||||
iconBackward: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/backward.png',
|
||||
iconForwardOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/forward_on.png',
|
||||
iconForward: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/forward.png',
|
||||
iconShare: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/share.png',
|
||||
iconShareOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/share_on.png',
|
||||
iconThumbForward: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_forward.png',
|
||||
iconThumbForwardV: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_forward_v.png',
|
||||
iconThumbForwardOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_forward_on.png',
|
||||
iconThumbForwardVOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_forward_v_on.png',
|
||||
iconThumbBackward: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_backward.png',
|
||||
iconThumbBackwardV: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_backward_v.png',
|
||||
iconThumbBackwardOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_backward_on.png',
|
||||
iconThumbBackwardVOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_backward_v_on.png',
|
||||
videoGallerySetupDone: function(){setInterval("updateInfo()", 750);},
|
||||
videoGalleryPlaylistEnd: function(){
|
||||
redirect();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
createVideoGallery();
|
||||
});
|
||||
|
||||
|
||||
function createVideoGallery() {
|
||||
jQuery('#componentWrapper').videoGallery({
|
||||
componentFixedSize: true,
|
||||
animateVideoSizeOnPlaylistClose: true,
|
||||
thumbOrientation: 'vertical',
|
||||
activePlaylist:'playlist',
|
||||
activeVideo:99999,
|
||||
autoPlay:true,
|
||||
loopingOn:false,
|
||||
randomPlay:false,
|
||||
autoAdvanceToNextVideo:true,
|
||||
youtubeChromeless:false,
|
||||
thumbWidth: 120,
|
||||
thumbHeight: 90,
|
||||
thumbsScrollValue: 150,
|
||||
autoOpenPlaylist: false,
|
||||
closePlaylistOnVideoSelect: false,
|
||||
thumbBackgroundColor: '#fff',
|
||||
iconLoader: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/loader.gif',
|
||||
iconClose: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/close.png',
|
||||
iconCloseOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/close_on.png',
|
||||
iconOpen: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/open.png',
|
||||
iconOpenOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/open_on.png',
|
||||
iconBackwardOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/backward_on.png',
|
||||
iconBackward: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/backward.png',
|
||||
iconForwardOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/forward_on.png',
|
||||
iconForward: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/forward.png',
|
||||
iconShare: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/share.png',
|
||||
iconShareOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/share_on.png',
|
||||
iconThumbForward: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_forward.png',
|
||||
iconThumbForwardV: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_forward_v.png',
|
||||
iconThumbForwardOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_forward_on.png',
|
||||
iconThumbForwardVOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_forward_v_on.png',
|
||||
iconThumbBackward: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_backward.png',
|
||||
iconThumbBackwardV: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_backward_v.png',
|
||||
iconThumbBackwardOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_backward_on.png',
|
||||
iconThumbBackwardVOn: '<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_backward_v_on.png',
|
||||
videoGalleryPlayMedia: function(){ updateInfo(); },
|
||||
videoGalleryPlaylistEnd: function(){
|
||||
loadVideo(0);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
@ -28,7 +28,7 @@
|
||||
// Resizer() resizes items based on the object width divided by the compressor * 10
|
||||
var resizer = function () {
|
||||
$this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)));
|
||||
console.log(Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)));
|
||||
//console.log(Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)));
|
||||
};
|
||||
|
||||
// Call once to set.
|
||||
|
||||
@ -1,13 +1,7 @@
|
||||
(function($) {
|
||||
|
||||
|
||||
|
||||
function VideoGallery(element, options) {
|
||||
|
||||
var self=this;
|
||||
|
||||
this.settings = $.extend({}, $.fn.videoGallery.defaults, options);
|
||||
|
||||
this.isMobile = jQuery.browser.mobile;
|
||||
//console.log(this.isMobile);
|
||||
|
||||
@ -331,6 +325,10 @@
|
||||
VideoGallery.prototype = {
|
||||
|
||||
// PUBLIC
|
||||
isLastMedia:function() {
|
||||
return this._playlistManager.getLastInOrder();
|
||||
},
|
||||
|
||||
getMediaID:function() {
|
||||
if(!this._componentInited || this._playlistTransitionOn) return;
|
||||
if(this._playlistManager.getCounter() == -1){
|
||||
@ -404,6 +402,10 @@
|
||||
inputPlaylist:function(id) {
|
||||
if(!this._componentInited || this._playlistTransitionOn) return;
|
||||
this._activePlaylist=id;
|
||||
this.refreshPlaylist(); //this._setPlaylist();
|
||||
},
|
||||
refreshPlaylist:function() {
|
||||
if(!this._componentInited || this._playlistTransitionOn) return;
|
||||
this._setPlaylist();
|
||||
},
|
||||
|
||||
@ -698,15 +700,15 @@
|
||||
}
|
||||
},
|
||||
_processYotubeSingleSuccess:function (response) {
|
||||
//console.log(response);
|
||||
/*
|
||||
/*console.log(response);
|
||||
|
||||
console.log(response.data);
|
||||
console.log(response.data.title);
|
||||
console.log(response.data.description);
|
||||
console.log(response.data.id);
|
||||
console.log(response.data.thumbnail.sqDefault);
|
||||
console.log(response.data.thumbnail.hqDefault);
|
||||
*/
|
||||
console.log(response.data.thumbnail.hqDefault);*/
|
||||
|
||||
|
||||
var obj = {}, _item;
|
||||
_item = response.data;
|
||||
@ -1399,12 +1401,16 @@
|
||||
if(self._autoAdvanceToNextVideo){
|
||||
self._mediaAdvance();
|
||||
}else{
|
||||
if(self.autoPlay) self._vimeoPlayer.api('play');
|
||||
if(self.autoPlay) {
|
||||
self._vimeoPlayer.api('play');
|
||||
}
|
||||
}
|
||||
});
|
||||
this._vimeoInited=true;
|
||||
this.settings.videoGalleryPlayMedia.call(this);
|
||||
}else{
|
||||
this._vimeoPlayer.initVideo(this._mediaPath);
|
||||
this.settings.videoGalleryPlayMedia.call(this);
|
||||
}
|
||||
},
|
||||
|
||||
@ -1427,10 +1433,12 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
this.settings.videoGalleryPlayMedia.call(this);
|
||||
this._youtubeInited=true;
|
||||
}else{
|
||||
this.youtubeHolder.css('left', 0+'px');
|
||||
this._youtubePlayer.initVideo(this._mediaPath);
|
||||
this.settings.videoGalleryPlayMedia.call(this);
|
||||
}
|
||||
},
|
||||
|
||||
@ -1625,6 +1633,13 @@
|
||||
$.fn.videoGallery.inputPlaylist = function(id) {
|
||||
videoGallery.inputPlaylist(id);
|
||||
}
|
||||
$.fn.videoGallery.refreshPlayList = function() {
|
||||
videoGallery.refreshPlaylist();
|
||||
}
|
||||
$.fn.videoGallery.isLastMedia = function() {
|
||||
return videoGallery.isLastMedia();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
};
|
||||
@ -1695,6 +1710,7 @@
|
||||
iconThumbBackwardOn: 'data/icons/thumb_backward_on.png',
|
||||
iconThumbBackwardVOn: 'data/icons/thumb_backward_v_on.png',
|
||||
|
||||
videoGalleryPlayMedia: function(){},
|
||||
videoGallerySetupDone: function(){}, //Callback, triggers when component is ready to receive public function calls
|
||||
videoGalleryPlaylistEnd: function(){} // Callback, triggers when playlist comes to an end (looping or not)
|
||||
//http://stackoverflow.com/questions/2534436/jquery-plugin-adding-callback-functionality
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -21,6 +21,25 @@ $gp_settings['enc_link'] = add_query_arg('refid', bp_dedication_encode(get_perma
|
||||
|
||||
// Song data
|
||||
$gp_settings['video'] = get_post_meta($post->ID, 'ghostpool_dedication_url', true);
|
||||
|
||||
if (isYoutubeVideo($gp_settings['video'])) {
|
||||
$gp_settings['video_type'] = 'youtube_single';
|
||||
if (strpos($gp_settings['video'], "youtube.com")) {
|
||||
$video = parse_str(parse_url($gp_settings['video'], PHP_URL_QUERY), $my_array_of_vars);
|
||||
$gp_settings['video_id'] = $my_array_of_vars['v'];
|
||||
$gp_settings['video_path'] = 'http://gdata.youtube.com/feeds/api/videos/' . $gp_settings['video_id'] . '?v=2&alt=jsonc';
|
||||
}
|
||||
if (strpos($gp_settings['video'], "youtu.be")) {
|
||||
$gp_settings['video_id'] = substr(parse_url($gp_settings['video'], PHP_URL_PATH), 1);
|
||||
$gp_settings['video_path'] = 'http://gdata.youtube.com/feeds/api/videos/' . $gp_settings['video_id'] . '?v=2&alt=jsonc';
|
||||
}
|
||||
}
|
||||
if (isVimeoVideo($gp_settings['video'])) {
|
||||
$gp_settings['video_type'] = 'vimeo_single';
|
||||
$gp_settings['video_id'] = substr(parse_url($gp_settings['video'], PHP_URL_PATH), 1);
|
||||
$gp_settings['video_path'] = 'http://vimeo.com/api/v2/video/' . $gp_settings['video_id'] . '.json';
|
||||
}
|
||||
|
||||
$gp_settings['artist'] = get_post_meta($post->ID, 'ghostpool_dedication_artist', true);
|
||||
$gp_settings['artist_short'] = cutstr($gp_settings['artist'], 47, '...');
|
||||
$gp_settings['song'] = get_post_meta($post->ID, 'ghostpool_dedication_song', true);
|
||||
@ -32,8 +51,6 @@ if ($gp_settings['artist_song_span_short'] != $gp_settings['artist_song_span'])
|
||||
$gp_settings['artist_song_span_short'] .= '...';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// from user
|
||||
$gp_settings['from_user_id'] = get_the_author_meta('ID');
|
||||
$gp_settings['from_user_link'] = '<a href="'.bp_core_get_userlink($gp_settings['from_user_id'], false, true).'" title="'.bp_core_get_username($gp_settings['from_user_id']).'">'.bp_core_get_username($gp_settings['from_user_id']).'</a>';
|
||||
|
||||
@ -1200,8 +1200,12 @@ h3.comments {
|
||||
}
|
||||
|
||||
.home-page #respond textarea {
|
||||
/*cambiamos ancho y alto del css por razones esteticas
|
||||
height: 90px !important;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
width: 100%;*/
|
||||
height: 30px !important;
|
||||
width: 669px;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
@ -1476,3 +1480,14 @@ color: #325670;
|
||||
height: 100px !important;
|
||||
list-style: none !important;
|
||||
}
|
||||
|
||||
/************** CAMBIOS DE ESTILO POR NANDO Y JORGE ***************/
|
||||
|
||||
div#comments div div#respond form#commentform.commentform input#submit {
|
||||
|
||||
margin-left: 536px;
|
||||
}
|
||||
.home-page div#page-wrapper div#content-wrapper div#content div#precontent-wrapper div#dedicationComments_container.columns div#comments div div#respond form#commentform.commentform input#submit {
|
||||
margin-left: 536px;
|
||||
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -2282,9 +2282,9 @@ padding: 10px 0 30px 0;
|
||||
margin-left: 10px;
|
||||
}
|
||||
#respond textarea {
|
||||
width: 544px;
|
||||
max-width: 544px;
|
||||
height: 150px;
|
||||
height:30px;
|
||||
max-width:627px;
|
||||
width:627px
|
||||
}
|
||||
#cancel-comment-reply-link {
|
||||
float: right;
|
||||
|
||||
2
wp-content/themes/score/style.min.css
vendored
2
wp-content/themes/score/style.min.css
vendored
@ -309,7 +309,7 @@ h3.toggle a{display:block;text-decoration:none}
|
||||
#commentform{float:left;margin:10px 0 12px;width:100%}
|
||||
#respond form{padding:10px 0 30px}
|
||||
#respond label{margin-left:10px}
|
||||
#respond textarea{height:150px;max-width:544px;width:544px}
|
||||
#respond textarea{height:30px;max-width:627px;width:627px}
|
||||
#cancel-comment-reply-link{display:block;float:right;font-size:11px;font-weight:400}
|
||||
.comment-score{display:none;float:left;margin:0 0 15px;width:100%}
|
||||
.comment-score-title{float:left;font-weight:700;margin:0 15px 0 0}
|
||||
|
||||
196
wp-content/themes/score/video-slider.bak.php
Normal file
196
wp-content/themes/score/video-slider.bak.php
Normal file
@ -0,0 +1,196 @@
|
||||
<!--Begin Slider-->
|
||||
<?php
|
||||
|
||||
require(ghostpool_inc . 'options.php');
|
||||
|
||||
$_ishome = (is_home() OR is_front_page());
|
||||
|
||||
global $gp_settings;
|
||||
global $current_user, $bp;
|
||||
get_currentuserinfo();
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
if ($_ishome || ( $bp->current_component == BP_DEDICATION_SLUG )) {
|
||||
$posts_per_page = $theme_video_slides;
|
||||
|
||||
$dedication_orderby = "date";
|
||||
$dedication_order = "DESC";
|
||||
$category_name = 'dedication';
|
||||
$post_status = array('publish', 'private');
|
||||
|
||||
$args = array(
|
||||
'post_type' => array('post'),
|
||||
'order' => $dedication_order,
|
||||
'orderby' => $dedication_orderby,
|
||||
'posts_per_page' => $posts_per_page, //-1,
|
||||
'post_status' => $post_status,
|
||||
'category_name' => $category_name,
|
||||
);
|
||||
query_posts($args);
|
||||
}
|
||||
|
||||
if (is_singular()) {
|
||||
//
|
||||
}
|
||||
|
||||
if (have_posts()) {
|
||||
$slide_counter = 0;
|
||||
$urls_video = array();
|
||||
|
||||
?>
|
||||
<div id="the_slider" <?php echo (play_video_on_full_screen()) ? 'class="fullscreen_div"' : ''; ?> >
|
||||
<!--Begin Slider Wrapper-->
|
||||
<div id="slider-wrapper">
|
||||
<?php if($theme_logo) { ?><div class="dedicationTitle_logo"><img src="<?php echo get_template_directory_uri(); ?>/lib/images/logo-w-fs.png" alt="<?php bloginfo('name'); ?>" /></div><?php } ?>
|
||||
<div id="dedicationTitle_container">
|
||||
<div id="dedicationTitle-data-panel"></div>
|
||||
<h2 id="dedicationTitle"></h2>
|
||||
</div>
|
||||
<div id="componentWrapper">
|
||||
<div class="mediaWrapper">
|
||||
<div class="youtubeHolder"></div>
|
||||
<div class="vimeoHolder"></div>
|
||||
</div>
|
||||
|
||||
<div class="thumbHolder">
|
||||
<div class="thumbContainer"><div class="thumbInnerContainer"></div></div>
|
||||
<div class="thumbBackward"><img src="<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_backward_v.png" alt="" width="31" height="21" /></div>
|
||||
<div class="thumbForward"><img src="<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/thumb_forward_v.png" alt="" width="31" height="21" /></div>
|
||||
</div>
|
||||
<div class="mediaPreloader"></div>
|
||||
<div class="componentPlaylist">
|
||||
<ul id='playlist'>
|
||||
|
||||
<?php
|
||||
while (have_posts()) : the_post(); include('loop-dedication-data.php');
|
||||
|
||||
// Si ya hemos visto más de 'posts_per_page' dedicatorias, salgo del buble
|
||||
if ($slide_counter == $posts_per_page) {
|
||||
break;
|
||||
}
|
||||
|
||||
$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 ) {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
$video = $gp_settings['video'];
|
||||
|
||||
if ($_ishome) {
|
||||
if ($theme_homepage_not_repeat_videos) {
|
||||
// Si la URL del video ya ha salido en una dedicatoria anterior, me la salto
|
||||
if (in_array($video, $urls_video)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$urls_video[] = $video;
|
||||
|
||||
// Video Type
|
||||
$vimeo = strpos($video, "vimeo.com");
|
||||
$yt1 = strpos($video, "youtube.com");
|
||||
$yt2 = strpos($video, "youtu.be");
|
||||
|
||||
if (($vimeo) OR ($yt1) OR ($yt2)) {
|
||||
if ($yt2) { //youtu.be
|
||||
$video_id = substr(parse_url($video, PHP_URL_PATH), 1);
|
||||
$data_type = 'youtube_single';
|
||||
$data_path = 'http://gdata.youtube.com/feeds/api/videos/' . $video_id . '?v=2&alt=jsonc';
|
||||
}
|
||||
if ($yt1) { //youtube.com
|
||||
$video = parse_str(parse_url($video, PHP_URL_QUERY), $my_array_of_vars);
|
||||
$video_id = $my_array_of_vars['v'];
|
||||
$data_type = 'youtube_single';
|
||||
$data_path = 'http://gdata.youtube.com/feeds/api/videos/' . $video_id . '?v=2&alt=jsonc';
|
||||
}
|
||||
if ($vimeo) { //vimeo.com
|
||||
$video_id = substr(parse_url($video, PHP_URL_PATH), 1);
|
||||
$data_type = 'vimeo_single';
|
||||
$data_path = 'http://vimeo.com/api/v2/video/' . $video_id . '.json';
|
||||
}
|
||||
?>
|
||||
<li data-type='<?php echo $data_type; ?>' data-path='<?php echo $data_path; ?>'>
|
||||
<span id="postdata-id-<?php echo $slide_counter; ?>"><?php the_ID(); ?></span>
|
||||
<span id="postdata-title-<?php echo $slide_counter; ?>"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
|
||||
<span id="postdata-artist-<?php echo $slide_counter; ?>"><?php echo $gp_settings['artist_short']; ?></span>
|
||||
<span id="postdata-song-<?php echo $slide_counter; ?>"><?php echo $gp_settings['song_short']; ?></span>
|
||||
<span id="postdata-link-<?php echo $slide_counter; ?>"><?php the_permalink(); ?></span>
|
||||
<span id="postdata-extlink-<?php echo $slide_counter; ?>"><?php echo $gp_settings['enc_link']; ?></span>
|
||||
<span id="postdata-comments-<?php echo $slide_counter; ?>"></span>
|
||||
<?php if (($theme_show_new_label) && ($gp_settings['unreaded'])) { ?><span id="postdata-mark-read-<?php echo $slide_counter; ?>"><?php echo mar_read_unread_links('', '', false); ?></span><?php } ?>
|
||||
<span id="postdata-from-to-<?php echo $slide_counter; ?>">
|
||||
<?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 } $slide_counter++; ?>
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
</div> <!-- componentPlaylist -->
|
||||
<div class="slideshow_controls">
|
||||
<?php if ($slide_counter > 1) { ?>
|
||||
<div class="controls_prev"><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/backward.png' width='11' height='16' alt='controls_prev'/></div>
|
||||
<div class="controls_playlist_toggle"><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/close.png' width='16' height='16' alt='controls_playlist_toggle'/></div>
|
||||
<div class="controls_next"><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/forward.png' width='11' height='16' alt='controls_next'/></div>
|
||||
<?php } ?>
|
||||
<div class="player_share"><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/share.png' width='40' height='40' alt=''/></div>
|
||||
|
||||
<div id="shareHolder">
|
||||
<div id="shareHolderInner">
|
||||
<div id="fb-root"></div>
|
||||
<div id='fsbbtn'><a href="https://www.facebook.com/" target='_blank'><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/facebook.png' width='20' height='20' alt='facebook'/></a></div>
|
||||
<div id='twtbtn'><a href="https://www.twitter.com/" target='_blank'><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/twitter.png' width='20' height='20' alt='twitter'/></a></div>
|
||||
<div id='gpsbtn'><a href="https://plus.google.com/" target='_blank'><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/google_plus.png' width='20' height='20' alt='google'/></a></div>
|
||||
<div id='mysbtn'><a href="https://myspace.com/" target='_blank'><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/myspace.png' width='20' height='20' alt='google'/></a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dedicationFooter_container">
|
||||
<div class="columns two first text-left">
|
||||
<h3 id="dedicationArtits"></h3>
|
||||
<h4 id="dedicationSong"></h4>
|
||||
</div>
|
||||
<div class="columns two last">
|
||||
<div class="controls_fullscreen"><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/<?php echo (play_video_on_full_screen()) ? 'fullscreen_exit.png' : 'fullscreen.png'; ?>' width='11' height='16' alt='fullscreen'/></div>
|
||||
<?php if(function_exists('bp_is_active')) { ?>
|
||||
<a id="dedicate_this_song_button" href="<?php echo bp_loggedin_user_domain() . bp_get_dedication_slug() ?>/new-dedication/" class="button" title="Dedicate this song">Dedicate this song</a>
|
||||
<a href="<?php echo bp_loggedin_user_domain() . bp_get_dedication_slug() ?>/new-dedication/" class="button" title="Dedicate a song">Dedicate a song</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function redirect() {
|
||||
<?php if ( is_user_logged_in() ) { ?>
|
||||
window.location.href = "<?php echo home_url(); ?>";
|
||||
<?php } else { ?>
|
||||
<?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>
|
||||
|
||||
<?php } ?>
|
||||
<!--End Slider-->
|
||||
</div>
|
||||
@ -10,19 +10,16 @@ global $current_user, $bp;
|
||||
get_currentuserinfo();
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
if ($_ishome || ( $bp->current_component == BP_DEDICATION_SLUG )) {
|
||||
$posts_per_page = $theme_video_slides;
|
||||
|
||||
$dedication_orderby = "date";
|
||||
$dedication_order = "DESC";
|
||||
$dedication_orderby = "rand";
|
||||
$category_name = 'dedication';
|
||||
$post_status = array('publish', 'private');
|
||||
$post_status = array('publish');
|
||||
|
||||
$args = array(
|
||||
'post_type' => array('post'),
|
||||
'order' => $dedication_order,
|
||||
'orderby' => $dedication_orderby,
|
||||
'posts_per_page' => -1,
|
||||
'post_status' => $post_status,
|
||||
@ -36,10 +33,9 @@ if (is_singular()) {
|
||||
}
|
||||
|
||||
if (have_posts()) {
|
||||
$slide_counter = 0;
|
||||
$urls_video = array();
|
||||
|
||||
?>
|
||||
|
||||
<div id="the_slider" <?php echo (play_video_on_full_screen()) ? 'class="fullscreen_div"' : ''; ?> >
|
||||
<!--Begin Slider Wrapper-->
|
||||
<div id="slider-wrapper">
|
||||
@ -62,15 +58,9 @@ if (have_posts()) {
|
||||
<div class="mediaPreloader"></div>
|
||||
<div class="componentPlaylist">
|
||||
<ul id='playlist'>
|
||||
|
||||
<?php
|
||||
while (have_posts()) : the_post(); include('loop-dedication-data.php');
|
||||
|
||||
// Si ya hemos visto más de 'posts_per_page' dedicatorias, salgo del buble
|
||||
if ($slide_counter == $posts_per_page) {
|
||||
break;
|
||||
}
|
||||
|
||||
$displayed_id = bp_displayed_user_id();
|
||||
|
||||
// Perfil del usuario: sólo mostrar las dedicadas por él y para él. El resto se descartan.
|
||||
@ -79,76 +69,29 @@ if (have_posts()) {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
$video = $gp_settings['video'];
|
||||
|
||||
if ($_ishome) {
|
||||
if ($theme_homepage_not_repeat_videos) {
|
||||
// Si la URL del video ya ha salido en una dedicatoria anterior, me la salto
|
||||
if (in_array($video, $urls_video)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$urls_video[] = $video;
|
||||
|
||||
// Video Type
|
||||
$vimeo = strpos($video, "vimeo.com");
|
||||
$yt1 = strpos($video, "youtube.com");
|
||||
$yt2 = strpos($video, "youtu.be");
|
||||
|
||||
if (($vimeo) OR ($yt1) OR ($yt2)) {
|
||||
if ($yt2) { //youtu.be
|
||||
$video_id = substr(parse_url($video, PHP_URL_PATH), 1);
|
||||
$data_type = 'youtube_single';
|
||||
$data_path = 'http://gdata.youtube.com/feeds/api/videos/' . $video_id . '?v=2&alt=jsonc';
|
||||
}
|
||||
if ($yt1) { //youtube.com
|
||||
$video = parse_str(parse_url($video, PHP_URL_QUERY), $my_array_of_vars);
|
||||
$video_id = $my_array_of_vars['v'];
|
||||
$data_type = 'youtube_single';
|
||||
$data_path = 'http://gdata.youtube.com/feeds/api/videos/' . $video_id . '?v=2&alt=jsonc';
|
||||
}
|
||||
if ($vimeo) { //vimeo.com
|
||||
$video_id = substr(parse_url($video, PHP_URL_PATH), 1);
|
||||
$data_type = 'vimeo_single';
|
||||
$data_path = 'http://vimeo.com/api/v2/video/' . $video_id . '.json';
|
||||
}
|
||||
?>
|
||||
<li data-type='<?php echo $data_type; ?>' data-path='<?php echo $data_path; ?>'>
|
||||
<span id="postdata-id-<?php echo $slide_counter; ?>"><?php the_ID(); ?></span>
|
||||
<span id="postdata-title-<?php echo $slide_counter; ?>"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
|
||||
<span id="postdata-artist-<?php echo $slide_counter; ?>"><?php echo $gp_settings['artist_short']; ?></span>
|
||||
<span id="postdata-song-<?php echo $slide_counter; ?>"><?php echo $gp_settings['song_short']; ?></span>
|
||||
<span id="postdata-link-<?php echo $slide_counter; ?>"><?php the_permalink(); ?></span>
|
||||
<span id="postdata-extlink-<?php echo $slide_counter; ?>"><?php echo $gp_settings['enc_link']; ?></span>
|
||||
<span id="postdata-comments-<?php echo $slide_counter; ?>"></span>
|
||||
<?php if (($theme_show_new_label) && ($gp_settings['unreaded'])) { ?><span id="postdata-mark-read-<?php echo $slide_counter; ?>"><?php echo mar_read_unread_links('', '', false); ?></span><?php } ?>
|
||||
<span id="postdata-from-to-<?php echo $slide_counter; ?>">
|
||||
<?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 } $slide_counter++; ?>
|
||||
<?php endwhile; ?>
|
||||
?>
|
||||
<li id='playlist-element-<?php the_ID(); ?>' data-type='<?php echo $gp_settings['video_type']; ?>' data-path='<?php echo $gp_settings['video_path']; ?>'>
|
||||
<span id="postdata-id-<?php the_ID(); ?>"><?php the_ID(); ?></span>
|
||||
<span id="postdata-title-<?php the_ID(); ?>"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
|
||||
<span id="postdata-artist-<?php the_ID(); ?>"><?php echo $gp_settings['artist_short']; ?></span>
|
||||
<span id="postdata-song-<?php the_ID(); ?>"><?php echo $gp_settings['song_short']; ?></span>
|
||||
<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>
|
||||
<?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(); ?>">
|
||||
<?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; ?>
|
||||
</ul>
|
||||
</div> <!-- componentPlaylist -->
|
||||
<div class="slideshow_controls">
|
||||
<?php if ($slide_counter > 1) { ?>
|
||||
<div class="controls_prev"><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/backward.png' width='11' height='16' alt='controls_prev'/></div>
|
||||
<div class="controls_playlist_toggle"><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/close.png' width='16' height='16' alt='controls_playlist_toggle'/></div>
|
||||
<div class="controls_next"><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/forward.png' width='11' height='16' alt='controls_next'/></div>
|
||||
<?php } ?>
|
||||
<div class="player_share"><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/share.png' width='40' height='40' alt=''/></div>
|
||||
<div class="controls_next"><img src='<?php echo get_template_directory_uri(); ?>/lib/scripts/videoslider/data/icons/forward.png' width='11' height='16' alt='controls_next'/></div>
|
||||
|
||||
<div id="shareHolder">
|
||||
<div id="shareHolderInner">
|
||||
@ -190,7 +133,6 @@ if (have_posts()) {
|
||||
<?php } ?>
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php } ?>
|
||||
<!--End Slider-->
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user