<?php global $gp;

gp_get_hub_id( get_the_ID() );

?>

<?php if ( $GLOBALS['gp_site_rating_enabled'] == true && isset( $GLOBALS['gp_review_loop'] ) ) { ?>

	<div class="user-rating-wrapper small-rating">
		<div class="average-rating-data">
			<div class="average-rating">
				<?php echo floatval( $GLOBALS['gp_user_rating'] ); ?>
			</div>
			<div class="user-average-text">
				<?php _e( 'User Avg', 'gp_lang' ); ?>
			</div>						
		</div>
	</div>
						
<?php } else { ?>

	<div class="user-rating-wrapper large-rating rating-<?php echo sanitize_html_class( $gp['review_user_rating_style'] ); ?>"<?php if ( isset( $GLOBALS['gp_user_rich_snippets'] ) && $GLOBALS['gp_user_rich_snippets'] == true ) { ?> itemscope itemtype="http://schema.org/Review"<?php } ?>>
	
		<?php if ( isset( $GLOBALS['gp_user_rich_snippets'] ) && $GLOBALS['gp_user_rich_snippets'] == true ) { ?>
			<meta itemprop="itemReviewed" content="<?php the_title_attribute( array( 'post' => $GLOBALS['gp_hub_id'] ) ); ?>">
			<meta itemprop="author" content="<?php echo the_author_meta( 'display_name', $post->post_author ); ?>">
		<?php } ?>

		<div<?php if ( isset( $GLOBALS['gp_user_rich_snippets'] ) && $GLOBALS['gp_user_rich_snippets'] == true ) { ?> itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"<?php } ?>>

			<div class="rating-inner">
				<div class="score-clip <?php echo sanitize_html_class( $GLOBALS['gp_user_clip_class_1'] ); ?>">
					<div class="score-spinner" style="-webkit-transform: rotate(<?php echo esc_attr( $GLOBALS['gp_user_deg'] ); ?>deg); transform: rotate(<?php echo esc_attr( $GLOBALS['gp_user_deg'] ); ?>deg);"></div>
				</div>
				<div class="score-clip <?php echo sanitize_html_class( $GLOBALS['gp_user_clip_class_2'] ); ?>">
					<div class="score-filler"></div>
				</div>		
				<div class="score-inner">
					<div class="score-table">
						<div class="score-cell">
			
							<span<?php if ( isset( $GLOBALS['gp_user_rich_snippets'] ) && $GLOBALS['gp_user_rich_snippets'] == true ) { ?> itemprop="ratingValue"<?php } ?>><?php echo floatval( $GLOBALS['gp_user_rating'] ); ?></span>
							<?php if ( isset( $GLOBALS['gp_user_rich_snippets'] ) && $GLOBALS['gp_user_rich_snippets'] == true ) { ?>
								<meta itemprop="worstRating" content="1">
								<meta itemprop="bestRating" content="<?php echo floatval( $gp['review_rating_number'] ); ?>">	
								<meta itemprop="ratingCount" content="<?php echo floatval( get_post_meta( $GLOBALS['gp_hub_id'], '_gp_user_votes', true ) ); ?>">
							<?php } ?>	
						</div>
					</div>
				</div>						
			</div>
			<h4 class="rating-text"<?php if ( isset( $GLOBALS['gp_user_rich_snippets'] ) && $GLOBALS['gp_user_rich_snippets'] == true ) { ?> itemprop="description"<?php } ?>><?php _e( 'User Avg', 'gp_lang' ); ?></h4>
	
		</div>	

	</div>

<?php } ?>