diff --git a/app/BaseController.php b/app/BaseController.php index 68f0cd5..c18d659 100644 --- a/app/BaseController.php +++ b/app/BaseController.php @@ -488,10 +488,10 @@ abstract class BaseController return $upRes; } - //获取artcile所有图片 + //获取artcile内容所有图片,返回数组 protected function getArticleAllpic($str) { - // + //正则匹配 $pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/"; preg_match_all($pattern,$str,$matchContent); if(isset($matchContent[1])){ @@ -505,7 +505,7 @@ abstract class BaseController } - //下载图片 + //下载远程图片 private function downloadImage($url) { $ch = curl_init(); @@ -520,7 +520,7 @@ abstract class BaseController } - //保存图片 + //把图片保存到本地 private function saveAsImage($url, $file) { $filename = pathinfo($url, PATHINFO_BASENAME); @@ -561,19 +561,18 @@ abstract class BaseController $images = $this->getArticleAllpic($content); if(count($images)) { foreach($images as $image){ - //1.网络图片 - //halt((stripos($image, Request::domain()) === false)); - if((stripos($image,'http') !== false) && (stripos($image, Request::domain()) === false)) { - - //2.下载远程图片 - $newImageUrl = $this->downloadImage($image); - - $content = str_replace($image,Request::domain().$newImageUrl,$content); - + //1.带http地址的图片,2.非本站的网络图片 3.非带有?号等参数的图片 + if((stripos($image,'http') !== false) && (stripos($image, Request::domain()) === false) && (stripos($image, '?') === false)) { + // 如果图片中没有带参数或者加密可下载 + //下载远程图片(可下载) + $newImageUrl = $this->downloadImage($image); + //替换图片链接 + $content = str_replace($image,Request::domain().$newImageUrl,$content); } } + //不可下载的图片,如加密或者带有参数的图片如?type=jpeg,直接返回content } - + return $content; } diff --git a/app/admin/controller/.gitignore b/app/admin/controller/.gitignore index 7105d64..134978c 100644 --- a/app/admin/controller/.gitignore +++ b/app/admin/controller/.gitignore @@ -3,4 +3,6 @@ Version.php TimeLine.php Plugins.php App.php +AddonsMarket.php +ViewsMarket.php diff --git a/app/admin/controller/Addons.php b/app/admin/controller/Addons.php index bf3cda8..f79e009 100644 --- a/app/admin/controller/Addons.php +++ b/app/admin/controller/Addons.php @@ -5,7 +5,6 @@ use app\common\controller\AdminController; use think\facade\View; use think\facade\Db; use think\facade\Request; -use think\facade\Cache; use think\facade\Config; use app\admin\model\Addons as AddonsModel; use taoler\com\Files; @@ -75,8 +74,9 @@ class Addons extends AdminController ['field' => 'price','title'=> '价格(元)'], ['field' => 'status','title'=> '状态', 'width'=> 100], ['field' => 'install','title'=> '安装', 'width'=> 100], + ['field' => 'vers','title'=> '版本选择','exportTemplet' => "function(d, obj){console.log(obj) var td = obj.td(this.field); return td.find('select').val();}"], ['field' => 'ctime','title'=> '时间', 'width'=> 150], - ['title' => '操作', 'width'=> 150, 'align'=>'center', 'toolbar'=> '#addons-tool'] + ['title' => '操作', 'width'=> 300, 'align'=>'center', 'toolbar'=> '#addons-tool'] ]; } else { $res = ['code'=>-1,'msg'=>'未获取到服务器信息']; diff --git a/app/admin/controller/Forum.php b/app/admin/controller/Forum.php index 8a32864..73978a2 100644 --- a/app/admin/controller/Forum.php +++ b/app/admin/controller/Forum.php @@ -164,6 +164,7 @@ class Forum extends AdminController $msg = $addOrEdit ? lang('edit') : lang('add'); if(Request::isAjax()) { $data = Request::param(); + if(isset($data['id']) && $data['pid'] == $data['id']) return json(['code'=>-1,'msg'=> $msg.'不能作为自己的子类']); $list = Db::name('cate')->cache('catename')->save($data); if($list){ diff --git a/app/admin/model/.gitignore b/app/admin/model/.gitignore index 3eb333c..c1767a0 100644 --- a/app/admin/model/.gitignore +++ b/app/admin/model/.gitignore @@ -1,2 +1,3 @@ +App.php Version.php Plugins.php \ No newline at end of file diff --git a/app/admin/view/.gitignore b/app/admin/view/.gitignore index 28856ab..a06dec6 100644 --- a/app/admin/view/.gitignore +++ b/app/admin/view/.gitignore @@ -1,4 +1,7 @@ /key_auth /time_line /version -/plugins \ No newline at end of file +/plugins +/addons_market +/views_market +/app \ No newline at end of file diff --git a/app/admin/view/addons/index.html b/app/admin/view/addons/index.html index dc8a41c..7c4b75a 100644 --- a/app/admin/view/addons/index.html +++ b/app/admin/view/addons/index.html @@ -4,48 +4,54 @@
-
-
-
- 插件分类 -
-
- + + + + +
+
+
+ + + + + + - - - - -
@@ -72,7 +78,14 @@ ,table = layui.table ,form = layui.form ,upload = layui.upload; - + + form.render('select'); // 渲染所在容器内的 select 元素 + //监听版本选择 + form.on('select(versSelect)', function(obj){ + console.log(111) + layer.tips(this.value + ' ' + this.name + ':'+ obj.elem.checked, obj.othis); + }); + //事件 var active = { add: function(){ diff --git a/app/admin/view/forum/tags.html b/app/admin/view/forum/tags.html index ba21ccb..82059e1 100644 --- a/app/admin/view/forum/tags.html +++ b/app/admin/view/forum/tags.html @@ -113,7 +113,7 @@ overflow: visible; treeTable.on('tool(Article-cate-list)', function(obj){ var data = obj.data; if(obj.event === 'del'){ - layer.confirm('确定删除此分类?', function(index){ + layer.confirm('是否删除此分类及分类下内容?', function(index){ $.ajax({ type:'post', url:forumTagsDelete, diff --git a/app/admin/view/public/base.html b/app/admin/view/public/base.html index 03da6d8..d02e4ce 100644 --- a/app/admin/view/public/base.html +++ b/app/admin/view/public/base.html @@ -20,7 +20,7 @@ {block name="css"}{/block} - + {block name="body"}内容{/block} + {block name="link"}{/block} - - + {if strpos($Request.SERVER.HTTP_USER_AGENT,"Html5Plus") === false} {include file="public/header" /} {/if} @@ -74,7 +69,7 @@ }).use('fly'); var element = layui.element; -{block name="script"} {/block} +{block name="script"}{/block} diff --git a/view/taoler/index/public/footer.html b/view/taoler/index/public/footer.html index f78d16f..4375ebd 100644 --- a/view/taoler/index/public/footer.html +++ b/view/taoler/index/public/footer.html @@ -1,16 +1,38 @@ -