Skip to content
This repository has been archived by the owner on Nov 30, 2019. It is now read-only.

Commit

Permalink
feat: third party comments
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-xjh committed Sep 12, 2018
1 parent f01d80d commit 14b776d
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 13 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Arcadia v1.0.0-beta版发布
# Arcadia v1.0.0正式版发布

> 精于心,简于形
Expand All @@ -18,11 +18,14 @@ Arcadia是一款基于holakit.css制作的typecho主题,没有使用任何其
4. 无前端框架,极速响应,页面请求资源更少,更快。
5. 采用[GitHub Flavored Markdown](https://github.github.com/gfm/)渲染Markdown,友好界面,美观而又不失内涵。
6. 内置代码高亮,支持多达151种语言。
7. 原生评论+第三方评论多评论系统,畅所欲言。
8. 自定义天气显示,简单实用。
9. 字数统计+阅读时间,让你的文章量化。
7. 更多亮点,等着你去发现💎~

## 使用方法

请填写此[表单](https://wj.qq.com/s/2579513/47b4/),填写完毕后加入QQ群:807852679。
前往release页面下载压缩包,安装至/you-blog-site/usr/themes目录下,QQ群:807852679。

## 兼容性

Expand All @@ -36,4 +39,4 @@ Arcadia是一款基于holakit.css制作的typecho主题,没有使用任何其

欢迎各种形式的贡献,包括但不限于优化,添加功能,文档 & 代码的改进,问题和 bugs 的报告。

> 请先填写表单加入QQ群再贡献,感谢🙏。
> 请先加入QQ群再贡献,感谢🙏。
6 changes: 5 additions & 1 deletion comments.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php if($this->options->comments_setting == 1){ ?>
<style>#comments .lists-navigator{margin:20px 0}#comments .lists-navigator ol{margin:20px 0;padding:0 10px;list-style:none;text-align:center}#comments .lists-navigator ol li.current a{color:var(--hola-primary-color)}.comment-container{position:relative;z-index:1;color:#5f5f5f;background-color:#f7f7f7}#comments{max-width:700px;margin:0 auto;padding:0 20px}#comments .page-navigator{margin:0}#comments a{color:#5f5f5f}#comments .response{font-size:16px;font-weight:400;display:block;padding:30px 0 30px 20px;color:#5f5f5f}#comments .response a{color:var(--hola-primary-color)}.comment-list{margin:0;padding-left:0;list-style-type:none}.comment-parent{margin:20px 0;border:1px solid rgba(184,197,214,.2);border-radius:3px;background:#fff;-webkit-box-shadow:0 1px 4px rgba(0,0,0,.04);box-shadow:0 1px 4px rgba(0,0,0,.04)}.comment-parent:last-child{margin:20px 0 0}.comment-parent:first-child{margin:0}.comment-child,.comment-child2{border-top:1px solid rgba(184,197,214,.2)}.comment-view{padding:20px;cursor:pointer}.comment-header{display:inline-block;width:100%}.comment-header .avatar{display:inline-block;float:left;width:40px;height:40px;border:1px solid #eaeaea;border-radius:50%}.comment-header .comment-author{font-size:13px;line-height:45px;display:inline-block;float:left;margin:0 20px}.comment-header .comment-by-author a{color:var(--hola-primary-color)!important}.comment-content{margin-bottom:10px;color:#313131}.comment-meta{font-size:12px}.comment-meta .comment-reply{display:none;float:right}.comment-meta .comment-reply a{color:var(--hola-primary-color)!important}.comment-view:hover .comment-meta .comment-reply{display:block}.comment-parent>.comment-children .avatar{width:34px;height:34px;margin:3px 0 0 3px}.comment-parent>.comment-children .comment-author-at{float:left;margin-right:5px}.comment-parent>.comment-children .comment-content{margin:-3px 3px 10px}.comment-parent>.comment-children .comment-meta{margin:0 3px}.comment-form{position:relative;margin:0 0 40px;padding:10px 20px;border-radius:3px;background:#fff;-webkit-box-shadow:0 1px 4px #f0f0f0;box-shadow:0 1px 4px rgba(0,0,0,.04)}.comment-form .form-control{font-size:13px;display:block;width:100%;height:34px;color:#313131;outline:0}.comment-form .form-control:focus{border-color:var(--hola-primary-color);outline:0}.comment-form textarea.form-control{overflow:hidden;height:150px;padding:10px 0;resize:none;border-radius:0}.comment-form .input-control{float:left;width:100%;max-width:206px;border-bottom:.1px dashed #ddd;border-radius:0}.comment-form .submit{font-size:13px;position:absolute;right:20px;bottom:20px;display:block;height:32px;margin:0 auto;padding:0 20px;-webkit-transition-duration:.4s;transition-duration:.4s;text-align:center;color:#313131;border:1px solid #f7f7f7;border-radius:30px;background-color:#f7f7f7}.comment-form .submit:hover,.submit:active,.submit:active:focus,.submit:focus{color:var(--hola-primary-color);border:1px solid var(--hola-primary-color);outline-style:none;background-color:#fff}.footer{position:relative;z-index:1;margin-top:0;padding-bottom:50px;background-color:#fff}.footer-social{border-bottom:1px solid rgba(184,197,214,.2)}.footer-social .footer-container{max-width:940px;margin:0 auto}.footer-social .social-list{padding:20px;text-align:center}.footer-social .social-list a{font-size:13px;padding:0 25px;text-decoration:none;color:#5f5f5f}.footer-meta{padding:50px 0 0;list-style:none}.footer-meta .footer-container{width:100%;max-width:960px;height:250px;margin:0 auto;padding:0 80px}.footer-meta .meta-item{position:relative;float:left;width:33.3333333%;min-height:1px;padding:0 30px}.footer-meta .meta-copyright .info-logo img{height:32px;margin-bottom:12px}.footer-meta .meta-copyright .info-text p{font-size:13px;line-height:20px;margin:0;color:#767676}.footer-meta .meta-copyright .info-text a{color:#767676}.footer-meta .meta-title{font-size:14px;padding:0 0 10px 0;text-decoration:none;color:#5f5f5f}.footer-meta .meta-posts li{font-size:13px;line-height:25px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#767676}.footer-meta .meta-posts li a{color:#5f5f5f}.footer-meta .meta-comments li{font-size:13px;line-height:25px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#5f5f5f}.footer-meta .meta-comments li a{color:#767676}@media(max-width:1000px){.directory-content{display:none}.post-header-thumb{height:280px}.post-header-thumb-cover{height:280px}.post-header-thumb-op{height:280px}.post-header-thumb-container{top:70px}}@media(max-width:880px){.index-page{padding:80px 0 0}.archive-page{padding:80px 0 20px}.common-page{padding:80px 0 0}.post-onelist-item-container{padding:50px 20px 55px}.post-list-item{width:50%;padding:10px}.post-list-item:nth-child(odd){padding-left:20px}.post-list-item:nth-child(even){padding-right:20px}.lists-navigator{margin:25px 0 30px}.post-header-thumb{height:250px}.post-header-thumb-op{height:250px}.post-header-thumb-cover{height:250px}.post-header-thumb-container{top:60px}.footer-meta .footer-container{padding:0}.main-content{margin:0 auto}.footer-meta .meta-item{padding:0 20px}}@media(max-width:700px){.comment-form .input-control{max-width:100%}.post-header-thumb{height:220px}.post-header-thumb-op{height:220px}.post-header-thumb-cover{height:220px}.post-header-thumb-container{top:40px}.post-page{padding:20px 25px 0}.page-page{padding:90px 25px 0}.search-page .search-tags{padding:0 0 15px}.search-page .search-tags p{margin:0}.related-post-lists{padding-top:15px}.post-onelist-item-container{padding:20px 20px 25px}.post-onelist-item-container .onelist-item-thumb{min-height:240px}}@media(max-width:650px){.navbar-menu{display:none}.navbar-search{padding:0 35px 0 0}.navbar-search form{width:180px;margin-right:55px}.navbar-mobile-menu{display:inline-block}.red-gradient{display:none}.meta-posts{display:none}.meta-comments{display:none}.post-bottom-bar .social-share{display:none}.post-page{padding:90px 25px 0}.common-page .post-list-item{width:100%;padding:10px 20px}.footer-social{display:none}.footer-meta .footer-container{height:70px;padding:0 15px}.footer-meta .meta-item{width:100%;padding:0 10px}.footer-meta .meta-copyright .info-text{float:right}.footer-meta .meta-copyright .info-text p{text-align:right}.post-onelist-item-container .onelist-item-thumb{min-height:220px}.post-header-thumb{display:none}.post-page .post-header{display:inherit}.post-page .post-content .post-tags{display:inherit}}@media(max-width:580px){.navbar-search form{width:150px}.index-page{padding:70px 0 0}.archive-page{padding:70px 0 20px}.common-page{padding:70px 0 0}.post-list-item{width:100%;padding:10px 20px}.post-list-item:first-child{padding-top:20px}.archive-page .post-list-item:first-child{padding-top:0}.archive-page .post-list-item:last-child{padding-bottom:0}.common-page .post-list-item:first-child{padding-top:0}.related-post-lists{padding-top:5px}.main-content{margin:0 auto}.post-onelist-item-container{padding:20px 20px 25px}.post-onelist-item-container .item-content{display:none}.post-onelist-item-container .item-readmore{display:none}</style>
<?php
function threadedComments($comments, $options) {
Expand Down Expand Up @@ -106,4 +107,7 @@ function threadedComments($comments, $options) {

<?php endif; ?>
</div>
</div>
</div>
<?php }elseif($this->options->comments_setting == 2){ ?>
<div class="hola-card"><?php $this->options->third_party_comments() ?></div>
<?php } ?>
31 changes: 23 additions & 8 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ function themeConfig($form) {
$form->addInput($search_box_text);
*/

//favicon
$favicon = new Typecho_Widget_Helper_Form_Element_Text('favicon', NULL, NULL, _t('favicon图标地址'));
$form->addInput($favicon);

//apple touch icon
$iosicon = new Typecho_Widget_Helper_Form_Element_Text('iosicon', NULL, NULL, _t('apple touch icon图标地址'));
$form->addInput($iosicon);

//文章字数统计
$post_word = new Typecho_Widget_Helper_Form_Element_Radio('post_word',
array('1' => _t('启用'),
Expand Down Expand Up @@ -89,6 +97,21 @@ function themeConfig($form) {

$form->addInput($time_show->multiMode());

//评论设置
$comments_setting = new Typecho_Widget_Helper_Form_Element_Radio('comments_setting',
array('1' => _t('原生评论'),
'2' => _t('第三方评论')
),

'1', _t('评论设置'), _t('第三方评论请在下方第三方评论代码中填写代码'));

$form->addInput($comments_setting);

//第三方评论代码
$third_party_comments = new Typecho_Widget_Helper_Form_Element_Textarea('third_party_comments', NULL, NULL, _t('第三方评论代码'));
$form->addInput($third_party_comments);

//侧边栏设置
$sidebar_show = new Typecho_Widget_Helper_Form_Element_Checkbox('sidebar_show',
array(
'hot_posts' => _t('热门文章(5篇)'),
Expand All @@ -103,14 +126,6 @@ function themeConfig($form) {

$form->addInput($sidebar_show->multiMode());

//favicon
$favicon = new Typecho_Widget_Helper_Form_Element_Text('favicon', NULL, NULL, _t('favicon图标地址'));
$form->addInput($favicon);

//apple touch icon
$iosicon = new Typecho_Widget_Helper_Form_Element_Text('iosicon', NULL, NULL, _t('apple touch icon图标地址'));
$form->addInput($iosicon);

//标签数量限制
$tag_limit = new Typecho_Widget_Helper_Form_Element_Text('tag_limit', NULL, NULL, _t('标签数量限制'), _t('请填写阿拉伯数字,默认为无穷大'));
$form->addInput($tag_limit);
Expand Down
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<link rel="stylesheet" href="<?php $this->options->themeUrl('/assets/css/holakit.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('/assets/css/style.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('/assets/css/font-awesome/css/font-awesome.min.css'); ?>">
<link rel="stylesheet" href="https://npmcdn.com/[email protected]/dist/data-tip.css">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/data-tip.css">
<script src="https://twemoji.maxcdn.com/2/twemoji.min.js?11.0"></script>
<style>
.markdown-body {
Expand Down

0 comments on commit 14b776d

Please sign in to comment.