diff --git a/Voting/class.voting.plugin.php b/Voting/class.voting.plugin.php
index a6236b0..daab2a0 100644
--- a/Voting/class.voting.plugin.php
+++ b/Voting/class.voting.plugin.php
@@ -38,7 +38,12 @@ public function addVotingBox($sender, $args) {
$currentUserVote = $commentModel->GetUserScore($id, $session->UserID);
}
- echo generateVoterBox($id,$args['Type'], $pScore, $nScore, $currentUserVote ).'';
+ $control = generateVoterBox($id,$args['Type'], $pScore, $nScore, $currentUserVote );
+
+ if ($session->IsValid()) {
+ $control .='';
+ }
+ echo $control;
}
@@ -366,13 +371,23 @@ function generateVoterBox($id, $VoteType, $pScore, $nScore, $currentUserVote) {
}
$result = '';
- $result .= Anchor(Wrap('', 'span', array('class' => 'icon ' . $cssClassVoteUp, 'rel' => 'nofollow')), $voteUpUrl, 'VoteUp');
+ // The up/down vote buttons are clickable in guest mode
+ if(Gdn::session()->isValid()) {
+ $result .= Anchor(Wrap('', 'span', array('class' => 'icon ' . $cssClassVoteUp, 'rel' => 'nofollow')), $voteUpUrl, 'VoteUp');
+ } else {
+ $result .= Wrap(Wrap('', 'span', array('class' => 'icon ' . $cssClassVoteUp, 'rel' => 'nofollow')), 'span', array('class' =>'VoteUp'));
+ }
+
$counts = formattedPScore($pScore);
if(!StringIsNullOrEmpty($nScore) && $nScore != 0) {
$counts .= '/' . formattedNScore($nScore);
}
$result .= Wrap($counts, 'span', array('class' => 'CountVoices'));
- $result .= Anchor(Wrap('', 'span', array('class' => 'icon ' . $cssClassVoteDown, 'rel' => 'nofollow')), $voteDownUrl, 'VoteDown');
+ if(Gdn::session()->isValid()) {
+ $result .= Anchor(Wrap('', 'span', array('class' => 'icon ' . $cssClassVoteDown, 'rel' => 'nofollow')), $voteDownUrl, 'VoteDown');
+ } else {
+ $result .= Wrap(Wrap('', 'span', array('class' => 'icon ' . $cssClassVoteDown, 'rel' => 'nofollow')), 'span', array('class' =>'VoteDown'));
+ }
$result .= '';
return $result;