comment level

This commit is contained in:
taoser 2023-07-03 12:54:48 +08:00
parent 868797f0bb
commit 74ab2ac512
46 changed files with 3371 additions and 1897 deletions

File diff suppressed because it is too large Load Diff

View File

@ -108,7 +108,7 @@
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
<div class="pear-card2">
<div class="title">待审文章</div>
<div class="count pear-text">14</div>
<div class="count pear-text">0</div>
</div>
</div>
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">

View File

@ -68,6 +68,9 @@ class Arts
*/
public function setKeywords(string $flag,string $title,string $content) :array
{
// 获取seo插件配置
$conf = get_addons_config('seo');
$keywords = [];
// seo插件配置
@ -148,12 +151,11 @@ class Arts
}
$post_data = substr($o,0,-1);
$res = $this->request_post($url, $post_data);
// 写入token
SetArr::name('taoler')->edit([
'baidu'=> [
'access_token' => json_decode($res)->access_token,
]
]);
// 保存token
$conf['baidufenci']['value']['access_token'] = json_decode($res)->access_token;
set_addons_config('seo', $conf);
echo 'api接口数据错误 - ';
echo $dataItem->error_msg;
}

View File

@ -45,6 +45,14 @@ class Comment extends Model
->select()
->toArray();
foreach ($comment as $k => $v)
{
if(empty($v['content'])){
unset($comment[$k]);
}
}
if(count($comment)) {
$data['data'] = getTree($comment);
$data['total'] = count($data['data']);
@ -181,20 +189,26 @@ class Comment extends Model
return '';
}
/**
* 评论下有评论且自身已删除,会显示为 评论已删除,评论下无评论且已删除则不显示
* 评论没有被删除正常显示
* 评论被删除,但它下面有跟评时自身会显示为“评论已删除”,跟评会显示,无跟评且已删除则不显示
* @param $value
* @param $data
* @return string
*/
public function getContentAttr($value,$data)
{
if($data['delete_time'] !== 0) {
if($data['delete_time'] == 0) {
return $value;
} else {
if($this::getByPid($data['id'])) {
return '<span style="text-decoration:line-through;">评论已删除</span>';
} else {
return '';
}
}
return $value;
}
}

View File

@ -35,9 +35,8 @@ class Comment extends BaseController
//删除评论
public function jiedaDelete()
{
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
$id = input('id');
//$arid = intval($id);
$comms = CommentModel::find($id);
$result = $comms->delete();
if($result){
@ -52,7 +51,7 @@ class Comment extends BaseController
public function getDa()
{
//获取原评论
$this->isLogin();
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
$id = input('id');
$comms = CommentModel::find($id);
$res['rows'] = [];
@ -66,7 +65,7 @@ class Comment extends BaseController
//更新评论
public function updateDa()
{
$this->isLogin();
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
$id = input('id');
$content = input('content');
$comms = CommentModel::find($id);
@ -83,6 +82,7 @@ class Comment extends BaseController
//更新评论
public function edit()
{
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
if(Request::isAjax()) {
$param = Request::param();
// halt($param);
@ -101,7 +101,7 @@ class Comment extends BaseController
//评论点赞
public function jiedaZan()
{
$this->isLogin();
if(!session('?user_id')) return json(['code'=>-1,'msg'=>'未登录']);
$data['comment_id'] = input('post.id');
$data['user_id'] = session('user_id');
//查询是否已存在点赞

View File

@ -11,6 +11,7 @@
namespace app\index\controller;
use app\common\controller\BaseController;
use app\common\lib\facade\HttpHelper;
use think\facade\View;
use think\facade\Request;
use think\facade\Db;
@ -32,7 +33,7 @@ class Index extends BaseController
//置顶文章
$artTop = Article::getArtTop(5);
//首页文章列表,显示10个
$artList = Article::getArtList(10);
$artList = Article::getArtList(15);
//热议文章
$artHot = Article::getArtHot(10);

View File

@ -1,6 +1,6 @@
{
"name": "taoser/taoler",
"description": "the new thinkphp taoler bbs system",
"description": "the new thinkphp taolerCMS system",
"type": "project",
"keywords": [
"taoler",

514
composer.lock generated
View File

@ -18,13 +18,7 @@
"type": "zip",
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22",
"reference": "8674e51bb65af933a5ffaf1c308a660387c35c22",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"dasprid/enum": "^1.0.3",
@ -78,13 +72,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-cache/adapter-common/zipball/8788309be72aa7be69b88cdc0687549c74a7d479",
"reference": "8788309be72aa7be69b88cdc0687549c74a7d479",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"cache/tag-interop": "^1.0",
@ -148,13 +136,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-cache/filesystem-adapter/zipball/f1faaae40aaa696ef899cef6f6888aedb90b419b",
"reference": "f1faaae40aaa696ef899cef6f6888aedb90b419b",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"cache/adapter-common": "^1.0",
@ -226,13 +208,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-cache/tag-interop/zipball/b062b1d735357da50edf8387f7a8696f3027d328",
"reference": "b062b1d735357da50edf8387f7a8696f3027d328",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": "^5.5 || ^7.0 || ^8.0",
@ -291,13 +267,7 @@
"type": "zip",
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/8e6b6ea76eabbf19ea2bf5b67b98e1860474012f",
"reference": "8e6b6ea76eabbf19ea2bf5b67b98e1860474012f",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1 <9.0"
@ -347,13 +317,7 @@
"type": "zip",
"url": "https://api.github.com/repos/endroid/qr-code/zipball/a75c913b0e4d6ad275e49a2c1de1cacffc6c2184",
"reference": "a75c913b0e4d6ad275e49a2c1de1cacffc6c2184",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"bacon/bacon-qr-code": "^2.0.5",
@ -425,13 +389,7 @@
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/414c24961042f6616fb43e23fa69a785f9fc053e",
"reference": "414c24961042f6616fb43e23fa69a785f9fc053e",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"ext-json": "*",
@ -516,13 +474,7 @@
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e",
"reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.5"
@ -601,13 +553,7 @@
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b",
"reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.4.0",
@ -712,13 +658,7 @@
"type": "zip",
"url": "https://api.github.com/repos/jae-jae/GHttp/zipball/82585ddd5e2c6651e37ab1d8166efcdbb6b293d4",
"reference": "82585ddd5e2c6651e37ab1d8166efcdbb6b293d4",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"cache/filesystem-adapter": "^1",
@ -759,13 +699,7 @@
"type": "zip",
"url": "https://api.github.com/repos/jae-jae/phpQuery-single/zipball/39a650ade692a6b480c22220dce0c198d6a946fb",
"reference": "39a650ade692a6b480c22220dce0c198d6a946fb",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.3.0"
@ -812,13 +746,7 @@
"type": "zip",
"url": "https://api.github.com/repos/jae-jae/QueryList/zipball/39dc0ca9c668bec7a793e20472ccd7d26ef89ea4",
"reference": "39dc0ca9c668bec7a793e20472ccd7d26ef89ea4",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"ext-dom": "*",
@ -868,23 +796,17 @@
},
{
"name": "laravel/serializable-closure",
"version": "v1.2.2",
"version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/serializable-closure.git",
"reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae"
"reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae",
"reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37",
"reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37",
"shasum": ""
},
"require": {
"php": "^7.3|^8.0"
@ -930,7 +852,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure"
},
"time": "2022-09-08T13:45:54+00:00"
"time": "2023-01-30T18:31:20+00:00"
},
{
"name": "league/flysystem",
@ -944,13 +866,7 @@
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1",
"reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
@ -1044,13 +960,7 @@
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd",
"reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
@ -1106,13 +1016,7 @@
"type": "zip",
"url": "https://api.github.com/repos/liliuwei/thinkphp-social/zipball/2067fc2c2cc3b3d109602bc19c3e5a99c5f4c970",
"reference": "2067fc2c2cc3b3d109602bc19c3e5a99c5f4c970",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.6.0",
@ -1187,13 +1091,7 @@
"type": "zip",
"url": "https://api.github.com/repos/lotofbadcode/phpspirit_databackup/zipball/77c2421f8461392c044cf8c29918f495c22a5612",
"reference": "77c2421f8461392c044cf8c29918f495c22a5612",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.0"
@ -1237,13 +1135,7 @@
"type": "zip",
"url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/cd6d9f267d1a3474bdddf1be1da079f01b942786",
"reference": "cd6d9f267d1a3474bdddf1be1da079f01b942786",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.3",
@ -1298,13 +1190,7 @@
"type": "zip",
"url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/ae0f1b3b03d8b29dff81747063cbfd6276246cc4",
"reference": "ae0f1b3b03d8b29dff81747063cbfd6276246cc4",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"laravel/serializable-closure": "^1.0",
@ -1380,13 +1266,7 @@
"type": "zip",
"url": "https://api.github.com/repos/PHP-DI/PhpDocReader/zipball/66daff34cbd2627740ffec9469ffbac9f8c8185c",
"reference": "66daff34cbd2627740ffec9469ffbac9f8c8185c",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.2.0"
@ -1418,23 +1298,17 @@
},
{
"name": "phpmailer/phpmailer",
"version": "v6.7.1",
"version": "v6.8.0",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55"
"reference": "df16b615e371d81fb79e506277faea67a1be18f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55",
"reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1",
"reference": "df16b615e371d81fb79e506277faea67a1be18f1",
"shasum": ""
},
"require": {
"ext-ctype": "*",
@ -1492,7 +1366,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.7.1"
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0"
},
"funding": [
{
@ -1500,7 +1374,7 @@
"type": "github"
}
],
"time": "2022-12-08T13:30:06+00:00"
"time": "2023-03-06T14:43:22+00:00"
},
{
"name": "psr/cache",
@ -1514,13 +1388,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.3.0"
@ -1569,13 +1437,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.4.0"
@ -1623,13 +1485,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0",
"reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.2.0"
@ -1669,27 +1525,21 @@
},
{
"name": "psr/http-client",
"version": "1.0.1",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-client.git",
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31",
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0 || ^2.0"
},
"type": "library",
"extra": {
@ -1709,7 +1559,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP clients",
@ -1721,9 +1571,9 @@
"psr-18"
],
"support": {
"source": "https://github.com/php-fig/http-client/tree/master"
"source": "https://github.com/php-fig/http-client/tree/1.0.2"
},
"time": "2020-06-29T06:28:15+00:00"
"time": "2023-04-10T20:12:12+00:00"
},
{
"name": "psr/http-message",
@ -1737,13 +1587,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
@ -1796,13 +1640,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.3.0"
@ -1852,13 +1690,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.3.0"
@ -1909,13 +1741,7 @@
"type": "zip",
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
"reference": "120b605dfeb996808c31b6477290a714d356e822",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=5.6"
@ -1959,13 +1785,7 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1"
@ -2048,13 +1868,7 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97",
"reference": "869329b1e9894268a8a61dabb69153029b7a8c97",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1"
@ -2130,13 +1944,7 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1"
@ -2219,13 +2027,7 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/1069c7a3fca74578022fab6f81643248d02f8e63",
"reference": "1069c7a3fca74578022fab6f81643248d02f8e63",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.3",
@ -2314,13 +2116,7 @@
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/be74908a6942fdd331554b3cec27ff41b45ccad4",
"reference": "be74908a6942fdd331554b3cec27ff41b45ccad4",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.2.5",
@ -2383,23 +2179,17 @@
},
{
"name": "taoser/think-addons",
"version": "v1.0.6",
"version": "v1.0.9",
"source": {
"type": "git",
"url": "https://github.com/taoser/think-addons.git",
"reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541"
"reference": "00112adf200b897deecbd1bbabc33ad22377b008"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/taoser/think-addons/zipball/e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
"reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/taoser/think-addons/zipball/00112adf200b897deecbd1bbabc33ad22377b008",
"reference": "00112adf200b897deecbd1bbabc33ad22377b008",
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -2440,9 +2230,9 @@
"description": "The ThinkPHP6 Addons Package",
"support": {
"issues": "https://github.com/taoser/think-addons/issues",
"source": "https://github.com/taoser/think-addons/tree/v1.0.6"
"source": "https://github.com/taoser/think-addons/tree/v1.0.9"
},
"time": "2022-10-06T13:11:38+00:00"
"time": "2023-06-10T05:08:45+00:00"
},
{
"name": "taoser/think-auth",
@ -2456,13 +2246,7 @@
"type": "zip",
"url": "https://api.github.com/repos/taoser/think-auth/zipball/d3aa853b7d2a34624bcc566150105f2815e68ad0",
"reference": "d3aa853b7d2a34624bcc566150105f2815e68ad0",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -2515,13 +2299,7 @@
"type": "zip",
"url": "https://api.github.com/repos/taoser/think-setarr/zipball/6651c31ef42417a6294ef08e6fb970917b7e7f86",
"reference": "6651c31ef42417a6294ef08e6fb970917b7e7f86",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.2.0"
@ -2561,13 +2339,7 @@
"type": "zip",
"url": "https://api.github.com/repos/tighten/collect/zipball/07eed6cf7441c7a69c379fdcb118eec1a1fdd0e6",
"reference": "07eed6cf7441c7a69c379fdcb118eec1a1fdd0e6",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": "^7.3|^8.0",
@ -2621,13 +2393,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/framework/zipball/7c324e7011246f0064b055b62ab9c3921cf0a041",
"reference": "7c324e7011246f0064b055b62ab9c3921cf0a041",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"ext-json": "*",
@ -2692,13 +2458,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-captcha/zipball/b1ef360670578214edeebcf824aaf6ab7ee0528b",
"reference": "b1ef360670578214edeebcf824aaf6ab7ee0528b",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"topthink/framework": "^6.0|^8.0"
@ -2751,13 +2511,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-helper/zipball/769acbe50a4274327162f9c68ec2e89a38eb2aff",
"reference": "769acbe50a4274327162f9c68ec2e89a38eb2aff",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0"
@ -2803,13 +2557,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-installer/zipball/38ba647706e35d6704b5d370c06f8a160b635f88",
"reference": "38ba647706e35d6704b5d370c06f8a160b635f88",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0||^2.0"
@ -2844,23 +2592,17 @@
},
{
"name": "topthink/think-migration",
"version": "v3.0.4",
"version": "v3.0.5",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-migration.git",
"reference": "c5880669b277762d5ff935e551bc0d5c71de6811"
"reference": "7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-migration/zipball/c5880669b277762d5ff935e551bc0d5c71de6811",
"reference": "c5880669b277762d5ff935e551bc0d5c71de6811",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/top-think/think-migration/zipball/7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca",
"reference": "7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca",
"shasum": ""
},
"require": {
"topthink/framework": "^6.0",
@ -2898,9 +2640,9 @@
],
"support": {
"issues": "https://github.com/top-think/think-migration/issues",
"source": "https://github.com/top-think/think-migration/tree/v3.0.4"
"source": "https://github.com/top-think/think-migration/tree/v3.0.5"
},
"time": "2022-10-26T07:57:54+00:00"
"time": "2023-02-26T13:16:22+00:00"
},
{
"name": "topthink/think-multi-app",
@ -2914,13 +2656,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-multi-app/zipball/4055a6187296ac16c0bc7bbab4ed5d92f82f791c",
"reference": "4055a6187296ac16c0bc7bbab4ed5d92f82f791c",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -2968,13 +2704,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-orm/zipball/10528ebf4a5106b19c3bac9c6deae7a67ff49de6",
"reference": "10528ebf4a5106b19c3bac9c6deae7a67ff49de6",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"ext-json": "*",
@ -3029,13 +2759,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-template/zipball/6d25642ae0e306166742fd7073dc7a159e18073c",
"reference": "6d25642ae0e306166742fd7073dc7a159e18073c",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -3076,13 +2800,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-view/zipball/edce0ae2c9551ab65f9e94a222604b0dead3576d",
"reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -3123,13 +2841,7 @@
"type": "zip",
"url": "https://api.github.com/repos/wamkj/thinkphp6.0-databackup/zipball/28a0e406d827132942723a3c9f69bb20c98e652f",
"reference": "28a0e406d827132942723a3c9f69bb20c98e652f",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -3174,13 +2886,7 @@
"type": "zip",
"url": "https://api.github.com/repos/walkor/channel/zipball/fbfb81c7ebc5858c4053f226cbb5d15fe670ff6e",
"reference": "fbfb81c7ebc5858c4053f226cbb5d15fe670ff6e",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"workerman/workerman": ">=4.0.12"
@ -3204,23 +2910,17 @@
},
{
"name": "workerman/phpsocket.io",
"version": "v1.1.16",
"version": "v1.1.17",
"source": {
"type": "git",
"url": "https://github.com/walkor/phpsocket.io.git",
"reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304"
"reference": "fb51151fd86414548e7cd9321c066c7b60983f8c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/f4dc14e69e9d0d8ce69c6180f93b76b7743f2304",
"reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/fb51151fd86414548e7cd9321c066c7b60983f8c",
"reference": "fb51151fd86414548e7cd9321c066c7b60983f8c",
"shasum": ""
},
"require": {
"workerman/channel": ">=1.0.0",
@ -3242,7 +2942,7 @@
],
"support": {
"issues": "https://github.com/walkor/phpsocket.io/issues",
"source": "https://github.com/walkor/phpsocket.io/tree/v1.1.16"
"source": "https://github.com/walkor/phpsocket.io/tree/v1.1.17"
},
"funding": [
{
@ -3254,7 +2954,7 @@
"type": "patreon"
}
],
"time": "2022-11-25T13:00:18+00:00"
"time": "2023-06-08T06:07:20+00:00"
},
{
"name": "workerman/workerman",
@ -3268,13 +2968,7 @@
"type": "zip",
"url": "https://api.github.com/repos/walkor/workerman/zipball/e967b79f95b9251a72acb971be05623ec1a51e83",
"reference": "e967b79f95b9251a72acb971be05623ec1a51e83",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.0"
@ -3337,13 +3031,7 @@
"type": "zip",
"url": "https://api.github.com/repos/yansongda/pay/zipball/7ff004f05f9d6e288ff9b4deef585d30395f37f2",
"reference": "7ff004f05f9d6e288ff9b4deef585d30395f37f2",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"ext-bcmath": "*",
@ -3420,13 +3108,7 @@
"type": "zip",
"url": "https://api.github.com/repos/yansongda/supports/zipball/c3f736efe169696cef94730976e604a61c345b5c",
"reference": "c3f736efe169696cef94730976e604a61c345b5c",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.4"
@ -3487,13 +3169,7 @@
"type": "zip",
"url": "https://api.github.com/repos/yzh52521/easyhttp/zipball/52cb9aba60a725bef77acd9c4c48ecc78931af9e",
"reference": "52cb9aba60a725bef77acd9c4c48ecc78931af9e",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"guzzlehttp/guzzle": "^6.0|^7.0",
@ -3547,13 +3223,7 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-trace/zipball/136cd5d97e8bdb780e4b5c1637c588ed7ca3e142",
"reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"shasum": ""
},
"require": {
"php": ">=7.1.0",

View File

@ -16,7 +16,7 @@ return [
// 应用名,此项不可更改
'appname' => 'TaoLer',
// 版本配置
'version' => '2.3.7',
'version' => '2.3.8',
// 加盐
'salt' => 'taoler',
// 数据库备份目录

View File

@ -525,7 +525,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
*/
.layui-form-pane{position:relative; width:100%;}
.que-comments{position:absolute;right:20px;bottom:5px;}
.que-comments{position:absolute; right:15px; bottom:15px;}
.wenda-user{height:200px; margin: 0,auto; text-align: center; pardding-top:20px;}
.wenda-user .user-img{posation:relative; width:100%;}
@ -538,7 +538,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
.detail-zan span{padding-right:5px; color:#999; cursor:pointer;}
.detail-zan span:hover{color:#666;}
.detail-zan span .icon-zan{font-size: 22px;}
.detail-zan span img{height: 25px; border-radius: 100%;}
.detail-zan span img{height: 25px; width:25px; border-radius: 100%; object-fit: cover;}
/* 详情页的底部操作条 */
@ -600,6 +600,10 @@ body .fly-user-main{position: relative; min-height: 600px;}
.fly-user-main .fly-none{min-height: 0;}
.fly-panel-user[pad20]{padding-top: 5px;}
@media screen and (min-width: 768px) {
.fly-panel-user{height: calc(100vh - 280px)}
}
.fly-form-app{margin-top:30px;}
.fly-form-app .iconfont{font-size:26px; padding: 0 5px;}
.fly-form-app .icon-qq{color:#7CA9C9}

View File

@ -234,27 +234,29 @@ layui.define('fly', function(exports){
});
});
}
}
,del: function(li){ //删除评论
layer.confirm('确认删除该回答么?', function(index){
layer.close(index);
fly.json(commentJiedaDelete, {
id: li.data('id')
}, function(res){
if(res.status === 0){
var count = dom.jiedaCount.text()|0;
dom.jiedaCount.html(--count);
li.remove();
//如果删除了最佳答案
if(li.hasClass('jieda-daan')){
$('.jie-status').removeClass('jie-status-ok').text('求解中');
,del: function(span){ //删除评论
if(taonystatus == 0) {
layer.confirm('确认删除该回答么?', function(index){
layer.close(index);
fly.json(commentJiedaDelete, {
id: li.data('id')
}, function(res){
if(res.status === 0){
var count = dom.jiedaCount.text()|0;
dom.jiedaCount.html(--count);
li.remove();
//如果删除了最佳答案
if(li.hasClass('jieda-daan')){
$('.jie-status').removeClass('jie-status-ok').text('求解中');
}
} else {
layer.msg(res.msg);
}
} else {
layer.msg(res.msg);
}
});
});
});
}
}
};

File diff suppressed because it is too large Load Diff

View File

@ -42,35 +42,37 @@ namespace Composer\Autoload;
*/
class ClassLoader
{
/** @var ?string */
/** @var \Closure(string):void */
private static $includeFile;
/** @var string|null */
private $vendorDir;
// PSR-4
/**
* @var array[]
* @psalm-var array<string, array<string, int>>
* @var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, array<int, string>>
* @var array<string, list<string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, string>
* @var list<string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* @var array[]
* @psalm-var array<string, array<string, string[]>>
* List of PSR-0 prefixes
*
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/
private $prefixesPsr0 = array();
/**
* @var array[]
* @psalm-var array<string, string>
* @var list<string>
*/
private $fallbackDirsPsr0 = array();
@ -78,8 +80,7 @@ class ClassLoader
private $useIncludePath = false;
/**
* @var string[]
* @psalm-var array<string, string>
* @var array<string, string>
*/
private $classMap = array();
@ -87,29 +88,29 @@ class ClassLoader
private $classMapAuthoritative = false;
/**
* @var bool[]
* @psalm-var array<string, bool>
* @var array<string, bool>
*/
private $missingClasses = array();
/** @var ?string */
/** @var string|null */
private $apcuPrefix;
/**
* @var self[]
* @var array<string, self>
*/
private static $registeredLoaders = array();
/**
* @param ?string $vendorDir
* @param string|null $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
* @return string[]
* @return array<string, list<string>>
*/
public function getPrefixes()
{
@ -121,8 +122,7 @@ class ClassLoader
}
/**
* @return array[]
* @psalm-return array<string, array<int, string>>
* @return array<string, list<string>>
*/
public function getPrefixesPsr4()
{
@ -130,8 +130,7 @@ class ClassLoader
}
/**
* @return array[]
* @psalm-return array<string, string>
* @return list<string>
*/
public function getFallbackDirs()
{
@ -139,8 +138,7 @@ class ClassLoader
}
/**
* @return array[]
* @psalm-return array<string, string>
* @return list<string>
*/
public function getFallbackDirsPsr4()
{
@ -148,8 +146,7 @@ class ClassLoader
}
/**
* @return string[] Array of classname => path
* @psalm-return array<string, string>
* @return array<string, string> Array of classname => path
*/
public function getClassMap()
{
@ -157,8 +154,7 @@ class ClassLoader
}
/**
* @param string[] $classMap Class to filename map
* @psalm-param array<string, string> $classMap
* @param array<string, string> $classMap Class to filename map
*
* @return void
*/
@ -175,24 +171,25 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
$paths
);
}
@ -201,19 +198,19 @@ class ClassLoader
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
$this->prefixesPsr0[$first][$prefix] = $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
$paths
);
}
}
@ -222,9 +219,9 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
@ -232,17 +229,18 @@ class ClassLoader
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
$paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
@ -252,18 +250,18 @@ class ClassLoader
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
$this->prefixDirsPsr4[$prefix] = $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
$paths
);
}
}
@ -272,8 +270,8 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 base directories
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 base directories
*
* @return void
*/
@ -290,8 +288,8 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
@ -425,7 +423,8 @@ class ClassLoader
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
@ -476,9 +475,9 @@ class ClassLoader
}
/**
* Returns the currently registered loaders indexed by their corresponding vendor directories.
* Returns the currently registered loaders keyed by their corresponding vendor directories.
*
* @return self[]
* @return array<string, self>
*/
public static function getRegisteredLoaders()
{
@ -555,18 +554,26 @@ class ClassLoader
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
* @private
*/
function includeFile($file)
{
include $file;
/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
}

View File

@ -98,7 +98,7 @@ class InstalledVersions
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}
@ -119,7 +119,7 @@ class InstalledVersions
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
@ -328,7 +328,9 @@ class InstalledVersions
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
@ -340,12 +342,17 @@ class InstalledVersions
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = require __DIR__ . '/installed.php';
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else {
self::$installed = array();
}
}
$installed[] = self::$installed;
if (self::$installed !== array()) {
$installed[] = self::$installed;
}
return $installed;
}

View File

@ -33,25 +33,18 @@ class ComposerAutoloaderInit1b32198725235c8d6500c87262ef30c2
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire1b32198725235c8d6500c87262ef30c2($fileIdentifier, $file);
$filesToLoad = \Composer\Autoload\ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}, null, null);
foreach ($filesToLoad as $fileIdentifier => $file) {
$requireFile($fileIdentifier, $file);
}
return $loader;
}
}
/**
* @param string $fileIdentifier
* @param string $file
* @return void
*/
function composerRequire1b32198725235c8d6500c87262ef30c2($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}

View File

@ -850,17 +850,17 @@
},
{
"name": "laravel/serializable-closure",
"version": "v1.2.2",
"version_normalized": "1.2.2.0",
"version": "v1.3.0",
"version_normalized": "1.3.0.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/serializable-closure.git",
"reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae"
"reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae",
"reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37",
"reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37",
"shasum": ""
},
"require": {
@ -872,7 +872,7 @@
"phpstan/phpstan": "^1.8.2",
"symfony/var-dumper": "^5.4.11"
},
"time": "2022-09-08T13:45:54+00:00",
"time": "2023-01-30T18:31:20+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -1394,24 +1394,18 @@
},
{
"name": "phpmailer/phpmailer",
"version": "v6.7.1",
"version_normalized": "6.7.1.0",
"version": "v6.8.0",
"version_normalized": "6.8.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55"
"reference": "df16b615e371d81fb79e506277faea67a1be18f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55",
"reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1",
"reference": "df16b615e371d81fb79e506277faea67a1be18f1",
"shasum": ""
},
"require": {
"ext-ctype": "*",
@ -1439,7 +1433,7 @@
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
},
"time": "2022-12-08T13:30:06+00:00",
"time": "2023-03-06T14:43:22+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -1471,7 +1465,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.7.1"
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0"
},
"funding": [
{
@ -1648,24 +1642,24 @@
},
{
"name": "psr/http-client",
"version": "1.0.1",
"version_normalized": "1.0.1.0",
"version": "1.0.2",
"version_normalized": "1.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-client.git",
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
"url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31",
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0 || ^2.0"
},
"time": "2020-06-29T06:28:15+00:00",
"time": "2023-04-10T20:12:12+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -1685,7 +1679,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP clients",
@ -1697,7 +1691,7 @@
"psr-18"
],
"support": {
"source": "https://github.com/php-fig/http-client/tree/master"
"source": "https://github.com/php-fig/http-client/tree/1.0.2"
},
"install-path": "../psr/http-client"
},
@ -2377,24 +2371,18 @@
},
{
"name": "taoser/think-addons",
"version": "v1.0.6",
"version_normalized": "1.0.6.0",
"version": "v1.0.9",
"version_normalized": "1.0.9.0",
"source": {
"type": "git",
"url": "https://github.com/taoser/think-addons.git",
"reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541"
"reference": "00112adf200b897deecbd1bbabc33ad22377b008"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/taoser/think-addons/zipball/e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
"reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/taoser/think-addons/zipball/00112adf200b897deecbd1bbabc33ad22377b008",
"reference": "00112adf200b897deecbd1bbabc33ad22377b008",
"shasum": ""
},
"require": {
"php": ">=7.1.0",
@ -2403,7 +2391,7 @@
"topthink/think-helper": "^3.0.0",
"topthink/think-view": "^1.0"
},
"time": "2022-10-06T13:11:38+00:00",
"time": "2023-06-10T05:08:45+00:00",
"type": "library",
"extra": {
"think": {
@ -2437,7 +2425,7 @@
"description": "The ThinkPHP6 Addons Package",
"support": {
"issues": "https://github.com/taoser/think-addons/issues",
"source": "https://github.com/taoser/think-addons/tree/v1.0.6"
"source": "https://github.com/taoser/think-addons/tree/v1.0.9"
},
"install-path": "../taoser/think-addons"
},
@ -2856,24 +2844,18 @@
},
{
"name": "topthink/think-migration",
"version": "v3.0.4",
"version_normalized": "3.0.4.0",
"version": "v3.0.5",
"version_normalized": "3.0.5.0",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-migration.git",
"reference": "c5880669b277762d5ff935e551bc0d5c71de6811"
"reference": "7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-migration/zipball/c5880669b277762d5ff935e551bc0d5c71de6811",
"reference": "c5880669b277762d5ff935e551bc0d5c71de6811",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/top-think/think-migration/zipball/7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca",
"reference": "7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca",
"shasum": ""
},
"require": {
"topthink/framework": "^6.0",
@ -2885,7 +2867,7 @@
"suggest": {
"fzaninotto/faker": "Required to use the factory builder (^1.8)."
},
"time": "2022-10-26T07:57:54+00:00",
"time": "2023-02-26T13:16:22+00:00",
"type": "library",
"extra": {
"think": {
@ -2913,7 +2895,7 @@
],
"support": {
"issues": "https://github.com/top-think/think-migration/issues",
"source": "https://github.com/top-think/think-migration/tree/v3.0.4"
"source": "https://github.com/top-think/think-migration/tree/v3.0.5"
},
"install-path": "../topthink/think-migration"
},
@ -3293,30 +3275,24 @@
},
{
"name": "workerman/phpsocket.io",
"version": "v1.1.16",
"version_normalized": "1.1.16.0",
"version": "v1.1.17",
"version_normalized": "1.1.17.0",
"source": {
"type": "git",
"url": "https://github.com/walkor/phpsocket.io.git",
"reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304"
"reference": "fb51151fd86414548e7cd9321c066c7b60983f8c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/f4dc14e69e9d0d8ce69c6180f93b76b7743f2304",
"reference": "f4dc14e69e9d0d8ce69c6180f93b76b7743f2304",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/walkor/phpsocket.io/zipball/fb51151fd86414548e7cd9321c066c7b60983f8c",
"reference": "fb51151fd86414548e7cd9321c066c7b60983f8c",
"shasum": ""
},
"require": {
"workerman/channel": ">=1.0.0",
"workerman/workerman": ">=4.0.0"
},
"time": "2022-11-25T13:00:18+00:00",
"time": "2023-06-08T06:07:20+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -3334,7 +3310,7 @@
],
"support": {
"issues": "https://github.com/walkor/phpsocket.io/issues",
"source": "https://github.com/walkor/phpsocket.io/tree/v1.1.16"
"source": "https://github.com/walkor/phpsocket.io/tree/v1.1.17"
},
"funding": [
{

View File

@ -3,7 +3,7 @@
'name' => 'taoser/taoler',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'c74d8b8052c4f2da4466d3ed181a1636e5c52c39',
'reference' => 'f6d525db0665b6aa400834582aba220223d8244b',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -119,9 +119,9 @@
'dev_requirement' => false,
),
'laravel/serializable-closure' => array(
'pretty_version' => 'v1.2.2',
'version' => '1.2.2.0',
'reference' => '47afb7fae28ed29057fdca37e16a84f90cc62fae',
'pretty_version' => 'v1.3.0',
'version' => '1.3.0.0',
'reference' => 'f23fe9d4e95255dacee1bf3525e0810d1a1b0f37',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/serializable-closure',
'aliases' => array(),
@ -191,9 +191,9 @@
'dev_requirement' => false,
),
'phpmailer/phpmailer' => array(
'pretty_version' => 'v6.7.1',
'version' => '6.7.1.0',
'reference' => '49cd7ea3d2563f028d7811f06864a53b1f15ff55',
'pretty_version' => 'v6.8.0',
'version' => '6.8.0.0',
'reference' => 'df16b615e371d81fb79e506277faea67a1be18f1',
'type' => 'library',
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
'aliases' => array(),
@ -239,9 +239,9 @@
'dev_requirement' => false,
),
'psr/http-client' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
'pretty_version' => '1.0.2',
'version' => '1.0.2.0',
'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-client',
'aliases' => array(),
@ -349,16 +349,16 @@
'taoser/taoler' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'c74d8b8052c4f2da4466d3ed181a1636e5c52c39',
'reference' => 'f6d525db0665b6aa400834582aba220223d8244b',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'taoser/think-addons' => array(
'pretty_version' => 'v1.0.6',
'version' => '1.0.6.0',
'reference' => 'e6e35bfd8b93dc469ebb5c5530ba350131bd7541',
'pretty_version' => 'v1.0.9',
'version' => '1.0.9.0',
'reference' => '00112adf200b897deecbd1bbabc33ad22377b008',
'type' => 'library',
'install_path' => __DIR__ . '/../taoser/think-addons',
'aliases' => array(),
@ -428,9 +428,9 @@
'dev_requirement' => false,
),
'topthink/think-migration' => array(
'pretty_version' => 'v3.0.4',
'version' => '3.0.4.0',
'reference' => 'c5880669b277762d5ff935e551bc0d5c71de6811',
'pretty_version' => 'v3.0.5',
'version' => '3.0.5.0',
'reference' => '7a5ec3952ea97bf1a5d8872e1bd10f2abf6294ca',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-migration',
'aliases' => array(),
@ -500,9 +500,9 @@
'dev_requirement' => false,
),
'workerman/phpsocket.io' => array(
'pretty_version' => 'v1.1.16',
'version' => '1.1.16.0',
'reference' => 'f4dc14e69e9d0d8ce69c6180f93b76b7743f2304',
'pretty_version' => 'v1.1.17',
'version' => '1.1.17.0',
'reference' => 'fb51151fd86414548e7cd9321c066c7b60983f8c',
'type' => 'library',
'install_path' => __DIR__ . '/../workerman/phpsocket.io',
'aliases' => array(),

View File

@ -53,6 +53,7 @@ echo $closure(); // james;
1. Creating **anonymous classes** within closures is not supported.
2. Using attributes within closures is not supported.
3. Serializing closures on REPL environments such as Laravel Tinker is not supported.
## Contributing

View File

@ -62,6 +62,17 @@ class SerializableClosure
return $this->serializable->getClosure();
}
/**
* Create a new unsigned serializable closure instance.
*
* @param Closure $closure
* @return \Laravel\SerializableClosure\UnsignedSerializableClosure
*/
public static function unsigned(Closure $closure)
{
return new UnsignedSerializableClosure($closure);
}
/**
* Sets the serializable closure secret key.
*

View File

@ -10,6 +10,7 @@ use Laravel\SerializableClosure\Support\ClosureScope;
use Laravel\SerializableClosure\Support\ClosureStream;
use Laravel\SerializableClosure\Support\ReflectionClosure;
use Laravel\SerializableClosure\Support\SelfReference;
use Laravel\SerializableClosure\UnsignedSerializableClosure;
use ReflectionObject;
use UnitEnum;
@ -379,7 +380,7 @@ class Native implements Serializable
$item = $property->getValue($data);
if ($item instanceof SerializableClosure || ($item instanceof SelfReference && $item->hash === $this->code['self'])) {
if ($item instanceof SerializableClosure || $item instanceof UnsignedSerializableClosure || ($item instanceof SelfReference && $item->hash === $this->code['self'])) {
$this->code['objects'][] = [
'instance' => $data,
'property' => $property,
@ -452,7 +453,7 @@ class Native implements Serializable
}
unset($value);
} elseif (is_object($data) && ! $data instanceof SerializableClosure) {
} elseif (is_object($data) && ! $data instanceof SerializableClosure && ! $data instanceof UnsignedSerializableClosure) {
if (isset($this->scope[$data])) {
$data = $this->scope[$data];

View File

@ -0,0 +1,82 @@
<?php
namespace Laravel\SerializableClosure;
use Closure;
use Laravel\SerializableClosure\Exceptions\PhpVersionNotSupportedException;
class UnsignedSerializableClosure
{
/**
* The closure's serializable.
*
* @var \Laravel\SerializableClosure\Contracts\Serializable
*/
protected $serializable;
/**
* Creates a new serializable closure instance.
*
* @param \Closure $closure
* @return void
*/
public function __construct(Closure $closure)
{
if (\PHP_VERSION_ID < 70400) {
throw new PhpVersionNotSupportedException();
}
$this->serializable = new Serializers\Native($closure);
}
/**
* Resolve the closure with the given arguments.
*
* @return mixed
*/
public function __invoke()
{
if (\PHP_VERSION_ID < 70400) {
throw new PhpVersionNotSupportedException();
}
return call_user_func_array($this->serializable, func_get_args());
}
/**
* Gets the closure.
*
* @return \Closure
*/
public function getClosure()
{
if (\PHP_VERSION_ID < 70400) {
throw new PhpVersionNotSupportedException();
}
return $this->serializable->getClosure();
}
/**
* Get the serializable representation of the closure.
*
* @return array
*/
public function __serialize()
{
return [
'serializable' => $this->serializable,
];
}
/**
* Restore the closure after serialization.
*
* @param array $data
* @return void
*/
public function __unserialize($data)
{
$this->serializable = $data['serializable'];
}
}

View File

@ -47,7 +47,7 @@ This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lg
PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file:
```json
"phpmailer/phpmailer": "^6.7.1"
"phpmailer/phpmailer": "^6.8.0"
```
or run

View File

@ -1 +1 @@
6.7.1
6.8.0

View File

@ -4,24 +4,32 @@
* Hindi PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Yash Karanke <mr.karanke@gmail.com>
* Rewrite and extension of the work by Jayanti Suthar <suthar.jayanti93@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। ';
$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.';
$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। ';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। ';
$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। ';
$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। ';
$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। ';
$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: ';
$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। ';
$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। ';
$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। ';
$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।';
$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। ';
$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान';
$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: ';
$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: ';
$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। ';
$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। ';
$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। ';
$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। ';
$PHPMAILER_LANG['smtp_detail'] = 'विवरण: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। ';
$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। ';
$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: ';

View File

@ -0,0 +1,247 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2023 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
namespace PHPMailer\PHPMailer;
/**
* Configure PHPMailer with DSN string.
*
* @see https://en.wikipedia.org/wiki/Data_source_name
*
* @author Oleg Voronkovich <oleg-voronkovich@yandex.ru>
*/
class DSNConfigurator
{
/**
* Create new PHPMailer instance configured by DSN.
*
* @param string $dsn DSN
* @param bool $exceptions Should we throw external exceptions?
*
* @return PHPMailer
*/
public static function mailer($dsn, $exceptions = null)
{
static $configurator = null;
if (null === $configurator) {
$configurator = new DSNConfigurator();
}
return $configurator->configure(new PHPMailer($exceptions), $dsn);
}
/**
* Configure PHPMailer instance with DSN string.
*
* @param PHPMailer $mailer PHPMailer instance
* @param string $dsn DSN
*
* @return PHPMailer
*/
public function configure(PHPMailer $mailer, $dsn)
{
$config = $this->parseDSN($dsn);
$this->applyConfig($mailer, $config);
return $mailer;
}
/**
* Parse DSN string.
*
* @param string $dsn DSN
*
* @throws Exception If DSN is malformed
*
* @return array Configuration
*/
private function parseDSN($dsn)
{
$config = $this->parseUrl($dsn);
if (false === $config || !isset($config['scheme']) || !isset($config['host'])) {
throw new Exception(
sprintf('Malformed DSN: "%s".', $dsn)
);
}
if (isset($config['query'])) {
parse_str($config['query'], $config['query']);
}
return $config;
}
/**
* Apply configuration to mailer.
*
* @param PHPMailer $mailer PHPMailer instance
* @param array $config Configuration
*
* @throws Exception If scheme is invalid
*/
private function applyConfig(PHPMailer $mailer, $config)
{
switch ($config['scheme']) {
case 'mail':
$mailer->isMail();
break;
case 'sendmail':
$mailer->isSendmail();
break;
case 'qmail':
$mailer->isQmail();
break;
case 'smtp':
case 'smtps':
$mailer->isSMTP();
$this->configureSMTP($mailer, $config);
break;
default:
throw new Exception(
sprintf(
'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".',
$config['scheme']
)
);
}
if (isset($config['query'])) {
$this->configureOptions($mailer, $config['query']);
}
}
/**
* Configure SMTP.
*
* @param PHPMailer $mailer PHPMailer instance
* @param array $config Configuration
*/
private function configureSMTP($mailer, $config)
{
$isSMTPS = 'smtps' === $config['scheme'];
if ($isSMTPS) {
$mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
}
$mailer->Host = $config['host'];
if (isset($config['port'])) {
$mailer->Port = $config['port'];
} elseif ($isSMTPS) {
$mailer->Port = SMTP::DEFAULT_SECURE_PORT;
}
$mailer->SMTPAuth = isset($config['user']) || isset($config['pass']);
if (isset($config['user'])) {
$mailer->Username = $config['user'];
}
if (isset($config['pass'])) {
$mailer->Password = $config['pass'];
}
}
/**
* Configure options.
*
* @param PHPMailer $mailer PHPMailer instance
* @param array $options Options
*
* @throws Exception If option is unknown
*/
private function configureOptions(PHPMailer $mailer, $options)
{
$allowedOptions = get_object_vars($mailer);
unset($allowedOptions['Mailer']);
unset($allowedOptions['SMTPAuth']);
unset($allowedOptions['Username']);
unset($allowedOptions['Password']);
unset($allowedOptions['Hostname']);
unset($allowedOptions['Port']);
unset($allowedOptions['ErrorInfo']);
$allowedOptions = \array_keys($allowedOptions);
foreach ($options as $key => $value) {
if (!in_array($key, $allowedOptions)) {
throw new Exception(
sprintf(
'Unknown option: "%s". Allowed values: "%s"',
$key,
implode('", "', $allowedOptions)
)
);
}
switch ($key) {
case 'AllowEmpty':
case 'SMTPAutoTLS':
case 'SMTPKeepAlive':
case 'SingleTo':
case 'UseSendmailOptions':
case 'do_verp':
case 'DKIM_copyHeaderFields':
$mailer->$key = (bool) $value;
break;
case 'Priority':
case 'SMTPDebug':
case 'WordWrap':
$mailer->$key = (int) $value;
break;
default:
$mailer->$key = $value;
break;
}
}
}
/**
* Parse a URL.
* Wrapper for the built-in parse_url function to work around a bug in PHP 5.5.
*
* @param string $url URL
*
* @return array|false
*/
protected function parseUrl($url)
{
if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) {
return parse_url($url);
}
$chunks = explode('?', $url);
if (is_array($chunks)) {
$result = parse_url($chunks[0]);
if (is_array($result)) {
$result['query'] = $chunks[1];
}
return $result;
}
return false;
}
}

View File

@ -750,7 +750,7 @@ class PHPMailer
*
* @var string
*/
const VERSION = '6.7.1';
const VERSION = '6.8.0';
/**
* Error severity: message only, continue processing.
@ -2423,7 +2423,7 @@ class PHPMailer
*/
public function addrFormat($addr)
{
if (empty($addr[1])) { //No name provided
if (!isset($addr[1]) || ($addr[1] === '')) { //No name provided
return $this->secureHeader($addr[0]);
}

View File

@ -46,7 +46,7 @@ class POP3
*
* @var string
*/
const VERSION = '6.7.1';
const VERSION = '6.8.0';
/**
* Default POP3 port number.

View File

@ -35,7 +35,7 @@ class SMTP
*
* @var string
*/
const VERSION = '6.7.1';
const VERSION = '6.8.0';
/**
* SMTP line break constant.
@ -51,6 +51,13 @@ class SMTP
*/
const DEFAULT_PORT = 25;
/**
* The SMTPs port to use if one is not specified.
*
* @var int
*/
const DEFAULT_SECURE_PORT = 465;
/**
* The maximum line length allowed by RFC 5321 section 4.5.3.1.6,
* *excluding* a trailing CRLF break.
@ -187,6 +194,7 @@ class SMTP
'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
'ZoneMTA' => '/[\d]{3} Message queued as (.*)/',
'Mailjet' => '/[\d]{3} OK queued as (.*)/',
];

View File

@ -7,6 +7,6 @@ Note that this is not a HTTP Client implementation of its own. It is merely abst
The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
[psr-url]: http://www.php-fig.org/psr/psr-18
[psr-url]: https://www.php-fig.org/psr/psr-18
[package-url]: https://packagist.org/packages/psr/http-client
[implementation-url]: https://packagist.org/providers/psr/http-client-implementation

View File

@ -7,12 +7,12 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
"homepage": "https://www.php-fig.org/"
}
],
"require": {
"php": "^7.0 || ^8.0",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0 || ^2.0"
},
"autoload": {
"psr-4": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2023-06-08 13:25:29
// This file is automatically generated at:2023-06-12 14:28:07
declare (strict_types = 1);
return array (
0 => 'taoser\\addons\\Service',

View File

@ -23,6 +23,10 @@ class Controller extends BaseController
protected $addon_path;
// 视图模型
protected $view;
// 插件配置
protected $addon_config = '';
// 插件信息
protected $addon_info = '';
/**

View File

@ -2,9 +2,9 @@
declare(strict_types=1);
use think\facade\Event;
use think\facade\App;
use think\facade\Route;
use taoser\addons\Service;
use think\facade\App;
use think\facade\Config;
use think\facade\Cache;
use think\helper\{
@ -24,11 +24,8 @@ define('DS', DIRECTORY_SEPARATOR);
spl_autoload_register(function ($class) {
$class = ltrim($class, '\\');
// $app = new think\App();
// $dir = $app->getRootPath();
// $dir = App::getRootPath();
$dir = app()->getRootPath();
// halt($dir);
$dir = App::getRootPath();
$namespace = 'addons';
if (strpos($class, $namespace) === 0) {
@ -287,3 +284,37 @@ if (!function_exists('get_addons_menu')) {
}
}
if (!function_exists('get_addons_list')) {
/**
* 获得插件列表
* @return array
*/
function get_addons_list()
{
$list = Cache::get('addonslist');
if (empty($list)) {
$addonsPath = app()->getRootPath().'addons'.DS; // 插件列表
$results = scandir($addonsPath);
$list = [];
foreach ($results as $name) {
if ($name === '.' or $name === '..')
continue;
if (is_file($addonsPath . $name))
continue;
$addonDir = $addonsPath . $name . DS;
if (!is_dir($addonDir))
continue;
if (!is_file($addonDir . 'Plugin' . '.php'))
continue;
$info = get_addons_info($name);
if (!isset($info['name']))
continue;
$info['url'] =isset($info['url']) && $info['url'] ?(string)addons_url($info['url']):'';
$list[$name] = $info;
}
Cache::set('addonslist', $list);
}
return $list;
}
}

View File

@ -15,7 +15,8 @@ use Phinx\Db\Adapter\AdapterFactory;
abstract class Command extends \think\console\Command
{
protected $adapter;
public function getAdapter()
{
if (isset($this->adapter)) {

View File

@ -1,4 +1,5 @@
<?php
<?php
/**
* This file is part of workerman.
*
@ -11,6 +12,7 @@
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace PHPSocketIO\Engine\Protocols\WebSocket;
use Workerman\Connection\ConnectionInterface;
@ -25,7 +27,7 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface
* @var int
*/
const MIN_HEAD_LEN = 6;
/**
* websocket blob类型
* @var char
@ -37,142 +39,122 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface
* @var char
*/
const BINARY_TYPE_ARRAYBUFFER = "\x82";
/**
* 检查包的完整性
* @param string $buffer
*/
public static function input($buffer, ConnectionInterface $connection)
public static function input(string $buffer, ConnectionInterface $connection): bool|int
{
// 数据长度
$recv_len = strlen($buffer);
// 长度不够
if($recv_len < self::MIN_HEAD_LEN)
{
if ($recv_len < self::MIN_HEAD_LEN) {
return 0;
}
// $connection->websocketCurrentFrameLength有值说明当前fin为0则缓冲websocket帧数据
if($connection->websocketCurrentFrameLength)
{
if ($connection->websocketCurrentFrameLength) {
// 如果当前帧数据未收全,则继续收
if($connection->websocketCurrentFrameLength > $recv_len)
{
if ($connection->websocketCurrentFrameLength > $recv_len) {
// 返回0因为不清楚完整的数据包长度需要等待fin=1的帧
return 0;
}
}
else
{
} else {
$data_len = ord($buffer[1]) & 127;
$firstbyte = ord($buffer[0]);
$is_fin_frame = $firstbyte>>7;
$is_fin_frame = $firstbyte >> 7;
$opcode = $firstbyte & 0xf;
switch($opcode)
{
// 附加数据帧 @todo 实现附加数据帧
switch ($opcode) {
// 附加数据帧 @todo 实现附加数据帧
case 0x0:
break;
// 文本数据帧
// 文本数据帧
case 0x1:
break;
// 二进制数据帧
// 二进制数据帧
case 0x2:
break;
// 关闭的包
// 关闭的包
case 0x8:
// 如果有设置onWebSocketClose回调尝试执行
if(isset($connection->onWebSocketClose))
{
if (isset($connection->onWebSocketClose)) {
call_user_func($connection->onWebSocketClose, $connection);
}
// 默认行为是关闭连接
else
{
else {
$connection->close();
}
return 0;
// ping的包
// ping的包
case 0x9:
// 如果有设置onWebSocketPing回调尝试执行
if(isset($connection->onWebSocketPing))
{
if (isset($connection->onWebSocketPing)) {
call_user_func($connection->onWebSocketPing, $connection);
}
// 默认发送pong
else
{
else {
$connection->send(pack('H*', '8a00'), true);
}
// 从接受缓冲区中消费掉该数据包
if(!$data_len)
{
if (!$data_len) {
$connection->consumeRecvBuffer(self::MIN_HEAD_LEN);
return 0;
}
break;
// pong的包
// pong的包
case 0xa:
// 如果有设置onWebSocketPong回调尝试执行
if(isset($connection->onWebSocketPong))
{
if (isset($connection->onWebSocketPong)) {
call_user_func($connection->onWebSocketPong, $connection);
}
// 从接受缓冲区中消费掉该数据包
if(!$data_len)
{
if (!$data_len) {
$connection->consumeRecvBuffer(self::MIN_HEAD_LEN);
return 0;
}
break;
// 错误的opcode
default :
// 错误的opcode
default:
echo "error opcode $opcode and close websocket connection\n";
$connection->close();
return 0;
}
// websocket二进制数据
$head_len = self::MIN_HEAD_LEN;
if ($data_len === 126) {
$head_len = 8;
if($head_len > $recv_len)
{
if ($head_len > $recv_len) {
return 0;
}
$pack = unpack('ntotal_len', substr($buffer, 2, 2));
$data_len = $pack['total_len'];
} else if ($data_len === 127) {
$head_len = 14;
if($head_len > $recv_len)
{
if ($head_len > $recv_len) {
return 0;
}
$arr = unpack('N2', substr($buffer, 2, 8));
$data_len = $arr[1]*4294967296 + $arr[2];
$data_len = $arr[1] * 4294967296 + $arr[2];
}
$current_frame_length = $head_len + $data_len;
if($is_fin_frame)
{
if ($is_fin_frame) {
return $current_frame_length;
}
else
{
} else {
$connection->websocketCurrentFrameLength = $current_frame_length;
}
}
// 收到的数据刚好是一个frame
if($connection->websocketCurrentFrameLength == $recv_len)
{
if ($connection->websocketCurrentFrameLength == $recv_len) {
self::decode($buffer, $connection);
$connection->consumeRecvBuffer($connection->websocketCurrentFrameLength);
$connection->websocketCurrentFrameLength = 0;
return 0;
}
// 收到的数据大于一个frame
elseif($connection->websocketCurrentFrameLength < $recv_len)
{
elseif ($connection->websocketCurrentFrameLength < $recv_len) {
self::decode(substr($buffer, 0, $connection->websocketCurrentFrameLength), $connection);
$connection->consumeRecvBuffer($connection->websocketCurrentFrameLength);
$current_frame_length = $connection->websocketCurrentFrameLength;
@ -181,46 +163,37 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface
return self::input(substr($buffer, $current_frame_length), $connection);
}
// 收到的数据不足一个frame
else
{
else {
return 0;
}
}
/**
* 打包
* @param string $buffer
* @return string
*/
public static function encode($buffer, ConnectionInterface $connection)
public static function encode(mixed $buffer, ConnectionInterface $connection): string
{
$len = strlen($buffer);
if(empty($connection->websocketHandshake))
{
if (empty($connection->websocketHandshake)) {
// 默认是utf8文本格式
$connection->websocketType = self::BINARY_TYPE_BLOB;
}
$first_byte = $connection->websocketType;
if($len<=125)
{
$encode_buffer = $first_byte.chr($len).$buffer;
if ($len <= 125) {
$encode_buffer = $first_byte . chr($len) . $buffer;
} else if ($len <= 65535) {
$encode_buffer = $first_byte . chr(126) . pack("n", $len) . $buffer;
} else {
$encode_buffer = $first_byte . chr(127) . pack("xxxxN", $len) . $buffer;
}
else if($len<=65535)
{
$encode_buffer = $first_byte.chr(126).pack("n", $len).$buffer;
}
else
{
$encode_buffer = $first_byte.chr(127).pack("xxxxN", $len).$buffer;
}
// 还没握手不能发数据,先将数据缓冲起来,等握手完毕后发送
if(empty($connection->websocketHandshake))
{
if(empty($connection->websocketTmpData))
{
if (empty($connection->websocketHandshake)) {
if (empty($connection->websocketTmpData)) {
// 临时数据缓冲
$connection->websocketTmpData = '';
}
@ -228,16 +201,16 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface
// 返回空,阻止发送
return '';
}
return $encode_buffer;
}
/**
* 解包
* @param string $buffer
* @return string
*/
public static function decode($buffer, ConnectionInterface $connection)
public static function decode(string $buffer, ConnectionInterface $connection): mixed
{
$len = $masks = $data = $decoded = null;
$len = ord($buffer[1]) & 127;
@ -254,19 +227,16 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface
for ($index = 0; $index < strlen($data); $index++) {
$decoded .= $data[$index] ^ $masks[$index % 4];
}
if($connection->websocketCurrentFrameLength)
{
if ($connection->websocketCurrentFrameLength) {
$connection->websocketDataBuffer .= $decoded;
return $connection->websocketDataBuffer;
}
else
{
} else {
$decoded = $connection->websocketDataBuffer . $decoded;
$connection->websocketDataBuffer = '';
return $decoded;
}
}
/**
* 处理websocket握手
* @param string $buffer
@ -276,33 +246,25 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface
public static function dealHandshake($connection, $req, $res)
{
$headers = array();
if(isset($connection->onWebSocketConnect))
{
try
{
if (isset($connection->onWebSocketConnect)) {
try {
call_user_func_array($connection->onWebSocketConnect, array($connection, $req, $res));
}
catch (\Exception $e)
{
} catch (\Exception $e) {
echo $e;
}
if(!$res->writable)
{
if (!$res->writable) {
return false;
}
}
if(isset($req->headers['sec-websocket-key']))
{
if (isset($req->headers['sec-websocket-key'])) {
$sec_websocket_key = $req->headers['sec-websocket-key'];
}
else
{
} else {
$res->writeHead(400);
$res->end('<b>400 Bad Request</b><br>Upgrade to websocket but Sec-WebSocket-Key not found.');
return 0;
}
// 标记已经握手
$connection->websocketHandshake = true;
// 缓冲fin为0的包直到fin为1
@ -313,8 +275,8 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface
$connection->websocketCurrentFrameBuffer = '';
// blob or arraybuffer
$connection->websocketType = self::BINARY_TYPE_BLOB;
$sec_websocket_accept = base64_encode(sha1($sec_websocket_key.'258EAFA5-E914-47DA-95CA-C5AB0DC85B11',true));
$sec_websocket_accept = base64_encode(sha1($sec_websocket_key . '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', true));
$headers['Content-Length'] = 0;
$headers['Upgrade'] = 'websocket';
$headers['Sec-WebSocket-Version'] = 13;
@ -322,14 +284,13 @@ class RFC6455 implements \Workerman\Protocols\ProtocolInterface
$headers['Sec-WebSocket-Accept'] = $sec_websocket_accept;
$res->writeHead(101, '', $headers);
$res->end();
// 握手后有数据要发送
if(!empty($connection->websocketTmpData))
{
if (!empty($connection->websocketTmpData)) {
$connection->send($connection->websocketTmpData, true);
$connection->websocketTmpData = '';
}
return 0;
}
}

View File

@ -1,8 +1,11 @@
<?php
namespace PHPSocketIO\Engine;
use \PHPSocketIO\Event\Emitter;
use \Workerman\Timer;
use \PHPSocketIO\Debug;
class Socket extends Emitter
{
public $id = 0;
@ -15,7 +18,7 @@ class Socket extends Emitter
public $sentCallbackFn = array();
public $request = null;
public $remoteAddress = '';
public $checkIntervalTimer = null;
public $checkIntervalTimer;
public $upgradeTimeoutTimer = null;
public $pingTimeoutTimer = null;
@ -24,7 +27,7 @@ class Socket extends Emitter
$this->id = $id;
$this->server = $server;
$this->request = $req;
$this->remoteAddress = $req->connection->getRemoteIp().':'.$req->connection->getRemotePort();
$this->remoteAddress = $req->connection->getRemoteIp() . ':' . $req->connection->getRemotePort();
$this->setTransport($transport);
$this->onOpen();
Debug::debug('Engine/Socket __construct');
@ -39,9 +42,10 @@ class Socket extends Emitter
{
$this->upgrading = true;
$this->upgradeTimeoutTimer = Timer::add(
$this->server->upgradeTimeout,
$this->server->upgradeTimeout,
array($this, 'upgradeTimeoutCallback'),
array($transport), false
array($transport),
false
);
$this->upgradeTransport = $transport;
$transport->on('packet', array($this, 'onUpgradePacket'));
@ -52,22 +56,18 @@ class Socket extends Emitter
public function onUpgradePacket($packet)
{
if(empty($this->upgradeTransport))
{
$this->onError('upgradeTransport empty');
return;
if (empty($this->upgradeTransport)) {
$this->onError('upgradeTransport empty');
return;
}
if('ping' === $packet['type'] && (isset($packet['data']) && 'probe' === $packet['data']))
{
$this->upgradeTransport->send(array(array('type'=> 'pong', 'data'=> 'probe')));
if ('ping' === $packet['type'] && (isset($packet['data']) && 'probe' === $packet['data'])) {
$this->upgradeTransport->send(array(array('type' => 'pong', 'data' => 'probe')));
//$this->transport->shouldClose = function(){};
if ($this->checkIntervalTimer) {
Timer::del($this->checkIntervalTimer);
}
Timer::del($this->checkIntervalTimer);
}
$this->checkIntervalTimer = Timer::add(0.5, array($this, 'check'));
}
else if('upgrade' === $packet['type'] && $this->readyState !== 'closed')
{
} else if ('upgrade' === $packet['type'] && $this->readyState !== 'closed') {
$this->upgradeCleanup();
$this->upgraded = true;
$this->clearTransport();
@ -77,21 +77,16 @@ class Socket extends Emitter
$this->upgradeTransport = null;
$this->setPingTimeout();
$this->flush();
if($this->readyState === 'closing')
{
if ($this->readyState === 'closing') {
$this->transport->close(array($this, 'onClose'));
}
}
else
{
if(!empty($this->upgradeTransport))
{
} else {
if (!empty($this->upgradeTransport)) {
$this->upgradeCleanup();
$this->upgradeTransport->close();
$this->upgradeTransport = null;
}
}
}
@ -100,8 +95,7 @@ class Socket extends Emitter
$this->upgrading = false;
Timer::del($this->checkIntervalTimer);
Timer::del($this->upgradeTimeoutTimer);
if(!empty($this->upgradeTransport))
{
if (!empty($this->upgradeTransport)) {
$this->upgradeTransport->removeListener('packet', array($this, 'onUpgradePacket'));
$this->upgradeTransport->removeListener('close', array($this, 'onUpgradeTransportClose'));
$this->upgradeTransport->removeListener('error', array($this, 'onUpgradeTransportError'));
@ -118,8 +112,7 @@ class Socket extends Emitter
{
//echo $err;
$this->upgradeCleanup();
if($this->upgradeTransport)
{
if ($this->upgradeTransport) {
$this->upgradeTransport->close();
$this->upgradeTransport = null;
}
@ -129,12 +122,11 @@ class Socket extends Emitter
{
//echo("client did not complete upgrade - closing transport\n");
$this->upgradeCleanup();
if('open' === $transport->readyState)
{
$transport->close();
if ('open' === $transport->readyState) {
$transport->close();
}
}
public function setTransport($transport)
{
$this->transport = $transport;
@ -145,77 +137,74 @@ class Socket extends Emitter
//this function will manage packet events (also message callbacks)
$this->setupSendCallback();
}
public function onOpen()
{
$this->readyState = 'open';
// sends an `open` packet
$this->transport->sid = $this->id;
$this->sendPacket('open', json_encode(array(
'sid'=> $this->id
, 'upgrades' => $this->getAvailableUpgrades()
, 'pingInterval'=> $this->server->pingInterval*1000
, 'pingTimeout'=> $this->server->pingTimeout*1000
'sid' => $this->id, 'upgrades' => $this->getAvailableUpgrades(), 'pingInterval' => $this->server->pingInterval * 1000, 'pingTimeout' => $this->server->pingTimeout * 1000
)));
$this->emit('open');
$this->setPingTimeout();
}
public function onPacket($packet)
{
if ('open' === $this->readyState) {
// export packet event
$this->emit('packet', $packet);
// Reset ping timeout on any packet, incoming data is a good sign of
// other side's liveness
$this->setPingTimeout();
switch ($packet['type']) {
case 'ping':
$this->sendPacket('pong');
$this->emit('heartbeat');
break;
case 'error':
$this->onClose('parse error');
break;
case 'message':
$this->emit('data', $packet['data']);
$this->emit('message', $packet['data']);
break;
}
}
else
{
echo('packet received with closed socket');
} else {
echo ('packet received with closed socket');
}
}
}
public function check()
{
if('polling' == $this->transport->name && $this->transport->writable)
{
if ('polling' == $this->transport->name && $this->transport->writable) {
$this->transport->send(array(array('type' => 'noop')));
}
}
public function onError($err)
public function onError($err)
{
$this->onClose('transport error', $err);
}
public function setPingTimeout()
{
if ($this->pingTimeoutTimer) {
Timer::del($this->pingTimeoutTimer);
}
$this->pingTimeoutTimer = Timer::add(
$this->server->pingInterval + $this->server->pingTimeout ,
array($this, 'pingTimeoutCallback'), null, false);
$this->server->pingInterval + $this->server->pingTimeout,
array($this, 'pingTimeoutCallback'),
null,
false
);
}
public function pingTimeoutCallback()
@ -224,21 +213,26 @@ class Socket extends Emitter
$this->onClose('ping timeout');
}
public function clearTransport()
{
$this->transport->close();
Timer::del($this->pingTimeoutTimer);
}
public function onClose($reason = '', $description = null)
{
if ('closed' !== $this->readyState)
{
if ('closed' !== $this->readyState) {
Timer::del($this->pingTimeoutTimer);
Timer::del($this->checkIntervalTimer);
if (!empty($this->checkIntervalTimer))
Timer::del($this->checkIntervalTimer);
$this->checkIntervalTimer = null;
Timer::del($this->upgradeTimeoutTimer);
if (!empty($this->checkIntervalTimer))
Timer::del($this->upgradeTimeoutTimer);
// clean writeBuffer in next tick, so developers can still
// grab the writeBuffer on 'close' event
$this->writeBuffer = array();
@ -251,74 +245,66 @@ class Socket extends Emitter
$this->request = null;
$this->upgradeTransport = null;
$this->removeAllListeners();
if(!empty($this->transport))
{
if (!empty($this->transport)) {
$this->transport->removeAllListeners();
$this->transport = null;
}
}
}
public function send($data, $options, $callback)
{
$this->sendPacket('message', $data, $callback);
return $this;
}
public function write($data, $options = array(), $callback = null)
{
return $this->send($data, $options, $callback);
}
public function sendPacket($type, $data = null, $callback = null)
{
if('closing' !== $this->readyState)
{
if ('closing' !== $this->readyState) {
$packet = array(
'type'=> $type
'type' => $type
);
if($data !== null)
{
if ($data !== null) {
$packet['data'] = $data;
}
// exports packetCreate event
$this->emit('packetCreate', $packet);
$this->writeBuffer[] = $packet;
//add send callback to object
if($callback)
{
if ($callback) {
$this->packetsFn[] = $callback;
}
$this->flush();
}
}
public function flush()
public function flush()
{
if ('closed' !== $this->readyState && $this->transport->writable
&& $this->writeBuffer)
{
if (
'closed' !== $this->readyState && $this->transport->writable
&& $this->writeBuffer
) {
$this->emit('flush', $this->writeBuffer);
$this->server->emit('flush', $this, $this->writeBuffer);
$wbuf = $this->writeBuffer;
$this->writeBuffer = array();
if($this->packetsFn)
{
if(!empty($this->transport->supportsFraming))
{
if ($this->packetsFn) {
if (!empty($this->transport->supportsFraming)) {
$this->sentCallbackFn[] = $this->packetsFn;
} else {
// @todo check
$this->sentCallbackFn[] = $this->packetsFn;
}
else
{
// @todo check
$this->sentCallbackFn[]=$this->packetsFn;
}
}
$this->packetsFn = array();
$this->transport->send($wbuf);
$this->emit('drain');
if($this->server)
{
if ($this->server) {
$this->server->emit('drain', $this);
}
}
@ -331,11 +317,10 @@ class Socket extends Emitter
public function close()
{
if ('open' !== $this->readyState)
{
if ('open' !== $this->readyState) {
return;
}
$this->readyState = 'closing';
if ($this->writeBuffer) {
@ -356,24 +341,21 @@ class Socket extends Emitter
{
$self = $this;
//the message was sent successfully, execute the callback
$this->transport->on('drain', array($this, 'onDrainCallback'));
$this->transport->on('drain', array($this, 'onDrainCallback'));
}
public function onDrainCallback()
{
if ($this->sentCallbackFn)
{
$seqFn = array_shift($this->sentCallbackFn);
if(is_callable($seqFn))
{
echo('executing send callback');
call_user_func($seqFn, $this->transport);
}else if (is_array($seqFn)) {
echo('executing batch send callback');
foreach($seqFn as $fn)
{
call_user_func($fn, $this->transport);
}
if ($this->sentCallbackFn) {
$seqFn = array_shift($this->sentCallbackFn);
if (is_callable($seqFn)) {
echo ('executing send callback');
call_user_func($seqFn, $this->transport);
} else if (is_array($seqFn)) {
echo ('executing batch send callback');
foreach ($seqFn as $fn) {
call_user_func($fn, $this->transport);
}
}
}
}

View File

@ -192,30 +192,6 @@
});
});
// 发布文章
form.on("submit(article-add)", function (data) {
var field = data.field;
var index = layer.load(1);
$.ajax({
type: "post",
url: "{:url('article/add')}",
data: field,
dataType: "json",
success: function (data) {
if (data.code === 0) {
notify.success(data.msg, function () {
location.href = data.url;
});
} else {
notify.error(data.msg);
$("#captcha").attr("src", "{:captcha_src()}?" + Math.random());
}
layer.close(index);
},
});
return false;
});
// 改变标题颜色
colorpicker.render({
elem: "#color",
@ -235,7 +211,7 @@
data: { type: "zip" },
accept: "file",
before: function(obj){
layer.load();
layer.load(0);
},
done: function (res) {
layer.closeAll('loading');
@ -248,6 +224,30 @@
},
});
// 发布文章
form.on("submit(article-add)", function (data) {
var field = data.field;
var loadIndex = layer.load(2);
$.ajax({
type: "post",
url: "{:url('article/add')}",
data: field,
dataType: "json",
success: function (res) {
layer.close(loadIndex);
if (res.code === 0) {
toast.success({title:"成功消息",message: res.msg});
location.href = res.url;
} else {
toast.error({title:"失败消息",message:res.msg});
$("#captcha").attr("src", "{:captcha_src()}?" + Math.random());
}
layer.close(index);
},
});
return false;
});
});
</script>
{// 编辑器}

View File

@ -75,46 +75,111 @@
{//评论内容}
<div class="fly-panel detail-box" id="flyReply">
<span style="font-size: 18px">评论 {article:comment_num}</span>
<span style="font-size:18px;">评论 {$article.comments_count}</span>
<ul class="jieda" id="jieda">
{article:comment}
<li data-id="{comment:id /}" class="jieda-daan">
<a name="item-1111111111"></a>
<div class="detail-about detail-about-reply">
<a class="fly-avatar" href="{comment:ulink /}">
<img src="{comment:uimg /}" alt=" " />{if($comment.user.vip > 0)}<i class="iconfont icon-renzheng" title="认证信息"></i>{/if}
<img src="{comment:uimg /}" alt="{comment:uname}">
</a>
<div class="fly-detail-user">
<a href="{comment:ulink /}" class="fly-link">
<cite>{comment:uname /}</cite>
</a>
{if condition="$article.user_id eq $comment.user_id"}<span>({:lang('poster')})</span>{/if}
<span>{comment:usign /}</span>
</div>
<div class="detail-hits">
<span class="post-time" data="{comment:time}"></span>{:hook('ipShow',$comment.user.city)}</span>
</div>
<div class="detail-hits"><span class="post-time" data="{comment:time /}"></span>{:hook('ipShow', $comment.user.city)}</div>
{if $comment.cai == 1}<i class="iconfont icon-caina" title="最佳答案"></i>{/if}
</div>
{//加密未解密评论不可查看}
{if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))}
<div class="detail-body jieda-body photos">{comment:content /}</div>
<div class="jieda-reply">
<span class="jieda-zan {if($comment.zan != 0)}zanok{/if}" type="zan"><i class="iconfont icon-zan"></i><em>{comment:zan /}</em></span>
<span type="reply" id="user-reply"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论 编辑/删除/采纳/权限}
<div class="jieda-admin">
{if ((session('user_id') == $comment.user_id) && (getLimtTime($comment.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{$comment.id}">{:lang('edit')}</span>
<span type="del">{:lang('delete')}</span>
{/if} {if ($comment.cai == 0) && ((session('user_id') == $article.user_id) OR ($user.auth ?? '')) && ($article.jie == 0)/}
<span class="jieda-accept" type="accept">{:lang('accept')}</span>
{/if}
{//加密未解密评论不可查看}
{if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))}
<div class="detail-body jieda-body photos">{comment:content /}</div>
<div class="jieda-reply">
{eq name="comment.delete_time" value="0"}
<span class="jieda-zan {if($comment.zan != 0)}zanok{/if}" type="zan">
<i class="iconfont icon-zan"></i><em>{comment:zan /}</em>
</span>
<span type="reply" data-pid="{comment:id /}" data-tid="{comment:uid /}"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论编辑删除采纳权限}
<div class="jieda-admin">
{if ((session('user_id') == $comment.user_id) && (getLimtTime($comment.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{comment:id /}">{:lang('edit')}</span>
<span type="del" class="comment-del" data-id="{comment:id /}">{:lang('delete')}</span>
{/if}
</div>
{/eq}
{// 第二层回复}
{notempty name="$comment.children"}
{volist name="$comment.children" id="vo"}
<div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0; background: #f6f6f6">
<a style="display: inline-block; float: left; width: 50px;"><img src="{$vo.user.user_img}" style="width: 30px; height: 30px; border-radius: 15px; object-fit: cover"></a>
<div style="float: left;width: calc(100% - 50px);">
<div>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
<div class="jieda-reply">
{eq name="vo.delete_time" value="0"}
<span class="jieda-zan {if($vo.zan != 0)}zanok{/if}" type="zan">
<i class="iconfont icon-zan"></i><em>{$vo.zan}</em>
</span>
<span type="reply" data-pid="{$vo.id}" data-tid="{$vo.user.id}"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论编辑删除采纳权限}
<div class="jieda-admin">
{if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{$vo.id}">{:lang('edit')}</span>
<span type="del" class="comment-del" data-id="{$vo.id}" >{:lang('delete')}</span>
{/if}
</div>
{/eq}
</div>
</div>
</div>
{// 第三层回复}
{notempty name="$vo.children"}
{volist name="$vo.children" id="voo"}
<div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0;">
<a style="display: inline-block; float: left; width: 50px;"><img src="{$voo.user.user_img}" style="width: 30px; height: 30px; object-fit: cover; border-radius: 15px;"></a>
<div style="float: left;width: calc(100% - 50px);">
<div>{$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$voo.content|raw}</div>
<div class="jieda-reply">
{eq name="voo.delete_time" value="0"}
<span class="jieda-zan {if($voo.zan != 0)}zanok{/if}" type="zan">
<i class="iconfont icon-zan"></i><em>{$voo.zan}</em>
</span>
<span type="reply" data-pid="{$vo.id}" data-tid="{$voo.user.id}"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论编辑删除采纳权限}
<div class="jieda-admin">
{if ((session('user_id') == $voo.user.id) && (getLimtTime($voo.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{$voo.id}">{:lang('edit')}</span>
<span type="del" class="comment-del" data-id="{$voo.id}">{:lang('delete')}</span>
{/if}
</div>
{/eq}
</div>
</div>
</div>
{/volist}
{/notempty}
{/volist}
{/notempty}
</div>
{else /}
<div class="detail-body jieda-body photos">
<i class="layui-icon layui-icon-password" style="font-size: 24px; color: #FF5722;"></i>
评论解密后查看
</div>
{/if}
</div>
{else /}
<div class="detail-body jieda-body photos"><i class="layui-icon layui-icon-password" style="font-size: 24px; color: #FF5722;"></i> 评论解密后查看 </div>
{/if}
<hr style="border:1px dotted red;height:1px;width:90%" />
<div style="margin: 5px 0px;">{comment:usign /}</div>
</li>
{/article:comment}
</ul>
@ -127,7 +192,7 @@
<div class="layui-form-item layui-form-text">
<a name="comment"></a>
<div class="layui-input-block">
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor" style="height: 150px"></textarea>
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor taonyeditor" style="height: 150px"></textarea>
</div>
</div>
<div class="layui-form-item que-comments">
@ -183,10 +248,6 @@
{block name="script"}
{:hook('taonyeditor')}
{:hook('taoplayer')}
<script>
var collectionFind = "{:url('Collection/find')}",
@ -211,25 +272,6 @@
uid = layui.cache.user.uid,
laypage = layui.laypage;
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
// 编辑器插件禁用状态,用原方式解析网页
if(taonystatus == 0) {
$('.detail-body').each(function(){
var othis = $(this), html = othis.html();
othis.html(fly.content(html));
});
} else {
$(".comment-edit").on('click',function (){
var id = $(this).data('id');
layer.open({
type: 2,
title: '修改',
shade: 0.1,
area: ['600px', '500px'],
content: "{:url('comment/edit')}" + '?id=' + id
});
});
}
//tpl模板给发布时间赋值
$("div.user-questions").children("span.user-post-time").each(function () {
@ -277,33 +319,96 @@
},
});
// 评论接口
function comment(data){
if (uid == -1) {
layer.msg('请先登陆',{icon:5,time:2000},function(){location.href = "{:url('login/index')}"});
return false;
}
var index = layer.load(1);
$.ajax({
type: "post",
url: "{:url('article/comment')}",
data: data,
dataType: "json",
success:function (res) {
layer.close(index);
if (res.code === 0) {
layer.msg(res.msg,{icon:6,time:2000},function () {location.reload(true)});
}else {
layer.open({title:'评论失败',content:res.msg,icon:5,anim:6});
}
}
});
}
// 回复用户
$("span[type='reply']").on('click',function (){
var pid = $(this).attr('data-pid');
var tid = $(this).data('tid');
var html =
'<form class="layui-form user-comment" style="margin-left:50px;">' +
'<div>' +
'<input type="hidden" name="article_id" value="{$article.id}">' +
'<input name="pid" value="'+ pid +'" class="layui-hide">' +
'<input name="to_user_id" value="'+ tid +'" class="layui-hide">' +
'<textarea name="content" required lay-verify="required" class="layui-textarea fly-editor" style="height: 100px; right: 5px; margin: 10px 5px;"></textarea>' +
'<button type="submit" class="layui-btn" lay-submit lay-filter="submit-user-comment">提交</button>' +
'</div>' +
'</form>';
var forms = $(this).nextAll('form');
if(forms.length == 0) {
// 移除其它评论块
$('.user-comment').remove();
//动态添加评论块
$(this).next().after(html);
}
})
//评论需要登陆
form.on("submit(user-comment)", function (data) {
var index = layer.load(1);
var filed = data.field;
if (uid === -1) {
layer.msg("请先登陆", { icon: 5, time: 2000 }, function () {
location.href = "{:url('login/index')}";
});
} else {
$.ajax({
type: "post",
url: "{:url('article/comment')}",
data: filed,
dataType: "json",
success: function (data) {
if (data.code === 0) {
layer.msg(data.msg, { icon: 6, time: 2000 }, function () {
location.reload(true);
});
} else {
layer.open({ title: "评论失败", content: data.msg, icon: 5, anim: 6 });
}
},
});
}
return false;
comment(data.field);
});
//提交回复
form.on('submit(submit-user-comment)', function(data){
comment(data.field);
return false;
})
// 编辑器插件启用状态
if(taonystatus == 0) {
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
$('.detail-body').each(function(){
var othis = $(this), html = othis.html();
othis.html(fly.content(html));
});
} else {
// 编辑评论
$(".comment-edit").on('click', function () {
var id = $(this).data('id');
layer.open({
type: 2,
title: '修改',
shade: 0.1,
area: ['600px', '500px'],
content: "{:url('comment/edit')}" + '?id=' + id
});
});
// 删除评论
$(".comment-del").on('click', function () {
var id = $(this).data('id');
layer.confirm('需要删除吗?', {icon: 3}, function (){
$.post("{:url('comment/jiedaDelete')}", {id: id}, function (res) {
if (res.status === 0) {
toast.success({title: "成功消息", message: res.msg});
location.reload(true);
} else {
toast.error({title: "失败消息", message: res.msg});
}
})
})
});
}
// 评论分页
laypage.render({
@ -364,12 +469,14 @@
});
</script>
{:hook('taonyeditor')}
{:hook('taoplayer')}
{:hook('taoplyr')}
{//图片点击放大}
{include file="/public/images-click" /}
{include file="/public/qr-read" /}
{/block}

View File

@ -26,180 +26,247 @@
{/block}
{block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block}
{block name="content"}
<main class="py-2 py-md-2 pb-3" style="transform: none">
<main class="py-2 py-md-2 pb-3" style="transform: none">
<div class="layui-container" style="transform: none">
<div class="layui-row layui-col-space15" style="transform: none">
<div class="layui-col-md8" itemscope itemType="">
<div class="post card">
<section class="card-body">
<div class="post-header border-bottom mb-4 pb-4">
<h1 class="h3 mb-3" itemprop="headline">{article:title /}</h1>
<div class="meta d-flex align-items-center text-xs text-muted">
<div>
<div class="d-inline-block" itemprop="author" itemscope="" itemtype="">
Posted by <a href="{$Request.domain}" target="_blank" class="text-muted" itemprop="url">
<span itemprop="name">{article:auther}</span></a>
<a href="{article:cate name='link'}" target="_blank" class="text-muted" rel="category">{article:cate name="catename"}</a><time class="d-inline-block" datetime="{$article.create_time|date='Y-m-d h:m:s'}" itemprop="datePublished">{article:time}</time>
</div>
</div>
<div class="ml-auto text-sm yincang">
<span class="mx-1">
<small>已阅读 {article:pv /} 次</small>
</span>
</div>
</div>
<div class="border-theme bg-primary"></div>
</div>
{:hook('taoplayerdiv')}
<article class="post-content detail-body" itemprop="articleBody" view-image>
{article:content}
</article>
{//文章末尾}
{if (($article.upzip !== '') || session('?user_name'))}
<div class="">
{notempty name="$article.upzip"}
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
{/notempty}
</div>
{/if}
{//解密文件}
{empty name="passJieMi"}
{if($article.read_type == 1)}
<div id="jiemi" style="text-align:center">
<button type="button" class="layui-btn layui-btn-primary"><i class="layui-icon layui-icon-password" style="font-size: 30px; color: #FF5722;"></i> 阅读请解密 </button>
</div>
{/if}
{/empty}
{notempty name="tags"}
<div style="margin-top: 15px">标签
{volist name="tags" id="vo" }
<a href="{$vo.url}"><span class="layui-btn layui-btn-xs layui-btn-normal layui-btn-radius">{$vo.name}</span></a>
{/volist}
</div>
{/notempty}
<div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125);">
<p style="line-height:200%;">{$sysInfo.state|raw}</p>
</div>
<div style="margin-top: 20px;">本文链接:<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a></div>
<div class="detail-zan">
<span class="jieda-zan" type="zan" id="article-zan">
点赞 <i class="iconfont icon-zan"></i> <em>{:count($userZanList)}</em>
</span>
{volist name="userZanList" id="vo" }
<span><img src="{$vo.userImg}"></span>
{/volist}
</div>
</section>
<div class="card-footer text-center mt-4">
<a href="javascript:" style="color: #FFF !important;" data-img="/qrcode/?text={$Request.domain}{$Request.url}&size=200" data-title="手机扫一扫继续阅读" data-desc="微信或浏览器均可" class="single-popup shangzan mr-3 text-muted text-xs">手机浏览</a>
<a href="javascript:" style="color: #FFF !important;" data-img="{:hook('qqKefu','dashang')}" data-title="赞赏支持一下站长" data-desc="微信赞赏扫码" class="single-popup shangzan text-muted text-xs">赞赏支持</a>
<div class="text-center text-muted text-xs" style="margin-top: 30px;">
"作者已被打赏 0 次"
</div>
</div>
</div>
<div class="post card block d-flex p-4">
<span class="d-inline-block text-muted mr-2 fanpian pb-2 mb-2"> # 上一篇: {$previous|raw}</span>
<span class="d-inline-block text-muted mr-2 fanpian"># 下一篇: {$next|raw}</span>
</div>
{notempty name="relationArticle"}
<section class="list-related">
<div class="content-related card">
<div class="card-body">
<div class="mb-3">相关文章</div>
<div class="list list-dots my-n2">
{volist name="relationArticle" id="vo"}
<div class="list-item py-2">
<a href="{$Request.domain}{$vo.url}" target="_blank" class="list-title fanpian" title="{$vo.title}" rel="bookmark">{$vo.title} </a>
<div class="layui-row layui-col-space15" style="transform: none">
<div class="layui-col-md8" itemscope itemType="">
<div class="post card">
<section class="card-body">
<div class="post-header border-bottom mb-4 pb-4">
<h1 class="h3 mb-3" itemprop="headline">{article:title /}</h1>
<div class="meta d-flex align-items-center text-xs text-muted">
<div>
<div class="d-inline-block" itemprop="author" itemscope="" itemtype="">
Posted by <a href="{$Request.domain}" target="_blank" class="text-muted" itemprop="url">
<span itemprop="name">{article:auther}</span></a>
<a href="{article:cate name='link'}" target="_blank" class="text-muted" rel="category">{article:cate name="catename"}</a><time class="d-inline-block" datetime="{$article.create_time|date='Y-m-d h:m:s'}" itemprop="datePublished">{article:time}</time>
</div>
</div>
<div class="ml-auto text-sm yincang">
<span class="mx-1">
<small>已阅读 {article:pv /} 次</small>
</span>
</div>
</div>
<div class="border-theme bg-primary"></div>
</div>
{:hook('taoplayerdiv')}
<article class="post-content detail-body" itemprop="articleBody" view-image>
{article:content}
</article>
{//文章末尾}
{if (($article.upzip !== '') || session('?user_name'))}
<div class="">
{notempty name="$article.upzip"}
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
{/notempty}
</div>
{/if}
{//解密文件}
{empty name="passJieMi"}
{if($article.read_type == 1)}
<div id="jiemi" style="text-align:center">
<button type="button" class="layui-btn layui-btn-primary"><i class="layui-icon layui-icon-password" style="font-size: 30px; color: #FF5722;"></i> 阅读请解密 </button>
</div>
{/if}
{/empty}
{notempty name="tags"}
<div style="margin-top: 15px">标签
{volist name="tags" id="vo" }
<a href="{$vo.url}"><span class="layui-btn layui-btn-xs layui-btn-normal layui-btn-radius">{$vo.name}</span></a>
{/volist}
</div>
{/notempty}
<div style="margin: 20px 0px 15px 0px; color: rgb(130, 125, 125);">
<p style="line-height:200%;">{$sysInfo.state|raw}</p>
</div>
<div style="margin-top: 20px;">本文链接:<a href="{$Request.domain}{$Request.url}">{$Request.domain}{$Request.url}</a></div>
<div class="detail-zan">
<span class="jieda-zan" type="zan" id="article-zan">
点赞 <i class="iconfont icon-zan"></i> <em>{:count($userZanList)}</em>
</span>
{volist name="userZanList" id="vo" }
<span><img src="{$vo.userImg}"></span>
{/volist}
</div>
</section>
<div class="card-footer text-center mt-4">
<a href="javascript:" style="color: #FFF !important;" data-img="/qrcode/?text={$Request.domain}{$Request.url}&size=200" data-title="手机扫一扫继续阅读" data-desc="微信或浏览器均可" class="single-popup shangzan mr-3 text-muted text-xs">手机浏览</a>
<a href="javascript:" style="color: #FFF !important;" data-img="{:hook('qqKefu','dashang')}" data-title="赞赏支持一下站长" data-desc="微信赞赏扫码" class="single-popup shangzan text-muted text-xs">赞赏支持</a>
<div class="text-center text-muted text-xs" style="margin-top: 30px;">
"作者已被打赏 0 次"
</div>
</div>
</div>
</div>
</section>
{/notempty}
<section class="comments">
<div class="card">
<div class="card-body pt-4">
{//评论内容}
<div class="mb-3" id="flyReply">
文章评论 <small class="font-theme text-muted">({article:comment_num})</small>
<ul class="jieda" id="jieda">
{article:comment}
<li data-id="{$vo.id}" class="jieda-daan">
<a name="item-1111111111"></a>
<div class="detail-about detail-about-reply">
<a class="fly-avatar" href="{comment:ulink /}">
<img src="{comment:uimg /}" alt=" " />{if($comment.user.vip > 0)}<i class="iconfont icon-renzheng" title="认证信息"></i>{/if}
</a>
<div class="fly-detail-user">
<a href="{comment:ulink /}" class="fly-link">
<cite>{comment:uname /}</cite>
</a>
{if condition="$article.user.id eq $comment.user_id"}<span>({:lang('poster')})</span>{/if}
</div>
<div class="detail-hits"><span class="post-time" data="{$vo.create_time}"></span>{:hook('ipShow',$comment.user.city)}</div>
</div>
{//加密未解密评论不可查看}
{if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))}
<div class="detail-body jieda-body photos">{comment:content}</div>
<div class="jieda-reply">
<span class="jieda-zan {if($comment.zan != 0)}zanok{/if}" type="zan"><i class="iconfont icon-zan"></i><em>{comment:zan /}</em></span>
<span type="reply"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论 编辑/删除/采纳/权限}
<div class="jieda-admin">
{if ((session('user_id') == $comment.user_id) && (getLimtTime($comment.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{comment:id /}">{:lang('edit')}</span>
<span type="del">{:lang('delete')}</span>
{/if}
<div class="post card block d-flex p-4">
<span class="d-inline-block text-muted mr-2 fanpian pb-2 mb-2"> # 上一篇: {$previous|raw}</span>
<span class="d-inline-block text-muted mr-2 fanpian"># 下一篇: {$next|raw}</span>
</div>
{notempty name="relationArticle"}
<section class="list-related">
<div class="content-related card">
<div class="card-body">
<div class="mb-3">相关文章</div>
<div class="list list-dots my-n2">
{volist name="relationArticle" id="vo"}
<div class="list-item py-2">
<a href="{$Request.domain}{$vo.url}" target="_blank" class="list-title fanpian" title="{$vo.title}" rel="bookmark">{$vo.title} </a>
</div>
{/volist}
</div>
</div>
{else /}
<div class="detail-body jieda-body photos"><i class="layui-icon layui-icon-password" style="font-size: 24px; color: #FF5722;"></i> 评论解密后查看 </div>
{/if}
<hr style="width:90%;border:1px dotted red;height:1px;margin:5px 0px;"; />
<div>{comment:usign /}</div>
</li>
{/article:comment}
</ul>
<div style="text-align: center" id="pages"></div>
</div>
{//评论区}
{if (config('taoler.config.is_reply') == 1 ) AND ( $article.is_reply == 0 )}
<div id="commentszbpmy" style="text-align: center;">
<h5>评论已关闭!</h5>
</div>
{/if}
{if session('?user_id') AND (config('taoler.config.is_reply') == 1 ) AND ( $article.is_reply == 1 )}
<div class="comment-respond">
<form class="comment-form">
<div class="layui-form">
<div class="layui-form-item layui-form-text">
<a name="comment"></a>
<div class="comment-textarea mb-3">
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor" style="height: 100px"></textarea>
</div>
</div>
<div class="layui-form-item que-comments">
<input type="hidden" name="article_id" value="{$article.id}" />
<input type="hidden" name="user_id" value="{:session('user_id')}" />
<button class="layui-btn layui-btn-danger" lay-filter="user-comment" lay-submit>{:lang('submit comments')}</button>
</div>
</div>
</form>
</div>
{/if}
</section>
{/notempty}
</div>
<section class="comments">
<div class="card">
<div class="card-body pt-4">
{//评论内容}
<div class="mb-3" id="flyReply">
文章评论 <small class="font-theme text-muted">({article:comment_num})</small>
<ul class="jieda" id="jieda">
{article:comment}
<li data-id="{comment:id /}" class="jieda-daan">
<div class="detail-about detail-about-reply">
<a class="fly-avatar" href="{comment:ulink /}">
<img src="{comment:uimg /}" alt="{comment:uname}">
</a>
<div class="fly-detail-user">
<a href="{comment:ulink /}" class="fly-link">
<cite>{comment:uname /}</cite>
</a>
{if condition="$article.user_id eq $comment.user_id"}<span>({:lang('poster')})</span>{/if}
<span>{comment:usign /}</span>
</div>
<div class="detail-hits">
<span class="post-time" data="{comment:time}"></span>{:hook('ipShow',$comment.user.city)}</span>
</div>
{//加密未解密评论不可查看}
{if($article.read_type == 0 || (($article.read_type == 1) && $passJieMi))}
<div class="detail-body jieda-body photos">{comment:content /}</div>
<div class="jieda-reply">
{eq name="comment.delete_time" value="0"}
<span class="jieda-zan {if($comment.zan != 0)}zanok{/if}" type="zan">
<i class="iconfont icon-zan"></i><em>{comment:zan /}</em>
</span>
<span type="reply" data-pid="{comment:id /}" data-tid="{comment:uid /}"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论编辑删除采纳权限}
<div class="jieda-admin">
{if ((session('user_id') == $comment.user_id) && (getLimtTime($comment.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{comment:id /}">{:lang('edit')}</span>
<span type="del" class="comment-del" data-id="{comment:id /}">{:lang('delete')}</span>
{/if}
</div>
{/eq}
{// 第二层回复}
{notempty name="$comment.children"}
{volist name="$comment.children" id="vo"}
<div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0; background: #f6f6f6">
<a style="display: inline-block; float: left; width: 50px;"><img src="{$vo.user.user_img}" style="width: 30px; height: 30px; border-radius: 15px; object-fit: cover"></a>
<div style="float: left;width: calc(100% - 50px);">
<div>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
<div class="jieda-reply">
{eq name="vo.delete_time" value="0"}
<span class="jieda-zan {if($vo.zan != 0)}zanok{/if}" type="zan">
<i class="iconfont icon-zan"></i><em>{$vo.zan}</em>
</span>
<span type="reply" data-pid="{$vo.id}" data-tid="{$vo.user.id}"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论编辑删除采纳权限}
<div class="jieda-admin">
{if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{$vo.id}">{:lang('edit')}</span>
<span type="del" class="comment-del" data-id="{$vo.id}" >{:lang('delete')}</span>
{/if}
</div>
{/eq}
</div>
</div>
</div>
{// 第三层回复}
{notempty name="$vo.children"}
{volist name="$vo.children" id="voo"}
<div class="layui-clear" style="margin:10px 0; padding: 10px; border: 1px solid #f0f0f0;">
<a style="display: inline-block; float: left; width: 50px;"><img src="{$voo.user.user_img}" style="width: 30px; height: 30px; object-fit: cover; border-radius: 15px;"></a>
<div style="float: left;width: calc(100% - 50px);">
<div>{$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$voo.content|raw}</div>
<div class="jieda-reply">
{eq name="voo.delete_time" value="0"}
<span class="jieda-zan {if($voo.zan != 0)}zanok{/if}" type="zan">
<i class="iconfont icon-zan"></i><em>{$voo.zan}</em>
</span>
<span type="reply" data-pid="{$vo.id}" data-tid="{$voo.user.id}"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论编辑删除采纳权限}
<div class="jieda-admin">
{if ((session('user_id') == $voo.user.id) && (getLimtTime($voo.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{$voo.id}">{:lang('edit')}</span>
<span type="del" class="comment-del" data-id="{$voo.id}">{:lang('delete')}</span>
{/if}
</div>
{/eq}
</div>
</div>
</div>
{/volist}
{/notempty}
{/volist}
{/notempty}
</div>
{else /}
<div class="detail-body jieda-body photos">
<i class="layui-icon layui-icon-password" style="font-size: 24px; color: #FF5722;"></i>
解密后查看内容
</div>
{/if}
</div>
</li>
{/article:comment}
</ul>
<div style="text-align: center" id="pages"></div>
</div>
{//评论区}
{if (config('taoler.config.is_reply') == 1 ) AND ( $article.is_reply == 0 )}
<div id="commentszbpmy" style="text-align: center;">
<h5>评论已关闭!</h5>
</div>
{/if}
{if session('?user_id') AND (config('taoler.config.is_reply') == 1 ) AND ( $article.is_reply == 1 )}
<div class="comment-respond">
<form class="comment-form">
<div class="layui-form">
<div class="layui-form-item layui-form-text">
<a name="comment"></a>
<div class="comment-textarea mb-3">
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor taonyeditor" style="height: 100px"></textarea>
</div>
</div>
<div class="layui-form-item que-comments">
<input type="hidden" name="article_id" value="{$article.id}" />
<input type="hidden" name="user_id" value="{:session('user_id')}" />
<button class="layui-btn layui-btn-danger" lay-filter="user-comment" lay-submit>{:lang('submit comments')}</button>
</div>
</div>
</form>
</div>
{/if}
</div>
</div>
</section>
</div>
</section>
</div>
<div class="sidebar layui-col-md4 d-none d-lg-block">
<div class="sidebar layui-col-md4 d-none d-lg-block">
<div class="theiaStickySidebar">
{//作者}
<dl class="function" id="rongkeji_User">
@ -248,7 +315,7 @@
<div class="text-muted text-xs"><time class="d-inline-block">{$vo.create_time|date='Y-m-d'}</time>
</div>
</div>
</li>
</li>
{/volist}
</ul>
</dd>
@ -257,7 +324,7 @@
{if count($hotTag) > 0}
<dl class="function" id="rongkeji_retags">
<dt class="function_t">热门标签</dt>
<dd class="function_c">
<dd class="function_c">
<ul>
{volist name="hotTag" id="vo"}
<li><a href="{$vo.url}" rel="tag">{$vo.name}</a></li>
@ -272,20 +339,19 @@
</div>
</div>
</div>
</div>
</div>
{//crud管理模块}
{include file="/public/crud" /}
</main>
</main>
{include file="public/menu" /}
{/block}
{block name="script"}
{:hook('taonyeditor')}
{:hook('taoplayer')}
<script type='text/javascript' src="{$Request.domain}/view/common/blog/js/theme.js"></script>
<script>
var collectionFind = "{:url('Collection/find')}",
@ -312,42 +378,14 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
var id = "{$article.id}";
let LOGIN_URL = "{:url('login/index')}";
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
// 编辑器插件启用状态
if(taonystatus == 0) {
$('.detail-body').each(function(){
var othis = $(this), html = othis.html();
othis.html(fly.content(html));
});
} else {
$(".comment-edit").on('click',function (){
var id = $(this).data('id');
layer.open({
type: 2,
title: '修改',
shade: 0.1,
area: ['600px', '500px'],
content: "{:url('comment/edit')}" + '?id=' + id
});
});
}
//加载评论编辑器
if(taonystatus == 1) {
$(".comment-edit").attr('type','');
}
//tpl模板给发布时间赋值
$('div.detail-hits').children('span.post-time').each(function(){
var othis = $(this), html = othis.html();
var string = laytpl('{{ d.time }}').render({
//time: html
var string = laytpl('{{ d.time }}').render({
time: othis.attr('data')
});
var posttime = layui.util.timeAgo(string, 1);
othis.text(posttime);
//console.log(othis.attr('data'));
});
//文章点赞
@ -393,32 +431,97 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
});
}
});
//评论需要登陆
form.on('submit(user-comment)',function (data){
var index = layer.load(1);
var filed = data.field;
if (uid == -1) {
layer.msg('请先登陆',{icon:5,time:2000},function(){location.href = "{:url('login/index')}"});
} else {
$.ajax({
type: "post",
url: "{:url('article/comment')}",
data: filed,
dataType: "json",
success:function (data) {
if (data.code == 0) {
layer.msg(data.msg,{icon:6,time:2000},function () {
location.reload(true);
});
}else {
layer.open({title:'评论失败',content:data.msg,icon:5,anim:6});
}
// 评论接口
function comment(data){
if (uid == -1) {
layer.msg('请先登陆',{icon:5,time:2000},function(){location.href = "{:url('login/index')}"});
return false;
}
});
var index = layer.load(1);
$.ajax({
type: "post",
url: "{:url('article/comment')}",
data: data,
dataType: "json",
success:function (res) {
layer.close(index);
if (res.code === 0) {
layer.msg(res.msg,{icon:6,time:2000},function () {location.reload(true)});
}else {
layer.open({title:'评论失败',content:res.msg,icon:5,anim:6});
}
}
});
}
// 回复用户
$("span[type='reply']").on('click',function (){
var pid = $(this).attr('data-pid');
var tid = $(this).data('tid');
var html =
'<form class="layui-form user-comment" style="margin-left:50px;">' +
'<div>' +
'<input type="hidden" name="article_id" value="{$article.id}">' +
'<input name="pid" value="'+ pid +'" class="layui-hide">' +
'<input name="to_user_id" value="'+ tid +'" class="layui-hide">' +
'<textarea name="content" required lay-verify="required" class="layui-textarea fly-editor taonyeditor" style="height: 100px; right: 5px; margin: 10px 5px;"></textarea>' +
'<button type="submit" class="layui-btn" lay-submit lay-filter="submit-user-comment">提交</button>' +
'</div>' +
'</form>';
var forms = $(this).nextAll('form');
if(forms.length == 0) {
// 移除其它评论块
$('.user-comment').remove();
//动态添加评论块
$(this).next().after(html);
}
})
// 评论
form.on('submit(user-comment)',function (data){
comment(data.field);
});
//提交回复
form.on('submit(submit-user-comment)', function(data){
comment(data.field);
return false;
})
// 编辑器插件启用状态
if(taonystatus == 0) {
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
$('.detail-body').each(function(){
var othis = $(this), html = othis.html();
othis.html(fly.content(html));
});
} else {
// 编辑评论
$(".comment-edit").on('click', function () {
var id = $(this).data('id');
layer.open({
type: 2,
title: '修改',
shade: 0.1,
area: ['600px', '500px'],
content: "{:url('comment/edit')}" + '?id=' + id
});
});
// 删除评论
$(".comment-del").on('click', function () {
var id = $(this).data('id');
layer.confirm('需要删除吗?', {icon: 3}, function (){
$.post("{:url('comment/jiedaDelete')}", {id: id}, function (res) {
if (res.status === 0) {
toast.success({title: "成功消息", message: res.msg});
location.reload(true);
} else {
toast.error({title: "失败消息", message: res.msg});
}
})
})
});
}
return false;
});
// 评论分页
laypage.render({
@ -479,6 +582,10 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
});
</script>
{:hook('taonyeditor')}
{:hook('taoplayer')}
{:hook('taoplyr')}
{/block}

View File

@ -202,19 +202,20 @@
//编辑文章
form.on('submit(article-edit)', function(data){
var field = data.field;
var field = data.field;
var loadIndex = layer.load(2);
$.ajax({
type:"post",
url:"{:url('article/edit')}",
data: field,
daType:"json",
success:function (data){
if (data.code == 0) {
notify.success(data.msg, function(){
location.href = data.url;
});
success:function (res){
layer.close(loadIndex);
if (res.code === 0) {
toast.success({title:"成功消息",message: res.msg});
location.href = res.url;
} else {
notify.error(data.msg);
toast.error({title:"失败消息",message:res.msg});
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
}
}

View File

@ -52,7 +52,6 @@
<span class="layui-btn layui-btn-xs guanzhu" >关注</span>
</div>
<div class="detail-hits">
<!--span style="padding-right: 10px; color: #FF7200">悬赏60飞吻</span-->
<span class="post-time" data="{$article.create_time}" style="padding-top: 5px;"></span>
{:hook('ipShow',$article.user.city)}
</div>
@ -107,7 +106,7 @@
<div class="layui-form-item layui-form-text">
<a name="comment"></a>
<div class="layui-input-block">
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor"></textarea>
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor taonyeditor"></textarea>
</div>
</div>
<div class="layui-form-item">
@ -145,6 +144,7 @@
<div class="detail-body jieda-body photos">{comment:content /}</div>
<div class="jieda-reply">
{eq name="comment.delete_time" value="0"}
<span class="jieda-zan {if($comment.zan != 0)}zanok{/if}" type="zan">
<i class="iconfont icon-zan"></i><em>{comment:zan /}</em>
</span>
@ -153,9 +153,10 @@
<div class="jieda-admin">
{if ((session('user_id') == $comment.user_id) && (getLimtTime($comment.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{comment:id /}">{:lang('edit')}</span>
<span type="del">{:lang('delete')}</span>
<span type="del" class="comment-del" data-id="{comment:id /}">{:lang('delete')}</span>
{/if}
</div>
{/eq}
{// 第二层回复}
{notempty name="$comment.children"}
@ -167,17 +168,19 @@
<div>{$vo.user.name} {$vo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
<div class="jieda-reply">
{eq name="vo.delete_time" value="0"}
<span class="jieda-zan {if($vo.zan != 0)}zanok{/if}" type="zan">
<i class="iconfont icon-zan"></i><em>{$vo.zan}</em>
</span>
<span type="reply" data-pid="{$vo.id}" data-tid="{$vo.user.id}"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论编辑删除采纳权限}
<div class="jieda-admin">
{if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{$vo.id}">{:lang('edit')}</span>
<span type="del">{:lang('delete')}</span>
{/if}
</div>
<span type="reply" data-pid="{$vo.id}" data-tid="{$vo.user.id}"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论编辑删除采纳权限}
<div class="jieda-admin">
{if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{$vo.id}">{:lang('edit')}</span>
<span type="del" class="comment-del" data-id="{$vo.id}" >{:lang('delete')}</span>
{/if}
</div>
{/eq}
</div>
</div>
@ -192,17 +195,19 @@
<div>{$voo.user.name} 回复 {$voo.touser} {$voo.create_time|date='Y-m-d H:i'}</div>
<div class="detail-body jieda-body photos">{$voo.content|raw}</div>
<div class="jieda-reply">
<span class="jieda-zan {if($voo.zan != 0)}zanok{/if}" type="zan">
<i class="iconfont icon-zan"></i><em>{$voo.zan}</em>
</span>
<span type="reply" data-pid="{$vo.id}" data-tid="{$voo.user.id}"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论编辑删除采纳权限}
<div class="jieda-admin">
{if ((session('user_id') == $voo.user.id) && (getLimtTime($voo.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{$voo.id}">{:lang('edit')}</span>
<span type="del">{:lang('delete')}</span>
{/if}
</div>
{eq name="voo.delete_time" value="0"}
<span class="jieda-zan {if($voo.zan != 0)}zanok{/if}" type="zan">
<i class="iconfont icon-zan"></i><em>{$voo.zan}</em>
</span>
<span type="reply" data-pid="{$vo.id}" data-tid="{$voo.user.id}"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
{//评论编辑删除采纳权限}
<div class="jieda-admin">
{if ((session('user_id') == $voo.user.id) && (getLimtTime($voo.create_time) < 2)) OR ($user.auth ?? '')}
<span type="edit" class="comment-edit" data-id="{$voo.id}">{:lang('edit')}</span>
<span type="del" class="comment-del" data-id="{$voo.id}">{:lang('delete')}</span>
{/if}
</div>
{/eq}
</div>
</div>
</div>
@ -213,17 +218,19 @@
{/notempty}
</div>
{else /}
<div class="detail-body jieda-body photos">
<i class="layui-icon layui-icon-password" style="font-size: 24px; color: #FF5722;"></i>
评论解密后查看
</div>
<div class="detail-body jieda-body photos">
<i class="layui-icon layui-icon-password" style="font-size: 24px; color: #FF5722;"></i>
评论解密后查看
</div>
{/if}
</div>
</li>
{/article:comment}
</ul>
<div style="text-align: center" id="pages"></div>
</div>
</div>
{//右栏}
@ -294,36 +301,14 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
var id = "{$article.id}";
let LOGIN_URL = "{:url('login/index')}";
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
// 编辑器插件启用状态
if(taonystatus == 0) {
$('.detail-body').each(function(){
var othis = $(this), html = othis.html();
othis.html(fly.content(html));
});
} else {
$(".comment-edit").on('click',function (){
var id = $(this).data('id');
layer.open({
type: 2,
title: '修改',
shade: 0.1,
area: ['600px', '500px'],
content: "{:url('comment/edit')}" + '?id=' + id
});
});
}
//tpl模板给发布时间赋值
$('div.detail-hits').children('span.post-time').each(function(){
var othis = $(this), html = othis.html();
var string = laytpl('{{ d.time }}').render({
//time: html
time: othis.attr('data')
});
var posttime = layui.util.timeAgo(string, 1);
othis.text(posttime);
//console.log(othis.attr('data'));
});
//文章点赞
@ -334,7 +319,7 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
return false;
}
$.post("{:url('article/userZanArticle')}",{article_id:id,type:1},function(data){
if(data.code == 0){
if(data.code === 0){
layer.msg(data.msg,{icon:6,time:2000},function () {
location.reload(true);
});
@ -359,7 +344,7 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
data:{id: id,title_color: color},
dataType:'json',
success:function(data){
if(data.code == 0){
if(data.code === 0){
layer.msg(data.msg,{icon:6,time:2000
});
} else {
@ -392,11 +377,6 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
}
});
}
// 评论
form.on('submit(user-comment)',function (data){
comment(data.field);
});
// 回复用户
$("span[type='reply']").on('click',function (){
@ -420,12 +400,52 @@ layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
$(this).next().after(html);
}
})
// 评论
form.on('submit(user-comment)',function (data){
comment(data.field);
});
//提交回复
form.on('submit(submit-user-comment)', function(data){
comment(data.field);
return false;
})
// 编辑器插件启用状态
if(taonystatus == 0) {
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
$('.detail-body').each(function(){
var othis = $(this), html = othis.html();
othis.html(fly.content(html));
});
} else {
// 编辑评论
$(".comment-edit").on('click', function () {
var id = $(this).data('id');
layer.open({
type: 2,
title: '修改',
shade: 0.1,
area: ['600px', '500px'],
content: "{:url('comment/edit')}" + '?id=' + id
});
});
// 删除评论
$(".comment-del").on('click', function () {
var id = $(this).data('id');
layer.confirm('需要删除吗?', {icon: 3}, function (){
$.post("{:url('comment/jiedaDelete')}", {id: id}, function (res) {
if (res.status === 0) {
toast.success({title: "成功消息", message: res.msg});
location.reload(true);
} else {
toast.error({title: "失败消息", message: res.msg});
}
})
})
});
}
// 评论分页
laypage.render({
elem: "pages", //注意,这里的 test1 是 ID不用加 # 号

View File

@ -7,7 +7,7 @@
</head>
<body>
<form class="layui-form" action="">
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor">{$comment.content}</textarea>
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor taonyeditor">{$comment.content}</textarea>
<div class="bottom">
<div class="button-container">
<input type="text" name="id" value="{$comment.id}" class="layui-input layui-hide"/>

View File

@ -74,18 +74,19 @@
<script>
$(function() {
$('#login').click(function() {
var loadIndex = layer.load(2);
$.ajax({
type:"post",
url:"{:url('login/index')}",
data:$('form').serialize(),
daType:"json",
success:function (data){
if (data.code == 0) {
notify.success(data.msg,function(){
location.href = data.url;
})
success:function (res){
layer.close(loadIndex);
if (res.code === 0) {
toast.success({title:"成功消息",message: res.msg});
location.href = res.url;
} else {
notify.error(data.msg);
toast.error({title:"失败消息",message:res.msg});
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
}
}

View File

@ -87,9 +87,9 @@
{block name="script"}
<script>
layui.use(['form','layer'],function(){
var $ = layui.jquery;
var form = layui.form;
var layer = layui.layer;
var $ = layui.jquery;
var form = layui.form;
var layer = layui.layer;
//注册
form.on('submit(user-register)', function(data){
var field = data.field;
@ -101,40 +101,34 @@ var layer = layui.layer;
url:"{:url('Login/reg')}",
data:field,
dataType:"json",
success:function(data){
if(data.code == 0){
layer.close(loading);
layer.msg(data.msg,{icon:6,tiye:2000},function(){
location.href = data.url;
});
success:function(res){
layer.close(loading);
if(res.code === 0){
toast.success({title:"成功消息",message: res.msg});
location.href = res.url;
} else {
layer.close(loading);
layer.open({title:"注册失败",content:data.msg,icon:5,anim:6});
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
$('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
}}
});
return false;
});
//表单取值
layui.$('#LAY-component-form-getval').on('click', function(){
$('#LAY-component-form-getval').on('click', function(){
var loadIndex = layer.load(2);
var data = form.val('register');
//console.log(data);
// var email = $("#L_email").val();
// console.log(email);
//alert(JSON.stringify(data));
$.post("{:url('Login/sentMailCode')}",{"email": data.email}, function(res){
if(res.code == 0){
layer.msg(res.msg,{icon:6,tiye:2000});
layer.close(loadIndex);
if(res.code === 0){
toast.success({title:"成功消息",message: res.msg});
} else {
layer.open({title:"发送失败",content:res.msg,icon:5,anim:6});
}
})
});
});
</script>
{/block}

View File

@ -30,12 +30,14 @@
{block name="meta"}{/block}
<script src="/static/jquery-3.6.0.min.js"></script>
<script src="{$Request.domain}/static/layui/layui.js" charset="utf-8"></script>
<script src="/static/res/mods/toast.js"></script>
<script src="/static/notify.js"></script>
<!-- 样式 -->
<link rel="canonical" href="{$Request.domain}{$Request.url}">
<link rel="stylesheet" href="{$Request.domain}/static/res/css/font_24081_qs69ykjbea.css" />
<link rel="stylesheet" href="{$Request.domain}/static/layui/css/layui.css">
<link rel="stylesheet" href="{$Request.domain}/static/res/css/global.css">
<link rel="stylesheet" href="/static/component/pear/css/module/toast.css">
{block name="link"}{/block}
<script src="/static/share/plusShare.js" type="text/javascript" charset="utf-8"></script>
{$sysInfo.showlist|raw}
@ -48,6 +50,7 @@
{include file="public/js" /}
<script>
var element = layui.element;
var toast = layui.toast;
var notify = layui.notify;
layui.cache.page = "{$jspage}";
layui.cache.user = {

View File

@ -48,15 +48,15 @@
</li>
<!-- 未登入的状态 -->
{else /}
<li class="layui-nav-item"><a class="iconfont icon-touxiang" href="{:url('user_login')}"></a></li>
<li class="layui-nav-item"><a class="layui-icon layui-icon-username" style="font-size: 20px;" href="{:url('user_login')}"></a></li>
<li class="layui-nav-item layui-hide-xs"><a href="{:url('user_login')}">{:lang('login')}</a></li>
<li class="layui-nav-item layui-hide-xs"><a href="{:url('user_reg')}">{:lang('register')}</a></li>
<li class="layui-nav-item layui-hide-xs layui-hide">
<select name="language" style="width:50px;" lay-filter="language" lay-verify="" id="language">
<option value="cn" {if cookie('think_lang') == 'zh-cn'} selected {/if} >{:lang('chinese')}</option>
<option value="tw" {if cookie('think_lang') == 'zh-tw'} selected {/if} >{:lang('tChinese')}</option>
<option value="en" {if cookie('think_lang') == 'en-us'} selected {/if} >{:lang('english')}</option>
</select>
<select name="language" style="width:50px;" lay-filter="language" lay-verify="" id="language">
<option value="cn" {if cookie('think_lang') == 'zh-cn'} selected {/if} >{:lang('chinese')}</option>
<option value="tw" {if cookie('think_lang') == 'zh-tw'} selected {/if} >{:lang('tChinese')}</option>
<option value="en" {if cookie('think_lang') == 'en-us'} selected {/if} >{:lang('english')}</option>
</select>
</li>
{/if}
</ul>