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

View File

@ -77,15 +77,7 @@ class Forum extends AdminController
$res['msg'] = '';
$res['count'] = $count;
foreach($forumList as $k=>$v){
$indexUrl = $this->getIndexUrl();
$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;
}
$url = $this->getRouteUrl($v['aid']);
$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 {
@ -270,8 +262,9 @@ class Forum extends AdminController
if ($count) {
$res = ['code'=>0,'msg'=>'','count'=>$count];
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['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 {
$res = ['code'=>-1,'msg'=>'没有查询结果!'];

View File

@ -2,7 +2,7 @@
/*
* @Author: TaoLer <alipey_tao@qq.com>
* @Date: 2022-04-13 09:54:31
* @LastEditTime: 2022-04-21 11:39:38
* @LastEditTime: 2022-04-24 08:44:53
* @LastEditors: TaoLer
* @Description: 搜索引擎SEO优化设置
* @FilePath: \TaoLer\app\admin\controller\Seo.php
@ -45,26 +45,31 @@ class Seo extends AdminController
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']);
$urls = [];
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 {
$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) {
$urls[] = $this->getRouteUrl($aid);
}
// 百度接口单次最大提交200进行分组
$urls = array_chunk($urls,2000);
$api = config('taoler.baidu.push_api');
$ch = curl_init();
foreach($urls as $url) {
$options = array(
CURLOPT_URL => $api,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => implode("\n", $urls),
CURLOPT_POSTFIELDS => implode("\n", $url),
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
@ -72,6 +77,9 @@ class Seo extends AdminController
if($result == false) {
return json(['code'=>-1,'msg'=>'接口失败']);
}
}
curl_close($ch);
$res = stripos($result,'error');
$data = json_decode($result);
if($res !== false) {

View File

@ -44,7 +44,7 @@
<img style="display: inline-block; width: 50%; height: 100%;" src= {{ d.avatar }}>
</script>
<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 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}}" >

View File

@ -58,6 +58,19 @@
</div>
<div class="layui-form-mid layui-word-aux">帖子ID范围,如果不填,默认全站提交</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">
<label class="layui-form-label">推送至API</label>
<div class="layui-input-block">

View File

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

View File

@ -128,7 +128,7 @@ layui.define(['table', 'form'], function(exports){
{type: 'checkbox'}
,{field: 'id', width: 80, title: 'ID', sort: true}
,{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: 'content', title: '评论', minWidth: 200}
,{field: 'replytime', title: '回复时间', width: 120, sort: true}

View File

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

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?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);
return array (
0 => 'taoser\\addons\\Service',

View File

@ -1,5 +1,5 @@
{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="description"}{$Request.param.ename|getCateDesc}{/block}
{block name="column"}{include file="/public/column" /}{/block}
@ -23,7 +23,9 @@
</h2>
<div class="fly-list-info">
<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>
<i>{$art.create_time|date='Y-m-d'}</i>
<!--
@ -102,7 +104,6 @@
,jump: function(obj, first){
//首次不执行
if(!first){
window.location.href = '{$path}/'+ obj.curr +'.html'; //跳转
}
}

View File

@ -35,7 +35,7 @@
</ul>
<div style="text-align: center">
<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>
@ -112,6 +112,5 @@ $('#friend-link').on('click', function(){
});
return false;
});
</script>
{/block}