ASong2U_Web/wp-content/themes/score/index.php
david a0daf83960 Tarea #928 -> Habilitar dedicatorias con videos Vimeo
Tarea #929 -> Revisar títulos muy largos para poner "..."
Tarea #930 -> Poner "FROM" y "TO" en todas las dedicatorias excepto cuando salgan en el perfil del usuario

git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@35 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
2012-07-26 10:17:11 +00:00

101 lines
4.1 KiB
PHP

<?php get_header();
global $gp_settings;
$_ishome = (is_home() OR is_front_page());
?>
<?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";
query_posts($args);
$contador = 0;
$urls_video = array();
?>
<div id="content"<?php if($gp_settings['dropdown_filter'] == "0") { ?> class="shift-down"<?php } ?>>
<?php if (have_posts()) : while (have_posts()) : the_post(); include('loop-data.php'); ?>
<?php
if ($contador == $gp_settings['posts_per_page']) {
break;
}
$from_user_id = get_the_author_meta('ID');
$to_user_id = get_post_meta($post->ID, 'ghostpool_destination_user_id', true);
$to_user = get_user_by('id', $to_user_id);
$to_user_email = get_post_meta($post->ID, 'ghostpool_destination_user_email', true);
$displayed_id = bp_displayed_user_id();
// Usuario actual puede ver la dedicatoria?
if ($post->post_status == 'private') {
if (($current_user->ID != $from_user_id) && ($current_user->ID != $to_user_id)) {
continue; // me salto esta dedicatoria
}
}
$video = get_post_meta($post->ID, 'ghostpool_dedication_url', true);
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;
$contador += 1;
?>
<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 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">
<?php
$artist = get_post_meta($post->ID, 'ghostpool_dedication_artist', true);
$song = get_post_meta($post->ID, 'ghostpool_dedication_song', true);
$to_user_id = get_post_meta($post->ID, 'ghostpool_destination_user_id', true);
$to_user = get_user_by ('id', $to_user_id);
?>
<h2><a href="<?php the_permalink(); ?>" title="<?php $artist.'. '.$song; ?>"><span><?php echo $artist;?></span>.&nbsp;<?php echo $song; ?></a></h2>
<?php if ($to_user) { gp_the_flag($to_user->ID, 24); ?>
<span>TO: <a href="<?php echo bp_core_get_userlink($to_user->ID, false, true); ?>" title="<?php echo bp_core_get_username($to_user->ID); ?>"><?php echo bp_core_get_username($to_user->ID); ?></a></span>
<?php } else { ?>
<?php gp_the_flag('', 24); ?>
<span>TO: <?php echo $to_user->user_nicename; ?></span>
<?php } ?>
</div>
<!--End Post Text-->
</div>
<?php endwhile; ?>
<?php if($gp_settings['pagination'] == "0") { gp_pagination(); } ?>
<?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>
<?php get_sidebar(); ?>
<?php get_footer(); ?>