mirror of
https://github.com/yunluo/gdk.git
synced 2024-06-20 06:25:13 +02:00
加入文章首尾自定义内容,自动判断下载链接
This commit is contained in:
parent
009a6499c9
commit
1185405a77
|
@ -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' => ''
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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.'<br>'.$content.'<br>'.$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){
|
|||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue