<?php 

global $gp_settings, $post;

// Post Type
$gp_settings['post_type'] = get_post_meta($post->ID, 'ghostpool_post_type', true);

// Image Dimensions
if(get_post_meta($post->ID, 'ghostpool_thumbnail_width', true) && get_post_meta($post->ID, 'ghostpool_thumbnail_width', true)) {
	$gp_settings['image_width'] = get_post_meta($post->ID, 'ghostpool_thumbnail_width', true);
} else {
	$gp_settings['image_width'] = $gp_settings['thumbnail_width'];
}
if(get_post_meta($post->ID, 'ghostpool_thumbnail_height', true) && get_post_meta($post->ID, 'ghostpool_thumbnail_height', true)) {
	$gp_settings['image_height'] = get_post_meta($post->ID, 'ghostpool_thumbnail_height', true);
} else {
	$gp_settings['image_height'] = $gp_settings['thumbnail_height'];
}

// Song data
$gp_settings['artist'] = get_post_meta($post->ID, 'ghostpool_dedication_artist', true);
$gp_settings['song'] = get_post_meta($post->ID, 'ghostpool_dedication_song', true);
$gp_settings['artist_song'] = $gp_settings['artist'] . '. ' . $gp_settings['song'];

// from user
$gp_settings['from_user_id'] = get_the_author_meta('ID');
$gp_settings['from_user_link'] = bp_core_get_userlink($gp_settings['from_user_id']);
$gp_settings['from_flag'] = gp_get_the_flag($gp_settings['from_user_id']);

// to user
$gp_settings['to_user_id'] = get_post_meta($post->ID, 'ghostpool_destination_user_id', true);
$gp_settings['to_user_email'] = get_post_meta($post->ID, 'ghostpool_destination_user_email', true);
$gp_settings['to_user'] = get_user_by ('id', $gp_settings['to_user_id']);

if ($gp_settings['to_user']) {
    $gp_settings['to_flag'] = gp_get_the_flag($gp_settings['to_user']->ID, 24);    
    $gp_settings['to_user_link'] = bp_core_get_userlink($gp_settings['to_user']->ID);
} else {
    $gp_settings['to_flag'] = gp_get_the_flag('', 24);
    $gp_settings['to_user_link'] = get_post_meta($post->ID, 'ghostpool_destination_user_name', true);
}

// Post Text Width
if(!has_post_thumbnail() OR $gp_settings['image_wrap'] == "Disable") {
	$gp_settings['post_text_width'] = $gp_settings['content_width'];	
} else {
	$gp_settings['post_text_width'] = $gp_settings['content_width'] - $gp_settings['image_width'] - 17;
}	

// Post Left Width
if($gp_settings['post_type'] == "Review" && $gp_settings['review_date_column'] == "0" && (($gp_settings['score_type'] == "Site Score" && $gp_settings['gp_gdsr']->review > 0) OR ($gp_settings['score_type'] == "User Score" && $gp_settings['user_voting'] != "Users cannot vote") OR ($gp_settings['score_type'] == "Site & User Score" && ($gp_settings['gp_gdsr']->review > 0 OR $gp_settings['user_voting'] != "Users cannot vote")))) {
	$gp_settings['post_left_width'] = $gp_settings['post_text_width'] - 190;
} elseif($gp_settings['post_type'] == "Review" && $gp_settings['review_date_column'] == "1" && (($gp_settings['score_type'] == "Site Score" && $gp_settings['gp_gdsr']->review > 0) OR ($gp_settings['score_type'] == "User Score" && $gp_settings['user_voting'] != "Users cannot vote") OR ($gp_settings['score_type'] == "Site & User Score" && ($gp_settings['gp_gdsr']->review > 0 OR $gp_settings['user_voting'] != "Users cannot vote")))) {
	$gp_settings['post_left_width'] = $gp_settings['post_text_width'] - 95;
} else {
	$gp_settings['post_left_width'] = $gp_settings['post_text_width'];
}	

?>
