From 756c7a62a3cd0b5bcc347db01cc988d170f89a80 Mon Sep 17 00:00:00 2001 From: 1099438829 <1099438829@qq.com> Date: Mon, 5 Apr 2021 23:53:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/taglib/Zz.php | 21 + app/index/common.php | 23 + public/template/blog/1.html | 1194 -------------------- public/template/blog/index.html | 1267 ---------------------- public/template/default/index/index.html | 51 +- 5 files changed, 53 insertions(+), 2503 deletions(-) delete mode 100644 public/template/blog/1.html delete mode 100644 public/template/blog/index.html diff --git a/app/common/taglib/Zz.php b/app/common/taglib/Zz.php index cf8172a..5d591bd 100644 --- a/app/common/taglib/Zz.php +++ b/app/common/taglib/Zz.php @@ -21,6 +21,7 @@ class Zz extends TagLib{ 'list'=> ['attr' => 'orderby,pagesize,type,typeid,void,model,where,display', 'close' => 1], 'prenext'=> ['attr' => 'get,cid,void', 'close' => 1], 'flink'=> ['attr' => 'type,row,void', 'close' => 1], + 'banner'=> ['attr' => 'type,row,void', 'close' => 1], 'sql'=> ['attr' => 'sql', 'close' => 1], 'article'=> ['attr' => 'id,void,model', 'close' => 1], 'tags'=> ['attr' => 'tags,void', 'close' => 1], @@ -185,6 +186,26 @@ class Zz extends TagLib{ return $parse; } + /** + * banner + */ + public function tagBanner($tag,$content) + { + $type=isset($tag['type'])?$tag['type']:'text'; + $type=$type=='text'?0:1; + $row=isset($tag['row'])?$tag['row']:100; + $void=isset($tag['void'])?$tag['void']:'field'; + + $parse = ''; + $parse .= '{volist name="__LIST__" id="'.$void.'"}'; + $parse .= $content; + $parse .= '{/volist}'; + return $parse; + } + + /** * 执行SQL */ diff --git a/app/index/common.php b/app/index/common.php index 731f61d..7316632 100644 --- a/app/index/common.php +++ b/app/index/common.php @@ -525,6 +525,29 @@ function tpl_get_friend_link($type,$row){ return $flinkListTemp; } +/** + * 模板-banner + */ +function tpl_get_banner($type,$row){ + $bannerList=cache('DATA_BANNER'); + if($bannerList===null){ + $bannerList=Db::name('slides')->where('status',1)->order('sort asc')->limit($row)->select(); + cache('DATA_BANNER',$bannerList); + } + if($type===0){ + return $bannerList; + } + $bannerListTemp=[]; + foreach ($bannerList as $key=>$item){ + if($item['image']){ + array_push($bannerListTemp,$item); + } + } + return $bannerListTemp; +} + + + if (!function_exists('web_config')) { /** diff --git a/public/template/blog/1.html b/public/template/blog/1.html deleted file mode 100644 index 3c1df6e..0000000 --- a/public/template/blog/1.html +++ /dev/null @@ -1,1194 +0,0 @@ - - - - -猿博 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
- -
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-

搜索内容

- -
-
-
- -
- -
-
-
-
-
-
-
-
-
-
- -
- - - - -
-
-
-
最新文章 -
-
-
- -
- - - -
-
- -
- - -
- -
- -
- - diff --git a/public/template/blog/index.html b/public/template/blog/index.html deleted file mode 100644 index 000cca3..0000000 --- a/public/template/blog/index.html +++ /dev/null @@ -1,1267 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 轻烟随风的博客blog - - - - - - - - -
-
-
-
- -
- -
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-

搜索内容

- -
-
- - - -
-
-
-
-
-
-
-
- -
- - - - -
-
-
-
最新文章 -
-
-
- -
- - - -
-
- -
- - -
- - -
- -
- - diff --git a/public/template/default/index/index.html b/public/template/default/index/index.html index 8df924a..64680ad 100644 --- a/public/template/default/index/index.html +++ b/public/template/default/index/index.html @@ -20,8 +20,10 @@