Skip to content

Commit 1bbe767

Browse files
committed
feat: release 7.3.0
1 parent 6488252 commit 1bbe767

File tree

21 files changed

+178
-40
lines changed

21 files changed

+178
-40
lines changed

app/Constant/AppConstant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ class AppConstant
66
{
77
const APP = 'blog';
88
const APP_NAME = 'ModStartBlog';
9-
const VERSION = '7.2.0';
9+
const VERSION = '7.3.0';
1010
}

module/Banner/Admin/routes.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

33

4-
$router->match(['get', 'post'], 'banner', '\Module\Banner\Admin\Controller\BannerController@index');
5-
$router->match(['get', 'post'], 'banner/add', '\Module\Banner\Admin\Controller\BannerController@add');
6-
$router->match(['get', 'post'], 'banner/edit', '\Module\Banner\Admin\Controller\BannerController@edit');
7-
$router->match(['post'], 'banner/delete', '\Module\Banner\Admin\Controller\BannerController@delete');
8-
$router->match(['get'], 'banner/show', '\Module\Banner\Admin\Controller\BannerController@show');
9-
$router->match(['post'], 'banner/sort', '\Module\Banner\Admin\Controller\BannerController@sort');
4+
$router->match(['get', 'post'], 'banner', 'BannerController@index');
5+
$router->match(['get', 'post'], 'banner/add', 'BannerController@add');
6+
$router->match(['get', 'post'], 'banner/edit', 'BannerController@edit');
7+
$router->match(['post'], 'banner/delete', 'BannerController@delete');
8+
$router->match(['get'], 'banner/show', 'BannerController@show');
9+
$router->match(['post'], 'banner/sort', 'BannerController@sort');

module/Blog/Core/MBlog.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,20 @@ public static function buildRecords($records)
9595
foreach ($records as $i => $v) {
9696
$records[$i]['_category'] = BlogCategoryUtil::get($v['categoryId']);
9797
$records[$i]['images'] = AssetsUtil::fixFull($v['images']);
98+
$records[$i]['_images'] = [];
99+
$records[$i]['_images'] = array_merge($records[$i]['_images'], $records[$i]['images']);
98100
$records[$i]['_cover'] = null;
99101
if (isset($records[$i]['images'][0])) {
100102
$records[$i]['_cover'] = $records[$i]['images'][0];
101103
}
102-
if (empty($records[$i]['_cover']) && isset($v['content'])) {
104+
if (isset($v['content'])) {
103105
$ret = HtmlUtil::extractTextAndImages($v['content']);
104-
if (isset($ret['images'][0])) {
105-
$records[$i]['_cover'] = AssetsUtil::fixFull($ret['images'][0]);
106+
if (!empty($ret['images'])) {
107+
$ret['images'] = AssetsUtil::fixFull($ret['images']);
108+
$records[$i]['_images'] = array_merge($records[$i]['_images'], $ret['images']);
109+
}
110+
if (empty($records[$i]['_cover']) && isset($ret['images'][0])) {
111+
$records[$i]['_cover'] = $ret['images'][0];
106112
}
107113
}
108114
}

module/Blog/Docs/release.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- 新增:博客新增暗黑模式
44
- 新增:博客支持超级搜索ElasticSearch(需要安装SuperSearchES)
55
- 新增:博客主动URL推送功能
6+
- 新增:侧边栏增加热门博客
67
- 修复:博客列表移动端标题显示异常问题
78
- 修复:博客评论审核状态文案错误修复
89

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div class="ub-content-box margin-bottom">
2+
<div class="tw-px-3">
3+
<div class="tw-text-lg">
4+
<i class="fa fa-fire"></i>
5+
热门博客
6+
</div>
7+
</div>
8+
<div class="tw-px-1">
9+
<div class="tw-mt-4">
10+
@foreach(MBlog::hottestBlog(5) as $b)
11+
<div class="tw-pb-2">
12+
<a href="{{modstart_web_url('blog/'.$b['id'])}}"
13+
class="tw-block tw-overflow-ellipsis tw-overflow-hidden ub-text-default tw-truncate">
14+
<i class="iconfont icon-angle-right ub-text-muted tw-mr-1"></i>
15+
{{$b['title']}}
16+
</a>
17+
</div>
18+
@endforeach
19+
</div>
20+
</div>
21+
</div>

module/Blog/View/pc/blog/inc/blogLatest.blade.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<div class="ub-content-box margin-bottom">
2-
<div class="tw-p-3">
2+
<div class="tw-px-3">
33
<div class="tw-text-lg">
4-
<i class="iconfont icon-list"></i>
4+
<i class="fa fa-calendar"></i>
55
最新博客
66
</div>
7+
</div>
8+
<div class="tw-px-1">
79
<div class="tw-mt-4">
810
@foreach(MBlog::latestBlog(5) as $b)
911
<div class="tw-pb-2">
@@ -17,3 +19,4 @@ class="tw-block tw-overflow-ellipsis tw-overflow-hidden ub-text-default tw-trunc
1719
</div>
1820
</div>
1921
</div>
22+

module/Blog/View/pc/blog/index.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939

4040
@include('module::Blog.View.pc.blog.inc.tags')
4141

42+
@include('module::Blog.View.pc.blog.inc.blogHottest')
43+
4244
@include('module::Blog.View.pc.blog.inc.partners')
4345

4446
</div>

module/Vendor/Provider/Schedule/ScheduleProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ public static function callByName($name)
4747

4848
public static function call(Schedule $schedule)
4949
{
50+
if (!isset($_SERVER['argv'][1]) || $_SERVER['argv'][1] != 'schedule:run') {
51+
return;
52+
}
5053
$autoCleanHistory = true;
5154
foreach (ScheduleBiz::all() as $provider) {
5255

module/Vendor/Util/FilterUtil.php

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
4+
namespace Module\Vendor\Util;
5+
6+
7+
use ModStart\Core\Exception\BizException;
8+
use ModStart\Core\Util\TreeUtil;
9+
10+
class FilterUtil
11+
{
12+
private static function categoryGet($categories, $id)
13+
{
14+
foreach ($categories as $category) {
15+
if ($category['id'] == $id) {
16+
return $category;
17+
}
18+
}
19+
return null;
20+
}
21+
22+
public static function categoryTreeFilter($categoryId, $categories, $keyTitle = 'title', $keyPid = 'pid')
23+
{
24+
$filterText = [];
25+
$pageTitle = [];
26+
$category = null;
27+
if ($categoryId) {
28+
$category = self::categoryGet($categories, $categoryId);
29+
BizException::throwsIfEmpty('分类不存在', $category);
30+
$filterText[] = $category[$keyTitle];
31+
$pageTitle[] = $category[$keyTitle];
32+
if ($category[$keyPid]) {
33+
$parentCategory = self::categoryGet($categories, $category[$keyPid]);
34+
$pageTitle[] = $parentCategory[$keyTitle];
35+
}
36+
}
37+
$categoryIds = [
38+
$categoryId
39+
];
40+
$childrenIds = TreeUtil::nodesChildrenIds($categories, $categoryId);
41+
$categoryIds = array_merge($categoryIds, $childrenIds);
42+
$categoryChain = TreeUtil::nodesChainWithItems($categories, $categoryId);
43+
return [
44+
$category,
45+
$categoryIds,
46+
$categoryChain,
47+
$filterText,
48+
$pageTitle,
49+
];
50+
}
51+
}

public/asset/theme/default/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)