Skip to content

Commit 29f9815

Browse files
committedDec 15, 2022
更新:修复已知bug
·
v2.7.7v2.1.7
1 parent 6fedce9 commit 29f9815

File tree

11 files changed

+29
-19
lines changed

11 files changed

+29
-19
lines changed
 

‎app/Command/Build.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function handle()
3636
{
3737
$version = $this->ask("版本","v1.0.0");
3838
$author = $this->ask("作者","zhuchunshu");
39-
$link = $this->ask("链接","https://forum.runpod.cn");
39+
$link = $this->ask("链接","https://www.runpod.cn");
4040
$content = $this->replace($version, $author, $link);
4141
file_put_contents(BASE_PATH."/build-info.php",$content);
4242
$this->info('Successfully');
@@ -45,6 +45,6 @@ public function handle()
4545
private function replace(mixed $version, mixed $author, mixed $link): string
4646
{
4747
$content = file_get_contents(BASE_PATH."/app/Command/build-info.stub");
48-
return str_replace(array('author', '1.0', 'http://forum.runpod.cn'), array($author, $version, $link), $content);
48+
return str_replace(array('author', '1.0', 'http://www.runpod.cn'), array($author, $version, $link), $content);
4949
}
5050
}

‎app/Controller/Admin/ApiController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class ApiController
1818
{
1919
private string $api_releases = "https://api.github.com/repos/zhuchunshu/super-forum/releases";
20-
private string $update_log = "https://forum.runpod.cn/48.md";
20+
private string $update_log = "https://www.runpod.cn/48.md";
2121
#[PostMapping(path:"getVersion")]
2222
public function getVersion(){
2323
// 获取最新版

‎app/Plugins/Comment/helpers.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ function get_topic_comment_page(int $comment_id): int
2222
// 获取最后一页页码
2323
$lastPage = TopicComment::query()
2424
->where(['status' => 'publish','topic_id'=>$topic_id])
25-
->paginate($comment_num)->lastPage();
25+
->paginate((int)$comment_num)->lastPage();
2626
for($i = 0; $i < $lastPage; $i++){
2727
$page = $i+1;
2828
$data = TopicComment::query()
2929
->where(['status' => 'publish','topic_id'=>$topic_id])
3030
->with("topic","user","parent")
3131
->orderBy("optimal","desc")
32-
->paginate($comment_num,['*'],'page',$page)->items();
32+
->paginate((int)$comment_num,['*'],'page',$page)->items();
3333
foreach($data as $value){
3434
if((int)$value->id===(int)$comment_id){
3535
$inPage=$page;
@@ -60,7 +60,7 @@ function get_topic_comment_floor(int $comment_id): ?int
6060
// ($key + 1)+(($comment->currentPage()-1)*get_options('comment_page_count',15))
6161
$page = TopicComment::query()
6262
->where(['topic_id' => $topic_id,'status' => 'publish'])
63-
->paginate($comment_num,['*'],'page',$comment_page);
63+
->paginate((int)$comment_num,['*'],'page',$comment_page);
6464
foreach($page as $k => $v){
6565
if((int)$v->id===$comment_id){
6666
$floor = ($k + 1)+(($comment_page-1)*get_options('comment_page_count',15));

‎app/Plugins/Comment/src/Controller/ApiController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public function topic_comment_list(){
217217
$page = TopicComment::query()
218218
->where(['status' => 'publish','topic_id'=>$topic_id])
219219
->with('topic','user')
220-
->paginate(get_options("comment_page_count",2));
220+
->paginate((int)get_options("comment_page_count",2));
221221
return Json_Api(200,true,$page);
222222
}
223223

‎app/Plugins/Core/src/Controller/IndexController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,30 @@ public function index(): \Psr\Http\Message\ResponseInterface
2727
->with('tag', 'user')
2828
->orderBy('topping', 'desc')
2929
->orderBy('updated_at', 'desc')
30-
->paginate(get_options('topic_home_num', 15));
30+
->paginate((int)get_options('topic_home_num', 15));
3131
if (request()->input('query') === 'hot') {
3232
$page = Topic::query()
3333
->where('status', 'publish')
3434
->with('tag', 'user')
3535
->orderBy('view', 'desc')
3636
->orderBy('id', 'desc')
37-
->paginate(get_options('topic_home_num', 15));
37+
->paginate((int)get_options('topic_home_num', 15));
3838
$title = '热度最高的帖子';
3939
}
4040
if (request()->input('query') === 'publish') {
4141
$page = Topic::query()
4242
->where('status', 'publish')
4343
->with('tag', 'user')
4444
->orderBy('id', 'desc')
45-
->paginate(get_options('topic_home_num', 15));
45+
->paginate((int)get_options('topic_home_num', 15));
4646
$title = '最新发布';
4747
}
4848
if (request()->input('query') === 'essence') {
4949
$page = Topic::query()
5050
->where([['essence', '>', 0], ['status', 'publish']])
5151
->with('tag', 'user')
5252
->orderBy('updated_at', 'desc')
53-
->paginate(get_options('topic_home_num', 15));
53+
->paginate((int)get_options('topic_home_num', 15));
5454
$title = '精华';
5555
}
5656
if (request()->input('query') === 'topping') {

‎app/Plugins/Core/src/Controller/User/IndexController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function draft()
8484
->with('tag', 'user')
8585
->orderBy('topping', 'desc')
8686
->orderBy('id', 'desc')
87-
->paginate(get_options('topic_home_num', 15));
87+
->paginate((int)get_options('topic_home_num', 15));
8888

8989
return view('User::draft', ['page' => $page]);
9090
}

‎app/Plugins/Topic/src/Controllers/TagsController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,31 @@ public function data($id)
4242
->with('tag', 'user')
4343
->orderBy('topping', 'desc')
4444
->orderBy('updated_at', 'desc')
45-
->paginate(get_options('topic_home_num', 15));
45+
->paginate((int)get_options('topic_home_num', 15));
4646
if (request()->input('query') === 'hot') {
4747
$page = Topic::query()
4848
->where('tag_id', $id)
4949
->where('status', 'publish')
5050
->with('tag', 'user')
5151
->orderBy('view', 'desc')
5252
->orderBy('id', 'desc')
53-
->paginate(get_options('topic_home_num', 15));
53+
->paginate((int)get_options('topic_home_num', 15));
5454
}
5555
if (request()->input('query') === 'publish') {
5656
$page = Topic::query()
5757
->where('tag_id', $id)
5858
->where('status', 'publish')
5959
->with('tag', 'user')
6060
->orderBy('id', 'desc')
61-
->paginate(get_options('topic_home_num', 15));
61+
->paginate((int)get_options('topic_home_num', 15));
6262
}
6363
if (request()->input('query') === 'essence') {
6464
$page = Topic::query()
6565
->where('tag_id', $id)
6666
->where([['essence', '>', 0], ['status', 'publish']])
6767
->with('tag', 'user')
6868
->orderBy('updated_at', 'desc')
69-
->paginate(get_options('topic_home_num', 15));
69+
->paginate((int)get_options('topic_home_num', 15));
7070
}
7171
if (request()->input('query') === 'topping') {
7272
$page = Topic::query()

‎app/Themes/CodeFec/resources/views/topic/show/show.blade.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,17 @@
1010
<div class="col-md-12">
1111
<div class="row row-cards justify-content-center">
1212
<div class="col-md-9">
13+
@foreach(Itf()->get('ui-topic-content-start-hook') as $k=>$v)
14+
@if(call_user_func($v['enable'])===true)
15+
@include($v['view'])
16+
@endif
17+
@endforeach
1318
@include('App::topic.show.content')
19+
@foreach(Itf()->get('ui-topic-content-end-hook') as $k=>$v)
20+
@if(call_user_func($v['enable'])===true)
21+
@include($v['view'])
22+
@endif
23+
@endforeach
1424
</div>
1525
<div class="col-md-3">
1626
<div class="row row-cards rd">

‎build-info.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
return [
1212
'version' => 'v2.1.6',
1313
'zhuchunshu' => 'zhuchunshu',
14-
'link' => 'https://forum.runpod.cn',
14+
'link' => 'https://www.runpod.cn',
1515
];

‎resources/views/admin/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class="btn btn-light">下载tar.gz包</a>
238238
<div class="row">
239239
<div class="col">更新日志</div>
240240
<div class="col-auto"><a
241-
href="https://forum.runpod.cn/48.html">查看</a></div>
241+
href="https://www.runpod.cn/48.html">查看</a></div>
242242
</div>
243243
</h3>
244244
<div style="overflow:scroll;overflow-x:hidden;max-height: 700px;"

‎resources/views/core/install.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<div class="card-body text-center">
3535
<h1>安装SuperForum!</h1>
3636
<p class="text-muted">本项目开源地址: <a href="https://github.com/zhuchunshu">https://github.com/zhuchunshu</a><br>安装过程中如若遇到问题请到论坛反馈:
37-
<a href="https://forum.runpod.cn">https://forum.runpod.cn</a></p>
37+
<a href="https://www.runpod.cn">https://www.runpod.cn</a></p>
3838
</div>
3939
<div class="hr-text hr-text-center hr-text-spaceless">@{{ tips }}</div>
4040
<div class="card-body">

0 commit comments

Comments
 (0)
Please sign in to comment.