diff --git a/README.md b/README.md index d456902..d08d74c 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ > TaoLer是一个简单迅捷的轻论坛系统,适用于个人或组织区域型信息交流发布平台。 - * 官网:https://www.aieok.com:8443 - * 版本:TaoLer 1.8.15 - * 日期:2021.12.15 + * 官网:https://www.aieok.com + * 版本:TaoLer 1.8.16 + * 日期:2021.12.21 webman版新架构已适配90% @@ -44,7 +44,8 @@ #### 安装教程 1. 首选确保满目使用环境要求,php > 7.2, mysql > 5.7.3 -2. git下载:https://gitee.com/toogee/TaoLer +2. git下载:https://gitee.com/toogee/TaoLer + github https://www.github.com/taoser/TaoLer 官网下载:https://www.aieok.com #### 引导安装 diff --git a/app/admin/middleware.php b/app/admin/middleware.php index 786d990..a56776a 100644 --- a/app/admin/middleware.php +++ b/app/admin/middleware.php @@ -1,5 +1,8 @@ getArtDetail($id); $arId = $artDetail->cate->id; @@ -89,10 +90,11 @@ class Article extends BaseController // 抛出 HTTP 异常 throw new \think\exception\HttpException(404, '异常消息'); } - $comments = $artDetail->comments()->where('status',1)->order(['cai'=>'asc','create_time'=>'asc'])->paginate(10); + $comments = $artDetail->comments()->where('status',1)->order(['cai'=>'asc','create_time'=>'asc'])->paginate(['list_rows'=>10, 'page'=>$page]); //$comment = new \app\common\model\Comment(); //$comments = $comment->getComment($id); //dump($comments); + $count = $comments->total(); $artDetail->inc('pv')->update(); $pv = Db::name('article')->field('pv')->where('id',$id)->value('pv'); $download = $artDetail->upzip ? download($artDetail->upzip,'file') : ''; @@ -106,7 +108,7 @@ class Article extends BaseController //分类钻展赞助 $ad_comm = $ad->getSliderList(7); - View::assign(['article'=>$artDetail,'pv'=>$pv,'comments'=>$comments,'artHot'=>$artHot,'ad_art'=>$ad_artImg,'ad_comm'=>$ad_comm,$download,'jspage'=>'jie']); + View::assign(['article'=>$artDetail,'pv'=>$pv,'comments'=>$comments,'artHot'=>$artHot,'ad_art'=>$ad_artImg,'ad_comm'=>$ad_comm,$download,'count'=>$count,'page'=>$page,'jspage'=>'jie']); return View::fetch('article/'.$tpl.'/detail'); } diff --git a/app/index/middleware.php b/app/index/middleware.php index e81c984..d546b58 100644 --- a/app/index/middleware.php +++ b/app/index/middleware.php @@ -1,8 +1,11 @@ getName(); + if($app !== 'install' && !file_exists('./install.lock')){ return redirect('/install/index'); //header('Location:'.Request::domain().'/install.php'); } - return $next($request); + return $next($request); } } diff --git a/config/database.php b/config/database.php index f4dd0fa..d954bcb 100644 --- a/config/database.php +++ b/config/database.php @@ -16,13 +16,13 @@ return [ // 数据库类型 'type' => 'mysql', // 服务器地址 - 'hostname' => '127.0.0.1', + 'hostname' => '', // 数据库名 - 'database' => 'taoler', + 'database' => '', // 用户名 - 'username' => 'taoler', + 'username' => '', // 密码 - 'password' => 'taoler2022', + 'password' => '', // 端口 'hostport' => '3306', // 数据库连接参数 diff --git a/view/taoler/index/article/ask/detail.html b/view/taoler/index/article/ask/detail.html index 741db91..a2c8337 100644 --- a/view/taoler/index/article/ask/detail.html +++ b/view/taoler/index/article/ask/detail.html @@ -191,7 +191,7 @@ var collectionFind = "{:url('Collection/find')}", langCollection = "{:lang('collection')}", langCancelCollection = "{:lang('cancel collection')}"; -layui.use(['fly', 'face','colorpicker','plyr'], function(){ +layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){ var $ = layui.jquery ,form = layui.form ,fly = layui.fly @@ -199,6 +199,7 @@ layui.use(['fly', 'face','colorpicker','plyr'], function(){ ,plyr = layui.plyr; var laytpl = layui.laytpl; var uid = layui.cache.user.uid; + var laypage = layui.laypage; //tpl模板给发布时间赋值 $('div.user-questions').children('span.user-post-time').each(function(){ @@ -280,6 +281,26 @@ layui.use(['fly', 'face','colorpicker','plyr'], function(){ } return false; }); + + //执行一个laypage实例 + laypage.render({ + elem: 'pages' //注意,这里的 test1 是 ID,不用加 # 号 + ,count: {$count} //数据总数,从服务端得到 + ,limit: 10 + ,curr : {$page} + + //获取起始页 + ,jump: function(obj, first){ + //首次不执行 + if(!first){ + var page = obj.curr; + var url = "{:url('article/detail',['id'=>$article.id])}" + $.post(url,{"page":page},function(){ + window.location.href = url + '?page=' + page + '#flyReply'; + }); + } + } + }); //下载 $('#zip-download').click(function (){ diff --git a/view/taoler/index/article/posts/detail.html b/view/taoler/index/article/posts/detail.html index dfcb00a..bba5d26 100644 --- a/view/taoler/index/article/posts/detail.html +++ b/view/taoler/index/article/posts/detail.html @@ -112,7 +112,7 @@ {/volist} -
{$comments|raw}
+
{if condition="$article.is_reply == 1"}
@@ -180,14 +180,15 @@ var collectionFind = "{:url('Collection/find')}", langCollection = "{:lang('collection')}", langCancelCollection = "{:lang('cancel collection')}"; -layui.use(['fly', 'face','colorpicker','plyr'], function(){ - var $ = layui.jquery - ,form = layui.form - ,fly = layui.fly - ,colorpicker = layui.colorpicker - ,plyr = layui.plyr; - var laytpl = layui.laytpl; - var uid = layui.cache.user.uid; +layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){ + var $ = layui.jquery + ,form = layui.form + ,fly = layui.fly + ,colorpicker = layui.colorpicker + ,plyr = layui.plyr; + var laytpl = layui.laytpl; + var uid = layui.cache.user.uid; + var laypage = layui.laypage; //tpl模板给发布时间赋值 $('div.detail-hits').children('span.post-time').each(function(){ @@ -258,6 +259,26 @@ layui.use(['fly', 'face','colorpicker','plyr'], function(){ return false; }); + //执行一个laypage实例 + laypage.render({ + elem: 'pages' //注意,这里的 test1 是 ID,不用加 # 号 + ,count: {$count} //数据总数,从服务端得到 + ,limit: 10 + ,curr : {$page} + + //获取起始页 + ,jump: function(obj, first){ + //首次不执行 + if(!first){ + var page = obj.curr; + var url = "{:url('article/detail',['id'=>$article.id])}" + $.post(url,{"page":page},function(){ + window.location.href = url + '?page=' + page + '#flyReply'; + }); + } + } + }); + //下载 $('#zip-download').click(function (){ var id = "{$article.id}"; diff --git a/view/taoler/index/index/index.html b/view/taoler/index/index/index.html index 2db9991..c55f5c7 100644 --- a/view/taoler/index/index/index.html +++ b/view/taoler/index/index/index.html @@ -9,7 +9,7 @@
-
+
{include file="public/index-slider" /} @@ -40,7 +40,7 @@
-
+
{:hook('signhook', ['id'=>1])}