function getVote($comment, $user) { $vote = Rates::model()->find('comment_id=:comment and user_id=:user', array(':comment' => $comment, ':user' => $user)); return $vote->rate; }
</span> | <span id="<?php echo $comment->attributes['id']; ?> " class="rateDislike <? if($vote == -1) echo 'voted'; ?> "> Dislike </span> <span totalrateid="<?php echo $comment->attributes['id']; ?> " class="rateTotal"> (<?php echo Rates::model()->getRate($comment->attributes['id']); ?> ) </span> </div> <!-- end rate --> <?php } ?> </div> <!-- comment --> <?php }