2012-10-27 08:00:09 +00:00
|
|
|
<?
|
2012-11-14 08:00:19 +00:00
|
|
|
$UserVotes = Votes::get_user_votes($LoggedUser['ID']);
|
|
|
|
$GroupVotes = Votes::get_group_votes($GroupID);
|
2012-10-27 08:00:09 +00:00
|
|
|
|
2012-11-14 08:00:19 +00:00
|
|
|
$TotalVotes = $GroupVotes['Total'];
|
2013-02-07 08:00:47 +00:00
|
|
|
$UpVotes = $GroupVotes['Ups'];
|
2012-10-27 08:00:09 +00:00
|
|
|
|
2013-05-16 16:15:57 +00:00
|
|
|
$Voted = isset($UserVotes[$GroupID]) ? $UserVotes[$GroupID]['Type'] : false;
|
2012-10-27 08:00:09 +00:00
|
|
|
?>
|
|
|
|
<div class="box" id="votes">
|
2013-08-28 23:08:41 +00:00
|
|
|
<div class="head"><strong>Album Votes</strong></div>
|
2012-10-27 08:00:09 +00:00
|
|
|
<div class="album_votes body">
|
2013-05-16 16:15:57 +00:00
|
|
|
This has <span id="upvotes" class="favoritecount"><?=number_format($UpVotes)?></span> <?=(($UpVotes == 1) ? 'upvote' : 'upvotes')?> out of <span id="totalvotes" class="favoritecount"><?=number_format($TotalVotes)?></span> total<span id="upvoted"<?=(($Voted != 'Up') ? ' class="hidden"' : '')?>>, including your upvote</span><span id="downvoted"<?=(($Voted != 'Down') ? ' class="hidden"' : '')?>>, including your downvote</span>.
|
2012-10-27 08:00:09 +00:00
|
|
|
<br /><br />
|
|
|
|
<? if (check_perms('site_album_votes')) { ?>
|
2013-02-12 08:00:08 +00:00
|
|
|
<span<?=($Voted ? ' class="hidden"' : '')?> id="vote_message"><a href="#" class="brackets upvote" onclick="UpVoteGroup(<?=$GroupID?>, '<?=$LoggedUser['AuthKey']?>'); return false;">Upvote</a> - <a href="#" class="brackets downvote" onclick="DownVoteGroup(<?=$GroupID?>, '<?=$LoggedUser['AuthKey']?>'); return false;">Downvote</a></span>
|
2012-10-27 08:00:09 +00:00
|
|
|
<? } ?>
|
2013-02-12 08:00:08 +00:00
|
|
|
<span<?=($Voted ? '' : ' class="hidden"')?> id="unvote_message">
|
|
|
|
Changed your mind?
|
|
|
|
<br />
|
|
|
|
<a href="#" onclick="UnvoteGroup(<?=$GroupID?>, '<?=$LoggedUser['AuthKey']?>'); return false;" class="brackets">Clear your vote</a>
|
|
|
|
</span>
|
2012-10-27 08:00:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|