Exemplo n.º 1
0
function the_review($post = 0)
{
    $post = get_post($post);
    $id = $post->ID;
    if (is_review()) {
        ?>
		<section id="rating">
			<table id="breakdown">
				<tr>
					<td><i class="icon-heart"></i><?php 
        echo get_option('lg_review_options')['labels']['positives'];
        ?>
</td>
					<td><i class="icon-heart-broken"></i><?php 
        echo get_option('lg_review_options')['labels']['negatives'];
        ?>
</td>
				</tr>
				<tr>
					<td><?php 
        echo get_post_meta($id, 'review', true)['positives'];
        ?>
</td>
					<td><?php 
        echo get_post_meta($id, 'review', true)['negatives'];
        ?>
</td>
				</tr>
			</table>
			<table id="score">
			<?php 
        $scores = get_post_meta($id, 'review', true);
        foreach ($scores as $key => $value) {
            if (is_numeric($value) && $key != 'total_score') {
                ?>
					<tr>
						<td><?php 
                echo strpretty($key);
                ?>
</td>
						<td><hr></td>
						<td><?php 
                the_score($value);
                ?>
</td>
					</tr>
				<?php 
            }
        }
        ?>
			</table>
			<div id="overall-rating">
				<div id="score-ring">
					<div class="ring-half" id="left-half"></div>
					<div class="ring-half" id="right-half"></div>
				</div>
				<div class="score-num">
					<span class="icon-back">
						<i class="icon-heart"></i>
					</span>
					<span class="num">
						<?php 
        the_score(get_the_total_score());
        ?>
					</span>
				</div>
			</div>
			<div id="bottom-line">
				<div>
					<?php 
        echo get_option('lg_review_options')['labels']['bottom_line'];
        ?>
				</div>
				<?php 
        echo get_post_meta($id, 'review', true)['bottom_line'];
        ?>
			</div>
		</section>
		<style type="text/css">
			<?php 
        if (get_the_total_score() > 50) {
            ?>
				#score-ring{
					clip: auto;
				}
				#score-ring #right-half{
					transform: rotate(180deg);
				}
				#score-ring #left-half{
					transform: rotate(<?php 
            echo 360 / 100 * the_score_num(get_the_total_score(), false) . 'deg';
            ?>
);
				}
			<?php 
        } else {
            ?>
				#score-ring #right-half{
					transform: rotate(<?php 
            echo 360 / 100 * the_score_num(get_the_total_score(), false) . 'deg';
            ?>
);
				}
			<?php 
        }
        ?>
		</style>
	<?php 
    }
}
Exemplo n.º 2
0
" rel="<?php 
        echo $thumb['rel'];
        ?>
" <?php 
        echo 'data="' . $thumb['data'] . '"';
        ?>
>
					<?php 
        the_post_thumbnail('thumbnail');
        echo $thumb['icon'];
        ?>
					<?php 
        if (is_review()) {
            ?>
<span class="rating"><?php 
            the_score(get_the_total_score());
            ?>
</span><?php 
        }
        ?>
				</a>
			</div>
		<?php 
    }
    ?>
	</header>
<?php 
}
?>
<section class="entry body">
	<?php