Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xenice committed Aug 8, 2020
1 parent 04ef6d0 commit 634534f
Show file tree
Hide file tree
Showing 21 changed files with 653 additions and 577 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,32 @@ MVC分层架构,层次分明,扩展更灵活、维护更方便;

### 更新说明

**最后更新:2020.07.27**
**最后更新:2020.08.08**

v2.0.6

- 新增选项-显示放灯片标题和描述;
- 新增客服QQ;
- 新增回到顶部按钮;

v2.0.5

- 优化文章内链样式;
- 新增二级菜单支持;
- 新增文章标题SEO(当前支持标题SEO、关键字SEO、描述SEO);
- 新增评论回复提示;
- 优化友情链接小工具显示;

v2.0.4

- 修复评论列表楼层号错位问题;
- 优化评论小工具;
- 新增archive页和author页面;
- 新增列表页无结果提示;
- 新增自定义网页图标功能;

v2.0.3

- 修复用elementor发布文章时文章列表显示相同描述和缩略图问题;
- 修复评论列表楼层序号反向问题;
- 添加缩略图alt属性和链接标签;
Expand Down
13 changes: 11 additions & 2 deletions app/web/action/GuestAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ public function customColor($head)
Theme::use('template')->color = $color;
list($a1, $a2, $b1, $b2, $b3, $b4) = $color;
$head .= '<style>';
$head .= "a:hover{color:$a1;}.breadcrumb a:hover{color:$a2;}.btn-custom,.badge-custom{color:$b3!important;background-color:$b1;border-color:$b1;}.btn-custom:hover,.badge-custom:hover{color:$b3;background-color:$b2;border-color:$b2}.form-control:focus {border-color: $b4!important;}.navbar-nav .current-menu-item a{color:$a1}.fa-search:hover{color:$a2;}.user-login .nav-item .nav-link{color:$b4;}.user-login .nav-item .active{color:$a2;}.post-content a {color:$a1;}.post-content a:hover{color:$b2;}";
$head .= "a:hover{color:$a1;}.breadcrumb a:hover{color:$a2;}.btn-custom,.badge-custom{color:$b3!important;background-color:$b1;border-color:$b1;}.btn-custom:hover,.badge-custom:hover{color:$b3;background-color:$b2;border-color:$b2}.form-control:focus {border-color: $b4!important;}.navbar-nav .current-menu-item a{color:$a1}.fa-search:hover{color:$a2;}.user-login .nav-item .nav-link{color:$b4;}.user-login .nav-item .active{color:$a2;}.post-content a {color:$a1;}.post-content a:hover{color:$b2;}.rollbar .rollbar-item:hover {background-color: $b4;}";
$head .= ".fa-weixin{color:#7BD172}.fa-qq{color:#f67585}.fa-weibo{color:#ff8d8d}";

$head .= '</style>';
return $head;
}
Expand Down Expand Up @@ -115,6 +114,16 @@ private function loginScripts()

public function footer($footer)
{
// rollbar
$str = '';
if($qq = take('service_qq')){
$str .= '<div class="rollbar-item" ><a target="_blank" title="'._t('Service QQ').'" href="http://wpa.qq.com/msgrd?v=3&uin='.$qq.'&site=qq&menu=yes"><i class="fa fa-qq"></i></a></div>';
}
if(take('enable_scroll_top')){
$str .= '<div class="rollbar-item scroll-top" title="'._t('Back to top').'"><i class="fa fa-angle-up"></i></div>';
}
$str && $footer .= '<div class="rollbar md-down-none">' . $str . '</div>';

take('Baidu_statistics') && $footer .= take('Baidu_statistics');
take('baidu_auto_push') && $footer .= take('baidu_auto_push');
return $footer;
Expand Down
63 changes: 0 additions & 63 deletions app/web/action/VideoAction.php

This file was deleted.

28 changes: 23 additions & 5 deletions app/web/controller/SingleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,30 @@ public function index()

public function scripts()
{
wp_enqueue_style('highlight-css', STATIC_URL . '/lib/highlight/styles/vs.css', [], '9.9.0');
wp_enqueue_script('highlight-js', STATIC_URL . '/lib/highlight/highlight.pack.js', [], '9.9.0', true);
wp_enqueue_script('line-numbers', STATIC_URL . '/lib/highlight/line-numbers.min.js', [], '1.0.0', true);
$cdn = take('enable_cdn');

wp_enqueue_style('share-css', STATIC_URL . '/lib/share/css/share.min.css', [], THEME_VER);
wp_enqueue_script('share-js', STATIC_URL . '/lib/share/js/social-share.min.js', [], THEME_VER, true);
if(take('enable_highlight')){
if($cdn){
wp_enqueue_style('highlight-css', 'https://cdn.staticfile.org/highlight.js/10.1.2/styles/vs.min.css', [], '10.1.2');
wp_enqueue_script('highlight-js', 'https://cdn.staticfile.org/highlight.js/10.1.2/highlight.min.js', [], '10.1.2', true);
wp_enqueue_script('line-numbers', 'https://cdn.staticfile.org/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js', [], '2.8.0', true);
}
else{
wp_enqueue_style('highlight-css', STATIC_URL . '/lib/highlight/styles/vs.css', [], '9.9.0');
wp_enqueue_script('highlight-js', STATIC_URL . '/lib/highlight/highlight.pack.js', [], '9.9.0', true);
wp_enqueue_script('line-numbers', STATIC_URL . '/lib/highlight/line-numbers.min.js', [], '1.0.0', true);
}

}

if($cdn){
wp_enqueue_style('share-css', 'https://cdn.staticfile.org/social-share.js/1.0.16/css/share.min.css', [], '1.0.16');
wp_enqueue_script('share-js', 'https://cdn.staticfile.org/social-share.js/1.0.16/js/social-share.min.js', [], '1.0.16', true);
}
else{
wp_enqueue_style('share-css', STATIC_URL . '/lib/share/css/share.min.css', [], '1.0.16');
wp_enqueue_script('share-js', STATIC_URL . '/lib/share/js/social-share.min.js', [], '1.0.16', true);
}
}

public function footer($footer)
Expand Down
4 changes: 2 additions & 2 deletions app/web/model/part/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function breadcrumb()

public function previousLink($tag = '', $same_term = false)
{
$post = get_previous_post($same_term);
$post = get_adjacent_post( $same_term, '', true, $this->taxonomy());
if($post){
$row = Theme::new('article_pointer', $post);
return $tag . '<a href="' . $row->url() . '" title="' . $row->title() . '">' . $row->title() . '</a>';
Expand All @@ -31,7 +31,7 @@ public function previousLink($tag = '', $same_term = false)

public function nextLink($tag = '', $same_term = false)
{
$post = get_next_post($same_term);
$post = get_adjacent_post( $same_term, '', false, $this->taxonomy());
if($post){
$row = Theme::new('article_pointer', $post);
return $tag . '<a href="' . $row->url() . '" title="' . $row->title() . '">' . $row->title() . '</a>';
Expand Down
36 changes: 36 additions & 0 deletions app/web/view/home/slide.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
$img2 = take('slide_image_2');
$img3 = take('slide_image_3');
?>
<style>
@media screen and (min-width:768px){
.carousel-caption{
bottom: 100px;
}
.carousel-caption h3{
font-size:1.25rem;
}
.carousel-caption p{
color:#eee;
}
}
@media screen and (max-width:767px) {
.carousel-caption{
bottom: 40px;
}
}
</style>
<div id="demo" class="carousel slide" data-ride="carousel">
<!-- 指示符 -->
<ul class="carousel-indicators">
Expand All @@ -16,16 +34,34 @@
<div class="carousel-item active">
<a href="<?=$img1['url']?>" title="<?=$img1['title']?>">
<img src="<?=$img1['path']?>" alt="<?=$img1['title']?>" />
<?php if(take('display_slide_title')):?>
<div class="carousel-caption">
<h3><?=$img1['title']?></h3>
<p class="md-down-none"><?=$img1['desc']?></p>
</div>
<?php endif;?>
</a>
</div>
<div class="carousel-item">
<a href="<?=$img2['url']?>" title="<?=$img2['title']?>">
<img src="<?=$img2['path']?>" alt="<?=$img2['title']?>" />
<?php if(take('display_slide_title')):?>
<div class="carousel-caption">
<h3><?=$img2['title']?></h3>
<p class="md-down-none"><?=$img2['desc']?></p>
</div>
<?php endif;?>
</a>
</div>
<div class="carousel-item">
<a href="<?=$img3['url']?>" title="<?=$img3['title']?>">
<img src="<?=$img3['path']?>" alt="<?=$img3['title']?>" />
<?php if(take('display_slide_title')):?>
<div class="carousel-caption">
<h3><?=$img3['title']?></h3>
<p class="md-down-none"><?=$img3['desc']?></p>
</div>
<?php endif;?>
</a>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions config/app.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
define('HOME_URL', home_url());
define('HOME_URL', home_url('',$_SERVER['HTTPS']?'https':'http'));
define('THEME_NAME', wp_get_theme()->get('Name'));
define('THEME_DIR', get_template_directory());
define('THEME_URL', get_template_directory_uri());
Expand All @@ -14,5 +14,4 @@
// options
define('OPTIONS_FILE', __dir__ . '/options.php');

define('DEBUG', false);
define('CACHE', false);
85 changes: 61 additions & 24 deletions config/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,43 @@
]

],
[
'id' => 'Baidu_statistics',
'name' => _t('Baidu Statistics'),
'desc' => _t('Fill in baidu statistics script'),
'type' => 'textarea',
'style' => 'regular',
'value' => '',
'rows' => 6

],
[
'id' => 'baidu_auto_push',
'name' => _t('Baidu Auto Push'),
'desc' => _t('Fill in baidu auto push script'),
'type' => 'textarea',
'style' => 'regular',
'value' => '',
'rows' => 6

],
[
'name' => _t('Bottom right button'),
'fields'=>[
[
'id' => 'enable_scroll_top',
'type' => 'checkbox',
'value' => false,
'label' => _t('Enable back-to-top button')
],
[
'id' => 'service_qq',
'type' => 'text',
'value' => '',
'label' => _t('Service QQ')
],
]
],
[
'name' => _t('Auxiliary'),
'fields'=>[
Expand All @@ -45,6 +82,12 @@
'value' => true,
'label' => _t('Enable static file CDN acceleration')
],
[
'id' => 'enable_highlight',
'type' => 'checkbox',
'value' => true,
'label' => _t('Enable code highlight')
],
[
'id' => 'enable_category_badge',
'type' => 'checkbox',
Expand All @@ -65,26 +108,6 @@
]
]
],
[
'id' => 'Baidu_statistics',
'name' => _t('Baidu Statistics'),
'desc' => _t('Fill in baidu statistics script'),
'type' => 'textarea',
'style' => 'regular',
'value' => '',
'rows' => 6

],
[
'id' => 'baidu_auto_push',
'name' => _t('Baidu Auto Push'),
'desc' => _t('Fill in baidu auto push script'),
'type' => 'textarea',
'style' => 'regular',
'value' => '',
'rows' => 6

]
]
],
[
Expand All @@ -110,12 +133,23 @@
'rows' => 3
],
[
'id' => 'enable_slide',
'name' => _t('Slide'),
'desc' => _t('Please set slide images below if Enable slide, Images recommended size is 715px*350px.'),
'type' => 'checkbox',
'value' => true,
'label' => _t('Enable Slide')
'fields'=>[
[
'id' => 'enable_slide',
'type' => 'checkbox',
'value' => true,
'label' => _t('Enable Slide')
],
[
'id' => 'display_slide_title',
'type' => 'checkbox',
'value' => true,
'label' => _t('Display the title and description of the slide')
]
]

],
[
'id' => 'slide_image_1',
Expand All @@ -124,6 +158,7 @@
'value' => [
'url' =>'http://www.xenice.com/',
'title'=>'xenice',
'desc' => '',
'path' =>STATIC_URL . '/images/onenice_slide_1.jpg'
]
],
Expand All @@ -134,6 +169,7 @@
'value' => [
'url' =>'http://www.xenice.com/',
'title'=>'xenice',
'desc' => '',
'path' =>STATIC_URL . '/images/onenice_slide_2.jpg'
]
],
Expand All @@ -144,6 +180,7 @@
'value' => [
'url' =>'http://www.xenice.com/',
'title'=>'xenice',
'desc' => '',
'path' =>STATIC_URL . '/images/onenice_slide_3.jpg'
]
]
Expand Down
Loading

0 comments on commit 634534f

Please sign in to comment.