diff --git a/class/cache/index.html b/class/cache/index.html new file mode 100644 index 0000000..e69de29 diff --git a/class/cache/timthumb_cacheLastCleanTime.touch b/class/cache/timthumb_cacheLastCleanTime.touch new file mode 100644 index 0000000..e69de29 diff --git a/class/simple_local_avatars.php b/class/local_avatars.php similarity index 100% rename from class/simple_local_avatars.php rename to class/local_avatars.php diff --git a/class/timthumb.php b/class/timthumb.php index 2115be1..6e721e8 100644 --- a/class/timthumb.php +++ b/class/timthumb.php @@ -1,14 +1,15 @@ '; echo '

A TimThumb error has occured

The following error(s) occured:
' . $html . '
'; echo '
Query String : ' . htmlentities( $_SERVER['QUERY_STRING'], ENT_QUOTES ); - echo '
TimThumb version : ' . VERSION . ''; + echo '
TimThumb version : ' . TIM_VERSION . ''; + } protected function serveInternalImage(){ $this->debug(3, "Local image path is $this->localImage"); diff --git a/framework/options-config.php b/framework/options-config.php index 8610938..7530ba6 100644 --- a/framework/options-config.php +++ b/framework/options-config.php @@ -3,1636 +3,737 @@ * 主题选项配置文件 */ -$gdk_options = array( - '优化选项' => array( - array( +$gdk_options = [ + '优化选项' => [ + [ 'name' => '新版编辑器开关', 'desc' => '新版编辑器尚不成熟,很多主题不兼容,建议禁用', 'id' => 'gdk_diasble_gutenberg', 'type' => 'radio', - 'options' => array( + 'options' => [ '1' => '禁用', '0' => '开启' - ), + ], 'std' => '1' - ), - array( - 'name' => '清理冗余头部代码开关', - 'desc' => 'wordpress头部自带很多无用代码,不安全且浪费,建议禁用', + ], + [ + 'name' => '禁用头部冗余代码', + 'desc' => 'WordPress头部自带很多无用代码,不安全且浪费,建议禁用', 'id' => 'gdk_diasble_head_useless', 'type' => 'radio', - 'options' => array( + 'options' => [ '1' => '禁用', '0' => '开启' - ), + ], 'std' => '1' - ), - array( - 'name' => '禁用wordpress更新', - 'desc' => 'wordpress更新会不时发送请求数据,所以可以关闭wordpress更新,包括主题,插件和内核更新', + ], + [ + 'name' => '禁用WordPress更新', + 'desc' => 'WordPress更新会不时发送请求数据,所以可以关闭WordPress更新,包括主题,插件和内核更新', 'id' => 'gdk_diasble_wp_update', 'type' => 'radio', - 'options' => array( + 'options' => [ '1' => '禁用', '0' => '开启' - ), + ], 'std' => '1' - ), - array( - 'name' => '禁用emojis功能', - 'desc' => 'wordpress的emojis功能会加载国外资源,那是网站速度,所以建议禁用', + ], + [ + 'name' => '禁用Emojis功能', + 'desc' => 'WordPress的Emojis功能会加载国外资源,那是网站速度,所以建议禁用', 'id' => 'gdk_disable_emojis', 'type' => 'radio', - 'options' => array( + 'options' => [ '1' => '禁用', '0' => '开启' - ), + ], 'std' => '1' - ), - array( + ], + [ 'name' => '禁用XML-RPC功能', - 'desc' => '该功能有安全风险,如果不使用wordpress的手机客户端或者第三方编辑器软件,那么建议禁用', + 'desc' => '该功能有安全风险,如果不使用WordPress的手机客户端或者第三方编辑器软件,那么建议禁用', 'id' => 'gdk_disable_xmlrpc', 'type' => 'radio', - 'options' => array( + 'options' => [ '1' => '禁用', '0' => '开启' - ), + ], 'std' => '1' - ), - array( + ], + [ 'name' => '禁用文章版本功能', 'desc' => '该功能有会造成数据库体量暴增为了你的数据库考虑,建议禁用', 'id' => 'gdk_disable_revision', 'type' => 'radio', - 'options' => array( + 'options' => [ '1' => '禁用', '0' => '开启' - ), + ], 'std' => '1' - ), - array( + ], + [ 'name' => '禁用pingback功能', 'desc' => '该功能会增加垃圾评论的几率,建议禁用', 'id' => 'gdk_disable_trackbacks', 'type' => 'radio', - 'options' => array( + 'options' => [ '1' => '禁用', '0' => '开启' - ), + ], 'std' => '1' - ), - array( - 'name' => 'wordpress更新中国加速', - 'desc' => '该功能会帮助顺利更新wordpress,突破429,注意:如果上面的wordpress禁用更新了,此处设置无效,建议开启', + ], + [ + 'name' => 'WordPress更新中国加速', + 'desc' => '该功能会帮助顺利更新WordPress,突破429,注意:如果上面的WordPress禁用更新了,此处设置无效,建议开启', 'id' => 'gdk_porxy_update', 'type' => 'radio', - 'options' => array( + 'options' => [ '0' => '禁用', '1' => '开启' - ), + ], 'std' => '1' - ), - array( + ], + [ 'name' => '头像加速功能', 'desc' => '该功能会增加头像加载速度,有随机头像,V2EX头像镜像和七牛头像镜像,默认选择随机头像', 'id' => 'gdk_switch_get_avatar', 'type' => 'radio', - 'options' => array( + 'options' => [ '1' => '随机头像', '2' => 'V2EX头像镜像', '3' => '七牛头像镜像', - ), + ], 'std' => '1' - ), - array( - 'name' => '评论', - 'desc' => '评论框占位文本', - 'id' => 'git_comment_placeholder', - 'type' => 'text', - 'std' => '说点什么吧…' - ), - array( - 'title' => '投稿设置', - 'type' => 'title' - ), - array( - 'name' => '开启', - 'desc' => '开启后,再后台新建一个页面,模板选择投稿', - 'id' => 'git_tougao_b', - 'type' => 'checkbox' - ), - array( - 'name' => '投稿时间间隔', - 'desc' => '秒,默认:240', - 'id' => 'git_tougao_time', - 'type' => 'number', - 'std' => 240 - ), - array( - 'name' => '投稿提醒邮箱', - 'desc' => '这里的邮箱一般是站长的邮箱,默认是获取网站自带的邮箱,另外,SMTP服务必须保证正常使用', - 'id' => 'git_tougao_mailto', - 'type' => 'text', - 'std' => get_bloginfo( 'admin_email' ) - ), - array( - 'name' => '流量统计代码', - 'desc' => '统计网站流量,推荐使用百度统计,国内比较优秀且速度快;还可使用Google统计、CNZZ等', - 'id' => 'git_track', - 'type' => 'textarea' - ), - array( - 'name' => '网站头部代码', - 'desc' => '会自动出现在页面头部(head区域),可放置广告代码等自定义代码的全局代码块', - 'id' => 'git_headcode', - 'type' => 'textarea' - ), - array( - 'name' => '网站自定义样式CSS', - 'desc' => '网站全局CSS代码,可以直接加入css代码,比如:.authorsocials i{font-size:16px;width:20px;height:18px}', - 'id' => 'git_customcss', - 'type' => 'textarea' - ), - array( - 'name' => '主题更新设置', - 'desc' => '禁止主题更新【 选择后,您将无法收到本主题的更新推送,请慎重选择】', - 'id' => 'git_updates_b', - 'type' => 'checkbox' - ) - ), - - 'SEO设置' => array( - array( + ] + ], + 'SEO设置' => [ + [ 'name' => '网站关键字',//选项显示的文字,选填 'desc' => '各关键字间用半角逗号','分割,数量在6个以内最佳。',//选项显示的一段描述文字,选填 'id' => 'git_keywords',//选项的id,必须是唯一,后面根据这个获取值,必填 'type' => 'text',//种类,这个是普通的文字输入,必填 'std' => ''//选项的默认值,选填 - ), - array( + ], + [ 'name' => '网站描述', 'desc' => '用简洁的文字描述本站点,字数建议在120个字以内。', 'id' => 'git_description', 'type' => 'text' - ), - array( + ], + [ 'name' => 'title分隔符', 'desc' => '显示在浏览器标题栏的一个用来风格网站名字的', 'id' => 'git_delimiter', 'type' => 'text', 'std' => '|' - ), - array( + ], + [ 'name' => '自动内链', 'desc' => '启用', 'id' => 'git_autolink_b', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '关键词出现数目', 'desc' => '文章中少于这个数字的关键词将不自动内链,默认是1,即全部链接', 'id' => 'git_autolink_1', 'type' => 'number', 'std' => 1 - ), - array( + ], + [ 'name' => '关键词链接次数', 'desc' => '文章中最多链接的次数,默认是6', 'id' => 'git_autolink_2', 'type' => 'number', 'std' => 6 - ), - array( + ], + [ 'name' => '图片自动添加alt以及title', 'desc' => '启用', 'id' => 'git_imgalt_b', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '外链自动GO跳转', 'desc' => '启用 【启用之后需要新建页面,模板选择Go跳转页面,别名为go】', 'id' => 'git_go', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '外链自动添加nofollow', 'desc' => '启用', 'id' => 'git_nofollow', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => 'Robot.txt优化', 'desc' => '启用 【开启本项之后,将只对搜索引擎开放首页,页面,文章页,其他一律屏蔽】', 'id' => 'git_robot_b', 'type' => 'checkbox' - ), - array( + ], + [ 'title' => '百度主动推送 查看主动推送效果',//标题文字 'type' => 'title'//title 是标签下的标题 - ), - array( + ], + [ 'name' => '主动推送接口地址,填写本项即开启推送', 'desc' => '在百度站长平台获取主动推送接口地址,比如:http://data.zz.baidu.com/urls?site=域名&token=一组字符, 主动推送接口地址', 'id' => 'git_sitemap_api', 'type' => 'text' - ) - ), - - '文章设置' => array( - array( - 'title' => '列表文章属性', + ] + ], + '安全设置' => [ + [ + 'title' => '登陆安全防御', 'type' => 'title' - ), - array( - 'name' => '访客数', - 'desc' => '不显示', - 'id' => 'git_post_views_b', - 'type' => 'checkbox' - ), - array( - 'name' => '作者名', - 'desc' => '不显示', - 'id' => 'git_post_author_b', - 'type' => 'checkbox' - ), - array( - 'name' => '评论数', - 'desc' => '不显示', - 'id' => 'git_post_comment_b', - 'type' => 'checkbox' - ), - array( - 'name' => '发布时间', - 'desc' => '不显示', - 'id' => 'git_post_time_b', - 'type' => 'checkbox' - ), - array( - 'name' => '喜欢数', - 'desc' => '不显示', - 'id' => 'git_post_like_b', - 'type' => 'checkbox' - ), - array( - 'name' => '文章面包屑', - 'desc' => '开启', - 'id' => 'git_singleMenu_b', - 'type' => 'checkbox' - ), - array( - 'name' => '自动首行缩进', - 'desc' => '开启 【开启后对文字内容自动首行缩进2格】', - 'id' => 'git_suojin', - 'type' => 'checkbox' - ), - array( - 'name' => '自动中英文空格', - 'desc' => '开启 【开启后对中英文会间隔开,但是会打乱部分关键词】', - 'id' => 'git_auto_kg', - 'type' => 'checkbox' - ), - array( - 'name' => '文章按照更新日期排序', - 'desc' => '开启 【开启按照最新更新排序,不开启则按照默认时间排序】', - 'id' => 'git_orderbygx', - 'type' => 'checkbox' - ), - array( + ], + [ + 'name' => '登陆安全保护', + 'desc' => '该功能会将连续多次登陆错误的用户暂时锁定,待解锁后方可重新登陆,默认开启', + 'id' => 'gdk_lock_login', + 'type' => 'radio', + 'options' => [ + '1' => '开启', + '0' => '禁用' + ], + 'std' => '1' + ], + [ + 'name' => '登录失败最大次数', + 'desc' => '默认:5', + 'id' => 'gdk_failed_login_limit', + 'type' => 'number', + 'std' => 5 + ], + [ + 'name' => '登录失败锁定时间', + 'desc' => '单位秒,默认:60', + 'id' => 'gdk_lockout_duration', + 'type' => 'number', + 'std' => 60 + ], + [ 'title' => '垃圾评论屏蔽', 'type' => 'title' - ), - array( + ], + [ 'name' => '过滤外语评论', 'desc' => '开启 【启用后,将屏蔽所有含有日文以及英语的评论,外贸站慎用】', 'id' => 'git_spam_lang', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '关键词,IP,邮箱屏蔽', 'desc' => '开启 【启用后,在WordPress-设置-讨论-黑名单中添加想要屏蔽的关键词,邮箱,网址,IP地址,每行一个】如图设置', 'id' => 'git_spam_keywords', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '屏蔽含有链接的评论', 'desc' => '开启 【启用后,屏蔽内容或者评论昵称含有链接的评论,如果您的评论需要输入链接或者图片的话,请慎选!!!】', 'id' => 'git_spam_url', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '屏蔽长链接评论', 'desc' => '开启 【启用后,屏蔽含有过长网址(超过50个字符)的评论,当然如果你已经选择了上面的选项的话,就不用选择了】', 'id' => 'git_spam_long', 'type' => 'checkbox' - ), - array( + ], + [ 'title' => '评论设置属性', 'type' => 'title' - ), - array( + ], + [ 'name' => '贴图', 'desc' => '不显示', 'id' => 'git_tietu', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '加粗', 'desc' => '不显示', 'id' => 'git_jiacu', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '删除线', 'desc' => '不显示', 'id' => 'git_shanchu', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '居中', 'desc' => '不显示', 'id' => 'git_juzhong', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '斜体', 'desc' => '不显示', 'id' => 'git_xieti', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '签到', 'desc' => '不显示', 'id' => 'git_qiandao', 'type' => 'checkbox' - ), - array( + ], + [ 'title' => '评论VIP设置', 'type' => 'title' - ), - array( + ], + [ 'name' => '启用', 'desc' => ' 【启用之后,您需要在下面设置用户的评论数字区间】', 'id' => 'git_vip', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => 'VIP 1', 'desc' => '输入的数字减一就是VIP 1的所要求的评论数字区间,默认是5', 'id' => 'git_vip1', 'type' => 'number', 'std' => 5 - ), - array( + ], + [ 'name' => 'VIP 2', 'desc' => '输入的数字减去上面的数字就是VIP 2的所要求的评论数字区间,默认是10', 'id' => 'git_vip2', 'type' => 'number', 'std' => 10 - ), - array( + ], + [ 'name' => 'VIP 3', 'desc' => '输入的数字减去上面的数字就是VIP 3的所要求的评论数字区间,默认是20', 'id' => 'git_vip3', 'type' => 'number', 'std' => 20 - ), - array( + ], + [ 'name' => 'VIP 4', 'desc' => '输入的数字减去上面的数字就是VIP 4的所要求的评论数字区间,默认是40', 'id' => 'git_vip4', 'type' => 'number', 'std' => 30 - ), - array( + ], + [ 'name' => 'VIP 5', 'desc' => '输入的数字减去上面的数字就是VIP 5的所要求的评论数字区间,默认是70', 'id' => 'git_vip5', 'type' => 'number', 'std' => 40 - ), - array( + ], + [ 'name' => 'VIP 6', 'desc' => '输入的数字减去上面的数字就是VIP 6的所要求的评论数字区间,默认是110', 'id' => 'git_vip6', 'type' => 'number', 'std' => 50 - ), - array( + ], + [ 'name' => '文章摘要', 'desc' => '个字', 'id' => 'git_excerpt_length', 'type' => 'number', 'std' => 180 - ), - array( + ], + [ 'name' => '文章二维码', 'desc' => '启用', 'id' => 'git_qr_b', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '作者模块', 'desc' => '启用', 'id' => 'git_auther_b', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '文章目录索引', 'desc' => '启用 【开启之后,默认索引文章H2标题】', 'id' => 'git_article_list', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '相关文章显示条数', 'desc' => '条       这是是显示文章下面的相关文章数目的', 'id' => 'git_related_count', 'type' => 'number', 'std' => 8 - ), - array( + ], + [ 'name' => '禁止站内文章Pingback', 'desc' => '开启       开启后,不会发送站内Pingback,建议开启', 'id' => 'git_pingback_b', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '禁止后台编辑时自动保存', 'desc' => '开启       开启后,后台编辑文章时候不会定时保存,有效缩减数据库存储量;但是,一般不建议开启,除非你的数据库容量很小', 'id' => 'git_autosave_b', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '文章版权声明', 'desc' => '此处输入的文字将出现在每篇文章最底部,你可以使用:{{title}}表示文章标题,{{link}}表示文章链接', 'id' => 'git_copyright_b', 'type' => 'textarea', 'std' => '极客公园 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:{{title}}' - ) - ), - - '样式设置' => array( - array( - 'name' => '透明导航栏', - 'desc' => '开启 【开启后您的菜单导航栏就会变成半透明】', - 'id' => 'git_tmnav_b', - 'type' => 'checkbox' - ), - array( - 'title' => '网站头部设置', - 'type' => 'title' - ), - array( - 'name' => '图片头部背景', - 'desc' => '开启【开启后您的头部背景将显示默认背景图,不开启则显示默认纯色背景】', - 'id' => 'git_pichead_b', - 'type' => 'checkbox' - ), - array( - 'name' => '自定义头部背景', - 'desc' => '请在这里输入您的图片路径', - 'id' => 'git_customhead', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '图片头部logo', - 'desc' => '开启【开启后您的头部背景将显示默认图片logo,不开启则显示默认文字logo】', - 'id' => 'git_piclogo_b', - 'type' => 'checkbox' - ), - array( - 'name' => '自定义头部logo', - 'desc' => '请在这里输入您的图片路径', - 'id' => 'git_customlogo', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => 'logo居左', - 'desc' => '开启【开启后您的logo将居左显示】', - 'id' => 'git_piclogo_left', - 'type' => 'checkbox' - ), - array( - 'title' => '主题皮肤设置', - 'type' => 'title' - ), - array( - 'name' => '网站配色', - 'desc' => '选择一个色调作为您网站的主色调,如果这里的色彩还不够,您可以使用下面的自定义色彩', - 'id' => 'git_skin_b', - 'type' => 'radio', - 'options' => array( - 'git_red_b' => '幽红色', - 'git_blue_b' => '深蓝色', - 'git_black_b' => '暗黑色', - 'git_purple_b' => '亮紫色', - 'git_yellow_b' => '淡黄色', - 'git_light_b' => '轻蓝色', - 'git_green_b' => '鲜绿色', - 'git_custom_color' => '自定义' - ), - 'std' => 'git_light_b' - ), - array( - 'name' => '颜色代码', - 'desc' => '请在这里输入你选择的颜色代码,举例:#000000获取颜色代码', - 'id' => 'git_color_nom', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => 'Hover颜色代码', - 'desc' => '请在这里输入你选择的Hover颜色代码,一般这里的颜色和上面的一样,只是会略深而已', - 'id' => 'git_color_hover', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '代码高亮主题', - 'desc' => '选择一个色调作为您网站的主色调,如果这里的色彩还不够,您可以使用下面的自定义色彩', - 'id' => 'git_prettify', - 'type' => 'radio', - 'options' => array( - 'monokai' => '黑色主题', - 'tomorrow' => '暗色主题', - 'solarized' => '蓝色主题', - 'deepblue' => '深绿主题', - 'yusigreen' => '淡绿主题' - ), - 'std' => 'yusigreen' - ), - array( - 'name' => '自定义登录页面背景', - 'desc' => '登录页面使用必应每日美图作为背景图,填写此项将使用自定义图片背景,不使用必应美图背景', - 'id' => 'git_loginbg', - 'type' => 'text', - 'std' => 'https://p.ssl.qhimg.com/t01552d259ec32fce5d.jpg' - ), - array( - 'title' => '侧边跟随设置', - 'type' => 'title' - ), - array( - 'name' => '侧边栏跟随', - 'desc' => '开启 【开启后为下面的选项选择侧边栏序号,注意是从2开始数的】', - 'id' => 'git_sideroll_b', - 'type' => 'checkbox' - ), - array( - 'name' => '第一个侧边栏:', - 'desc' => '跟随', - 'id' => 'git_sideroll_1', - 'type' => 'number', - 'std' => '' - ), - array( - 'name' => '第二个侧边栏:', - 'desc' => '跟随', - 'id' => 'git_sideroll_2', - 'type' => 'number', - 'std' => '' - ), - array( - 'title' => '分类设置', - 'type' => 'title' - ), - array( - 'name' => '是否开启CMS', - 'desc' => '启用 【不启用的话,显示是博客模式】', - 'id' => 'git_cms_b', - 'type' => 'checkbox' - ), - array( - 'name' => '网站是否开启卡片式', - 'desc' => '启用 【不启用的话,显示是传统博客形式】', - 'id' => 'git_card_b', - 'type' => 'checkbox' - ), - array( - 'name' => '选择分类展示形式', - 'desc' => '选择一种风格作为分类页面的展示形式,有卡片式和列表式', - 'id' => 'git_cat_style', - 'type' => 'radio', - 'options' => array( - 'git_cat_card' => '卡片风格', - 'git_cat_list' => '列表风格' - ), - 'std' => 'git_cat_card' - ), - array( - 'name' => '选择标签展示形式', - 'desc' => '选择一种风格作为标签页面的展示形式,有卡片式和列表式', - 'id' => 'git_tag_style', - 'type' => 'radio', - 'options' => array( - 'git_tag_card' => '卡片风格', - 'git_tag_list' => '列表风格' - ), - 'std' => 'git_tag_card' - ), - array( - 'name' => 'cms 分类文章数目', - 'desc' => '默认4个,也可以8个', - 'id' => 'git_cat_num', - 'type' => 'number', - 'std' => 4 - ), - array( - 'name' => '分类ID', - 'desc' => '显示在CMS首页的分类,举例:1,15,5,6,12,13,16,20', - 'id' => 'git_cat_id', - 'type' => 'text', - 'std' => '' - ), - array( - 'title' => '首页隐藏分类', - 'type' => 'title' - ), - array( - 'name' => '屏蔽分类', - 'desc' => '格式按照-3,-4,-5输入', - 'id' => 'git_blockcat', - 'type' => 'text', - 'std' => '' - ), - array( - 'title' => 'RSS隐藏分类', - 'type' => 'title' - ), - array( - 'name' => '屏蔽分类', - 'desc' => '格式按照-3,-4,-5输入', - 'id' => 'git_blockcat_rss', - 'type' => 'text', - 'std' => '' - ), - array( - 'title' => '搜索隐藏分类', - 'type' => 'title' - ), - array( - 'name' => '屏蔽分类', - 'desc' => '格式按照-3,-4,-5输入', - 'id' => 'git_blockcat_search', - 'type' => 'text', - 'std' => '' - ) - ), - - '幻灯设置' => array( - array( - 'title' => '幻灯片方案选择', - 'type' => 'title' - ), - array( - 'name' => '选择适合网站的幻灯片方案', - 'desc' => '选择一种风格作为标签页面的展示形式,有卡片式和列表式', - 'id' => 'git_slide_style', - 'type' => 'radio', - 'options' => array( - 'git_slide_3d' => '豪华版幻灯片', - 'git_slide_pt' => '简单版幻灯片', - 'git_slide_off' => '关闭幻灯片', - ), - 'std' => 'git_slide_pt' - ), - array( - 'title' => '幻灯片【豪华版】设置[716*297]', - 'type' => 'title' - ), - array( - 'name' => '移动端不显示', - 'desc' => '开启', - 'id' => 'git_mobilesticky_b', - 'type' => 'checkbox' - ), - array( - 'name' => '幻灯片显示数目', - 'desc' => '个', - 'id' => 'git_sticky_count', - 'type' => 'number', - 'std' => 4 - ), - array( - 'title' => '幻灯片【简约版】设置[855*300]', - 'type' => 'title' - ), - array( - 'name' => '幻灯片一图片', - 'desc' => '在这里输入您的幻灯片的图片路径', - 'id' => 'git_slick1img_b', - 'type' => 'text', - 'std' => 'https://p.ssl.qhimg.com/t018a12da24a5687855.jpg' - ), - array( - 'name' => '幻灯片一链接', - 'desc' => '在这里输入您的幻灯片的引用链接', - 'id' => 'git_slick1url_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '幻灯片一标题', - 'desc' => '在这里输入您的幻灯片的标题', - 'id' => 'git_slick1title_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '幻灯片二图片', - 'desc' => '在这里输入您的幻灯片的图片路径', - 'id' => 'git_slick2img_b', - 'type' => 'text', - 'std' => 'https://p.ssl.qhimg.com/t019de3d2e67ceef590.jpg' - ), - array( - 'name' => '幻灯片二链接', - 'desc' => '在这里输入您的幻灯片的引用链接', - 'id' => 'git_slick2url_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '幻灯片二标题', - 'desc' => '在这里输入您的幻灯片的标题', - 'id' => 'git_slick2title_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '幻灯片三图片', - 'desc' => '在这里输入您的幻灯片的图片路径', - 'id' => 'git_slick3img_b', - 'type' => 'text', - 'std' => 'https://p.ssl.qhimg.com/t01511a88bc738bebe9.jpg' - ), - array( - 'name' => '幻灯片三链接', - 'desc' => '在这里输入您的幻灯片的引用链接', - 'id' => 'git_slick3url_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '幻灯片三标题', - 'desc' => '在这里输入您的幻灯片的标题', - 'id' => 'git_slick3title_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '幻灯片四图片', - 'desc' => '在这里输入您的幻灯片的图片路径', - 'id' => 'git_slick4img_b', - 'type' => 'text', - 'std' => 'https://p.ssl.qhimg.com/t01e814d7303096185c.jpg' - ), - array( - 'name' => '幻灯片四链接', - 'desc' => '在这里输入您的幻灯片的引用链接', - 'id' => 'git_slick4url_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '幻灯片四标题', - 'desc' => '在这里输入您的幻灯片的标题', - 'id' => 'git_slick4title_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '幻灯片五图片', - 'desc' => '在这里输入您的幻灯片的图片路径', - 'id' => 'git_slick5img_b', - 'type' => 'text', - 'std' => 'https://p.ssl.qhimg.com/t0173790ccd103bf12b.jpg' - ), - array( - 'name' => '幻灯片五链接', - 'desc' => '在这里输入您的幻灯片的引用链接', - 'id' => 'git_slick5url_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '幻灯片五标题', - 'desc' => '在这里输入您的幻灯片的标题', - 'id' => 'git_slick5title_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '幻灯片六图片', - 'desc' => '在这里输入您的幻灯片的图片路径', - 'id' => 'git_slick6img_b', - 'type' => 'text', - 'std' => 'https://p.ssl.qhimg.com/t018514935a00cbeeb7.jpg' - ), - array( - 'name' => '幻灯片六链接', - 'desc' => '在这里输入您的幻灯片的引用链接', - 'id' => 'git_slick6url_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '幻灯片六标题', - 'desc' => '在这里输入您的幻灯片的标题', - 'id' => 'git_slick6title_b', - 'type' => 'text', - 'std' => '' - ) - ), - - '社交设置' => array( - array( - 'title' => '社交小图标,空置默认为不启用,建议别超过六个', - 'type' => 'title' - ), - array( - 'name' => 'RSS订阅地址', - 'desc' => '如果您想使用自定义的RSS地址,请在这里输入您期望的地址。', - 'id' => 'git_rss', - 'type' => 'text', - 'std' => '', - ), - array( - 'name' => '新浪微博', - 'desc' => '填写新浪微博个人主页链接', - 'id' => 'git_weibo', - 'type' => 'text', - 'std' => 'https://gitcafe.net/go/weibo' - ), - array( - 'name' => '腾讯微信', - 'desc' => '请输入您的微信号', - 'id' => 'git_weixin', - 'type' => 'text', - 'std' => 'yunluoV587' - ), - array( - 'name' => '微信二维码', - 'desc' => '请输入您的二维码图片路径', - 'id' => 'git_weixin_qr', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '腾讯QQ', - 'desc' => '直接输入QQ号即可', - 'id' => 'git_qqContact', - 'type' => 'text', - 'std' => '865113728' - ), - array( - 'name' => 'Email', - 'desc' => '请填写好您的邮我代码,获取邮我组建代码', - 'id' => 'git_emailContact', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '支付宝', - 'desc' => '', - 'id' => 'git_pay', - 'type' => 'text', - 'std' => 'sp91@qq.com' - ), - array( - 'name' => '支付宝二维码', - 'desc' => '请输入您的支付宝图片路径', - 'id' => 'git_pay_qr', - 'type' => 'text', - 'std' => 'https://p.ssl.qhimg.com/t0162cc8398cbf7dea3.jpg' - ), - array( - 'name' => '自定义社交网络名字', - 'desc' => '输入您的其他的社交网络名字,比如:github', - 'id' => 'git_customicon_name', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '自定义社交网络链接', - 'desc' => '输入您的其他的社交网络链接', - 'id' => 'git_customicon_url', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '自定义社交网络图标', - 'desc' => '输入您的其他的社交网络图标,使用awesome图标,格式类似于fa-github', - 'id' => 'git_customicon_icon', - 'type' => 'text', - 'std' => '' - ) - ), - '底部设置' => array( - array( - 'name' => '超级Footer', - 'desc' => '启用【开启后,下面的设置才会有效】', - 'id' => 'git_superfoot_b', - 'type' => 'checkbox' - ), - array( - 'name' => 'Footer1标题', - 'desc' => '在这里输入第一个footer的标题', - 'id' => 'git_foottitle1', - 'type' => 'text', - 'std' => '版权声明' - ), - array( - 'name' => 'Footer1内容', - 'desc' => '在这里输入第一个footer的内容', - 'id' => 'git_footconent1', - 'type' => 'textarea', - 'std' => '本站的文章和资源来自互联网或者站长
的原创,按照 CC BY -NC -SA 3.0 CN
协议发布和共享,转载或引用本站文章
应遵循相同协议。如果有侵犯版权的资
源请尽快联系站长,我们会在24h内删
除有争议的资源。' - ), - array( - 'name' => 'Footer2标题', - 'desc' => '在这里输入第二个footer的标题', - 'id' => 'git_foottitle2', - 'type' => 'text', - 'std' => '网站驱动' - ), - array( - 'name' => 'Footer2内容', - 'desc' => '在这里输入第二个footer的内容', - 'id' => 'git_footconent2', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => 'Footer3标题', - 'desc' => '在这里输入第三个footer的标题', - 'id' => 'git_foottitle3', - 'type' => 'text', - 'std' => '友情链接' - ), - array( - 'name' => 'Footer3内容', - 'desc' => '在这里输入第三个footer的内容', - 'id' => 'git_footconent3', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => 'Footer4标题', - 'desc' => '在这里输入第四个footer的标题', - 'id' => 'git_foottitle4', - 'type' => 'text', - 'std' => '支持主题' - ), - array( - 'name' => 'Footer4内容', - 'desc' => '在这里输入第四个footer的内容', - 'id' => 'git_footconent4', - 'type' => 'textarea', - 'std' => 'yunluo' - ), - array( - 'name' => '网站footer公共代码', - 'desc' => '在全站页面footer部分出现,可放置网站的版权信息等等', - 'id' => 'git_footcode', - 'type' => 'textarea', - 'std' => 'Copyright © 2014-2015 极客公园 | 关于网站 | 标签汇总 | 文章归档 | 友情链接 | 网站地图 | 由 云左 & 七牛 & 强力驱动' - ), - array( - 'name' => '全站底部脚本代码', - 'desc' => '可放置广告代码等自定义(css或js)的全局代码块', - 'id' => 'git_footercode', - 'type' => 'textarea', - 'std' => '' - ) - ), - '广告设置' => array( - array( - 'name' => '网站顶部右侧广告', - 'desc' => '开启 【这里需要logo居左才可以生效】', - 'id' => 'git_toubuads', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => '广告:404页面广告', - 'desc' => '开启', - 'id' => 'git_404ad', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => '广告:全站 - 导航下横幅', - 'desc' => '显示在公告栏下', - 'id' => 'git_adsite_01', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => '广告:幻灯片下广告', - 'desc' => '如果幻灯没开启,则不显示', - 'id' => 'git_adindex_02', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => '广告:文章页 - 页面标题下', - 'desc' => '开启', - 'id' => 'git_adpost_01', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => '广告:文章页 - 相关文章下', - 'desc' => '开启', - 'id' => 'git_adpost_02', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => '广告:文章页 - 网友评论下', - 'desc' => '开启', - 'id' => 'git_adpost_03', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => '广告:下载单页上横幅', - 'desc' => '开启', - 'id' => 'git_downloadad1', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => '广告:下载单页下横幅', - 'desc' => '开启', - 'id' => 'git_downloadad2', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => '手机广告:全站正文列表最', - 'desc' => '开启【手机广告只适合在手机中投放。例如百度联盟移动广告,PC端不会显示。下同】', - 'id' => 'Mobiled_adindex_02', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => '手机广告:文章页 - 页面标题下', - 'desc' => '开启', - 'id' => 'Mobiled_adpost_01', - 'type' => 'textarea', - 'std' => '' - ), - array( - 'name' => '手机广告:文章页 - 相关文章下', - 'desc' => '开启', - 'id' => 'Mobiled_adpost_02', - 'type' => 'textarea', - 'std' => '' - ) - ), - '优化设置' => array( - array( - 'name' => '禁用REST API', - 'desc' => '禁用 【禁用后,APP开发或者小程序开发会有影响】', - 'id' => 'git_restapi_b', - 'type' => 'checkbox' - ), - array( - 'name' => '链接去掉Categroy', - 'desc' => '启用 【开启后,需要至设置——固定连接——重新保存一下,否则会发生404错误】', - 'id' => 'git_categroy_b', - 'type' => 'checkbox' - ), - array( - 'name' => '百度收录提示', - 'desc' => '启用 【开启后,将会在文章标题下显示百度收录状态,需要curl扩展的支持,否则不生效】', - 'id' => 'git_baidurecord_b', - 'type' => 'checkbox' - ), - array( - 'name' => '网站下雪特效', - 'desc' => '启用 【开启后,将产生全站下雪特效,但是没事的时候也不要下雪】', - 'id' => 'git_snow_b', - 'type' => 'checkbox' - ), - array( - 'name' => '网站禁止复制', - 'desc' => '启用 【启用后访客无法使用右键复制】', - 'id' => 'git_copy_b', - 'type' => 'checkbox' - ), - array( - 'name' => '复制弹窗提醒', - 'desc' => '启用 【启用后,访客复制之后会弹出提示弹窗】', - 'id' => 'git_copydialog_b', - 'type' => 'checkbox' - ), - array( - 'name' => '页面&站内搜索伪静态', - 'desc' => '启用 【开启后,请前往固定连接重新保存一下,否则404】', - 'id' => 'git_pagehtml_b', - 'type' => 'checkbox' - ), - array( - 'name' => '评论UA', - 'desc' => '启用', - 'id' => 'git_ua_b', - 'type' => 'checkbox' - ), - array( - 'name' => '取消静态资源的版本查询', - 'desc' => '启用', - 'id' => 'git_query', - 'type' => 'checkbox' - ), - array( - 'title' => 'WordPress安全设置[小白慎用]', - 'type' => 'title' - ), - array( - 'name' => '加密WordPress后台', - 'desc' => '启用 【启用之后,请填写下面的问题与答案,访问链接格式:http://yoursite/wp-login.php?问题=答案】', - 'id' => 'git_admin', - 'type' => 'checkbox' - ), - array( - 'name' => '访问问题[绝对不准用中文]', - 'desc' => '这里随便填写一个字符,比如:googlo', - 'id' => 'git_admin_q', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '访问答案[绝对不准用中文]', - 'desc' => '这里随便填写一个字符,比如:yunluo', - 'id' => 'git_admin_a', - 'type' => 'text', - 'std' => '' - ), - array( - 'name' => '后台登录错误报警', - 'desc' => '启用 【启用之后,后台登录错误之后会自动邮件报警】', - 'id' => 'git_login_tx', - 'type' => 'checkbox' - ), - array( - 'name' => '禁用HTML标签评论', - 'desc' => '启用 【启用之后,评论框下方的一些按钮将不可用,谨慎考虑】', - 'id' => 'git_html_comment', - 'type' => 'checkbox' - ), - array( - 'title' => 'WordPress注册登录设置', - 'type' => 'title' - ), - array( - 'name' => '登录和注册安全验证', - 'desc' => '启用 【启用之后,将在登录和注册页面添加数学题验证,若有更好的验证方法,可关闭】', - 'id' => 'git_admin_captcha', - 'type' => 'checkbox' - ), - array( - 'name' => '限制每个IP的注册', - 'desc' => '启用 【启用之后,主题会在网站根目录生成ips.txt文件,里面的ip就是保存的已注册用户的ip】', - 'id' => 'git_regist_ips', - 'type' => 'checkbox' - ), - array( - 'name' => '每个IP允许注册的用户数', - 'desc' => '请输入每个IP允许的注册数目,默认为1', - 'id' => 'git_regist_ips_num', - 'type' => 'number', - 'std' => 1 - ), - array( - 'name' => '新用户注册站长邮件', - 'desc' => '关闭 【该功能为有用户注册时给站长发邮件,鸡肋功能,建议关闭】', - 'id' => 'git_user_notification_to_admin', - 'type' => 'checkbox' - ), - array( - 'name' => '自定义注册欢迎邮件', - 'desc' => '开启 【本功能为用户注册后发一个体验较好的邮件,开启后同时关闭默认欢迎邮件】', - 'id' => 'git_user_notification_to_user', - 'type' => 'checkbox' - ), - array( - 'name' => '开启用户注册成功重定向', - 'desc' => '开启', - 'id' => 'git_register_redirect_ok', - 'type' => 'checkbox' - ), - array( - 'name' => '注册成功后重定向', - 'desc' => '选择一个重定向链接,如果选择自定义URL,请在下方填写好跳转链接', - 'id' => 'git_redirect_choise', - 'type' => 'radio', - 'options' => array( - 'git_redirect_home' => '网站首页', - 'git_redirect_author' => '前台个人中心', - 'git_redirect_profile' => '后台台个人中心', - 'git_redirect_customurl' => '自定义URL' - ), - 'std' => 'git_redirect_home' - ), - array( - 'name' => '自定义注册重定向URL', - 'desc' => '如果自定义跳转开启的话,这里一定要填写链接', - 'id' => 'git_register_redirect_url', - 'type' => 'text', - 'std' => '' - ) - ), - '支付设置' => array( - array( + ] + ], + '支付设置' => [ + [ 'title' => '统一支付设置', 'type' => 'title' - ), - array( + ], + [ 'name' => '金币和RMB兑换关系', 'desc' => '请输入兑换关系,比如1RMB=10金币,请慎重选择,一旦设置好后面不能修改的', 'id' => 'git_chongzhi_dh', 'type' => 'number', 'std' => 10 - ), - array( + ], + [ 'name' => '选择一个支付方式', 'desc' => '两种方案选择其中一种,必须选择一个哦', 'id' => 'git_pay_way', 'type' => 'radio', - 'options' => array( + 'options' => [ 'git_payjs_ok' => '调用Payjs支付', 'git_eapay_ok' => '调用简付支付' - ), + ], 'std' => 'git_payjs_ok' - ), - array( + ], + [ 'title' => 'PayJs支付设置   注册PayJs   【微信官方,微信正规渠道,强烈推荐】', 'type' => 'title' - ), - array( + ], + [ 'name' => 'PayJs商户号', 'desc' => '', 'id' => 'git_payjs_id', 'type' => 'text', 'std' => 2333333333 - ), - array( + ], + [ 'name' => 'PayJs密钥', 'desc' => '', 'id' => 'git_payjs_secret', 'type' => 'text', 'std' => 444444444 - ), - array( + ], + [ 'title' => '简付支付设置   注册简付', 'type' => 'title' - ), - array( + ], + [ 'name' => '简付App ID', 'desc' => '', 'id' => 'git_eapay_id', 'type' => 'text', 'std' => 2333333333 - ), - array( + ], + [ 'name' => '简付App Key', 'desc' => '', 'id' => 'git_eapay_secret', 'type' => 'text', 'std' => 444444444 - ) - ), - '高级设置' => array( - array( - 'name' => '头像来源设置', - 'desc' => '头像设置,云落强烈推荐选择随机头像,懒人选择', - 'id' => 'git_avater', - 'type' => 'radio', - 'options' => array( - 'git_avatar_rand' => '随机头像【速度最快但随机】', - 'git_avatar_qn' => '头像镜像【精确头像但速度略慢】' - ), - 'std' => 'git_avatar_qn' - ), - array( + ] + ], + '高级设置' => [ + [ 'name' => 'jQuery来源设置', 'desc' => '选择一个适合自己的jQuery公共库来源', 'id' => 'git_jqcdn', 'type' => 'radio', - 'options' => array( + 'options' => [ 'git_jqcdn_upai' => '远程jQuery库【底部加载,速度快,兼容差】', 'git_jqcdn_bendi' => '本地jQuery库【头部加载,速度慢,兼容好】' - ), + ], 'std' => 'git_jqcdn_upai' - ), - array( + ], + [ 'name' => 'HTML代码压缩', 'desc' => '启用 【开启后,将压缩网页HTML代码,可读性会降低,但是性能略有提升】', 'id' => 'git_compress', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '图片懒加载', 'desc' => '启用 【开启后,网站图片将进行懒加载】', 'id' => 'git_lazyload', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '侧边栏缓存', 'desc' => '启用 【开启后,将会自动缓存小工具,如果想禁止缓存某个小工具,可以去小工具页面排除】', 'id' => 'git_sidebar_cache', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '开启前台弹窗登录', 'desc' => '如果启用UM插件,最好开启', 'id' => 'git_fancylogin', 'type' => 'checkbox' - ), - array( - 'title' => '新浪微博同步设置', + ], + [ + 'title' => 'CDN镜像加速', 'type' => 'title' - ), - array( - 'name' => '开启', - 'desc' => '', - 'id' => 'git_sinasync_b', - 'type' => 'checkbox' - ), - array( - 'name' => '新浪用户名', - 'desc' => '最好输入您的微博的登陆邮箱', - 'id' => 'git_wbuser_b', + ], + [ + 'name' => 'CDN镜像加速', + 'desc' => '开启本功能可以将本站静态资源同步到远程CDN服务器,减轻本站的流量压力,提高网站整体速度,国内主流CDN服务商[七牛,又拍,阿里OSS,腾讯COS,华为BOS等等]均支持,默认关闭,配置好服务器端后开启', + 'id' => 'gdk_cdn', + 'type' => 'radio', + 'options' => [ + '0' => '禁用', + '1' => '开启' + ], + 'std' => '0' + ], + [ + 'name' => 'CDN域名', + 'desc' => '输入您的CDN域名,一般需要到cdn后台获取,必须带 http(s):// ,且结尾不能带/ ', + 'id' => 'gdk_cdn_host', 'type' => 'text', 'std' => '' - ), - array( - 'name' => '新浪密码', - 'desc' => '请输入您的微博密码', - 'id' => 'git_wbpasd_b', - 'type' => 'password', - 'std' => '' - ), - array( - 'name' => '新浪appkey', - 'desc' => '请输入您的微博appkey,这个需要您自己去微博开放平台申请', - 'id' => 'git_wbapky_b', - 'type' => 'text', - 'std' => '' - ), - array( - 'title' => 'CDN镜像加速设置', - 'type' => 'title' - ), - array( - 'name' => '开启', - 'desc' => '', - 'id' => 'git_qncdn_b', - 'type' => 'checkbox' - ), - array( - 'name' => 'CDN加速域名', - 'desc' => '输入本项目之前,必须开启本功能,输入您的七牛云自定义域名,必须带 http:// 结尾不能带/ 注册七牛,并获取链接如图', - 'id' => 'git_cdnurl_b', - 'type' => 'text', - 'std' => '' - ), - array( + ], + [ 'name' => 'CDN镜像文件格式', - 'desc' => '在输入框内添加准备镜像的文件格式,比如jpg,png,gif,mp3,mp4(使用|分隔)', - 'id' => 'git_cdnurl_format', + 'desc' => '在输入框内添加准备镜像的文件格式,比如png|jpg|jpeg|gif|ico(使用|分隔)', + 'id' => 'gdk_cdn_ext', 'type' => 'text', 'std' => 'png|jpg|jpeg|gif|ico|html|7z|zip|rar|pdf|ppt|wmv|mp4|avi|mp3|txt' - ), - array( - 'name' => 'CDN镜像文件夹', - 'desc' => '在输入框内添加准备镜像的文件夹,比如wp-content|wp-includes(使用|分隔)', - 'id' => 'git_cdnurl_dir', + ], + [ + 'name' => 'CDN镜像目录', + 'desc' => '在输入框内添加准备镜像的文件夹,默认为wp-content|wp-includes(使用|分隔)', + 'id' => 'gdk_cdn_dir', 'type' => 'text', 'std' => 'wp-content|wp-includes' - ), - array( - 'name' => 'CDN自定义样式', - 'desc' => '启用【使用七牛CDN可以不启用,其他CDN必须启用', - 'id' => 'git_cdnurl_style', - 'type' => 'checkbox' - ), - array( + ], + [ + 'name' => 'CDN自定义缩略图样式', + 'desc' => '国内CDN服务商均支持的功能,使用自定义图片样式功能进行裁剪缩略图,默认使用的分隔符为【!】,默认开启', + 'id' => 'gdk_cdn_style', + 'type' => 'radio', + 'options' => [ + '0' => '禁用', + '1' => '开启' + ], + 'std' => '1' + ], + [ 'name' => 'CDN水印', 'desc' => '启用【如果启用,请在七牛,又拍,OSS等CDN中设置自定义样式,名字为:water.jpg,分隔符为 ! 】', 'id' => 'git_cdn_water', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => 'CDN镜像后台化', 'desc' => '启用【一般可不启用,如果您启用CDN镜像之后并在FTP删除了本地文件,则必须开启】', 'id' => 'git_adminqn_b', 'type' => 'checkbox' - ), - array( + ], + [ 'title' => '微信登录设置', 'type' => 'title' - ), - array( + ], + [ 'name' => '是否启用微信扫码登录', 'desc' => '启用 【开启后,新建微信登录页面即可,另外需要HTTPS】', 'id' => 'git_weauth_oauth', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '是否启用强制微信登录', 'desc' => '启用 【开启后,将禁用WordPress自带的登录,所有登录地址都跳转到微信的登录,如需临时使用自带登录,可以使用这个链接:你的域名/wp-login.php?loggedout=true】', 'id' => 'git_weauth_oauth_force', 'type' => 'checkbox' - ), - array( + ], + [ 'title' => '微信推送设置', 'type' => 'title' - ), - array( + ], + [ 'name' => '评论微信推送提醒', 'desc' => '启用【开启后,如果网站有新的评论,可以给您的微信推送提醒,这个只是给网站管理员提醒,不涉及访客】', 'id' => 'git_Server', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '微信推送KEY', 'desc' => '请输入您的微信推送KEY', 'id' => 'git_Server_key', 'type' => 'text', 'std' => '' - ), - array( + ], + [ 'name' => '微信订阅号/公众号二维码', 'desc' => '请输入您的微信订阅号/公众号二维码图片链接,不要想得太多,只是给主题调用的。', 'id' => 'git_mp_qr', 'type' => 'text', 'std' => '' - ), - array( + ], + [ 'name' => '微信验证码', 'desc' => '请输入您的微信验证码,这里的必须要要和微信里面回复的保持一致。', 'id' => 'git_mp_code', 'type' => 'text', 'std' => '2233' - ), - array( + ], + [ 'name' => '微信可见提示信息,可用html代码', 'desc' => '在本输入框内输入您的微信公众号描述信息,支持html代码,字数合适就行,不能太多', 'id' => 'git_mp_tips', 'type' => 'textarea', 'std' => '请关注极客公园官方微信公众号,关注并订阅云落极客公园获取验证码。在微信里搜索云落极客公园或者微信扫描二维码都可以关注极客公园官方微信公众号。' - ), - array( + ], + [ 'title' => 'HTML5 桌面推送', 'type' => 'title' - ), - array( + ], + [ 'name' => 'HTML5推送标题【必选】', 'desc' => '显示在弹窗顶部', 'id' => 'git_notification_title', 'type' => 'text', 'std' => 'Hi,你好' - ), - array( + ], + [ 'name' => 'HTML5推送间隔【必选】', 'desc' => '输入数字,当自动关闭或者用户关闭之后多久再次弹窗,默认10天', 'id' => 'git_notification_days', 'type' => 'number', 'std' => 10 - ), - array( + ], + [ 'name' => 'HTML5推送COOKIE【必选】', 'desc' => '修改COOKIE值可以强制向访客推送新的信息,无视时间间隔,不能使用中文,默认233', 'id' => 'git_notification_cookie', 'type' => 'text', 'std' => '233' - ), - array( + ], + [ 'name' => 'HTML5推送图片【必选】', 'desc' => '填写一个正方形的图片,显示在推送信息左侧,默认为默认头像', 'id' => 'git_notification_icon', 'type' => 'text', 'std' => '', - ), - array( + ], + [ 'name' => 'HTML5推送链接【可选】', 'desc' => '当用户点击弹窗的时候说点击的链接,默认为极客公园', 'id' => 'git_notification_link', 'type' => 'text', 'std' => 'https://gitcafe.net' - ), - array( + ], + [ 'name' => 'HTML5推送内容', 'desc' => '在这里输入推送主体内容,字数合适就行,不能太多【必选】', 'id' => 'git_notification_body', 'type' => 'textarea', 'std' => '极客公园,一个分享有趣的安卓APP和实用的WordPress技术以及Windows使用技巧的网站' - ), - array( + ], + [ 'title' => 'SMTP邮箱设置', 'type' => 'title' - ), - array( + ], + [ 'name' => '发件人地址', 'desc' => '请输入您的邮箱地址', 'id' => 'git_maildizhi_b', 'type' => 'text', 'std' => '' - ), - array( + ], + [ 'name' => '发件人昵称', 'desc' => '请输入您的网站名称', 'id' => 'git_mailnichen_b', 'type' => 'text', 'std' => '' - ), - array( + ], + [ 'name' => 'SMTP服务器地址', 'desc' => '请输入您的邮箱的SMTP服务器,查看查看常用SMTP地址', 'id' => 'git_mailsmtp_b', 'type' => 'text', 'std' => 'smtp.qq.com' - ), - array( + ], + [ 'name' => 'SSL安全连接', 'desc' => '启用【如果你布吉岛这个是什么东东,那么请不要启用】', 'id' => 'git_smtpssl_b', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => 'SMTP服务器端口', 'desc' => '请输入您的smtp端口,一般QQ邮箱25就可以了,如果选择了上面的SSL,推荐使用465端口', 'id' => 'git_mailport_b', 'type' => 'number', 'std' => 465 - ), - array( + ], + [ 'name' => '邮箱账号', 'desc' => '请输入您的邮箱地址,比如云落的sp91@qq.com', 'id' => 'git_mailuser_b', 'type' => 'text', 'std' => '' - ), - array( + ], + [ 'name' => '邮箱密码', 'desc' => '请输入您的邮箱授权码', 'id' => 'git_mailpass_b', 'type' => 'password', 'std' => '' - ), - array( + ], + [ 'title' => '站内搜索设置', 'type' => 'title' - ), - array( + ], + [ 'name' => '百度站内搜索', 'desc' => '开启 【开启百度站内搜索将关闭自带搜索】', 'id' => 'git_search_baidu', 'type' => 'checkbox' - ), - array( + ], + [ 'name' => '百度站内搜索代码', 'desc' => '将从百度搜索获取的代码添加到本输入框', 'id' => 'git_search_code', 'type' => 'textarea', 'std' => '' - ), - array( + ], + [ 'title' => '下载设置', 'type' => 'title' - ), - array( + ], + [ 'name' => '弹窗下载备注', 'desc' => '开启【主要填写一句对文件的普遍性备注,一般是下载方式,加密密码,解压方式等等】', 'id' => 'git_fancydlad', 'type' => 'text', 'std' => '本站文件全部采用7Z压缩,请使用7-Zip解压文件' - ), - array( + ], + [ 'name' => '弹窗下载版权声明', 'desc' => '开启【就是那种本文件收集自网络,有问题联系站长那些装X的文字】', 'id' => 'git_fancydlcp', 'type' => 'textarea', 'std' => '本站所有软件和资料均为软件作者提供或网友推荐发布而来,仅供学习和研究使用,不得用于任何商业用途。如本站不慎侵犯你的版权请联系我,我将及时处理,并撤下相关内容! ' - ), - array( + ], + [ 'name' => '下载面板下载声明', 'desc' => '这里的文字在下载面板中粗线,建议文字不要太多,防止错位', 'id' => 'git_dltable_b', 'type' => 'textarea', 'std' => '本站文件大多来自于网络,仅供学习和研究使用,不得用于商业用途,如有版权问题,请联系博猪!' - ), - array( + ], + [ 'name' => '下载单页下载声明', 'desc' => '这里的文字在下载单页中粗线,采用<ol><li>文字</li></ol>的形式', 'id' => 'git_dlpage_dl', @@ -1641,13 +742,13 @@ $gdk_options = array(

下载文件若为压缩包,亲留意文章中的解压密码,并尽量使用最新版压缩软件解压

下载压缩包文件损坏,请切换其他渠道下载损坏部分

以上如有疑问,请在文章中留言给博猪

' - ), - array( + ], + [ 'name' => '下载单页免责声明', 'desc' => '这里的文字在下载单页中粗线,纯文字即可', 'id' => 'git_dlpage_mz', 'type' => 'textarea', 'std' => '本站大部分下载资源收集于网络,只做学习和交流使用,版权归原作者所有,若为付费内容,请在下载后24小时之内自觉删除,若作商业用途请购买正版,由于未及时购买和付费发生的侵权行为,与本站无关。本站发布的内容若侵犯到您的权益,请联系站长删除,我们将及时处理!' - ) - ) -); \ No newline at end of file + ] + ] +]; \ No newline at end of file diff --git a/framework/plugin-options.php b/framework/plugin-options.php index 585874c..0fb0f31 100644 --- a/framework/plugin-options.php +++ b/framework/plugin-options.php @@ -17,9 +17,9 @@ function gdk_update_options() { global $gdk_default_options, $gdk_options, $gdk_current_options; foreach ($gdk_options as $panel) { foreach ($panel as $option) { - $id = isset( $option['id'] ) ? $option['id'] : ''; - $type = isset( $option['type'] ) ? $option['type'] : ''; - $std = isset( $option['std'] ) ? $option['std'] : ''; + $id = $option['id'] ?? ''; + $type = $option['type'] ?? ''; + $std = $option['std'] ?? ''; if ( !$id ) continue; $gdk_default_options[$id] = $std; if ( isset($gdk_current_options[$id]) ) continue; @@ -67,7 +67,7 @@ foreach ( array_keys($gdk_options) as $i => $name ) { '; + echo '
'; foreach ( $panel as $option ) { $type = $option['type']; if ( $type == 'title' ) { @@ -248,6 +248,13 @@ switch ( $type ) { border-bottom: 4px solid #6b48ff; } +.gdk_option input[type=radio]:checked::before { + background-color: #6b48ff; +} +.gdk_option input[type=radio]:focus { + box-shadow: 0 0 0 1px #6b48ff; +} + .wp-filter .drawer-toggle:before { content: "\f463"; color: #fff!important; diff --git a/functions/security.php b/functions/security.php index e1dc013..804ac81 100644 --- a/functions/security.php +++ b/functions/security.php @@ -28,9 +28,9 @@ add_action( 'wp', 'gdk_prevent_script_injection' ); } } - - if ( ! class_exists( 'Gdk_Limit_Login_Attempts' ) ) { - class Gdk_Limit_Login_Attempts { +if(gdk_get_option('gdk_lock_login')){ + if ( ! class_exists( 'GDK_Limit_Login_Attempts' ) ) { + class GDK_Limit_Login_Attempts { var $failed_login_limit = 3; //登录失败的次数限制 var $lockout_duration = 60; @@ -44,8 +44,8 @@ add_action( 'wp', 'gdk_prevent_script_injection' ); add_action( 'wp_login_failed', array( $this, 'login_failed' ), 10, 1 ); } /** - * Lock login attempts of failed login limit is reached - */ + * Lock login attempts of failed login limit is reached + */ public function check_attempted_login( $user, $username, $password ) { if ( get_transient( $this->transient_name ) ) { $datas = get_transient( $this->transient_name ); @@ -53,35 +53,33 @@ add_action( 'wp', 'gdk_prevent_script_injection' ); $until = get_option( '_transient_timeout_' . $this->transient_name ); $time = $this->when( $until ); //Display error message to the user when limit is reached - return new WP_Error( 'too_many_tried', sprintf( esc_attr( 'ERROR: 您已达到登陆错误次数,请在 %1$s 后再次尝试登陆.' ) , $time ) ); + return new WP_Error( 'too_many_tried', sprintf( esc_attr( 'ERROR:您已触发登陆安全保护,请在 %1$s 后再次尝试.' ) , $time ) ); } } return $user; } /** - * Add transient - */ + * Add transient + */ public function login_failed( $username ) { if ( get_transient( $this->transient_name ) ) { $datas = get_transient( $this->transient_name ); $datas['tried']++; if ( $datas['tried'] <= $this->failed_login_limit ) - set_transient( $this->transient_name, $datas , $this->lockout_duration ); + set_transient( $this->transient_name, $datas , $this->lockout_duration ); } else { - $datas = array( - 'tried' => 1 - ); + $datas = array('tried' => 1 ); set_transient( $this->transient_name, $datas , $this->lockout_duration ); } } /** - * Return difference between 2 given dates - * @param int $time Date as Unix timestamp - * @return string Return string - */ + * Return difference between 2 given dates + * @param int $time Date as Unix timestamp + * @return string Return string + */ private function when( $time ) { if ( ! $time ) - return; + return; $right_now = time(); $diff = abs( $right_now - $time ); $second = 1; @@ -89,20 +87,20 @@ add_action( 'wp', 'gdk_prevent_script_injection' ); $hour = $minute * 60; $day = $hour * 24; if ( $diff < $minute ) - return floor( $diff / $second ) . ' ' . esc_attr( '秒' ); + return floor( $diff / $second ) . ' ' . esc_attr( '秒' ); if ( $diff < $minute * 2 ) - return esc_attr( 'about 1 minute ago' ); + return esc_attr( 'about 1 minute ago' ); if ( $diff < $hour ) - return floor( $diff / $minute ) . ' ' . esc_attr( '分' ); + return floor( $diff / $minute ) . ' ' . esc_attr( '分' ); if ( $diff < $hour * 2 ) - return esc_attr( 'about 1 hour'); + return esc_attr( 'about 1 hour'); return floor( $diff / $hour ) . ' ' . esc_attr( '小时' ); } } } //Enable it: - new Gdk_Limit_Login_Attempts(); - + new GDK_Limit_Login_Attempts(); +} //禁用登陆错误信息 @@ -119,36 +117,7 @@ add_filter( 'login_errors', 'gdk_disable_login_errors' ); //禁用找回密码 -class Gdk_Password_Reset_Removed -{ - function __construct() { - add_filter( 'show_password_fields', array( $this, 'disable' ) ); - add_filter( 'allow_password_reset', array( $this, 'disable' ) ); - add_filter( 'gettext', array( $this, 'remove' ) ); - } - - function disable() { - if ( is_admin() ) { - $user_id = get_current_user_id(); - $user = get_user_by('id' , $user_id ); - if ( !empty( $user->roles ) && is_array( $user->roles ) && $user->roles[0] == 'administrator' ) - return true; - } - return false; - } - - function remove( $translated_text, $untranslated_text ) { - if ( is_login() && in_string($untranslated_text,'Lost your password?') ){ - return str_replace('Lost your password?','',$untranslated_text); - }else{ - return $translated_text; - } - } - - -} - -new Gdk_Password_Reset_Removed(); +add_filter('allow_password_reset', '__return_false' ); //拦截无来路的评论 add_action('check_comment_flood', 'gdk_comment_check_referrer'); @@ -157,3 +126,25 @@ add_action('check_comment_flood', 'gdk_comment_check_referrer'); wp_die( esc_attr( 'Please enable referrers in your browser!' ) ); } } + + +//拦截垃圾评论 +function gdk_url_spamcheck($approved, $commentdata) { + return (strlen($commentdata['comment_author_url']) > 50) ? 'spam' : $approved; +} +add_filter('pre_comment_approved', 'gdk_url_spamcheck', 99, 2); + +function gdk_comment_lang($incoming_comment) { + $pattern = '/[一-龥]/u'; + // 禁止全英文评论 + if (!preg_match($pattern, $incoming_comment['comment_content'])) { + wp_die("您的评论中必须包含汉字!"); + } + $pattern = '/[あ-んア-ン]/u'; + // 禁止日文评论 + if (preg_match($pattern, $incoming_comment['comment_content'])) { + wp_die("评论禁止包含日文!"); + } + return($incoming_comment); +} +add_filter('preprocess_comment', 'gdk_comment_lang'); \ No newline at end of file diff --git a/functions/server.php b/functions/server.php index f46abef..e66c051 100644 --- a/functions/server.php +++ b/functions/server.php @@ -1,128 +1,14 @@ post_content; - $get_post_title = get_post($post_ID)->post_title; - if ($get_post_info->post_status == 'publish' && $_POST['original_post_status'] != 'publish') { - $appkey = git_get_option('git_wbapky_b'); - $username = git_get_option('git_wbuser_b'); - $userpassword = git_get_option('git_wbpasd_b'); - $request = new WP_Http; - $keywords = ""; - $tags = wp_get_post_tags($post_ID); - foreach ($tags as $tag) { - $keywords = $keywords . '#' . $tag->name . "#"; - } - $string1 = '【' . strip_tags($get_post_title) . '】:'; - $string2 = $keywords . ' [阅读全文]:' . get_permalink($post_ID); - /* 微博字数控制,避免超标同步失败 */ - $wb_num = (138 - WeiboLength($string1 . $string2)) * 2; - $status = $string1 . mb_strimwidth(strip_tags(apply_filters('the_content', $get_post_centent)) , 0, $wb_num, '...') . $string2; - $api_url = 'https://api.weibo.com/2/statuses/update.json'; - $body = array( - 'status' => $status, - 'source' => $appkey - ); - $headers = array( - 'Authorization' => 'Basic ' . base64_encode("$username:$userpassword") - ); - $result = $request->post($api_url, array( - 'body' => $body, - 'headers' => $headers - )); - /* 若同步成功,则给新增自定义栏目git_weibo_sync,避免以后更新文章重复同步 */ - add_post_meta($post_ID, 'git_weibo_sync', 1, true); - } -} -if (git_get_option('git_sinasync_b')) { - add_action('publish_post', 'post_to_sina_weibo', 0); -} -/* -//获取微博字符长度函数 -*/ -function WeiboLength($str) { - $arr = arr_split_zh($str); //先将字符串分割到数组中 - foreach ($arr as $v) { - $temp = ord($v); //转换为ASCII码 - if ($temp > 0 && $temp < 127) { - $len = $len + 0.5; - } else { - $len++; - } - } - return ceil($len); //加一取整 - -} -/* -//拆分字符串函数,只支持 gb2312编码 -//参考:http://u-czh.iteye.com/blog/1565858 -*/ -function arr_split_zh($tempaddtext) { - $tempaddtext = iconv("UTF-8", "GBK//IGNORE", $tempaddtext); - $cind = 0; - $arr_cont = array(); - for ($i = 0; $i < strlen($tempaddtext); $i++) { - if (strlen(substr($tempaddtext, $cind, 1)) > 0) { - if (ord(substr($tempaddtext, $cind, 1)) < 0xA1) { //如果为英文则取1个字节 - array_push($arr_cont, substr($tempaddtext, $cind, 1)); - $cind++; - } else { - array_push($arr_cont, substr($tempaddtext, $cind, 2)); - $cind+= 2; - } - } - } - foreach ($arr_cont as & $row) { - $row = iconv("gb2312", "UTF-8", $row); - } - return $arr_cont; -} - - -//百度收录提示 -if (git_get_option('git_baidurecord_b') && function_exists('curl_init')) { - function baidu_check($url, $post_id){ - $baidu_record = get_post_meta($post_id, 'baidu_record', true); - if ($baidu_record != 1) { - $url = 'http://www.baidu.com/s?wd=' . $url; - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - $rs = curl_exec($curl); - curl_close($curl); - if (!strpos($rs, '没有找到该URL,您可以直接访问') && !strpos($rs, '很抱歉,没有找到与')) { - update_post_meta($post_id, 'baidu_record', 1) || add_post_meta($post_id, 'baidu_record', 1, true); - return 1; - } else { - return 0; - } - } else { - return 1; - } - } - function baidu_record(){ - global $wpdb; - $post_id = null === $post_id ? get_the_ID() : $post_id; - if (baidu_check(get_permalink($post_id), $post_id) == 1) { - echo '已收录'; - } else { - echo '未收录'; - } - } -} - //七牛CDN if (!is_admin() && git_get_option('git_qncdn_b')) { - add_action('wp_loaded', 'Googlo_ob_start'); - function Googlo_ob_start() { - ob_start('Googlo_qiniu_cdn_replace'); + add_action('wp_loaded', 'gdk_cdn_start'); + function gdk_cdn_start() { + ob_start('gdk_cdn_replace'); } - function Googlo_qiniu_cdn_replace($html) { + function gdk_cdn_replace($html) { $local_host = home_url(); //博客域名 $qiniu_host = git_get_option('git_cdnurl_b'); //七牛域名 $cdn_exts = git_get_option('git_cdnurl_format'); //扩展名(使用|分隔) @@ -164,6 +50,44 @@ if (is_admin() && git_get_option('git_cdnurl_b') && git_get_option('git_adminqn_ add_filter('wp_get_attachment_url', 'attachment_replace'); } + + + + +//百度收录提示 +if (git_get_option('git_baidurecord_b') && function_exists('curl_init')) { + function baidu_check($url, $post_id){ + $baidu_record = get_post_meta($post_id, 'baidu_record', true); + if ($baidu_record != 1) { + $url = 'http://www.baidu.com/s?wd=' . $url; + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + $rs = curl_exec($curl); + curl_close($curl); + if (!strpos($rs, '没有找到该URL,您可以直接访问') && !strpos($rs, '很抱歉,没有找到与')) { + update_post_meta($post_id, 'baidu_record', 1) || add_post_meta($post_id, 'baidu_record', 1, true); + return 1; + } else { + return 0; + } + } else { + return 1; + } + } + function baidu_record(){ + global $wpdb; + $post_id = null === $post_id ? get_the_ID() : $post_id; + if (baidu_check(get_permalink($post_id), $post_id) == 1) { + echo '已收录'; + } else { + echo '未收录'; + } + } +} + + + //百度主动推送 if (git_get_option('git_sitemap_api')) { function Git_Baidu_Submit($post_ID) { diff --git a/functions/utils.php b/functions/utils.php index 77a9be3..01468da 100644 --- a/functions/utils.php +++ b/functions/utils.php @@ -335,10 +335,11 @@ function nc_the_meta($key, $placeholder = '') { } function gdk_is_mobile() { - if (empty($_SERVER['HTTP_USER_AGENT'])) { + $ua = $_SERVER['HTTP_USER_AGENT']; + if (empty($ua)) { return false; - } elseif ((strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') === false) // many mobile devices (all iPh, etc.) - || strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'NetType/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Kindle') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'MQQBrowser') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mobi') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'HUAWEI') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'TBS/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Mi') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false) { + } elseif ((in_string($ua, 'Mobile') && strpos($ua, 'iPad') === false) // many mobile devices (all iPh, etc.) + || in_string($ua, 'Android') || in_string($ua, 'NetType/') || in_string($ua, 'Kindle') || in_string($ua, 'MQQBrowser') || in_string($ua, 'Opera Mini') || in_string($ua, 'Opera Mobi') || in_string($ua, 'HUAWEI') || in_string($ua, 'TBS/') || in_string($ua, 'Mi') || in_string($ua, 'iPhone')) { return true; } else { return false; @@ -396,4 +397,157 @@ function in_string($text,$find) { } else { return false; } +} + +function getBrowser() { + $u_agent = $_SERVER['HTTP_USER_AGENT']; + $bname = $u_agent; + $platform = ''; + $version= ''; + + //First get the platform? + if ( preg_match( '/linux/i', $u_agent ) ) { + $platform = 'Linux'; + } + elseif ( preg_match( '/macintosh|mac os x/i', $u_agent ) ) { + $platform = 'Mac'; + } + elseif ( preg_match( '/windows|win32/i', $u_agent ) ) { + $platform = 'Windows'; + } + + // Next get the name of the useragent yes seperately and for good reason + if ( preg_match( '/MSIE/i',$u_agent) && ! preg_match( '/Opera/i',$u_agent ) ) { + $bname = 'Internet Explorer'; + $ub = "MSIE"; + } elseif( preg_match( '/Firefox/i',$u_agent ) ) { + $bname = 'Mozilla Firefox'; + $ub = "Firefox"; + } elseif( preg_match( '/Chrome/i',$u_agent ) ) { + $bname = 'Google Chrome'; + $ub = "Chrome"; + } elseif( preg_match( '/Safari/i',$u_agent ) ) { + $bname = 'Apple Safari'; + $ub = "Safari"; + } elseif( preg_match( '/Opera/i',$u_agent ) ) { + $bname = 'Opera'; + $ub = "Opera"; + } elseif( preg_match( '/Netscape/i',$u_agent ) ) { + $bname = 'Netscape'; + $ub = "Netscape"; + } + + // finally get the correct version number + $known = array( 'Version', $ub, 'other'); + $pattern = '#( ?' . join( '|', $known) . + ')[/ ]+( ?[0-9.|a-zA-Z.]*)#'; + + if ( ! preg_match_all( $pattern, $u_agent, $matches ) ) { + // we have no matching number just continue + } + + if ( isset( $matches['browser'] ) && is_array($matches['browser']) ) { + // see how many we have + $i = count( $matches['browser'] ); + + if ( $i != 1) { + + //we will have two since we are not using 'other' argument yet + //see if version is before or after the name + if ( strripos( $u_agent,"Version") < strripos( $u_agent,$ub ) ){ + $version = $matches['version'][0]; + } else { + $version = $matches['version'][1]; + } + } else { + $version = $matches['version'][0]; + } + } else { + $version="?"; + } + + return array( + 'userAgent' => $u_agent, + 'name' => $bname, + 'version' => $version, + 'platform' => $platform, + 'pattern' => $pattern + ); +} + + +function get_ip_address( ) { + // check for shared internet/ISP IP + if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) && validate_ip( $_SERVER['HTTP_CLIENT_IP'] ) ) { + return $_SERVER['HTTP_CLIENT_IP']; + } + + // check for IPs passing through proxies + if ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { + + // check if multiple ips exist in var + if ( in_string( $_SERVER['HTTP_X_FORWARDED_FOR'], ',')) { + $iplist = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR']); + foreach ( $iplist as $ip) { + if ( validate_ip( $ip ) ) + return $ip; + } + } else { + if ( validate_ip( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) + return $_SERVER['HTTP_X_FORWARDED_FOR']; + } + } + if ( ! empty( $_SERVER['HTTP_X_FORWARDED']) && validate_ip( $_SERVER['HTTP_X_FORWARDED'] ) ) { + return $_SERVER['HTTP_X_FORWARDED']; + } + if ( ! empty( $_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && validate_ip( $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'] ) ) { + return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP']; + } + if ( ! empty( $_SERVER['HTTP_FORWARDED_FOR']) && validate_ip( $_SERVER['HTTP_FORWARDED_FOR'] ) ) { + return $_SERVER['HTTP_FORWARDED_FOR']; + } + if ( ! empty( $_SERVER['HTTP_FORWARDED']) && validate_ip( $_SERVER['HTTP_FORWARDED'] ) ) { + return $_SERVER['HTTP_FORWARDED']; + } + + // return unreliable ip since all else failed + return $_SERVER['REMOTE_ADDR']; +} + +/** + * Ensures an ip address is both a valid IP and does not fall within + * a private network range. + */ +function validate_ip( $ip) { + if ( strtolower( $ip) === 'unknown') { + return false; + } + + // generate ipv4 network address + $ip = ip2long( $ip); + + // if the ip is set and not equivalent to 255.255.255.255 + if ( $ip !== false && $ip !== -1) { + // make sure to get unsigned long representation of ip + // due to discrepancies between 32 and 64 bit OSes and + // signed numbers ( ints default to signed in PHP) + $ip = sprintf( '%u', $ip); + // do private network range checking + if ( $ip >= 0 && $ip <= 50331647) return false; + if ( $ip >= 167772160 && $ip <= 184549375) return false; + if ( $ip >= 2130706432 && $ip <= 2147483647) return false; + if ( $ip >= 2851995648 && $ip <= 2852061183) return false; + if ( $ip >= 2886729728 && $ip <= 2887778303) return false; + if ( $ip >= 3221225984 && $ip <= 3221226239) return false; + if ( $ip >= 3232235520 && $ip <= 3232301055) return false; + if ( $ip >= 4294967040) return false; + } + return true; +} + +//Ajax报错方式 +function gdk_die($ErrMsg) { + header('HTTP/1.1 405 Method Not Allowed'); + echo $ErrMsg; + exit; } \ No newline at end of file diff --git a/route.php b/gdk_route.php similarity index 100% rename from route.php rename to gdk_route.php diff --git a/modules/base/functions/anti-spam.php b/modules/base/functions/anti-spam.php index 4b1c7fc..a4abe2d 100644 --- a/modules/base/functions/anti-spam.php +++ b/modules/base/functions/anti-spam.php @@ -1,22 +1,2 @@ 50) ? 'spam' : $approved; -} -add_filter('pre_comment_approved', 'nc_url_spamcheck', 99, 2); -function nc_comment_post($incoming_comment) -{ - $pattern = '/[一-龥]/u'; - // 禁止全英文评论 - if (!preg_match($pattern, $incoming_comment['comment_content'])) { - wp_die("您的评论中必须包含汉字!"); - } - $pattern = '/[あ-んア-ン]/u'; - // 禁止日文评论 - if (preg_match($pattern, $incoming_comment['comment_content'])) { - wp_die("评论禁止包含日文!"); - } - return($incoming_comment); -} -add_filter('preprocess_comment', 'nc_comment_post');