<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php
$GLOBALS['z'] = $this->options->CDNURL;
function threadedComments($comments, $options) {
$commentClass = '';
if ($comments->authorId) {
if ($comments->authorId == $comments->ownerId) {
$commentClass .= ' comment-by-author';$idcard="本文作者";
} else {
$commentClass .= ' comment-by-user';$idcard="其他编辑";
}
}else{$idcard="";
}
$commentLevelClass = $comments->levels > 0 ? ' c_c' : ' c_p';
if ($comments->url) {
$author = '<a href="' . $comments->url . '" target="_blank" rel="external nofollow">' . $comments->author . '</a>';
} else {
$author = $comments->author;
}
?>
<li id="li-<?php $comments->theId();?>" class="<?php echo $cl;?>">
<div id="<?php $comments->theId(); ?>">
<?php
$host = 'https://cdn.v2ex.com';
$url = '/gravatar/';
$size = '100';
$rating = Helper::options()->commentsAvatarRating;
$hash = md5(strtolower($comments->mail));
$email = strtolower($comments->mail);
$sjtx = Typecho_Widget::widget('Widget_Options')->motx;
$qq=str_replace('@qq.com','',$email);
if(strstr($email,"qq.com") && is_numeric($qq) && strlen($qq) < 11 && strlen($qq) > 4)
{
$avatar = '//q.qlogo.cn/g?b=qq&nk='.$qq.'&s=100';
}else{
$avatar = $host . $url . $hash . '?s=' . $size . '&r=' . $rating . '&d='.$sjtx;
}
?>
<img class="avatar" src="<?php echo $avatar ?>" alt="<?php echo $comments->author; ?>" width="<?php echo $size ?>" height="<?php echo $size ?>" />
<div class="cp">
<?php get_comment_at($comments->coid); ?> <?php
$cos = preg_replace('#</?[p|P][^>]*>#','',$comments->content);
echo $cos;
?>
<div class="cm"><span><?php echo $author ?><?php echo '<span class="idcard">'.$idcard.'</span>';?></span> <?php $comments->date(); ?><span class="cr"><?php $comments->reply(); ?></span></div>
</div>
</div>
<?php if ($comments->children){ ?><div class="children"><?php $comments->threadedComments($options); ?></div><?php } ?>
</li>
<?php } ?>
<div id="comment">
<?php $this->comments()->to($comments); ?>
<h4><?php $this->commentsNum(_t('暂无评论'), _t('仅有 1 条评论'), _t('已有 %d 条评论')); ?></h4><br>
<div id="<?php $this->respondId(); ?>" class="respond">
<div class="ccr"><?php $comments->cancelReply(); ?></div>
<h3 class="response">发表新评论</h3>
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form">
<?php if($this->user->hasLogin()): ?>
<span>已登入<a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>. <a href="<?php $this->options->logoutUrl(); ?>" title="Logout">退出 »</a></span>
<?php else: ?>
<?php if($this->remember('author',true) != "" && $this->remember('mail',true) != "") : ?>
<span>欢迎【<?php $this->remember('author'); ?>】的归来 | <small style="cursor: pointer;" onclick = "tg_c('ainfo','hinfo');"> 编辑资料</small></span>
<div id ="ainfo" class="ainfo hinfo">
<?php else : ?>
<div class="ainfo">
<?php endif ; ?>
<div class="tbox">
<input type="text" name="author" id="author" class="ci" placeholder="称呼" value="<?php $this->remember('author'); ?>" required>
<input type="email" name="mail" id="mail" class="ci" placeholder="邮箱" value="<?php $this->remember('mail'); ?>" <?php if ($this->options->commentsRequireMail): ?> required<?php endif; ?>>
<input type="url" name="url" id="url" class="ci" placeholder="http://" value="<?php $this->remember('url'); ?>" <?php if ($this->options->commentsRequireURL): ?> required<?php endif; ?>>
</div>
</div>
<?php endif; ?>
<div class="tbox"><textarea name="text" id="textarea" class="ci" onkeydown="if(event.ctrlKey&&event.keyCode==13){document.getElementById('submit').click();return false};" placeholder="在这里输入你的评论" required ><?php $this->remember('text',false); ?></textarea></div>
<button type="submit" class="submit" id="submit">提交评论 (Ctrl + Enter)</button>
</form>
</div>
<?php if ($comments->have()): ?>
<?php $comments->listComments(); ?><?php $comments->pageNav('«', '»'); ?>
<?php endif; ?>
</div>
<script type="text/javascript">
(function () {
window.TypechoComment = {
dom : function (id) {
return document.getElementById(id);
},
create : function (tag, attr) {
var el = document.createElement(tag);
for (var key in attr) {
el.setAttribute(key, attr[key]);
}
return el;
},
reply : function (cid, coid) {
var comment = this.dom(cid), parent = comment.parentNode,
response = this.dom('<?php echo $this->respondId(); ?>'),
input = this.dom('comment-parent'),
form = 'form' == response.tagName ? response : response.getElementsByTagName('form')[0],
textarea = response.getElementsByTagName('textarea')[0];
if (null == input) {
input = this.create('input', {
'type' : 'hidden',
'name' : 'parent',
'id' : 'comment-parent'
});
form.appendChild(input);
}
input.setAttribute('value', coid);
if (null == this.dom('comment-form-place-holder')) {
var holder = this.create('div', {
'id' : 'comment-form-place-holder'
});
response.parentNode.insertBefore(holder, response);
}
comment.appendChild(response);
this.dom('cancel-comment-reply-link').style.display = '';
if (null != textarea && 'text' == textarea.name) {
textarea.focus();
}
return false;
},
cancelReply : function () {
var response = this.dom('<?php echo $this->respondId(); ?>'),
holder = this.dom('comment-form-place-holder'),
input = this.dom('comment-parent');
if (null != input) {
input.parentNode.removeChild(input);
}
if (null == holder) {
return true;
}
this.dom('cancel-comment-reply-link').style.display = 'none';
holder.parentNode.insertBefore(response, holder);
return false;
}
};
})();
function tg_c(id,nc){var e=document.getElementById(id);var c=e.className;if(!c){e.className=nc}else{var classArr=c.split(' ');var exist=false;for(var i=0;i<classArr.length;i++){if(classArr[i]===nc){classArr.splice(i,1);e.className=Array.prototype.join.call(classArr," ");exist=true;break}}if(!exist){classArr.push(nc);e.className=Array.prototype.join.call(classArr," ")}}}
</script>
没有合适的资源?快使用搜索试试~ 我知道了~
响应式 Typecho博客主题模板 自适应手机端
共36个文件
php:12个
png:11个
js:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 31 浏览量
2022-06-28
15:00:16
上传
评论
收藏 164KB ZIP 举报
温馨提示
后台设置全面简单,几乎所有看得到的地方都可以自定义 后台设置可以完美适配https 站点 响应式设计布局,适应于任何尺寸大小的屏幕
资源推荐
资源详情
资源评论
收起资源包目录
响应式 Typecho博客主题模板 自适应手机端.zip (36个子文件)
响应式 Typecho博客主题模板 自适应手机端
博客主题模板
LuSongSong
category.php 1KB
functions.php 7KB
footer.php 570B
index.php 2KB
post.php 3KB
guestbook.php 727B
sidebar.php 4KB
comments.php 7KB
images
logo1.png 330B
gnew2.gif 178B
book.png 1KB
bookmark.png 1KB
pictures.png 1KB
logo.png 4KB
thumbnails.png 1KB
blockquote.gif 273B
fire.png 1KB
common.js 494B
btn_top.gif 2KB
home.png 1KB
btn_comment.gif 1KB
gonganbeian.png 1KB
spring_festival_bg.jpg 98KB
user.png 1KB
btn_tougao.gif 860B
pencil.png 1KB
js
core.min.js 7KB
html5-css3.js 13KB
jquery-2.2.4.min.js 84KB
common.js 6KB
jquery.pjax.min.js 8KB
404.php 2KB
style
style.css 38KB
page.php 1KB
files.php 2KB
header.php 2KB
共 36 条
- 1
资源评论
智慧浩海
- 粉丝: 1w+
- 资源: 5150
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功