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@36 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
This commit is contained in:
David Arranz 2012-07-26 14:33:47 +00:00
parent a0daf83960
commit a35720b7ea
3 changed files with 14 additions and 46 deletions

View File

@ -16,7 +16,7 @@ function bp_dedication_ajax_autocomplete_results() {
$data = array();
foreach ( $users as $user ) {
$suggestions[] = $user->display_name . ' (' . $user->user_login . ')';
$suggestions[] = $user->user_login;
$data[] = $user->ID;
}

View File

@ -1,6 +1,6 @@
<?php get_header();
global $gp_settings;
global $gp_settings, $post;
$_ishome = (is_home() OR is_front_page());
?>
@ -13,23 +13,19 @@ $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 (have_posts()) : while (have_posts()) : the_post(); include('loop-dedication-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)) {
if (($displayed_id != $gp_settings['from_user_id']) && ($displayed_id != $gp_settings['to_user_id'])) {
continue; // me salto esta dedicatoria
}
}
@ -63,20 +59,9 @@ $urls_video = array();
<!--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 } ?>
<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>&nbsp;
<?php echo $gp_settings['to_flag']; ?><span>TO: <?php echo $gp_settings['to_user_link']; ?></span>
</div>
<!--End Post Text-->

View File

@ -25,29 +25,17 @@
<?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)) {
if (($displayed_id != $gp_settings['from_user_id']) && ($displayed_id != $gp_settings['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'); ?>>
@ -64,16 +52,11 @@
<!--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>
<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>&nbsp;
<?php echo $gp_settings['to_flag']; ?><span>TO: <?php echo $gp_settings['to_user_link']; ?></span>
</div>
<!--End Post Text-->
</div>
<?php endwhile; ?>