首页 > CMS建站 > PhpCMS > 正文

PHPCMS V9如何添加https开头的友情链接

2020-07-03 12:54:45
字体:
来源:转载
供稿:网友
这篇文章主要为大家详细介绍了PHPCMS V9如何添加https开头的友情链接,具有一定的参考价值,感兴趣的小伙伴们可以参考一下,有需要的朋友可以收藏方便以后借鉴。

随着网站安全的深入,现在越来越多的网站都开始使用了https,在换友情链接的时候要填写https开头的网址,可是phpcms v9却只能填写以http开头的网站,该如何修改呢?361模板网经过摸索和在网上找到的一些教程然后做了些变动,下面分享给大家,希望对您有所帮助。

1、打开 /phpcms/modules/link/index.php 文件

找到

if($_POST['url']=="" || !preg_match('/^http:////(.*)/i', $_POST['url'])){showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid"); }

修改为:

if($_POST['url']=="" || !preg_match('/^(http:////|https:////)(.*)/i', $_POST['url'])){showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid"); }

找到

$logo = safe_replace(strip_tags($_POST['logo']));if(!preg_match('/^http:////(.*)/i', $logo)){$logo = '';}

修改为:

 $logo = safe_replace(strip_tags($_POST['logo']));if(!preg_match('/^(http:////|https:////)(.*)/i', $logo)){$logo = '';}

2、打开 /phpcms/modules/link/templates/link_add.tpl.php 文件

找到

$("#link_url").formValidator({onshow:"<?php echo L("input").L('url')?>",onfocus:"<?php echo L("input").L('url')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('url')?>"}).regexValidator({regexp:"^http:////[A-Za-z0-9]+/.[A-Za-z0-9]+[//=/?%/-&]*([^<>])*$",onerror:"<?php echo L('link_onerror')?>"})

修改为:

$("#link_url").formValidator({onshow:"<?php echo L("input").L('url')?>",onfocus:"<?php echo L("input").L('url')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('url')?>"}).regexValidator({regexp:"^(http:////|https:////)[A-Za-z0-9]+/.[A-Za-z0-9]+[//=/?%/-&]*([^<>])*$",onerror:"<?php echo L('link_onerror')?>"})

这样修改处理后就能实现PHPCMS V9添加https开头的友情链接了。

以上就是PHPCMS V9如何添加https开头的友情链接的全部内容,希望对大家的学习和解决疑问有所帮助,也希望大家多多支持错新网。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表