1.9.4
This commit is contained in:
parent
7eb272c437
commit
5a6a54c887
@ -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%
|
||||
|
||||
|
@ -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'=>'没有查询结果!'];
|
||||
|
@ -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,33 +45,41 @@ 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();
|
||||
$options = array(
|
||||
CURLOPT_URL => $api,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POSTFIELDS => implode("\n", $urls),
|
||||
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
|
||||
);
|
||||
curl_setopt_array($ch, $options);
|
||||
$result = curl_exec($ch);
|
||||
if($result == false) {
|
||||
return json(['code'=>-1,'msg'=>'接口失败']);
|
||||
foreach($urls as $url) {
|
||||
$options = array(
|
||||
CURLOPT_URL => $api,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POSTFIELDS => implode("\n", $url),
|
||||
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
|
||||
);
|
||||
curl_setopt_array($ch, $options);
|
||||
$result = curl_exec($ch);
|
||||
if($result == false) {
|
||||
return json(['code'=>-1,'msg'=>'接口失败']);
|
||||
}
|
||||
}
|
||||
curl_close($ch);
|
||||
|
||||
$res = stripos($result,'error');
|
||||
$data = json_decode($result);
|
||||
if($res !== false) {
|
||||
|
@ -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}}" >
|
||||
@ -64,15 +64,15 @@
|
||||
|
||||
{block name="js"}
|
||||
<script>
|
||||
var forumList = "{:url('Forum/list')}",
|
||||
forumListdel = "{:url('Forum/listdel')}",
|
||||
var forumList = "{:url('Forum/list')}",
|
||||
forumListdel = "{:url('Forum/listdel')}",
|
||||
forumListform = "{:url('Forum/listform')}",
|
||||
forumReplys = "{:url('Forum/replys')}",
|
||||
forumRedel = "{:url('Forum/redel')}",
|
||||
forumReplys = "{:url('Forum/replys')}",
|
||||
forumRedel = "{:url('Forum/redel')}",
|
||||
forumReplysform = "{:url('Forum/replysform')}",
|
||||
forumTags = "{:url('Forum/tags')}",
|
||||
forumTags = "{:url('Forum/tags')}",
|
||||
forumTagsDelete = "{:url('Forum/tagsdelete')}",
|
||||
forumTagsForm = "{:url('Forum/tagsform')}";
|
||||
forumTagsForm = "{:url('Forum/tagsform')}";
|
||||
layui.config({
|
||||
base: '/static/admin/' //静态资源所在路径
|
||||
}).extend({
|
||||
|
@ -57,7 +57,20 @@
|
||||
<input type="text" name="end_id" placeholder="结束ID" autocomplete="off" class="layui-input">
|
||||
</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">
|
||||
<label class="layui-form-label">推送至API</label>
|
||||
<div class="layui-input-block">
|
||||
|
@ -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');
|
||||
|
@ -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}
|
||||
|
4
vendor/composer/installed.php
vendored
4
vendor/composer/installed.php
vendored
@ -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
2
vendor/services.php
vendored
@ -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',
|
||||
|
@ -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}
|
||||
@ -10,7 +10,7 @@
|
||||
<div class="layui-col-md9">
|
||||
<div class="fly-panel" style="margin-bottom: 0;">
|
||||
|
||||
{include file="public/filter" /}
|
||||
{include file="public/filter" /}
|
||||
<ul class="fly-list">
|
||||
{volist name="artList['data']" id="art"}
|
||||
<li>
|
||||
@ -23,22 +23,24 @@
|
||||
</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>
|
||||
<i>{$art.create_time|date='Y-m-d'}</i>
|
||||
<!--
|
||||
<i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
|
||||
{if($art.user.vip > 0)}
|
||||
<i class="layui-badge fly-badge-vip">vip{$art.user.vip}</i>
|
||||
{/if}
|
||||
-->
|
||||
{if($art.user.vip > 0)}
|
||||
<i class="layui-badge fly-badge-vip">vip{$art.user.vip}</i>
|
||||
{/if}
|
||||
-->
|
||||
</a>
|
||||
<span>
|
||||
{$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_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>'}
|
||||
</span>
|
||||
{$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_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>'}
|
||||
</span>
|
||||
<span class="layui-hide-xs" title="浏览"><i class="iconfont" title="浏览"></i> {$art.pv}</span>
|
||||
{if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">{:lang('end')}</span>{/if}
|
||||
<span class="fly-list-nums">
|
||||
@ -102,7 +104,6 @@
|
||||
,jump: function(obj, first){
|
||||
//首次不执行
|
||||
if(!first){
|
||||
|
||||
window.location.href = '{$path}/'+ obj.curr +'.html'; //跳转
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
@ -96,11 +96,11 @@
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
var replyUrl = "{:url('index/reply')}";
|
||||
var signStatusUrl = "{:url('sign/status')}";
|
||||
var signInUrl = "{:url('sign/sign')}";
|
||||
var signRuleUrl = "{:url('sign/getsignrule')}";
|
||||
var signJsonUrl = "{:url('sign/signJson')}";
|
||||
var replyUrl = "{:url('index/reply')}";
|
||||
var signStatusUrl = "{:url('sign/status')}";
|
||||
var signInUrl = "{:url('sign/sign')}";
|
||||
var signRuleUrl = "{:url('sign/getsignrule')}";
|
||||
var signJsonUrl = "{:url('sign/signJson')}";
|
||||
|
||||
$('#friend-link').on('click', function(){
|
||||
layer.open({
|
||||
@ -112,6 +112,5 @@ $('#friend-link').on('click', function(){
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
</script>
|
||||
{/block}
|
Loading…
Reference in New Issue
Block a user