示例#1
0
文件: vote.php 项目: Kufirc/Gazelle
<?php

$UserVotes = Votes::get_user_votes($LoggedUser['ID']);
$GroupVotes = Votes::get_group_votes($GroupID);
$TotalVotes = $GroupVotes['Total'];
$UpVotes = $GroupVotes['Ups'];
$DownVotes = $TotalVotes - $UpVotes;
$Voted = isset($UserVotes[$GroupID]) ? $UserVotes[$GroupID]['Type'] : false;
$Score = Votes::binomial_score($UpVotes, $TotalVotes);
?>
<div class="box" id="votes">
	<div class="head"><strong>Album Votes</strong></div>
	<div class="album_votes body">
		<span class="favoritecount tooltip" title="<?php 
echo $UpVotes . ($UpVotes == 1 ? ' upvote' : ' upvotes');
?>
"><span id="upvotes"><?php 
echo number_format($UpVotes);
?>
</span> <span class="vote_album_up">&and;</span></span>
		&nbsp; &nbsp;
		<span class="favoritecount tooltip" title="<?php 
echo $DownVotes . ($DownVotes == 1 ? ' downvote' : ' downvotes');
?>
"><span id="downvotes"><?php 
echo number_format($DownVotes);
?>
</span> <span class="vote_album_down">&or;</span></span>
		&nbsp; &nbsp;
		<span class="favoritecount" id="totalvotes"><?php 
echo number_format($TotalVotes);