This commit is contained in:
tao 2022-08-02 18:47:24 +08:00
parent 7eb272c437
commit 5a6a54c887
11 changed files with 77 additions and 63 deletions

View File

@ -3,8 +3,8 @@
> TaoLer是一个简单迅捷的轻论坛系统适用于个人或组织区域型信息交流发布平台。 > TaoLer是一个简单迅捷的轻论坛系统适用于个人或组织区域型信息交流发布平台。
* 官网https://www.aieok.com * 官网https://www.aieok.com
* 版本TaoLer 1.9.3 * 版本TaoLer 1.9.4
* 日期2022.4.22 * 日期2022.4.24
webman版新架构已适配90% webman版新架构已适配90%

View File

@ -77,15 +77,7 @@ class Forum extends AdminController
$res['msg'] = ''; $res['msg'] = '';
$res['count'] = $count; $res['count'] = $count;
foreach($forumList as $k=>$v){ foreach($forumList as $k=>$v){
$indexUrl = $this->getIndexUrl(); $url = $this->getRouteUrl($v['aid']);
$artUrl = (string) url('detail_id', ['id' => $v['aid']]);
if(empty(config('app.domain_bind'))) {
// 未绑定域名
$url = $indexUrl . str_replace('admin','index',$artUrl);
} else {
// 单独绑定域名
$url = $indexUrl . $artUrl;
}
$res['data'][]= ['id'=>$v['aid'],'poster'=>$v['name'],'avatar'=>$v['user_img'],'title'=>htmlspecialchars($v['title']),'url'=>$url,'content'=>htmlspecialchars($v['content']),'posttime'=>date("Y-m-d",$v['update_time']),'top'=>$v['is_top'],'hot'=>$v['is_hot'],'reply'=>$v['is_reply'],'check'=>$v['status']]; $res['data'][]= ['id'=>$v['aid'],'poster'=>$v['name'],'avatar'=>$v['user_img'],'title'=>htmlspecialchars($v['title']),'url'=>$url,'content'=>htmlspecialchars($v['content']),'posttime'=>date("Y-m-d",$v['update_time']),'top'=>$v['is_top'],'hot'=>$v['is_hot'],'reply'=>$v['is_reply'],'check'=>$v['status']];
} }
} else { } else {
@ -270,8 +262,9 @@ class Forum extends AdminController
if ($count) { if ($count) {
$res = ['code'=>0,'msg'=>'','count'=>$count]; $res = ['code'=>0,'msg'=>'','count'=>$count];
foreach($replys as $k => $v){ foreach($replys as $k => $v){
$url = $this->getRouteUrl($v['cid']);
//$res['data'][] = ['id'=>$v['id'],'replyer'=>$v->user->name,'cardid'=>$v->article->title,'avatar'=>$v->user->user_img,'content'=>$v['content'],'replytime'=>$v['create_time']]; //$res['data'][] = ['id'=>$v['id'],'replyer'=>$v->user->name,'cardid'=>$v->article->title,'avatar'=>$v->user->user_img,'content'=>$v['content'],'replytime'=>$v['create_time']];
$res['data'][] = ['id'=>$v['aid'],'replyer'=>$v['name'],'cardid'=>htmlspecialchars($v['title']),'avatar'=>$v['user_img'],'content'=>htmlspecialchars($v['content']),'replytime'=>date("Y-m-d",$v['create_time']),'check'=>$v['astatus'],'cid'=>$v['cid']]; $res['data'][] = ['id'=>$v['aid'],'replyer'=>$v['name'],'title'=>htmlspecialchars($v['title']),'avatar'=>$v['user_img'],'content'=>htmlspecialchars($v['content']),'replytime'=>date("Y-m-d",$v['create_time']),'check'=>$v['astatus'],'url'=>$url];
} }
} else { } else {
$res = ['code'=>-1,'msg'=>'没有查询结果!']; $res = ['code'=>-1,'msg'=>'没有查询结果!'];

View File

@ -2,7 +2,7 @@
/* /*
* @Author: TaoLer <alipey_tao@qq.com> * @Author: TaoLer <alipey_tao@qq.com>
* @Date: 2022-04-13 09:54:31 * @Date: 2022-04-13 09:54:31
* @LastEditTime: 2022-04-21 11:39:38 * @LastEditTime: 2022-04-24 08:44:53
* @LastEditors: TaoLer * @LastEditors: TaoLer
* @Description: 搜索引擎SEO优化设置 * @Description: 搜索引擎SEO优化设置
* @FilePath: \TaoLer\app\admin\controller\Seo.php * @FilePath: \TaoLer\app\admin\controller\Seo.php
@ -45,33 +45,41 @@ class Seo extends AdminController
public function push() public function push()
{ {
$data = Request::only(['start_id','end_id']); $data = Request::only(['start_id','end_id','time']);
if(empty(config('taoler.baidu.push_api'))) return json(['code'=>-1,'msg'=>'请先配置接口push_api']); if(empty(config('taoler.baidu.push_api'))) return json(['code'=>-1,'msg'=>'请先配置接口push_api']);
$urls = []; $urls = [];
if(empty($data['start_id']) || empty($data['end_id'])) { if(empty($data['start_id']) || empty($data['end_id'])) {
$artAllId = Db::name('article')->where(['delete_time'=>0,'status'=>1])->column('id'); $artAllId = Db::name('article')->where(['delete_time'=>0,'status'=>1])->whereTime('create_time', $data['time'])->column('id');
} else { } else {
$artAllId = Db::name('article')->where(['delete_time'=>0,'status'=>1])->where('id','between',[$data['start_id'],$data['end_id']])->column('id'); $artAllId = Db::name('article')->where(['delete_time'=>0,'status'=>1])->where('id','between',[$data['start_id'],$data['end_id']])->whereTime('create_time', $data['time'])->column('id');
} }
if(empty($artAllId)) return json(['code'=>-1,'msg'=>'没有查询到结果,无需推送']);
// 组装链接数组
foreach($artAllId as $aid) { foreach($artAllId as $aid) {
$urls[] = $this->getRouteUrl($aid); $urls[] = $this->getRouteUrl($aid);
} }
// 百度接口单次最大提交200进行分组
$urls = array_chunk($urls,2000);
$api = config('taoler.baidu.push_api'); $api = config('taoler.baidu.push_api');
$ch = curl_init(); $ch = curl_init();
$options = array( foreach($urls as $url) {
CURLOPT_URL => $api, $options = array(
CURLOPT_POST => true, CURLOPT_URL => $api,
CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true,
CURLOPT_POSTFIELDS => implode("\n", $urls), CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), CURLOPT_POSTFIELDS => implode("\n", $url),
); CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
curl_setopt_array($ch, $options); );
$result = curl_exec($ch); curl_setopt_array($ch, $options);
if($result == false) { $result = curl_exec($ch);
return json(['code'=>-1,'msg'=>'接口失败']); if($result == false) {
return json(['code'=>-1,'msg'=>'接口失败']);
}
} }
curl_close($ch);
$res = stripos($result,'error'); $res = stripos($result,'error');
$data = json_decode($result); $data = json_decode($result);
if($res !== false) { if($res !== false) {

View File

@ -44,7 +44,7 @@
<img style="display: inline-block; width: 50%; height: 100%;" src= {{ d.avatar }}> <img style="display: inline-block; width: 50%; height: 100%;" src= {{ d.avatar }}>
</script> </script>
<script type="text/html" id="title"> <script type="text/html" id="title">
<a href="{$domain}/jie/{{d.cid}}.html" target="_blank">{{d.cardid}}</a> <a href="{{d.url}}.html" target="_blank">{{d.title}}</a>
</script> </script>
<script type="text/html" id="buttonCheck"> <script type="text/html" id="buttonCheck">
{if condition="checkRuleButton('forum/recheck')"}<input type="checkbox" name="check" lay-skin="switch" lay-filter="recheck" lay-text="通过|{{# if(d.check == -1){ }}禁止{{# } }} {{# if(d.check == 0){ }}待审{{# } }}" {{# if(d.check == 1){ }} checked {{# } }} id="{{d.id}}" > {if condition="checkRuleButton('forum/recheck')"}<input type="checkbox" name="check" lay-skin="switch" lay-filter="recheck" lay-text="通过|{{# if(d.check == -1){ }}禁止{{# } }} {{# if(d.check == 0){ }}待审{{# } }}" {{# if(d.check == 1){ }} checked {{# } }} id="{{d.id}}" >
@ -64,15 +64,15 @@
{block name="js"} {block name="js"}
<script> <script>
var forumList = "{:url('Forum/list')}", var forumList = "{:url('Forum/list')}",
forumListdel = "{:url('Forum/listdel')}", forumListdel = "{:url('Forum/listdel')}",
forumListform = "{:url('Forum/listform')}", forumListform = "{:url('Forum/listform')}",
forumReplys = "{:url('Forum/replys')}", forumReplys = "{:url('Forum/replys')}",
forumRedel = "{:url('Forum/redel')}", forumRedel = "{:url('Forum/redel')}",
forumReplysform = "{:url('Forum/replysform')}", forumReplysform = "{:url('Forum/replysform')}",
forumTags = "{:url('Forum/tags')}", forumTags = "{:url('Forum/tags')}",
forumTagsDelete = "{:url('Forum/tagsdelete')}", forumTagsDelete = "{:url('Forum/tagsdelete')}",
forumTagsForm = "{:url('Forum/tagsform')}"; forumTagsForm = "{:url('Forum/tagsform')}";
layui.config({ layui.config({
base: '/static/admin/' //静态资源所在路径 base: '/static/admin/' //静态资源所在路径
}).extend({ }).extend({

View File

@ -58,6 +58,19 @@
</div> </div>
<div class="layui-form-mid layui-word-aux">帖子ID范围,如果不填,默认全站提交</div> <div class="layui-form-mid layui-word-aux">帖子ID范围,如果不填,默认全站提交</div>
</div> </div>
<div class="layui-form-item">
<label class="layui-form-label">选择时间</label>
<div class="layui-input-inline">
<select name="time" lay-verify="required">
<option value="today">今天</option>
<option value="yesterday">昨天</option>
<option value="week">本周</option>
<option value="month">本月</option>
<option value="''">全部</option>
</select>
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">推送至API</label> <label class="layui-form-label">推送至API</label>
<div class="layui-input-block"> <div class="layui-input-block">

View File

@ -2,7 +2,7 @@
/* /*
* @Author: TaoLer <alipey_tao@qq.com> * @Author: TaoLer <alipey_tao@qq.com>
* @Date: 2021-12-06 16:04:50 * @Date: 2021-12-06 16:04:50
* @LastEditTime: 2022-04-22 06:33:20 * @LastEditTime: 2022-04-22 16:25:14
* @LastEditors: TaoLer * @LastEditors: TaoLer
* @Description: 搜索引擎SEO优化设置 * @Description: 搜索引擎SEO优化设置
* @FilePath: \TaoLer\app\index\route\route.php * @FilePath: \TaoLer\app\index\route\route.php
@ -19,7 +19,7 @@ Route::get('captcha/[:config]','\\think\\captcha\\CaptchaController@index');
Route::rule('/', 'index'); // 首页访问路由 Route::rule('/', 'index'); // 首页访问路由
Route::group(function () use($detail_as,$cate_as){ Route::group(function () use($detail_as,$cate_as){
Route::get("$detail_as<id>", 'article/detail'); Route::get("$detail_as<id>", 'article/detail');
Route::get("$cate_as<ename>",'article/cate')->name('cate'); Route::get("$cate_as<ename>$",'article/cate')->name('cate');
Route::get("$cate_as<ename>/<type>$", 'article/cate')->name('cate_type'); Route::get("$cate_as<ename>/<type>$", 'article/cate')->name('cate_type');
Route::rule("$cate_as<ename>/<type>/<page>", 'article/cate')->name('cate_page'); Route::rule("$cate_as<ename>/<type>/<page>", 'article/cate')->name('cate_page');
Route::rule('add','Article/add'); Route::rule('add','Article/add');

View File

@ -128,7 +128,7 @@ layui.define(['table', 'form'], function(exports){
{type: 'checkbox'} {type: 'checkbox'}
,{field: 'id', width: 80, title: 'ID', sort: true} ,{field: 'id', width: 80, title: 'ID', sort: true}
,{field: 'replyer', title: '回帖人', width: 80} ,{field: 'replyer', title: '回帖人', width: 80}
,{field: 'cardid', title: '帖ID',templet: '#title'} ,{field: 'title', title: '帖ID',templet: '#title'}
,{field: 'avatar', title: '头像', width: 80, templet: '#imgTpl'} ,{field: 'avatar', title: '头像', width: 80, templet: '#imgTpl'}
,{field: 'content', title: '评论', minWidth: 200} ,{field: 'content', title: '评论', minWidth: 200}
,{field: 'replytime', title: '回复时间', width: 120, sort: true} ,{field: 'replytime', title: '回复时间', width: 120, sort: true}

View File

@ -5,7 +5,7 @@
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
'reference' => '3f2bac47e4326e46b7e195dcaf909dfef2fb4c17', 'reference' => 'bf441719f29b5b109daebc5b9ededd8da8914773',
'name' => 'taoser/taoler', 'name' => 'taoser/taoler',
'dev' => true, 'dev' => true,
), ),
@ -160,7 +160,7 @@
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
'reference' => '3f2bac47e4326e46b7e195dcaf909dfef2fb4c17', 'reference' => 'bf441719f29b5b109daebc5b9ededd8da8914773',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'taoser/think-addons' => array( 'taoser/think-addons' => array(

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php <?php
// This file is automatically generated at:2022-04-22 08:07:42 // This file is automatically generated at:2022-04-24 09:15:39
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'taoser\\addons\\Service', 0 => 'taoser\\addons\\Service',

View File

@ -1,5 +1,5 @@
{extend name="public/base" /} {extend name="public/base" /}
{block name="title"}{$Request.param.ename|getCateName}-{$sysInfo.webname}{/block} {block name="title"}{$sysInfo.webname}{/block}
{block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block} {block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block}
{block name="description"}{$Request.param.ename|getCateDesc}{/block} {block name="description"}{$Request.param.ename|getCateDesc}{/block}
{block name="column"}{include file="/public/column" /}{/block} {block name="column"}{include file="/public/column" /}{/block}
@ -10,7 +10,7 @@
<div class="layui-col-md9"> <div class="layui-col-md9">
<div class="fly-panel" style="margin-bottom: 0;"> <div class="fly-panel" style="margin-bottom: 0;">
{include file="public/filter" /} {include file="public/filter" /}
<ul class="fly-list"> <ul class="fly-list">
{volist name="artList['data']" id="art"} {volist name="artList['data']" id="art"}
<li> <li>
@ -23,22 +23,24 @@
</h2> </h2>
<div class="fly-list-info"> <div class="fly-list-info">
<a href="{:url('user/home',['id'=>$art.user.id])}" link> <a href="{:url('user/home',['id'=>$art.user.id])}" link>
{if config('taoler.config.area_show') == 1}<span class="layui-badge layui-bg-green " title="来自哪简称">{:getAsing($art.user.area_id) ?: '无'}</span>{/if} {if config('taoler.config.area_show') == 1}
<span class="layui-badge layui-bg-green " title="来自哪简称">{:getAsing($art.user.area_id) ?: '无'}</span>
{/if}
<cite>{$art.user.nickname ?: $art.user.name}</cite> <cite>{$art.user.nickname ?: $art.user.name}</cite>
<i>{$art.create_time|date='Y-m-d'}</i> <i>{$art.create_time|date='Y-m-d'}</i>
<!-- <!--
<i class="iconfont icon-renzheng" title="认证信息XXX"></i> <i class="iconfont icon-renzheng" title="认证信息XXX"></i>
{if($art.user.vip > 0)} {if($art.user.vip > 0)}
<i class="layui-badge fly-badge-vip">vip{$art.user.vip}</i> <i class="layui-badge fly-badge-vip">vip{$art.user.vip}</i>
{/if} {/if}
--> -->
</a> </a>
<span> <span>
{$art.has_img ?= ' <i class="layui-icon layui-icon-picture" style=" color: #5FB878;"></i>'} {$art.has_img ?= ' <i class="layui-icon layui-icon-picture" style=" color: #5FB878;"></i>'}
{$art.has_video ?= ' <i class="layui-icon layui-icon-play" style="color: #FF5722;"></i>'} {$art.has_video ?= ' <i class="layui-icon layui-icon-play" style="color: #FF5722;"></i>'}
{$art.has_audio ?= ' <i class="layui-icon layui-icon-speaker" style="color: #000000;"></i>'} {$art.has_audio ?= ' <i class="layui-icon layui-icon-speaker" style="color: #000000;"></i>'}
{$art.upzip ?= ' <i class="layui-icon layui-icon-file-b" style="color: #009688;" title="附件"></i>'} {$art.upzip ?= ' <i class="layui-icon layui-icon-file-b" style="color: #009688;" title="附件"></i>'}
</span> </span>
<span class="layui-hide-xs" title="浏览"><i class="iconfont" title="浏览">&#xe60b;</i> {$art.pv}</span> <span class="layui-hide-xs" title="浏览"><i class="iconfont" title="浏览">&#xe60b;</i> {$art.pv}</span>
{if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">{:lang('end')}</span>{/if} {if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">{:lang('end')}</span>{/if}
<span class="fly-list-nums"> <span class="fly-list-nums">
@ -102,7 +104,6 @@
,jump: function(obj, first){ ,jump: function(obj, first){
//首次不执行 //首次不执行
if(!first){ if(!first){
window.location.href = '{$path}/'+ obj.curr +'.html'; //跳转 window.location.href = '{$path}/'+ obj.curr +'.html'; //跳转
} }
} }

View File

@ -35,7 +35,7 @@
</ul> </ul>
<div style="text-align: center"> <div style="text-align: center">
<div class="laypage-main"> <div class="laypage-main">
<a href="{:url('article/cate',['ename'=>'all'])}" class="laypage-next">{:lang('more post')}</a> <a href="{:url('cate',['ename'=>'all'])}" class="laypage-next">{:lang('more post')}</a>
</div> </div>
</div> </div>
</div> </div>
@ -96,11 +96,11 @@
{block name="script"} {block name="script"}
<script> <script>
var replyUrl = "{:url('index/reply')}"; var replyUrl = "{:url('index/reply')}";
var signStatusUrl = "{:url('sign/status')}"; var signStatusUrl = "{:url('sign/status')}";
var signInUrl = "{:url('sign/sign')}"; var signInUrl = "{:url('sign/sign')}";
var signRuleUrl = "{:url('sign/getsignrule')}"; var signRuleUrl = "{:url('sign/getsignrule')}";
var signJsonUrl = "{:url('sign/signJson')}"; var signJsonUrl = "{:url('sign/signJson')}";
$('#friend-link').on('click', function(){ $('#friend-link').on('click', function(){
layer.open({ layer.open({
@ -112,6 +112,5 @@ $('#friend-link').on('click', function(){
}); });
return false; return false;
}); });
</script> </script>
{/block} {/block}