當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SiteHelper::comment_vote方法代碼示例

本文整理匯總了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);
					});
				}
開發者ID:jjsub,項目名稱:samesub,代碼行數:31,代碼來源:core_lib.php

示例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 
開發者ID:jjsub,項目名稱:samesub,代碼行數:31,代碼來源:view.php


注:本文中的SiteHelper::comment_vote方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。