本文整理汇总了PHP中SiteHelper::comment_vote方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteHelper::comment_vote方法的具体用法?PHP SiteHelper::comment_vote怎么用?PHP SiteHelper::comment_vote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SiteHelper
的用法示例。
在下文中一共展示了SiteHelper::comment_vote方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
pad_w_zero = '';
if(comment_number.length < 2)pad_w_zero = '0'; ///pad_w_zero
if(reset_comment == false ) { style = "background-color:#FFFF99";}
new_line = '<div class="comment_board_entry" id="c'+comments[i]['comment_id']+'" style="'+style+'">';
new_line += '<div class="comment_header">';
new_line += '<span class="comment_number">'+pad_w_zero+comment_number+'</span>';
new_line += '<span class="comment_country">'+comments[i]['comment_country']+'</span>';
new_line += '<span class="comment_time">'+ comments[i]['comment_time'] +' </span>';
new_line += '<span class="comment_username"><a href="<?php
echo Yii::app()->getRequest()->getBaseUrl(true);
?>
/mysub/'+ comments[i]['username'] +'">'+ comments[i]['username'] + '</a></span>';
new_line += '<?php
echo SiteHelper::comment_vote("'+comments[i]['comment_id']+'", "'+ comments[i]['likes']+'", "'+comments[i]['dislikes']+'");
?>
';
new_line += '</div>';
new_line += '<div class="comment_text">'+ comments[i]['comment_text']+'</div>';
new_line += '</div>';
$("#comments_board").prepend(new_line);
if(reset_comment == false ){
$("#c"+comments[i]['comment_id']).fadeTo("slow",0.5, function () {
$(this).css("background-color", "white");
$(this).fadeTo("slow",1.0);
});
}
示例2: count
$comments = Comment::model()->with('user', 'country')->findAll("subject_id = {$model->id}");
$total_comments = count($comments);
if ($total_comments == 0) {
echo "<h4>" . Yii::t('subject', 'NO COMMENTS') . "</h4>";
}
foreach ($comments as $comment) {
?>
<div class="comment" id="c<?php
echo $comment->id;
?>
">
<div class="comment_info">
<?php
$time_since_comment = SiteLibrary::time_since(SiteLibrary::utc_time() - $comment->time);
echo '<span class="comment_number">' . str_pad($comment->comment_number, 2, '0', STR_PAD_LEFT) . '</span>' . '<span class="comment_country">' . $comment->country->code . '</span>' . ' <span>' . CHtml::link($comment->user->username, array('mysub/' . $comment->user->username)) . '</span>' . ' <span title="' . date("Y/m/d H:i", $comment->time) . ' UTC ' . '">' . Yii::t('comment', '{time_number} {time_name} ago', array('{time_number}' => $time_since_comment[0], '{time_name}' => Yii::t('site', $time_since_comment[1]))) . '</span>';
echo SiteHelper::comment_vote($comment->id, $comment->likes, $comment->dislikes);
?>
</div>
<div class="comment_content">
<?php
echo nl2br(CHtml::encode($comment->comment));
?>
</div>
</div><!-- comment -->
<?php
}
?>
<br>
<div class="flash-notice" style="border:none"><?php