ASong2U_Web/wp-content/themes/score/post-loop-dedication.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

91 lines
4.0 KiB
PHP

<?php global $gp_settings; ?>
<?php if($gp_settings['title'] == "Show") { ?>
<h1 class="page-title">
<?php if(is_search()) { ?>
<?php echo $wp_query->found_posts; ?> <?php _e('search results for', 'gp_lang'); ?> "<?php echo esc_html($s); ?>"
<?php } elseif(is_category()) { ?>
<?php if(get_category_parents) { $catstr = get_category_parents($cat, false, ' / '); echo substr($catstr, 0, strlen($catstr) -3 ); } else { single_cat_title(); } ?>
<?php } elseif(is_tag()) { ?>
<?php single_tag_title(); ?>
<?php } elseif(is_author()) { ?>
<?php wp_title(''); ?><?php _e('\'s Posts'); ?>
<?php } elseif(is_archive()) { ?>
<?php _e('Archives', 'gp_lang'); ?> <?php wp_title(' / '); ?>
<?php } ?>
</h1>
<?php } ?>
<?php $post_status = 'publish'; ?>
<?php query_posts("$query_string&caller_get_posts=1&orderby=$orderby&order=$order&gdsr_sort=$gdsr_sort&gdsr_order=$gdsr_order&paged=$paged&post_status=$post_status&posts_per_page=".$gp_settings['posts_per_page']); ?>
<div id="content" class="fullwidth<?php if($gp_settings['dropdown_filter'] == "0") { ?> shift-down<?php } ?>">
<?php if (have_posts()) : while (have_posts()) : the_post(); include('loop-dedication-data.php'); ?>
<?php
$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
}
}
$contador += 1;
$artist = get_post_meta($post->ID, 'ghostpool_dedication_artist', true);
$song = get_post_meta($post->ID, 'ghostpool_dedication_song', true);
$artist_song = $artist . '. ' . $song;
$artist_song_span = '<span>'.$artist.'</span>'.'. '.$song;
$new_name = cutstr($artist_song_span, 38, '');
if ($new_name != $artist_song_span) {
$new_name .= '...';
}
?>
<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">
<h2><a href="<?php the_permalink(); ?>" title="<?php echo $artist_song; ?>"><?php echo $new_name; ?></a></h2>
<?php gp_the_flag($from_user_id); ?>
<span>FROM:
<a href="<?php echo bp_core_get_userlink($from_user_id, false, true); ?>" title="<?php echo bp_core_get_username($from_user_id); ?>"><?php echo bp_core_get_username($from_user_id); ?></a>
</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 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; wp_reset_query(); ?>
</div>