<button id="btntip" onclick="javascript:tip(<?php echo $tid; ?> )" class="btn pull-right btn-primary J_ajax_submit_btn"><i class="fa fa-leaf"></i> 提示</button><?php } ?> </div> </div> <?php } else { ?> <div class="tip" style="text-align:right;color:#428bca">此题已答!</div> <hr /> <?php echo Comments("games", $object_id); } ?> </div> <?php $ad = sp_getad("portal_article_bottom"); ?> <?php if (!empty($ad)) { ?> <div class="tc-box"> <div class="headtitle"> <h2>赞助商</h2> </div> <div>
$avatar = $value->user->avatar; $url = Url::to(['user/view', 'id' => $value->user_id]); } else { $username = $value->author ? $value->author : "游客"; $avatar = Yii::$app->homeUrl . "upload/avatar/default.png"; $url = "javascript:;"; } echo '<li class="media"> <a class="pull-left" href="' . $url . '"> <img class="media-object img-circle" alt="' . Html::encode($username) . '" src="' . $avatar . '" style="width: 48px; height: 48px;"> </a> <div class="media-body"> <h4 class="media-heading"><a href="' . $url . '">' . Html::encode($username) . '</a> • <span title="' . date("Y-m-d H:i:s", $value->create_time) . '">' . Common::formatTime($value->create_time) . '</span></h4> <p>' . Html::encode($value->content) . '</p><div class="ops"><a href="" class="comment-up" data-id="' . $value->id . '"><i class="glyphicon glyphicon-thumbs-up"></i> (<span>' . $value->up . '</span>)</a> <a href="" class="comment-down" data-id="' . $value->id . '"><i class="glyphicon glyphicon-thumbs-down"></i> (<span>' . $value->down . '</span>)</a> <a href="" class="comment-reply" data-id="' . $value->id . '" data-postid="' . $id . '" title="回复"><i class="glyphicon glyphicon-share-alt"></i></a></div>'; renderItems($items, $value, $id); echo "</li>"; } } } } echo '<ul class="media-list">'; echo Comments($comments, $pages, $id); echo '</ul>'; if ($pages->totalCount > $pages->pageSize) { echo LinkPager::widget(['pagination' => $pages]); } $this->registerJs(' jQuery(".comment-list").on("click", ".comment-up", function (e) { if ($.cookie("comment-"+$(this).data("id"))!=1) { $.get("' . Url::to(['post/comment-up']) . '?id="+$(this).data("id")); $(this).children("span").text(parseInt($(this).children("span").text())+1); $.cookie("comment-"+$(this).data("id"), "1"); $(this).parent("div").css("position", "relative"); $(this).after("<span style=\\"position:absolute;color:red;\\">+1</span>").next().animate({bottom:"19px"}).fadeOut(900); }else{ alert("你已经投过票了!"); }
height : 100 }); function makeCode () { qrcode.makeCode("http://<?php echo $_SERVER['HTTP_HOST']; echo $_SERVER['REQUEST_URI']; ?> "); } makeCode(); </script> <div class="clearfix"></div> </div> <?php echo Comments("posts", $object_id); ?> </div> <?php $ad = sp_getad("portal_article_bottom"); ?> <?php if (!empty($ad)) { ?> <div class="tc-box"> <div class="headtitle"> <h2>赞助商</h2> </div> <div> <?php
<?php if (!defined('THINK_PATH')) { exit; } ?> <!-- //评论模板,<?php echo Comments(); ?> 中会调用--> <br> <h3>评论</h3> <div class="comment-area" id="comments"> <hr> <form class="form-horizontal comment-form" action="<?php echo u('comment/comment/post'); ?> " method="post"> <div class="control-group"> <div class="comment-postbox-wraper"> <textarea class="form-control comment-postbox" placeholder="Write your comment here" style="min-height:90px;" name="content"></textarea> </div> </div> <div class="control-group"> <button type="submit" class="btn pull-right btn-primary J_ajax_submit_btn"><i class="fa fa-comment-o"></i> 发表评论</button> </div> <input type="hidden" name="post_table" value="<?php echo $post_table;
public function comment($param) { echo Comments($param['post_table'], $param['post_id'], array('post_title' => $param['post_title'])); }