From 1185405a77cd9e1ad6973a26707a93cb649e0862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E8=90=BD?= Date: Sat, 1 Feb 2020 11:24:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=96=87=E7=AB=A0=E9=A6=96?= =?UTF-8?q?=E5=B0=BE=E8=87=AA=E5=AE=9A=E4=B9=89=E5=86=85=E5=AE=B9,?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=A4=E6=96=AD=E4=B8=8B=E8=BD=BD=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/options-config.php | 18 ++++++++++++++++-- functions/Common.php | 26 ++++++++++++++++++++++++++ functions/advanced.php | 12 +++++++++++- 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/framework/options-config.php b/framework/options-config.php index 82a52e7..774194d 100644 --- a/framework/options-config.php +++ b/framework/options-config.php @@ -629,18 +629,32 @@ $gdk_options = [ 'type' => 'title' ], [ - 'name' => '头部自定义代码', + 'name' => '网站头部自定义代码', 'desc' => '代码将插入到head区域', 'id' => 'gdk_custom_head_code', 'type' => 'textarea', 'std' => '' ], [ - 'name' => '底部自定义代码', + 'name' => '网站底部自定义代码', 'desc' => '代码将插入到foot区域', 'id' => 'gdk_custom_foot_code', 'type' => 'textarea', 'std' => '' + ], + [ + 'name' => '文章顶部自定义内容', + 'desc' => '在文章顶部插入一个内容', + 'id' => 'gdk_artical_top', + 'type' => 'textarea', + 'std' => '' + ], + [ + 'name' => '文章底部自定义内容', + 'desc' => '在文章底部插入一个内容', + 'id' => 'gdk_artical_bottom', + 'type' => 'textarea', + 'std' => '' ] ] ]; diff --git a/functions/Common.php b/functions/Common.php index 2ab81e0..0d64618 100644 --- a/functions/Common.php +++ b/functions/Common.php @@ -835,3 +835,29 @@ function gdk_str2arr($data, $delimiter = ',') { return $result; } + +function gdk_panlinks($links) { + if(!filter_var($url, FILTER_VALIDATE_URL)) return false; + if(in_string($links,'baidu')){ + $linknane = '百度网盘'; + }elseif(in_string($links,'yunpan')){ + $linknane = '360云盘'; + }elseif(in_string($links,'lanzous')){ + $linknane = '蓝奏网盘'; + }elseif(in_string($links,'189')){ + $linknane = '天翼云盘'; + }elseif(in_string($links,'mega')){ + $linknane = 'MEGA云盘'; + }elseif(in_string($links,'yadi.sk')){ + $linknane = '毛子云盘'; + }elseif(in_string($links,'cdn')){ + $linknane = 'CDN'; + }elseif(in_string($links,'ctfile')){ + $linknane = '360云盘'; + }elseif(in_string($links,'weiyun')){ + $linknane = '腾讯微云'; + }else{ + $linknane = '下载'; + } + return $linknane; +} \ No newline at end of file diff --git a/functions/advanced.php b/functions/advanced.php index cfc58ad..d08c9a6 100644 --- a/functions/advanced.php +++ b/functions/advanced.php @@ -8,6 +8,14 @@ if (gdk_option('gdk_cdn_water')) add_filter('the_content', 'gdk_cdn_water'); +//文章首尾添加自定义内容 +function gdk_add_content($content) { + $before = gdk_option('gdk_artical_top'); + $after = gdk_option('gdk_artical_bottom'); + $content = $before.'
'.$content.'
'.$after; + return $content; +} +add_filter('the_content', 'gdk_add_content'); //头像解决方案 function gdk_switch_get_avatar( $avatar ) { @@ -135,4 +143,6 @@ function mail_temp($mail_title,$mail_cotent,$link,$link_title){