Skip to content

Commit

Permalink
更新:修复已知bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuchunshu committed Dec 15, 2022
1 parent 6fedce9 commit 29f9815
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 19 deletions.
4 changes: 2 additions & 2 deletions app/Command/Build.php
Expand Up @@ -36,7 +36,7 @@ public function handle()
{
$version = $this->ask("版本","v1.0.0");
$author = $this->ask("作者","zhuchunshu");
$link = $this->ask("链接","https://forum.runpod.cn");
$link = $this->ask("链接","https://www.runpod.cn");
$content = $this->replace($version, $author, $link);
file_put_contents(BASE_PATH."/build-info.php",$content);
$this->info('Successfully');
Expand All @@ -45,6 +45,6 @@ public function handle()
private function replace(mixed $version, mixed $author, mixed $link): string
{
$content = file_get_contents(BASE_PATH."/app/Command/build-info.stub");
return str_replace(array('author', '1.0', 'http://forum.runpod.cn'), array($author, $version, $link), $content);
return str_replace(array('author', '1.0', 'http://www.runpod.cn'), array($author, $version, $link), $content);
}
}
2 changes: 1 addition & 1 deletion app/Controller/Admin/ApiController.php
Expand Up @@ -17,7 +17,7 @@
class ApiController
{
private string $api_releases = "https://api.github.com/repos/zhuchunshu/super-forum/releases";
private string $update_log = "https://forum.runpod.cn/48.md";
private string $update_log = "https://www.runpod.cn/48.md";
#[PostMapping(path:"getVersion")]
public function getVersion(){
// 获取最新版
Expand Down
6 changes: 3 additions & 3 deletions app/Plugins/Comment/helpers.php
Expand Up @@ -22,14 +22,14 @@ function get_topic_comment_page(int $comment_id): int
// 获取最后一页页码
$lastPage = TopicComment::query()
->where(['status' => 'publish','topic_id'=>$topic_id])
->paginate($comment_num)->lastPage();
->paginate((int)$comment_num)->lastPage();
for($i = 0; $i < $lastPage; $i++){
$page = $i+1;
$data = TopicComment::query()
->where(['status' => 'publish','topic_id'=>$topic_id])
->with("topic","user","parent")
->orderBy("optimal","desc")
->paginate($comment_num,['*'],'page',$page)->items();
->paginate((int)$comment_num,['*'],'page',$page)->items();
foreach($data as $value){
if((int)$value->id===(int)$comment_id){
$inPage=$page;
Expand Down Expand Up @@ -60,7 +60,7 @@ function get_topic_comment_floor(int $comment_id): ?int
// ($key + 1)+(($comment->currentPage()-1)*get_options('comment_page_count',15))
$page = TopicComment::query()
->where(['topic_id' => $topic_id,'status' => 'publish'])
->paginate($comment_num,['*'],'page',$comment_page);
->paginate((int)$comment_num,['*'],'page',$comment_page);
foreach($page as $k => $v){
if((int)$v->id===$comment_id){
$floor = ($k + 1)+(($comment_page-1)*get_options('comment_page_count',15));
Expand Down
2 changes: 1 addition & 1 deletion app/Plugins/Comment/src/Controller/ApiController.php
Expand Up @@ -217,7 +217,7 @@ public function topic_comment_list(){
$page = TopicComment::query()
->where(['status' => 'publish','topic_id'=>$topic_id])
->with('topic','user')
->paginate(get_options("comment_page_count",2));
->paginate((int)get_options("comment_page_count",2));
return Json_Api(200,true,$page);
}

Expand Down
8 changes: 4 additions & 4 deletions app/Plugins/Core/src/Controller/IndexController.php
Expand Up @@ -27,30 +27,30 @@ public function index(): \Psr\Http\Message\ResponseInterface
->with('tag', 'user')
->orderBy('topping', 'desc')
->orderBy('updated_at', 'desc')
->paginate(get_options('topic_home_num', 15));
->paginate((int)get_options('topic_home_num', 15));
if (request()->input('query') === 'hot') {
$page = Topic::query()
->where('status', 'publish')
->with('tag', 'user')
->orderBy('view', 'desc')
->orderBy('id', 'desc')
->paginate(get_options('topic_home_num', 15));
->paginate((int)get_options('topic_home_num', 15));
$title = '热度最高的帖子';
}
if (request()->input('query') === 'publish') {
$page = Topic::query()
->where('status', 'publish')
->with('tag', 'user')
->orderBy('id', 'desc')
->paginate(get_options('topic_home_num', 15));
->paginate((int)get_options('topic_home_num', 15));
$title = '最新发布';
}
if (request()->input('query') === 'essence') {
$page = Topic::query()
->where([['essence', '>', 0], ['status', 'publish']])
->with('tag', 'user')
->orderBy('updated_at', 'desc')
->paginate(get_options('topic_home_num', 15));
->paginate((int)get_options('topic_home_num', 15));
$title = '精华';
}
if (request()->input('query') === 'topping') {
Expand Down
2 changes: 1 addition & 1 deletion app/Plugins/Core/src/Controller/User/IndexController.php
Expand Up @@ -84,7 +84,7 @@ public function draft()
->with('tag', 'user')
->orderBy('topping', 'desc')
->orderBy('id', 'desc')
->paginate(get_options('topic_home_num', 15));
->paginate((int)get_options('topic_home_num', 15));

return view('User::draft', ['page' => $page]);
}
Expand Down
8 changes: 4 additions & 4 deletions app/Plugins/Topic/src/Controllers/TagsController.php
Expand Up @@ -42,31 +42,31 @@ public function data($id)
->with('tag', 'user')
->orderBy('topping', 'desc')
->orderBy('updated_at', 'desc')
->paginate(get_options('topic_home_num', 15));
->paginate((int)get_options('topic_home_num', 15));
if (request()->input('query') === 'hot') {
$page = Topic::query()
->where('tag_id', $id)
->where('status', 'publish')
->with('tag', 'user')
->orderBy('view', 'desc')
->orderBy('id', 'desc')
->paginate(get_options('topic_home_num', 15));
->paginate((int)get_options('topic_home_num', 15));
}
if (request()->input('query') === 'publish') {
$page = Topic::query()
->where('tag_id', $id)
->where('status', 'publish')
->with('tag', 'user')
->orderBy('id', 'desc')
->paginate(get_options('topic_home_num', 15));
->paginate((int)get_options('topic_home_num', 15));
}
if (request()->input('query') === 'essence') {
$page = Topic::query()
->where('tag_id', $id)
->where([['essence', '>', 0], ['status', 'publish']])
->with('tag', 'user')
->orderBy('updated_at', 'desc')
->paginate(get_options('topic_home_num', 15));
->paginate((int)get_options('topic_home_num', 15));
}
if (request()->input('query') === 'topping') {
$page = Topic::query()
Expand Down
10 changes: 10 additions & 0 deletions app/Themes/CodeFec/resources/views/topic/show/show.blade.php
Expand Up @@ -10,7 +10,17 @@
<div class="col-md-12">
<div class="row row-cards justify-content-center">
<div class="col-md-9">
@foreach(Itf()->get('ui-topic-content-start-hook') as $k=>$v)
@if(call_user_func($v['enable'])===true)
@include($v['view'])
@endif
@endforeach
@include('App::topic.show.content')
@foreach(Itf()->get('ui-topic-content-end-hook') as $k=>$v)
@if(call_user_func($v['enable'])===true)
@include($v['view'])
@endif
@endforeach
</div>
<div class="col-md-3">
<div class="row row-cards rd">
Expand Down
2 changes: 1 addition & 1 deletion build-info.php
Expand Up @@ -11,5 +11,5 @@
return [
'version' => 'v2.1.6',
'zhuchunshu' => 'zhuchunshu',
'link' => 'https://forum.runpod.cn',
'link' => 'https://www.runpod.cn',
];
2 changes: 1 addition & 1 deletion resources/views/admin/index.blade.php
Expand Up @@ -238,7 +238,7 @@ class="btn btn-light">下载tar.gz包</a>
<div class="row">
<div class="col">更新日志</div>
<div class="col-auto"><a
href="https://forum.runpod.cn/48.html">查看</a></div>
href="https://www.runpod.cn/48.html">查看</a></div>
</div>
</h3>
<div style="overflow:scroll;overflow-x:hidden;max-height: 700px;"
Expand Down
2 changes: 1 addition & 1 deletion resources/views/core/install.blade.php
Expand Up @@ -34,7 +34,7 @@
<div class="card-body text-center">
<h1>安装SuperForum!</h1>
<p class="text-muted">本项目开源地址: <a href="https://github.com/zhuchunshu">https://github.com/zhuchunshu</a><br>安装过程中如若遇到问题请到论坛反馈:
<a href="https://forum.runpod.cn">https://forum.runpod.cn</a></p>
<a href="https://www.runpod.cn">https://www.runpod.cn</a></p>
</div>
<div class="hr-text hr-text-center hr-text-spaceless">@{{ tips }}</div>
<div class="card-body">
Expand Down

0 comments on commit 29f9815

Please sign in to comment.