优化一下评论列表加上@
This commit is contained in:
parent
e69663dad4
commit
a88130d5c5
|
@ -64,7 +64,6 @@
|
|||
<?php $this->user->screenName(); ?></a>.
|
||||
<a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> »</a></p>
|
||||
<?php else: ?>
|
||||
|
||||
<p class="comment-form-author">
|
||||
<input placeholder="称呼 *" type="text" name="author" id="author" class="text" value="" required />
|
||||
</p>
|
||||
|
@ -88,7 +87,6 @@
|
|||
<?php else: ?>
|
||||
<?php _e(''); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($comments->have()): ?>
|
||||
<?php $comments->listComments(); ?>
|
||||
<?php
|
||||
|
@ -152,6 +150,7 @@ function threadedComments($comments, $options) {
|
|||
</div>
|
||||
</div>
|
||||
<div class="comment-content">
|
||||
<?php if ($comments->parent) {echo getPermalinkFromCoid($comments->parent);}?>
|
||||
<?php $comments->content(); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -190,6 +190,13 @@ function img_postthumb($cid) {
|
|||
return ""; // 没有匹配到图片URL,返回空字符串
|
||||
}
|
||||
}
|
||||
//回复加上@
|
||||
function getPermalinkFromCoid($coid) {
|
||||
$db = Typecho_Db::get();
|
||||
$row = $db->fetchRow($db->select('author')->from('table.comments')->where('coid = ? AND status = ?', $coid, 'approved'));
|
||||
if (empty($row)) return '';
|
||||
return '<a href="#comment-'.$coid.'" style="text-decoration: none;">@'.$row['author'].'</a>';
|
||||
}
|
||||
//开始增加某些奇怪的东西
|
||||
// 获取月份
|
||||
function getMonth() {
|
||||
|
|
Loading…
Reference in New Issue