Skip to content

Commit

Permalink
Added scores next to voting on artists page
Browse files Browse the repository at this point in the history
Squashed commit of the following:

Author: glitch <[email protected]>

    added scores next to voting on artists page
  • Loading branch information
itismadness committed Feb 7, 2018
1 parent 6260388 commit c77543f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion classes/votes.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ class Votes {
* @param $Vote The pre-existing vote, if it exists 'Up'|'Down'
*/
public static function vote_link($GroupID, $Vote = '') {
if (!G::$LoggedUser['NoVoteLinks'] && check_perms('site_album_votes')) { ?>
if (!G::$LoggedUser['NoVoteLinks'] && check_perms('site_album_votes')) {
$GroupVotes = self::get_group_votes($GroupID); ?>
<span class="votespan brackets" style="white-space: nowrap;">
Vote:
<a href="#" onclick="UpVoteGroup(<?=$GroupID?>, '<?=G::$LoggedUser['AuthKey']?>'); return false;" class="tooltip small_upvote vote_link_<?=$GroupID?><?=(!empty($Vote) ? ' hidden' : '')?>" style="font-weight: bolder;" title="Upvote">&and;</a>
<span class="tooltip voted_type small_upvoted voted_up_<?=$GroupID?><?=(($Vote == 'Down' || empty($Vote)) ? ' hidden' : '')?>" style="font-weight: bolder;" title="Upvoted">&and;</span>
<a href="#" onclick="DownVoteGroup(<?=$GroupID?>, '<?=G::$LoggedUser['AuthKey']?>'); return false;" class="tooltip small_downvote vote_link_<?=$GroupID?><?=(!empty($Vote) ? ' hidden' : '')?>" style="font-weight: bolder;" title="Downvote">&or;</a>
<span class="tooltip voted_type small_downvoted voted_down_<?=$GroupID?><?=(($Vote == 'Up' || empty($Vote)) ? ' hidden' : '')?>" style="font-weight: bolder;" title="Downvoted">&or;</span>
<a href="#" onclick="UnvoteGroup(<?=$GroupID?>, '<?=G::$LoggedUser['AuthKey']?>'); return false;" class="tooltip small_clearvote vote_clear_<?=$GroupID?><?=(empty($Vote) ? ' hidden' : '')?>" title="Clear your vote">x</a>
Score: <?=number_format(self::binomial_score($GroupVotes['Ups'], $GroupVotes['Total']) * 100, 1)?>
</span>
<? }
}
Expand Down

0 comments on commit c77543f

Please sign in to comment.