diff --git a/app/admin/controller/Seo.php b/app/admin/controller/Seo.php index 2813de6..88064f7 100644 --- a/app/admin/controller/Seo.php +++ b/app/admin/controller/Seo.php @@ -2,7 +2,7 @@ /* * @Author: TaoLer * @Date: 2022-04-13 09:54:31 - * @LastEditTime: 2022-04-27 14:20:06 + * @LastEditTime: 2022-04-29 17:24:47 * @LastEditors: TaoLer * @Description: 搜索引擎SEO优化设置 * @FilePath: \TaoLer\app\admin\controller\Seo.php @@ -316,28 +316,74 @@ class Seo extends AdminController public function searchLog() { $time = input('search_time'); + $name = input('spider_name'); $logPath = app()->getRootPath().'runtime/log/browse/'.$time.'.log'; $logPath = str_replace('\\','/',$logPath); - if(!file_exists($logPath)) return json(['code'=>-1,'msg'=>'还没有要分析的日志哦']); + if(!file_exists($logPath)) { + return json(['code'=>-1,'msg'=>'还没有要分析的日志哦!']); + } $log = file_get_contents($logPath); $log = preg_replace('/\[info\][^\n]*compatible;/', '', $log); - - // 正则蜘蛛 - preg_match_all('/(.*?)(?:bingbot|Googlebot|Baiduspider|SemrushBot|AhrefsBot|MJ12bot)+[^\n]*\r?\n/',$log,$arr); - - $string = ''; - foreach($arr[0] as $str) { - $str = preg_replace('/\[(.*?)T/', '', $str); - $str = preg_replace('/\+08:00\]/', '', $str); - $string .= preg_replace('/\/(.*?)\)/', '', $str); + + switch($name) { + case 'Baiduspider': + preg_match_all('/(.*?)(?:Baiduspider)+[^\n]*\r?\n/',$log,$arr); + break; + case 'Bytespider': + preg_match_all('/(.*?)(?:Bytespider)+[^\n]*\r?\n/',$log,$arr); + break; + case 'Googlebot': + preg_match_all('/(.*?)(?:Googlebot)+[^\n]*\r?\n/',$log,$arr); + break; + case 'bingbot': + preg_match_all('/(.*?)(?:bingbot)+[^\n]*\r?\n/',$log,$arr); + break; + default: + // 正则全部蜘蛛 + preg_match_all('/(.*?)(?:bingbot|Googlebot|Baiduspider|Bytespider|SemrushBot|AhrefsBot|MJ12bot)+[^\n]*\r?\n/',$log,$arr); } - if(strlen($string)) { - return json(['code'=>0,'msg'=>'分析成功','data'=>$string]); + // $string = ''; + // foreach($arr[0] as $str) { + // $str = preg_replace('/\[(.*?)T/', '', $str); + // $str = preg_replace('/\+08:00\]/', '', $str); + // $string .= preg_replace('/\/(.*?)\)/', '', $str); + // } + + // if(strlen($string)) { + // return json(['code'=>0,'msg'=>'分析成功','data'=>$string]); + // } else { + // return json(['code'=>-1,'msg'=>'还没有蜘蛛来哦']); + // } + $list = []; + if(count($arr[0])) { + $list['code']= 0; + $list['msg'] = '分析成功'; + $list['count'] = count($arr[0]); + foreach($arr[0] as $k =>$str) { + // $str = preg_replace('/\[(.*?)T/', '', $str); + // $str = preg_replace('/\+08:00\]/', '', $str); + // 时间 + $str = preg_replace('/\/(.*?)\)/', '', $str); + $ptime = "/([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/"; + preg_match($ptime, $str,$at); + $time = str_replace('T',' ',$at[0]); + //$list[$k]['time'] = $time; + // ip + $pip = '/(?:(?:2[0-4][0-9]\.)|(?:25[0-5]\.)|(?:1[0-9][0-9]\.)|(?:[1-9][0-9]\.)|(?:[0-9]\.)){3}(?:(?:2[0-5][0-5])|(?:25[0-5])|(?:1[0-9][0-9])|(?:[1-9][0-9])|(?:[1-9]))/'; + preg_match($pip, $str,$aip); + $ip = $aip[0]; + // url + $pattern="/(http|https):\/\/.*$/i"; + preg_match($pattern, $str,$url); + + $list['data'][] = ['id'=>$k + 1, 'time'=>$time, 'name'=>$name, 'ip'=>$ip, 'url'=>$url[0]]; + } + return json($list); } else { - return json(['code'=>-1,'msg'=>'还没有蜘蛛来哦']); + return json(['code'=>-1,'msg'=> '没有需要分析的数据']); } - + } } \ No newline at end of file diff --git a/app/admin/view/seo/index.html b/app/admin/view/seo/index.html index dd20fa9..f747afa 100644 --- a/app/admin/view/seo/index.html +++ b/app/admin/view/seo/index.html @@ -186,6 +186,18 @@ +
+ +
+ +
+
@@ -194,8 +206,10 @@
+
- +
+
@@ -218,11 +232,12 @@ base: '/static/admin/' //静态资源所在路径 }).extend({ index: 'lib/index' //主入口模块 - }).use(['index', 'laydate'], function(){ + }).use(['index', 'laydate', 'table'], function(){ var $ = layui.$ ,form = layui.form var element =layui.element ; var laydate = layui.laydate; + var table = layui.table; //执行一个laydate实例 laydate.render({ @@ -232,6 +247,21 @@ ,value: new Date() }); + //第一个实例 + table.render({ + elem: '#spider' + ,url: "{:url('seo/searchLog')}" //数据接口 + ,page: true //开启分页 + ,cols: [[ //表头 + {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'} + ,{field: 'time', title: '时间', width:160} + ,{field: 'name', title: '名称', width:120, sort: true} + ,{field: 'ip', title: 'IP', width:200} + ,{field: 'url', title: 'URL', minWidth: 200} + ]] + ,text: '对不起,加载出现异常!' + }); + // baidu push form.on('submit(search_push)', function(data){ var field = data.field; @@ -328,12 +358,15 @@ $.post("{:url('seo/searchLog')}",field,function(res){ if(res.code == 0){ layer.msg(res.msg,{icon:6,tiye:2000},function(){ - $("textarea[name='search_list']").html(res.data); - //location.reload(); + //$("textarea[name='search_list']").html(res.data); }); } else { layer.open({title:"添加失败",content:res.msg,icon:5,anim:6}); } + //执行重载 + table.reload('spider', { + where: field + }); }); return false; }); diff --git a/app/common/model/User.php b/app/common/model/User.php index a6dced7..b69b0a9 100644 --- a/app/common/model/User.php +++ b/app/common/model/User.php @@ -8,6 +8,7 @@ use think\facade\Cookie; use think\facade\Config; use think\facade\Lang; use app\event\UserLogin; +use taoler\com\Files; class User extends Model { @@ -105,21 +106,27 @@ class User extends Model //注册校验 public function reg($data) - { - //随机存入默认头像 - $code = mt_rand('1','11'); - $data['user_img'] = "/static/res/images/avatar/$code.jpg"; - $data['create_time'] = time(); - $salt = substr(md5($data['create_time']),-6); - $data['password'] = substr_replace(md5($data['password']),$salt,0,6); - $data['status'] = Config::get('taoler.config.regist_check'); - $msg = $data['status'] ? '注册成功请登录' : '注册成功,请等待审核'; - $result = $this->save($data); - if ($result) { - return ['code'=>1,'msg'=>$msg]; - } else{ - return '注册失败'; - } + { + // public/static/res/images/avatar的所有图片 + $images = Files::getAllFile('static/res/images/avatar'); + //随机图片 + $i = array_rand($images); + $img = $images[$i]; + $data['user_img'] = '/'.str_replace('\\','/',$img); + //随机存入默认头像 + // $code = mt_rand('1','11'); + // $data['user_img'] = "/static/res/images/avatar/$code.jpg"; + $data['create_time'] = time(); + $salt = substr(md5($data['create_time']),-6); + $data['password'] = substr_replace(md5($data['password']),$salt,0,6); + $data['status'] = Config::get('taoler.config.regist_check'); + $msg = $data['status'] ? '注册成功请登录' : '注册成功,请等待审核'; + $result = $this->save($data); + if ($result) { + return ['code'=>1,'msg'=>$msg]; + } else{ + return '注册失败'; + } } //重置密码 @@ -155,7 +162,6 @@ class User extends Model $user = $this->find($data['user_id']); $salt = substr(md5($user['create_time']),-6); $pwd = substr_replace(md5($data['nowpass']),$salt,0,6); - //原注册密码加密规则 $data['nowpass'] = md5($pwd); $result = $data['nowpass'] == $user['password']; if(!$result){ diff --git a/composer.lock b/composer.lock index b75fac1..d0aa2c7 100644 --- a/composer.lock +++ b/composer.lock @@ -1602,16 +1602,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.39", + "version": "v4.4.41", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "35237c5e5dcb6593a46a860ba5b29c1d4683d80e" + "reference": "58eb36075c04aaf92a7a9f38ee9a8b97e24eb481" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/35237c5e5dcb6593a46a860ba5b29c1d4683d80e", - "reference": "35237c5e5dcb6593a46a860ba5b29c1d4683d80e", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/58eb36075c04aaf92a7a9f38ee9a8b97e24eb481", + "reference": "58eb36075c04aaf92a7a9f38ee9a8b97e24eb481", "shasum": "" }, "require": { @@ -1671,7 +1671,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.39" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.41" }, "funding": [ { @@ -1687,7 +1687,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T10:38:15+00:00" + "time": "2022-04-25T21:15:06+00:00" }, { "name": "topthink/think-trace", diff --git a/public/static/res/css/global.css b/public/static/res/css/global.css index ff55530..14ced03 100644 --- a/public/static/res/css/global.css +++ b/public/static/res/css/global.css @@ -464,7 +464,7 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co .detail-hits .layui-btn{border-radius: 0;} .detail-hits .layui-btn+.layui-btn{margin-left: 5px;} .detail-hits .jie-admin{margin-right: 1px;} -.detail-body{margin: 10px 0 0; min-height: 306px; line-height: 26px; font-size: 16px; color: #333; word-wrap: break-word;} +.detail-body{margin: 10px 0 0; min-height: 50px; line-height: 26px; font-size: 16px; color: #333; word-wrap: break-word;} .detail-body p{margin-bottom:15px;} .detail-body img{max-width: 100%; cursor: pointer;} /* diff --git a/public/static/res/mods/imgcom.js b/public/static/res/mods/imgcom.js index 08daf8d..0dd9b2b 100644 --- a/public/static/res/mods/imgcom.js +++ b/public/static/res/mods/imgcom.js @@ -10,9 +10,8 @@ var layer = layui.layer; var compressImage = { uploads: function(obj){ //obj.preview(function(index, file, result){ - - //执行实例 - var index = layer.load(1); + + //执行实例 var files = obj.pushFile(); var filesArry = []; for (var key in files) { //将上传的文件转为数组形式 @@ -105,7 +104,7 @@ var compressImage = { //}) } - } + } //输出 imgcom 接口 exports('imgcom', compressImage); }); diff --git a/public/static/res/mods/index.js b/public/static/res/mods/index.js index 304d26f..225b26e 100644 --- a/public/static/res/mods/index.js +++ b/public/static/res/mods/index.js @@ -91,72 +91,300 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'], ,form: {} - //简易编辑器 - ,layEditor: function(options){ - var html = ['
' - ,'' - ,'' - ,'' - ,'' - ,'' - ,'' - ,'' - ,'' - ,'hr' - ,'' - ,'
'].join(''); + //简易编辑器 + ,layEditor: function(options){ + var html = ['
' + ,'' + ,'' + ,'' + ,'' + ,'' + ,'' + ,'' + ,'' + ,'hr' + ,'' + ,'
'].join(''); - var closeTips = function(){ - layer.close(mod.face.index); - }; + var closeTips = function(){ + layer.close(mod.face.index); + }; - var log = {}, mod = { - //加粗 - strong: function(editor){ - var str = window.getSelection().toString(); - if(!str == ''){ - //var strB = ''+ str + ''; - layui.focusInsert(editor[0], '[strong]'+ str + '[/strong]'); - //console.log(str); - // console.log(strB); - } - }, - face: function(editor, self){ //插入表情 - var str = '', ul, face = fly.faces; - for(var key in face){ - str += '
  • '; + var log = {}, mod = { + //加粗 + strong: function(editor){ + var str = window.getSelection().toString(); + if(!str == ''){ + //var strB = ''+ str + ''; + layui.focusInsert(editor[0], '[strong]'+ str + '[/strong]'); + //console.log(str); + // console.log(strB); + } + }, + face: function(editor, self){ //插入表情 + var str = '', ul, face = fly.faces; + for(var key in face){ + str += '
  • '; + } + str = ''; + + layer.close(mod.face.index); + mod.face.index = layer.tips(str, self, { + tips: 3 + ,time: 0 + ,skin: 'layui-edit-face' + ,tipsMore: true + }); + + $(document).off('click', closeTips).on('click', closeTips); + + $('#LAY-editface li').on('click', function(){ + var title = $(this).attr('title') + ' '; + layui.focusInsert(editor[0], 'face' + title); + editor.trigger('keyup'); + }); + } + ,picture: function(editor){ //插入图片 + //判断登陆 + if(uid == -1){ + layer.msg('请登录再发图', {icon: 6}, function(){ + location.href = login; + }) + return false; + } + + layer.open({ + type: 1 + ,id: 'fly-jie-upload' + ,title: '插入图片' + ,area: 'auto' + ,shade: false + //,area: '465px' + ,fixed: false + ,offset: [ + editor.offset().top - $(window).scrollTop() + 'px' + ,editor.offset().left + 'px' + ] + ,skin: 'layui-layer-border' + ,content: [''].join('') + ,success: function(layero, index){ + var image = layero.find('input[name="image"]'); + + //执行上传实例 + upload.render({ + elem: '#uploadImg' + ,accept: 'images' + ,acceptMime: 'image/*' + ,exts: 'jpg|png|gif|bmp|jpeg' + ,url: uploads + ,data: {type:'image'} + ,auto: false + //,bindAction: '#img-button' //指向一个按钮触发上传 + //,field: 'image' + ,size: 10240 + ,choose: function (obj) { //选择文件后的回调 + imgcom.uploads(obj); } - str = ''; + ,done: function(res){ + if(res.status == 0){ + //console.log(res.url); + image.val(res.url); + } else { + layer.msg(res.msg, {icon: 5}); + } + } + ,error: function(){ + layer.msg('系统错误,请联系管理员'); + } + }); - layer.close(mod.face.index); - mod.face.index = layer.tips(str, self, { - tips: 3 - ,time: 0 - ,skin: 'layui-edit-face' - ,tipsMore: true - }); + form.on('submit(uploadImages)', function(data){ + var field = data.field; + if(!field.image) return image.focus(); + layui.focusInsert(editor[0], 'img['+ field.image + '] '); + layer.close(index); + editor.trigger('keyup'); + }); + } + }); + } + ,href: function(editor){ //超链接 + layer.prompt({ + title: '请输入合法链接' + ,shade: false + ,fixed: false + ,id: 'LAY_flyedit_href' + ,offset: [ + editor.offset().top - $(window).scrollTop() + 1 + 'px' + ,editor.offset().left + 1 + 'px' + ] + }, function(val, index, elem){ + if(!/^http(s*):\/\/[\S]/.test(val)){ + layer.tips('请务必 http 或 https 开头', elem, {tips:1}) + return; + } + layui.focusInsert(editor[0], ' a('+ val +')['+ val + '] '); + layer.close(index); + editor.trigger('keyup'); + }); + } + ,quote: function(editor){ //引用 + layer.prompt({ + title: '请输入引用内容' + ,formType: 2 + ,maxlength: 10000 + ,shade: false + ,id: 'LAY_flyedit_quote' + ,offset: [ + editor.offset().top - $(window).scrollTop() + 1 + 'px' + ,editor.offset().left + 1 + 'px' + ] + ,area: ['300px', '100px'] + }, function(val, index, elem){ + layui.focusInsert(editor[0], '[quote]\n '+ val + '\n[/quote]\n'); + layer.close(index); + editor.trigger('keyup'); + }); + } + ,code: function(editor){ //插入代码 + layer.prompt({ + title: '请贴入代码' + ,formType: 2 + ,maxlength: 10000 + ,shade: false + ,id: 'LAY_flyedit_code' + ,area: ['800px', '360px'] + }, function(val, index, elem){ + layui.focusInsert(editor[0], '[pre]\n'+ val + '\n[/pre]\n'); + layer.close(index); + editor.trigger('keyup'); + }); + } + ,hr: function(editor){ //插入水平分割线 + layui.focusInsert(editor[0], '[hr]\n'); + editor.trigger('keyup'); + } + ,video: function(editor){ //插入视频 + //判断登陆 + if(uid == -1){ + layer.msg('请登录再发视频', {icon: 6}, function(){ + location.href = login; + }) + return false; + } + layer.open({ + type: 1 + ,id: 'fly-jie-video-upload' + ,title: '插入视频' + ,area: 'auto' + ,shade: false + //,area: '465px' + ,fixed: false + ,offset: [ + editor.offset().top - $(window).scrollTop() + 'px' + ,editor.offset().left + 'px' + ] + ,skin: 'layui-layer-border' + ,content: [''].join('') + ,success: function(layero, index){ + var video = layero.find('input[name="video"]'), cover = layero.find('input[name="cover"]'); - $(document).off('click', closeTips).on('click', closeTips); - - $('#LAY-editface li').on('click', function(){ - var title = $(this).attr('title') + ' '; - layui.focusInsert(editor[0], 'face' + title); - editor.trigger('keyup'); - }); + //上传视频 + upload.render({ + url: uploads + ,data: {type:'video'} + ,accept: 'video' + ,acceptMime: 'video/mp4' + ,exts: 'mp4' + ,elem: '#layedit-video' + ,before: function(obj){ //obj参数包含的信息,跟 choose回调完全一致,可参见上文。 + layer.load(2); //上传loading + } + ,done: function(res){ + if(res.status == 0){ + video.val(res.url); + } else { + layer.msg(res.msg, {icon: 5}); + } + layer.closeAll('loading'); + } + }); + //上传图片 + upload.render({ + elem: '#video-img' + ,accept: 'images' + ,acceptMime: 'image/*' + ,exts: 'jpg|png|gif|bmp|jpeg' + ,url: uploads + ,data: {type:'image'} + ,auto: false + //,bindAction: '#img-button' //指向一个按钮触发上传 + //,field: 'image' + ,size: 10240 + ,choose: function (obj) { //选择文件后的回调 + imgcom.uploads(obj); + } + ,done: function(res){ + if(res.status == 0){ + cover.val(res.url); + } else { + layer.msg(res.msg, {icon: 5}); + } + } + ,error: function(){ + layer.msg('系统错误,请联系管理员'); + } + }); + form.on('submit(uploadImages)', function(data){ + var field = data.field; + if(!field.video) return video.focus(); + layui.focusInsert(editor[0], 'video('+field.cover+')['+ field.video + '] '); + layer.close(index); + }); } - ,picture: function(editor){ //插入图片 - //判断登陆 - if(uid == -1){ - layer.msg('请登录再发图', {icon: 6}, function(){ - location.href = login; - }) - return false; - } - + }); + } + ,audio: function(editor){ //插入音频 + //判断登陆 + if(uid == -1){ + layer.msg('请登录再发布', {icon: 6}, function(){ + location.href = login; + }) + return false; + } layer.open({ type: 1 - ,id: 'fly-jie-upload' - ,title: '插入图片' + ,id: 'fly-jie-audio-upload' + ,title: '插入音频' ,area: 'auto' ,shade: false //,area: '465px' @@ -170,440 +398,211 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'], ,'
  • ' ,'' ,'
    ' - ,'' + ,'' ,'
    ' - ,'' + ,'' ,'
  • ' ,'
  • ' - ,'' + ,'' ,'
  • ' ,''].join('') ,success: function(layero, index){ - var image = layero.find('input[name="image"]'); + var loding,audio = layero.find('input[name="audio"]'); - //执行上传实例 upload.render({ - elem: '#uploadImg' - ,accept: 'images' - ,acceptMime: 'image/*' - ,exts: 'jpg|png|gif|bmp|jpeg' - ,url: uploads - ,data: {type:'image'} - ,auto: false - //,bindAction: '#img-button' //指向一个按钮触发上传 - //,field: 'image' - ,size: 10240 - ,choose: function (obj) { //选择文件后的回调 - imgcom.uploads(obj); + url: uploads + ,data: {type:'audio'} + ,elem: '#fly-jie-audio-upload .upload-audio' + ,accept: 'audio' + ,acceptMime: 'audio/*' + ,exts: 'mp3|m4a' + ,before: function(obj){ + //loding = layer.msg('文件上传中,请稍等哦', { icon: 16 ,shade:0.3,time:0 }); + layer.load(2); //上传loading } - ,done: function(res){ + if(res.status == 0){ - //console.log(res.url); - image.val(res.url); + audio.val(res.url); } else { layer.msg(res.msg, {icon: 5}); } - } - ,error: function(){ - layer.msg('系统错误,请联系管理员'); + layer.closeAll('loading'); } }); - form.on('submit(uploadImages)', function(data){ - var field = data.field; - if(!field.image) return image.focus(); - layui.focusInsert(editor[0], 'img['+ field.image + '] '); + var field = data.field; + if(!field.audio) return audio.focus(); + layui.focusInsert(editor[0], 'audio['+ field.audio + '] '); layer.close(index); - editor.trigger('keyup'); }); } }); - } - ,href: function(editor){ //超链接 - layer.prompt({ - title: '请输入合法链接' - ,shade: false - ,fixed: false - ,id: 'LAY_flyedit_href' - ,offset: [ - editor.offset().top - $(window).scrollTop() + 1 + 'px' - ,editor.offset().left + 1 + 'px' - ] - }, function(val, index, elem){ - if(!/^http(s*):\/\/[\S]/.test(val)){ - layer.tips('请务必 http 或 https 开头', elem, {tips:1}) - return; - } - layui.focusInsert(editor[0], ' a('+ val +')['+ val + '] '); - layer.close(index); - editor.trigger('keyup'); - }); - } - ,quote: function(editor){ //引用 - layer.prompt({ - title: '请输入引用内容' - ,formType: 2 - ,maxlength: 10000 - ,shade: false - ,id: 'LAY_flyedit_quote' - ,offset: [ - editor.offset().top - $(window).scrollTop() + 1 + 'px' - ,editor.offset().left + 1 + 'px' - ] - ,area: ['300px', '100px'] - }, function(val, index, elem){ - layui.focusInsert(editor[0], '[quote]\n '+ val + '\n[/quote]\n'); - layer.close(index); - editor.trigger('keyup'); - }); - } - ,code: function(editor){ //插入代码 - layer.prompt({ - title: '请贴入代码' - ,formType: 2 - ,maxlength: 10000 - ,shade: false - ,id: 'LAY_flyedit_code' - ,area: ['800px', '360px'] - }, function(val, index, elem){ - layui.focusInsert(editor[0], '[pre]\n'+ val + '\n[/pre]\n'); - layer.close(index); - editor.trigger('keyup'); - }); - } - ,hr: function(editor){ //插入水平分割线 - layui.focusInsert(editor[0], '[hr]\n'); - editor.trigger('keyup'); - } - ,video: function(editor){ //插入视频 - //判断登陆 - if(uid == -1){ - layer.msg('请登录再发视频', {icon: 6}, function(){ - location.href = login; - }) - return false; - } - layer.open({ - type: 1 - ,id: 'fly-jie-video-upload' - ,title: '插入视频' - ,area: 'auto' - ,shade: false - //,area: '465px' - ,fixed: false - ,offset: [ - editor.offset().top - $(window).scrollTop() + 'px' - ,editor.offset().left + 'px' - ] - ,skin: 'layui-layer-border' - ,content: [''].join('') - ,success: function(layero, index){ - var video = layero.find('input[name="video"]'), cover = layero.find('input[name="cover"]'); + } + ,preview: function(editor, span){ //预览 + var othis = $(span), getContent = function(){ + var content = editor.val(); + return /^\{html\}/.test(content) + ? content.replace(/^\{html\}/, '') + : fly.content(content) + }, isMobile = device.ios || device.android; - //上传视频 - upload.render({ - url: uploads - ,data: {type:'video'} - ,accept: 'video' - ,acceptMime: 'video/mp4' - ,exts: 'mp4' - ,elem: '#layedit-video' - ,before: function(obj){ //obj参数包含的信息,跟 choose回调完全一致,可参见上文。 - layer.load(2); //上传loading - } - ,done: function(res){ - if(res.status == 0){ - video.val(res.url); - } else { - layer.msg(res.msg, {icon: 5}); - } - layer.closeAll('loading'); - } - }); - //上传图片 - upload.render({ - elem: '#video-img' - ,accept: 'images' - ,acceptMime: 'image/*' - ,exts: 'jpg|png|gif|bmp|jpeg' - ,url: uploads - ,data: {type:'image'} - ,auto: false - //,bindAction: '#img-button' //指向一个按钮触发上传 - //,field: 'image' - ,size: 10240 - ,choose: function (obj) { //选择文件后的回调 - imgcom.uploads(obj); - } - ,done: function(res){ - if(res.status == 0){ - cover.val(res.url); - } else { - layer.msg(res.msg, {icon: 5}); - } + if(mod.preview.isOpen) return layer.close(mod.preview.index); + + mod.preview.index = layer.open({ + type: 1 + ,title: '预览' + ,shade: false + ,offset: 'r' + ,id: 'LAY_flyedit_preview' + ,area: [ + isMobile ? '100%' : '775px' + ,'100%' + ] + ,scrollbar: isMobile ? false : true + ,anim: -1 + ,isOutAnim: false + ,content: '
    '+ getContent() +'
    ' + ,success: function(layero){ + editor.on('keyup', function(val){ + layero.find('.detail-body').html(getContent()); + }); + mod.preview.isOpen = true; + othis.addClass('layui-this'); + } + ,end: function(){ + delete mod.preview.isOpen; + othis.removeClass('layui-this'); + } + }); + } +}; + + layui.use('face', function(face){ + options = options || {}; + fly.faces = face; + $(options.elem).each(function(index){ + var that = this, othis = $(that), parent = othis.parent(); + parent.prepend(html); + parent.find('.fly-edit span').on('click', function(event){ + var type = $(this).attr('type'); + mod[type].call(that, othis, this); + if(type === 'face'){ + event.stopPropagation() } - ,error: function(){ - layer.msg('系统错误,请联系管理员'); - } - }); - form.on('submit(uploadImages)', function(data){ - var field = data.field; - if(!field.video) return video.focus(); - layui.focusInsert(editor[0], 'video('+field.cover+')['+ field.video + '] '); - layer.close(index); - }); - } - }); - } - ,audio: function(editor){ //插入音频 - //判断登陆 - if(uid == -1){ - layer.msg('请登录再发布', {icon: 6}, function(){ - location.href = login; - }) - return false; - } - layer.open({ - type: 1 - ,id: 'fly-jie-audio-upload' - ,title: '插入音频' - ,area: 'auto' - ,shade: false - //,area: '465px' - ,fixed: false - ,offset: [ - editor.offset().top - $(window).scrollTop() + 'px' - ,editor.offset().left + 'px' - ] - ,skin: 'layui-layer-border' - ,content: [''].join('') - ,success: function(layero, index){ - var loding,audio = layero.find('input[name="audio"]'); + }); + }); + }); - upload.render({ - url: uploads - ,data: {type:'audio'} - ,elem: '#fly-jie-audio-upload .upload-audio' - ,accept: 'audio' - ,acceptMime: 'audio/*' - ,exts: 'mp3|m4a' - ,before: function(obj){ - //loding = layer.msg('文件上传中,请稍等哦', { icon: 16 ,shade:0.3,time:0 }); - layer.load(2); //上传loading - } - ,done: function(res){ - - if(res.status == 0){ - audio.val(res.url); - } else { - layer.msg(res.msg, {icon: 5}); - } - layer.closeAll('loading'); - } - }); - form.on('submit(uploadImages)', function(data){ - var field = data.field; - if(!field.audio) return audio.focus(); - layui.focusInsert(editor[0], 'audio['+ field.audio + '] '); - layer.close(index); - }); - } - }); - } - ,preview: function(editor, span){ //预览 - var othis = $(span), getContent = function(){ - var content = editor.val(); - return /^\{html\}/.test(content) - ? content.replace(/^\{html\}/, '') - : fly.content(content) - }, isMobile = device.ios || device.android; + } - if(mod.preview.isOpen) return layer.close(mod.preview.index); - - mod.preview.index = layer.open({ - type: 1 - ,title: '预览' - ,shade: false - ,offset: 'r' - ,id: 'LAY_flyedit_preview' - ,area: [ - isMobile ? '100%' : '775px' - ,'100%' - ] - ,scrollbar: isMobile ? false : true - ,anim: -1 - ,isOutAnim: false - ,content: '
    '+ getContent() +'
    ' - ,success: function(layero){ - editor.on('keyup', function(val){ - layero.find('.detail-body').html(getContent()); - }); - mod.preview.isOpen = true; - othis.addClass('layui-this'); - } - ,end: function(){ - delete mod.preview.isOpen; - othis.removeClass('layui-this'); - } - }); - } - }; - - layui.use('face', function(face){ - options = options || {}; - fly.faces = face; - $(options.elem).each(function(index){ - var that = this, othis = $(that), parent = othis.parent(); - parent.prepend(html); - parent.find('.fly-edit span').on('click', function(event){ - var type = $(this).attr('type'); - mod[type].call(that, othis, this); - if(type === 'face'){ - event.stopPropagation() - } - }); - }); - }); - - } - - ,escape: function(html){ - return String(html||'').replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&') - .replace(//g, '>').replace(/'/g, ''').replace(/"/g, '"'); - } + ,escape: function(html){ + return String(html||'').replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&') + .replace(//g, '>').replace(/'/g, ''').replace(/"/g, '"'); + } //内容转义 - ,content: function(content){ - var util = fly - ,item = fly.faces; + ,content: function(content){ + var util = fly + ,item = fly.faces; - //支持的html标签 - var html = function(end){ - return new RegExp('\\n*\\|\\-'+ (end||'') +'(div|span|p|button|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)\\-\\|\\n*', 'g'); - }; + //支持的html标签 + var html = function(end){ + return new RegExp('\\n*\\|\\-'+ (end||'') +'(div|span|p|button|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)\\-\\|\\n*', 'g'); + }; - //XSS - content = util.escape(content||'') + //XSS + content = util.escape(content||'') - //转义图片 - .replace(/img\[([^\s]+?)\]/g, function(img){ - return ''; - }) + //转义图片 + .replace(/img\[([^\s]+?)\]/g, function(img){ + return '
    '; + }) - //转义@ - .replace(/@(\S+)(\s+?|$)/g, '@$1$2') + //转义@ + .replace(/@(\S+)(\s+?|$)/g, '@$1$2') - //转义表情 - .replace(/face\[([^\s\[\]]+?)\]/g, function(face){ - var alt = face.replace(/^face/g, ''); - return ''+ alt +''; - }) + //转义表情 + .replace(/face\[([^\s\[\]]+?)\]/g, function(face){ + var alt = face.replace(/^face/g, ''); + return ''+ alt +''; + }) - //转义脚本 - .replace(/a(\(javascript:)(.+)(;*\))/g, 'a(javascript:layer.msg(\'非法脚本\');)') + //转义脚本 + .replace(/a(\(javascript:)(.+)(;*\))/g, 'a(javascript:layer.msg(\'非法脚本\');)') - //转义链接 - .replace(/a\([\s\S]+?\)\[[\s\S]*?\]/g, function(str){ - var href = (str.match(/a\(([\s\S]+?)\)\[/)||[])[1]; - var text = (str.match(/\)\[([\s\S]*?)\]/)||[])[1]; - if(!href) return str; - var rel = /^(http(s)*:\/\/)\b(?!(\w+\.)*(sentsin.com|layui.com))\b/.test(href.replace(/\s/g, '')); - return ''+ (text||href) +''; - }) + //转义链接 + .replace(/a\([\s\S]+?\)\[[\s\S]*?\]/g, function(str){ + var href = (str.match(/a\(([\s\S]+?)\)\[/)||[])[1]; + var text = (str.match(/\)\[([\s\S]*?)\]/)||[])[1]; + if(!href) return str; + var rel = /^(http(s)*:\/\/)\b(?!(\w+\.)*(sentsin.com|layui.com))\b/.test(href.replace(/\s/g, '')); + return ''+ (text||href) +''; + }) - //转义横线 - .replace(/\[hr\]\n*/g, '
    ') + //转义横线 + .replace(/\[hr\]\n*/g, '
    ') - //转义表格 - .replace(/\[table\]([\s\S]*)\[\/table\]\n*/g, function(str){ - return str.replace(/\[(thead|th|tbody|tr|td)\]\n*/g, '<$1>') - .replace(/\n*\[\/(thead|th|tbody|tr|td)\]\n*/g, '') + //转义表格 + .replace(/\[table\]([\s\S]*)\[\/table\]\n*/g, function(str){ + return str.replace(/\[(thead|th|tbody|tr|td)\]\n*/g, '<$1>') + .replace(/\n*\[\/(thead|th|tbody|tr|td)\]\n*/g, '') - .replace(/\[table\]\n*/g, '') - .replace(/\n*\[\/table\]\n*/g, '
    '); - }) + .replace(/\[table\]\n*/g, '') + .replace(/\n*\[\/table\]\n*/g, '
    '); + }) - //转义 div/span - .replace(/\n*\[(div|span)([\s\S]*?)\]([\s\S]*?)\[\/(div|span)\]\n*/g, function(str){ - return str.replace(/\[(div|span)([\s\S]*?)\]\n*/g, '<$1 $2>') - .replace(/\n*\[\/(div|span)\]\n*/g, ''); - }) + //转义 div/span + .replace(/\n*\[(div|span)([\s\S]*?)\]([\s\S]*?)\[\/(div|span)\]\n*/g, function(str){ + return str.replace(/\[(div|span)([\s\S]*?)\]\n*/g, '<$1 $2>') + .replace(/\n*\[\/(div|span)\]\n*/g, ''); + }) - //转义列表 - .replace(/\[ul\]([\s\S]*)\[\/ul\]\n*/g, function(str){ - return str.replace(/\[li\]\n*/g, '
  • ') - .replace(/\n*\[\/li\]\n*/g, '
  • ') + //转义列表 + .replace(/\[ul\]([\s\S]*)\[\/ul\]\n*/g, function(str){ + return str.replace(/\[li\]\n*/g, '
  • ') + .replace(/\n*\[\/li\]\n*/g, '
  • ') - .replace(/\[ul\]\n*/g, ''); - }) + .replace(/\[ul\]\n*/g, ''); + }) - //转义代码 - .replace(/\[pre\]([\s\S]*)\[\/pre\]\n*/g, function(str){ - return str.replace(/\[pre\]\n*/g, '
    ')
    -                      .replace(/\n*\[\/pre\]\n*/g, '
    '); - }) + //转义代码 + .replace(/\[pre\]([\s\S]*)\[\/pre\]\n*/g, function(str){ + return str.replace(/\[pre\]\n*/g, '
    ')
    +                    .replace(/\n*\[\/pre\]\n*/g, '
    '); + }) - //转义引用 - .replace(/\[quote\]([\s\S]*)\[\/quote\]\n*/g, function(str){ - return str.replace(/\[quote\]\n*/g, '
    ') - .replace(/\n*\[\/quote\]\n*/g, '
    '); - }) + //转义引用 + .replace(/\[quote\]([\s\S]*)\[\/quote\]\n*/g, function(str){ + return str.replace(/\[quote\]\n*/g, '
    ') + .replace(/\n*\[\/quote\]\n*/g, '
    '); + }) - //转义加粗 - .replace(/\[strong\]([\s\S]*)\[\/strong\]\n*/g, function(str){ - return str.replace(/\[strong\]\n*/g,'') - .replace(/\n*\[\/strong\]\n*/g, ''); - }) + //转义加粗 + .replace(/\[strong\]([\s\S]*)\[\/strong\]\n*/g, function(str){ + return str.replace(/\[strong\]\n*/g,'') + .replace(/\n*\[\/strong\]\n*/g, ''); + }) - //转义换行 - .replace(/\n/g, '
    ') + //转义换行 + .replace(/\n/g, '
    ') - //转义视频 - .replace(/video\(.*?\)\[([^\s]+?)\]/g, function(str){ - var cover = (str.match(/video\(([\s\S]+?)\)\[/)||[])[1]; - var video = (str.match(/\)\[([^\s]+?)\]/)||[])[1]; - cover = cover ? cover : '/static/res/images/video_cover.jpg'; - return ''; - }) - //转义音频 - .replace(/audio\[([^\s]+?)\]/g, function(audio){ - return ''; - }) + //转义视频 + .replace(/video\(.*?\)\[([^\s]+?)\]/g, function(str){ + var cover = (str.match(/video\(([\s\S]+?)\)\[/)||[])[1]; + var video = (str.match(/\)\[([^\s]+?)\]/)||[])[1]; + cover = cover ? cover : '/static/res/images/video_cover.jpg'; + return ''; + }) + //转义音频 + .replace(/audio\[([^\s]+?)\]/g, function(audio){ + return ''; + }) - return content; - } + return content; + } //新消息通知 ,newmsg: function(){ @@ -671,7 +670,7 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'], } }); } - }; + }; //加载扩展模块 layui.config({ @@ -737,14 +736,14 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'], var tplSignin = ['{{# if(d.signed){ }}' ,'' ,'获得了{{ d.experience }}' + jName + '' - ,'{{# } else { }}' + ,'{{# } else { }}' ,'' ,'可获得{{ d.experience }}' + jName + '' - ,'{{# } }}'].join('') - ,tplSigninDay = '已连续签到{{ d.days }}天' + ,'{{# } }}'].join('') + ,tplSigninDay = '已连续签到{{ d.days }}天' - ,signRender = function(data){ - laytpl(tplSignin).render(data, function(html){ + ,signRender = function(data){ + laytpl(tplSignin).render(data, function(html){ elemSigninMain.html(html); }); laytpl(tplSigninDay).render(data, function(html){ @@ -758,7 +757,6 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'], ,elemSigninDays = $('.fly-signin-days'); if(elemSigninMain[0]){ - fly.json(signStatusUrl, function(res){ if(!res.data) return; signRender.token = res.data.token; @@ -766,6 +764,7 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'], }); } + $('body').on('click', '#LAY_signin', function(){ //登录判断 if(uid == -1){ @@ -1095,8 +1094,8 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'], if (layui.cache.user.uid !== -1) { loading = layer.load(2, { shade: [0.2, '#000'] - }); - location.href = articleAdd; + }); + location.href = articleAdd; } else { layer.msg('请先登陆',{ icon:5, @@ -1162,6 +1161,5 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'], }); exports('fly', fly); - }); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 891a010..db3022f 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1045,17 +1045,17 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.39", - "version_normalized": "4.4.39.0", + "version": "v4.4.41", + "version_normalized": "4.4.41.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "35237c5e5dcb6593a46a860ba5b29c1d4683d80e" + "reference": "58eb36075c04aaf92a7a9f38ee9a8b97e24eb481" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/35237c5e5dcb6593a46a860ba5b29c1d4683d80e", - "reference": "35237c5e5dcb6593a46a860ba5b29c1d4683d80e", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/58eb36075c04aaf92a7a9f38ee9a8b97e24eb481", + "reference": "58eb36075c04aaf92a7a9f38ee9a8b97e24eb481", "shasum": "" }, "require": { @@ -1079,7 +1079,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2022-02-25T10:38:15+00:00", + "time": "2022-04-25T21:15:06+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -1117,7 +1117,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.39" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.41" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 52e48f8..cfe1ee8 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '55487e7d9d3d67406b0dbe02896d285923cec456', + 'reference' => 'bb712c71c521dd5acc4656bb49ff90285de07458', 'name' => 'taoser/taoler', 'dev' => true, ), @@ -146,12 +146,12 @@ 'dev_requirement' => true, ), 'symfony/var-dumper' => array( - 'pretty_version' => 'v4.4.39', - 'version' => '4.4.39.0', + 'pretty_version' => 'v4.4.41', + 'version' => '4.4.41.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), - 'reference' => '35237c5e5dcb6593a46a860ba5b29c1d4683d80e', + 'reference' => '58eb36075c04aaf92a7a9f38ee9a8b97e24eb481', 'dev_requirement' => true, ), 'taoser/taoler' => array( @@ -160,7 +160,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '55487e7d9d3d67406b0dbe02896d285923cec456', + 'reference' => 'bb712c71c521dd5acc4656bb49ff90285de07458', 'dev_requirement' => false, ), 'taoser/think-addons' => array( diff --git a/vendor/services.php b/vendor/services.php index a329d5c..189c070 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'taoser\\addons\\Service', diff --git a/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php b/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php index e7a0f64..9f5a375 100644 --- a/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php +++ b/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php @@ -1,4 +1,5 @@ flags = $flags; $this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8'); - $this->decimalPoint = localeconv(); - $this->decimalPoint = $this->decimalPoint['decimal_point']; + $this->decimalPoint = \PHP_VERSION_ID >= 80000 ? '.' : localeconv()['decimal_point']; $this->setOutput($output ?: static::$defaultOutput); if (!$output && \is_string(static::$defaultOutput)) { static::$defaultOutput = $this->outputStream; @@ -122,8 +121,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface */ public function dump(Data $data, $output = null) { - $this->decimalPoint = localeconv(); - $this->decimalPoint = $this->decimalPoint['decimal_point']; + $this->decimalPoint = \PHP_VERSION_ID >= 80000 ? '.' : localeconv()['decimal_point']; if ($locale = $this->flags & (self::DUMP_COMMA_SEPARATOR | self::DUMP_TRAILING_COMMA) ? setlocale(\LC_NUMERIC, 0) : null) { setlocale(\LC_NUMERIC, 'C'); diff --git a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php index 88e5ba9..4db0f08 100644 --- a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php @@ -371,7 +371,7 @@ return function (root, x) { if (/\bsf-dump-toggle\b/.test(a.className)) { e.preventDefault(); if (!toggle(a, isCtrlKey(e))) { - var r = doc.getElementById(a.getAttribute('href').substr(1)), + var r = doc.getElementById(a.getAttribute('href').slice(1)), s = r.previousSibling, f = r.parentNode, t = a.parentNode; @@ -438,7 +438,7 @@ return function (root, x) { toggle(a); } } else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) { - a = a.substr(1); + a = a.slice(1); elt.className += ' '+a; if (/[\[{]$/.test(elt.previousSibling.nodeValue)) { diff --git a/view/taoler/index/article/news/detail.html b/view/taoler/index/article/news/detail.html index b157dad..9211d49 100644 --- a/view/taoler/index/article/news/detail.html +++ b/view/taoler/index/article/news/detail.html @@ -10,7 +10,7 @@
    {//标题} -

    {$article.title}

    +

    {$article.title}

    {//作者}
    @@ -23,7 +23,9 @@
    {// 内容}
    {$article.content}
    +
    +
    {//管理} {if (($article.upzip !== '') || session('?user_name'))}
    @@ -31,7 +33,7 @@ {/notempty}
    - {if ($user.auth ?? '')} + {if ($user.auth ?? '')} {if($article.is_top == 0)} @@ -49,20 +51,16 @@ {else /} {:lang('enable reply')} {/if} - {:lang('title color')} - {/if} - {if(session('user_name')==$article.user.name || ($user.auth ?? ''))} - {:lang('edit')} - {/if} + {:lang('title color')} + {/if} + {if(session('user_name')==$article.user.name || ($user.auth ?? ''))} + {:lang('edit')} + {/if}
    {/if}
    -
    - -
    -
    @@ -100,7 +98,7 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){ //tpl模板给发布时间赋值 $('div.detail-hits').children('span.post-time').each(function(){ var othis = $(this), html = othis.html(); - var string = laytpl('{{ d.time }}').render({ + var string = laytpl('{{ d.time }}').render({ //time: html time: othis.attr('data') }); @@ -217,7 +215,6 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){ $(function(){ $(".photos").on("click","img",function(){ var _this = $(this); - console.log(_this); imgShow("#outerdiv", "#innerdiv", "#bigimg", _this); }); }); @@ -260,7 +257,6 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){ $(this).fadeOut("fast"); }); } - +
    {//管理} {if (($article.upzip !== '') || session('?user_name'))}
    @@ -79,10 +81,6 @@ {/if}
    -
    - -
    - {//评论}
    评论 {$article.comments_count} diff --git a/view/taoler/index/user/index.html b/view/taoler/index/user/index.html index 90d4b81..f8d35ac 100644 --- a/view/taoler/index/user/index.html +++ b/view/taoler/index/user/index.html @@ -1,3 +1,12 @@ + {extend name="public/user" /} {block name="content"} @@ -20,16 +29,13 @@
    @@ -39,10 +45,10 @@ {block name="script"} {/block} \ No newline at end of file