<?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('Dedicatited 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'); ?> &raquo;</a>        
    <?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="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['to_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(); ?>                            


